/* ── LEADERBOARD ──────────────────────────────────────────────────────────── */
.leaderboard { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 860px) { .leaderboard { grid-template-columns: 1fr 1fr; gap: 10px; } }
/* Mobile: horizontal scroll row instead of stacking */
@media (max-width: 540px) {
  .leaderboard {
    grid-template-columns: none;
    display: flex; flex-direction: row;
    gap: 10px;
    overflow-x: auto; overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    /* hide scrollbar but keep scrollability */
    scrollbar-width: none;
    margin-right: -16px;
    padding-left: 16px; padding-right: 16px;
  }
  .leaderboard::-webkit-scrollbar { display: none; }
  .house-card {
    flex: 0 0 72vw; max-width: 280px;
    scroll-snap-align: start;
  }
}

/* HOUSE CARD — each card carries its house color: a tinted top wash, themed
   hover glow and a glowing score. --hc is set per theme below. */
.house-card {
  --hc: var(--border-hi);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--hc) 9%, transparent), transparent 46%),
    var(--surface-1);
  border-radius: var(--radius-lg, 17px);
  border: 1px solid var(--border); overflow: hidden;
  transition: border-color .25s, transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
  position: relative;
}
.house-card::before {
  content: ''; position: absolute; right: -20px; bottom: -20px;
  width: 110px; height: 110px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.03); pointer-events: none;
}
.house-card::after {
  content: ''; position: absolute; right: -6px; bottom: -6px;
  width: 60px; height: 60px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.03); pointer-events: none;
}
.house-card:hover {
  border-color: color-mix(in srgb, var(--hc) 55%, var(--border));
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(0,0,0,.32), 0 0 30px -6px color-mix(in srgb, var(--hc) 38%, transparent);
}
.house-card.is-my-house.aqua { border-color: #5bc8f5; box-shadow: 0 0 0 2px #5bc8f5; }
.house-card.is-my-house.ignis { border-color: #ff6b6b; box-shadow: 0 0 0 2px #ff6b6b; }
.house-card.is-my-house.terra { border-color: #5ef56a; box-shadow: 0 0 0 2px #5ef56a; }
.house-card.is-my-house.aether { border-color: #c77dff; box-shadow: 0 0 0 2px #c77dff; }
@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.card-enter { animation: fadeUp .5s ease both; }

.house-card-stripe { height: 4px; }
.house-card-body   { padding: 18px 16px 14px; position: relative; z-index: 1; }
.house-rank { font-size: .62rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.house-rank.is-leader { color: var(--gold); }
.house-rank.is-tied   { color: var(--text-2); }
.my-house-badge { color: var(--red); }
.house-icon  { font-size: 4rem; line-height: 1; margin-bottom: 8px; display: block; }
.house-name  { font-family: 'Bebas Neue', sans-serif; font-size: 1.45rem; color: var(--text-1); margin-bottom: 3px; letter-spacing: .04em; line-height: 1; }
.house-motto { font-size: .74rem; color: var(--text-3); font-style: italic; margin-bottom: 16px; min-height: 2em; line-height: 1.4; }
.house-pts-row   { display: flex; align-items: baseline; gap: 5px; margin-bottom: 12px; }
.house-pts       { font-family: 'Bebas Neue', sans-serif; font-size: 3rem; line-height: 1; letter-spacing: .02em; transition: color .3s; text-shadow: 0 0 22px color-mix(in srgb, currentColor 30%, transparent); }
.house-pts-label { font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.progress-track  { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progress-fill   { height: 100%; border-radius: 99px; transition: width .9s var(--ease-out); box-shadow: 0 0 10px color-mix(in srgb, var(--hc, transparent) 45%, transparent); }
.house-detail-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: .72rem; font-weight: 600; letter-spacing: .03em;
  cursor: pointer; padding: 7px 14px; border-radius: 20px; transition: all .2s;
  /* good tap target */
  min-height: 32px;
}
.house-detail-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-subtle); }

/* COLOR THEMES (--hc drives the card tint + hover glow) */
.theme-ignis  { --hc: #ff6b6b; }
.theme-aqua   { --hc: #5bc8f5; }
.theme-terra  { --hc: #5ef56a; }
.theme-aether { --hc: #c77dff; }
.theme-ignis  .house-card-stripe { background: linear-gradient(90deg,#c0392b,#ff6b6b); }
.theme-ignis  .house-pts         { color: #ff6b6b; }
.theme-ignis  .progress-fill     { background: linear-gradient(90deg,#8b1a1a,#e74c3c); }
.theme-aqua   .house-card-stripe { background: linear-gradient(90deg,#1a6b8a,#5bc8f5); }
.theme-aqua   .house-pts         { color: #5bc8f5; }
.theme-aqua   .progress-fill     { background: linear-gradient(90deg,#0d3d52,#2980b9); }
.theme-terra  .house-card-stripe { background: linear-gradient(90deg,#27892b,#5ef56a); }
.theme-terra  .house-pts         { color: #5ef56a; }
.theme-terra  .progress-fill     { background: linear-gradient(90deg,#1a5c1c,#2ecc71); }
.theme-aether .house-card-stripe { background: linear-gradient(90deg,#6b3d9a,#c77dff); }
.theme-aether .house-pts         { color: #c77dff; }
.theme-aether .progress-fill     { background: linear-gradient(90deg,#3d1a6b,#9b59b6); }

/* Light mode house card adjustments */
[data-theme="light"] .theme-ignis  .house-pts { color: #c0392b; }
[data-theme="light"] .theme-aqua   .house-pts { color: #1a6b8a; }
[data-theme="light"] .theme-terra  .house-pts { color: #27892b; }
[data-theme="light"] .theme-aether .house-pts { color: #6b3d9a; }

/* ── LEADERBOARD HEADER + FULLSCREEN (TV / quick-reference mode) ───────────── */
/* The title row carries the fullscreen toggle on its far right. .section-label
   keeps its dash + filler line and grows to push the button to the edge. */
.lb-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lb-header .section-label { flex: 1; margin-bottom: 0; }
.lb-fs-season { display: none; }
.lb-fs-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-3); border-radius: 10px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.lb-fs-btn:hover { color: var(--text-1); border-color: var(--border-hi); background: var(--surface-3); }
.lb-fs-btn svg { width: 17px; height: 17px; }
.lb-fs-icon-close { display: none; }

/* Fullscreen: only the ranking, blown up to fill the screen. Everything else on
   the board is covered by the fixed, opaque #lbSection overlay. */
body.lb-fullscreen { overflow: hidden; }
body.lb-fullscreen #lbSection {
  position: fixed; inset: 0; z-index: 3000;
  margin: 0; padding: clamp(20px, 3.5vh, 48px) clamp(24px, 4vw, 80px);
  display: flex; flex-direction: column;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 12% -5%, var(--red-subtle) 0%, transparent 58%),
    radial-gradient(ellipse 70% 50% at 88% 108%, var(--accent-glow) 0%, transparent 55%);
  animation: lbFsIn .3s ease both;
}
@keyframes lbFsIn { from { opacity: 0 } to { opacity: 1 } }

body.lb-fullscreen .lb-header { margin-bottom: clamp(16px, 3vh, 40px); }
body.lb-fullscreen .section-label { font-size: clamp(.9rem, 1.5vw, 1.35rem); }
body.lb-fullscreen .lb-fs-season {
  display: inline-block; color: var(--text-2);
  font-family: 'Bebas Neue', sans-serif; letter-spacing: .06em; line-height: 1;
  font-size: clamp(1rem, 2vw, 1.8rem);
}
body.lb-fullscreen .lb-fs-icon-open  { display: none; }
body.lb-fullscreen .lb-fs-icon-close { display: inline; }

body.lb-fullscreen .leaderboard {
  flex: 1; align-content: center;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 34px);
  margin-bottom: 0; overflow: visible;
}
/* Scale card internals so they read from across a room. */
body.lb-fullscreen .house-card-body  { padding: clamp(20px, 2.4vw, 40px); }
body.lb-fullscreen .house-rank       { font-size: clamp(.62rem, .9vw, 1.05rem); margin-bottom: clamp(12px, 2vh, 24px); }
body.lb-fullscreen .house-icon       { font-size: clamp(2.6rem, 10.5vw, 6rem); margin-bottom: clamp(8px, 1.4vh, 20px); }
body.lb-fullscreen .house-name       { font-size: clamp(1.7rem, 3vw, 4rem); }
body.lb-fullscreen .house-motto      { font-size: clamp(.8rem, 1vw, 1.2rem); min-height: 0; margin-bottom: clamp(12px, 2vh, 26px); }
body.lb-fullscreen .house-pts        { font-size: clamp(3.4rem, 6vw, 8rem); }
body.lb-fullscreen .house-pts-label  { font-size: clamp(.62rem, .8vw, 1rem); }
body.lb-fullscreen .house-pts-row    { margin-bottom: clamp(12px, 2vh, 22px); }
body.lb-fullscreen .progress-track   { height: clamp(6px, .8vh, 12px); margin-bottom: 0; }
body.lb-fullscreen .house-detail-btn { display: none; }   /* no per-house buttons on the TV view */
body.lb-fullscreen .house-card:hover { transform: none; box-shadow: none; }

/* Summary bar sits below the ranking, scaled up for the TV view. */
body.lb-fullscreen .summary-bar {
  margin: clamp(16px, 3vh, 36px) 0 0; flex-shrink: 0;
  padding: clamp(14px, 2vh, 28px) clamp(20px, 3vw, 44px);
}
body.lb-fullscreen .summary-val     { font-size: clamp(1.9rem, 3vw, 3.6rem); }
body.lb-fullscreen .summary-key     { font-size: clamp(.62rem, .8vw, 1rem); margin-top: clamp(4px, .8vh, 10px); }
body.lb-fullscreen .summary-divider { height: clamp(36px, 6vh, 72px); }

/* ── SUMMARY BAR ──────────────────────────────────────────────────────────── */
.summary-bar {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg, 17px);
  padding: 18px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 28px; box-shadow: var(--shadow-card);
}
.summary-item { text-align: center; flex: 1; min-width: 80px; }
.summary-val  { font-family: 'Bebas Neue', sans-serif; font-size: 1.9rem; color: var(--text-1); letter-spacing: .04em; line-height: 1; }
.summary-key  { font-size: .62rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; }
.summary-divider { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }
@media (max-width: 400px) { .summary-divider { display: none; } .summary-bar { justify-content: center; gap: 16px; padding: 14px 16px; } }

/* ── MY HOUSE CARD ────────────────────────────────────────────────────────── */
.my-house-card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; margin-bottom: 28px;
  position: relative; box-shadow: var(--shadow-card);
}
.my-house-card::after { content: ''; position: absolute; right: -50px; top: -50px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(200,16,46,.05) 0%, transparent 70%); pointer-events: none; }
.my-house-stripe { height: 4px; }
.my-house-body { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.my-house-left { display: flex; align-items: center; gap: 16px; }
.my-house-icon { font-size: 6rem; line-height: 1; }
.my-house-name { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; letter-spacing: .04em; line-height: 1; }
.my-house-motto { font-size: .8rem; color: var(--text-3); font-style: italic; margin-top: 3px; }
.my-house-affinity { font-size: .78rem; color: var(--text-2); margin-top: 5px; }
.my-house-pts { text-align: right; flex-shrink: 0; }
.my-house-pts-val { font-family: 'Bebas Neue', sans-serif; font-size: 2.6rem; line-height: 1; letter-spacing: .04em; }
.my-house-pts-key { font-size: .62rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; }
@media (max-width: 440px) {
  .my-house-body { flex-direction: column; align-items: flex-start; }
  .my-house-pts  { text-align: left; }
}

/* ── CUPS ─────────────────────────────────────────────────────────────────── */
.cups-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 24px; }
@media (max-width: 700px) { .cups-row { grid-template-columns: 1fr 1fr; } }
.cups-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md, 13px); padding: 14px 16px; transition: border-color .2s, transform .25s var(--ease-out), box-shadow .25s var(--ease-out); box-shadow: var(--shadow-card); }
.cups-card:hover { border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow-card), 0 8px 26px rgba(0,0,0,.2), 0 0 22px -8px var(--gold); }
.cups-icon  { font-size: 2.4rem; margin-bottom: 5px; display: block; }
.cups-name  { font-family: 'Bebas Neue', sans-serif; font-size: 1.05rem; color: var(--text-1); letter-spacing: .04em; margin-bottom: 2px; }
.cups-count { font-size: 1rem; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.cups-count span { font-size: .7rem; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.cups-track { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.cups-fill  { height: 100%; border-radius: 2px; opacity: .85; transition: width .8s ease; }

/* ── COLLAPSIBLE ──────────────────────────────────────────────────────────── */
.collapsible-section { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 10px; background: var(--surface-1); box-shadow: var(--shadow-card); }
.collapsible-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; padding: 15px 18px;
  cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--text-2);
  letter-spacing: .01em; transition: background .2s, color .2s;
  /* big tap target */
  min-height: 52px;
}
.collapsible-toggle span { display: flex; align-items: center; gap: 9px; }
.collapsible-toggle:hover { background: var(--surface-2); color: var(--text-1); }
.collapsible-toggle[aria-expanded="true"] { color: var(--text-1); border-bottom: 1px solid var(--border); }
.chevron { transition: transform .3s ease; color: var(--text-3); }
.collapsible-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.collapsible-body { overflow: hidden; max-height: 0; padding: 0 18px; transition: max-height .38s cubic-bezier(.4,0,.2,1), padding .3s ease; }
.collapsible-body.open { max-height: 2400px; padding: 18px; }
@keyframes slideDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }

/* ── HOW TO ───────────────────────────────────────────────────────────────── */
.howto-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
@media (max-width: 800px) { .howto-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .howto-grid { grid-template-columns: 1fr; } }
.howto-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.howto-card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.howto-icon  { font-size: 1.5rem; margin-bottom: 7px; display: block; }
.howto-title { font-weight: 700; font-size: .88rem; color: var(--text-1); margin-bottom: 5px; }
.howto-desc  { font-size: .79rem; color: var(--text-2); line-height: 1.55; }
.howto-note  { margin-top: 10px; font-size: .74rem; color: var(--text-3); font-style: italic; padding: 7px 10px; background: var(--surface-3); border-radius: 5px; border-left: 2px solid var(--border-hi); }
.howto-note.active { background: var(--green-dim); color: var(--green); font-style: normal; font-weight: 600; border-left-color: var(--green); }

/* ── SEASONS TABLE ────────────────────────────────────────────────────────── */
.seasons-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.seasons-table th { text-align: left; font-weight: 700; letter-spacing: .07em; color: var(--text-3); font-size: .68rem; text-transform: uppercase; border-bottom: 1px solid var(--border); padding: 8px 12px; }
.seasons-table td { padding: 11px 12px; border-bottom: 1px solid var(--surface-2); color: var(--text-2); vertical-align: middle; }
.seasons-table tr:last-child td { border-bottom: none; }
.seasons-table tr:hover td { background: var(--surface-2); }
.season-winner-cell { font-size: .95rem; }
.season-scores-cell { font-size: .75rem; color: var(--text-3); }
/* Closed seasons that have a yearbook are clickable rows. */
.season-row-link { cursor: pointer; transition: background .15s; }
.season-row-link:hover td { background: color-mix(in srgb, var(--gold) 10%, var(--surface-2)); }
.season-row-link:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.season-yb-tag {
  display: inline-block; margin-left: 6px; font-size: .62rem; font-weight: 800;
  color: var(--gold); background: rgba(212,160,23,.14); border: 1px solid rgba(212,160,23,.35);
  border-radius: 999px; padding: 1px 7px; vertical-align: middle; letter-spacing: .02em;
}
/* Mobile: hide less important columns */
@media (max-width: 540px) {
  .season-scores-cell { display: none; }
  .seasons-table th:nth-child(3) { display: none; }
}

/* ── APP NAV (teacher view switcher) ─────────────────────────────────────── */
.app-nav {
  display: flex; gap: 6px; padding: 8px 20px;
  justify-content: center;
  background: color-mix(in srgb, var(--surface-1) 76%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 600px) {
  .app-nav { padding: 6px 14px; }
}
.nav-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 99px; border: 1px solid transparent;
  background: none; color: var(--text-2); font-size: .83rem; font-weight: 600;
  cursor: pointer; transition: background .2s, color .2s, box-shadow .25s var(--ease-out), transform .2s var(--ease-out);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .nav-tab { padding: 6px 12px; font-size: .78rem; gap: 5px; }
  .nav-tab svg { width: 11px; height: 11px; }
}
.nav-tab svg { opacity: .7; transition: opacity .2s; }
.nav-tab:hover { background: var(--surface-2); color: var(--text-1); }
.nav-tab:hover svg { opacity: 1; }
/* Active tab: filled brand pill with glow — the gaming statement of the chrome. */
.nav-tab.active {
  background: var(--grad-red); border-color: transparent;
  color: #fff; font-weight: 700;
  box-shadow: 0 4px 16px var(--red-glow), inset 0 1px 0 rgba(255,255,255,.18);
}
.nav-tab.active svg { opacity: 1; }

/* ── TEACHER VIEW ─────────────────────────────────────────────────────────── */
#teacherView { min-height: calc(100vh - 140px); }
.teacher-view-inner {
  max-width: 1140px; margin: 0 auto; padding: 36px 24px 80px;
}
@media (max-width: 600px) { .teacher-view-inner { padding: 28px 16px 80px; } }

.teacher-view-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.teacher-view-header::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.teacher-view-title {
  font-size: .66rem; font-weight: 700; letter-spacing: .24em;
  text-transform: uppercase; color: var(--text-3); white-space: nowrap;
}

/* Sub-tabs */
.teacher-tabs {
  display: flex; gap: 3px; flex-wrap: wrap;
  padding: 4px; background: var(--surface-2); border-radius: 10px;
  border: 1px solid var(--border); margin-bottom: 24px;
}
.teacher-tab {
  position: relative;
  flex: 1; min-width: 70px; padding: 8px 10px; border: none; border-radius: 7px;
  background: none; color: var(--text-2); font-size: .78rem; font-weight: 500;
  cursor: pointer; transition: all .15s; white-space: nowrap; text-align: center;
}
/* Marker shown on the Evento/Encuesta tabs while one is active (teachers don't
   get the top banners, so this is their at-a-glance cue). */
.teacher-tab.has-activity::after {
  content: ""; position: absolute; top: 5px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 2px var(--surface-2);
  animation: tabActivityPulse 1.8s ease-in-out infinite;
}
.teacher-tab.has-activity.active::after { box-shadow: 0 0 0 2px var(--surface-1); }
@keyframes tabActivityPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.8); }
}
@media (max-width: 540px) {
  .teacher-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: 10px; }
  .teacher-tabs::-webkit-scrollbar { display: none; }
  .teacher-tab { flex: 0 0 auto; }
}
.teacher-tab:hover { background: var(--surface-3); color: var(--text-1); }
.teacher-tab.active {
  background: var(--surface-1); color: var(--text-1); font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.18), 0 0 0 1px var(--border);
}

.teacher-tab-panel { animation: fadeInPanel .18s ease; }
@keyframes fadeInPanel { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.teacher-panel-section {
  background: transparent; border: none; border-radius: 0; padding: 0;
}

/* No-season placeholder */
.no-season-msg {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-3); font-size: .88rem;
}
.no-season-msg svg { flex-shrink: 0; opacity: .5; }

/* ── HOUSE FILTER BAR ─────────────────────────────────────────────────────── */
.house-filter-bar {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px;
}
.house-filter-chips {
  display: flex; gap: 7px; flex-wrap: wrap;
}
.house-chip {
  padding: 5px 13px; border-radius: 20px; border: 1.5px solid var(--border);
  background: none; color: var(--text-2); font-size: .78rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.house-chip:hover { border-color: var(--border-hi); color: var(--text-1); }
.house-chip.active {
  background: var(--chip-color, var(--red)); border-color: var(--chip-color, var(--red));
  color: #fff; font-weight: 600;
}

/* Group filter (teacher-private student groups) */
.group-filter-row { display: flex; gap: 8px; align-items: center; }
.group-filter-select { flex: 1; margin-bottom: 0; }
.group-manage-btn {
  flex-shrink: 0; white-space: nowrap; font-size: .78rem; padding: 8px 12px;
}

.student-search-input { margin-bottom: 0; }
.student-count-info {
  font-size: .75rem; color: var(--text-3); margin-bottom: 10px;
  padding-left: 2px;
}

/* ── STUDENT ROWS (new unified list) ──────────────────────────────────────── */
.student-list {
  max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.student-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 9px; transition: border-color .15s; flex-wrap: wrap;
}
.student-row:hover { border-color: var(--border-hi); }
.student-row-rank {
  font-family: 'Bebas Neue', sans-serif; font-size: 1rem; color: var(--text-3);
  min-width: 22px; text-align: center; flex-shrink: 0;
}
.student-row-icon { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.student-row-info { flex: 1; min-width: 80px; overflow: hidden; }
.student-row-name {
  font-weight: 600; font-size: .88rem; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.student-row-house { font-size: .72rem; font-weight: 600; letter-spacing: .03em; margin-top: 2px; }
.student-row-pts {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--text-1);
  white-space: nowrap; flex-shrink: 0;
}
.student-row-pts-label { font-family: 'Inter', sans-serif; font-size: .68rem; color: var(--text-3); font-weight: 400; }
.student-row-controls { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }

