/* v1.5.1 — layout + colour + animation-ready */
.thi-wrap {
  --thi-gap: 56px;
  --thi-size: 120px;   /* image circle diameter */
  --thi-ring: 8px;     /* ring stroke width */
  --thi-text: #fff;
  --thi-muted: #b9c2cf;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--thi-gap);
  align-items: start;
}
@media (max-width: 980px) { .thi-wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .thi-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); --thi-gap: 40px; } }

/* schemes */
.thi-wrap.thi-dark  { --thi-text:#ffffff; --thi-muted:#cfd6de; }
.thi-wrap.thi-light { --thi-text:#0b0e13; --thi-muted:#4a5568; }

.thi-house {
  --thi-accent: #999;
  color: var(--thi-text);
  text-align: center;
  position: relative;
}

/* number (score) at top, in house colour */
.thi-points {
  color: var(--thi-accent);
  font-family: var(--ammac-font, ui-serif, Georgia, serif);
  font-weight: 800;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
/* Example: tweak a specific house */
.thi-house.thi-alfred .thi-points { font-size: 30px; }
.thi-house.thi-galahad .thi-ring .ring-fg { stroke-width: 10px; }

/* If you still see white numbers due to theme CSS, add specificity: */
.thi-wrap .thi-house .thi-points { color: var(--thi-accent) !important; }

/* house name BETWEEN number and graphic */
.thi-name {
  color: var(--thi-text);
  font-family: var(--ammac-font, ui-serif, Georgia, serif);
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 8px;    /* space above the graphic */
}

/* logo + ring stack */
.thi-logo {
  position: relative;
  width: calc(var(--thi-size) + 16px);
  height: calc(var(--thi-size) + 16px);
  margin: 0 auto;
}

.thi-img {
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
}
.thi-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thi-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg); /* start at 12 o’clock */
}
.thi-ring .ring-bg,
.thi-ring .ring-fg {
  fill: none;
  stroke-width: var(--thi-ring);
}
.thi-ring .ring-bg {
  stroke: color-mix(in oklab, var(--thi-accent) 28%, transparent);
}
.thi-ring .ring-fg {
  stroke: var(--thi-accent);
  /* r=46 => circumference ~289 */
  stroke-dasharray: 289 289;
  /* We will set dashoffset in JS for clean 0->target animation */
}

/* accessibility when no image */
.thi-missing { width: 100%; height: 100%; display: block; background: #222; }
