:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --line: #e6eaf2;
  --brand: #2563eb;
  --brand-2: #7c3aed;
  --good: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;
  --info: #0891b2;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.10), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(124, 58, 237, 0.10), transparent 32%),
    var(--bg);
  color: var(--text);
}

button, select, input {
  font-family: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden { display: none !important; }

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, .12), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(124, 58, 237, .10), transparent 28%),
    #f6f8fc;
}

.auth-card {
  width: min(1080px, 100%);
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  display: grid;
  grid-template-columns: .85fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.auth-side {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 34px;
  background:
    linear-gradient(150deg, rgba(37, 99, 235, .12), rgba(124, 58, 237, .10)),
    #f8fbff;
  border-right: 1px solid var(--line);
}

.auth-side h1 {
  margin: 18px 0 12px;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-side p {
  margin: 0;
  max-width: 34ch;
  color: #475569;
  line-height: 1.7;
}

.auth-side-grid {
  display: grid;
  gap: 10px;
}

.auth-side-grid span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #dbe5f4;
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}

.auth-side-grid strong {
  color: #172033;
}

.auth-side-grid em {
  color: #64748b;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.auth-main {
  min-width: 0;
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  overflow: auto;
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 30px;
}

.auth-title h2 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

.auth-title p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.65;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
  background: #f1f5f9;
}

.auth-tabs button {
  min-height: 38px;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-weight: 900;
}

.auth-tabs button.active {
  color: #1d4ed8;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.auth-subtabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.auth-subtabs button {
  min-height: 34px;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 850;
}

.auth-subtabs button.active {
  background: #eef4ff;
  color: #1d4ed8;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-alert {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
}

.auth-alert.quiet {
  border-color: var(--line);
  background: #f8fafc;
  color: #334155;
}

.auth-alert strong,
.auth-alert span {
  display: block;
}

.auth-alert span {
  line-height: 1.45;
  font-size: 13px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field span {
  color: #334155;
  font-weight: 850;
  font-size: 13px;
}

.auth-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.auth-field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: end;
  gap: 10px;
}

.auth-code-row .secondary-btn {
  min-height: 42px;
}

.auth-wide {
  width: 100%;
  min-height: 44px;
}

.auth-note {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.65;
}

.auth-note code {
  color: #1d4ed8;
  font-weight: 800;
}

.auth-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.auth-mini-grid span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 880px) {
  .auth-shell {
    padding: 18px;
    place-items: start center;
  }

  .auth-card {
    width: min(560px, 100%);
    max-height: none;
    grid-template-columns: 1fr;
  }

  .auth-side {
    min-height: auto;
    padding: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-side h1 {
    font-size: 30px;
  }

  .auth-side-grid {
    display: none;
  }

  .auth-main {
    max-height: none;
    padding: 20px;
  }
}

.start-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.start-card {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.start-card.wide {
  width: min(1440px, 100%);
  grid-template-columns: minmax(390px, .82fr) minmax(620px, 1.18fr);
}

.hero, .setup-panel, .panel, .student-card, .training-card, .facility-card, .event-card, .contest-modal {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero {
  padding: 30px;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 18px;
}

.hero::after {
  display: none;
}

.badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 13px;
}

.start-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.start-school-title {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 18px;
}

.start-school-title h1 {
  margin: 0 0 8px;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: 0;
}

.start-school-title p,
.start-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.start-school-title > strong {
  min-width: 66px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 18px;
}

.start-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.start-metric {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
}

.start-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.start-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.start-metric.good strong { color: #047857; }
.start-metric.warn strong { color: #b45309; }

.start-info-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.start-section-title,
.label-line,
.school-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.start-section-title strong {
  font-size: 15px;
}

.start-section-title span,
.label-line span {
  color: var(--muted);
  font-size: 13px;
}

.start-specials,
.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.start-specials span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.start-rule-list {
  display: grid;
  gap: 8px;
}

.start-rule-list div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.start-rule-list strong {
  font-size: 13px;
}

.start-rule-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.setup-panel {
  padding: 30px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.setup-panel h2 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.setup-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-btn {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 12px;
}

.setup-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.setup-head b {
  padding: 8px 12px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eef4ff;
  white-space: nowrap;
}

.setup-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
}

.coach-builder {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.coach-stat-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.coach-stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.coach-stat-row strong,
.coach-stat-row small {
  display: block;
}

.coach-stat-row strong {
  font-size: 14px;
}

.coach-stat-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.coach-stepper {
  display: grid;
  grid-template-columns: 30px 28px 30px;
  align-items: center;
  gap: 4px;
}

.coach-stepper button,
.coach-stepper span {
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.coach-stepper button {
  border: 1px solid var(--line);
  background: #f1f5f9;
  color: #334155;
}

.coach-stepper span {
  color: #1d4ed8;
  background: #eef4ff;
}

.form-row {
  margin: 0;
}

.form-row label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.form-row select, .form-row input {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.school-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.school-option {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  color: var(--text);
  min-height: 112px;
}

.school-option strong,
.school-option span,
.school-option em,
.school-option i {
  display: block;
}

.school-option em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.school-option span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}

.school-option-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 0 !important;
}

.school-option-metrics {
  display: flex !important;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px !important;
}

.school-option-metrics i {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.school-option.active {
  border-color: #2563eb;
  background: #eef4ff;
  color: #1d4ed8;
}

.teacher-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 16px 0;
}

.teacher-preview p {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.6;
}

.candidate-list {
  display: grid;
  gap: 8px;
  max-height: 392px;
  overflow: auto;
  padding-right: 4px;
}

.candidate {
  display: grid;
  grid-template-columns: 20px 1fr 64px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.candidate.active {
  border-color: #2563eb;
  background: #eef4ff;
}

.candidate.disabled {
  opacity: .58;
}

.candidate span,
.candidate small,
.candidate strong {
  display: block;
}

.candidate small {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}

.candidate-topics {
  color: #64748b !important;
  font-size: 12px;
}

.candidate-score {
  text-align: right;
  color: #0f766e;
  font-size: 20px;
  line-height: 1;
}

.candidate-score small {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
}

.start-actions {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 10px;
  align-items: center;
  padding-top: 2px;
}

.start-actions .ghost-btn {
  width: 100%;
  height: 52px;
}

.primary-btn, .secondary-btn, .ghost-btn, .danger-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.primary-btn {
  width: 100%;
  height: 52px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 32px rgba(37, 99, 235, .22);
}

.secondary-btn { background: #eef4ff; color: #1d4ed8; }
.ghost-btn { background: #f1f5f9; color: #334155; }
.danger-btn { background: #fff1f2; color: #be123c; }

button:hover { transform: translateY(-1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.game-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 20px;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 30px rgba(37, 99, 235, .18);
}

.stat-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
}

.stat-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-tile strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.stat-tile small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}

.nav button {
  text-align: left;
  background: transparent;
  color: var(--muted);
  padding: 13px 14px;
  border-radius: 14px;
  font-weight: 800;
}

.nav button.active {
  color: #1d4ed8;
  background: #eef4ff;
}

.side-actions {
  display: grid;
  gap: 8px;
}

.main {
  padding: 26px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h2 {
  font-size: 34px;
  margin: 0 0 6px;
  letter-spacing: -1px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.kpi {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.kpi:last-child { border-bottom: 0; }
.kpi span { color: var(--muted); }
.kpi strong { text-align: right; }

.student-list, .training-list, .facility-list, .event-list {
  display: grid;
  gap: 14px;
}

.student-card, .training-card, .facility-card, .event-card {
  padding: 18px;
  box-shadow: none;
  border: 1px solid var(--line);
  background: #fff;
}

.student-head, .card-head, .facility-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.student-name {
  font-size: 18px;
  font-weight: 900;
}

.tag, .pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
  margin: 2px 3px 2px 0;
}

.tag.good { background: #ecfdf5; color: #15803d; }
.tag.warn { background: #fffbeb; color: #b45309; }
.tag.bad { background: #fff1f2; color: #be123c; }
.tag.info { background: #ecfeff; color: #0e7490; }

.bars {
  display: grid;
  gap: 10px;
}

.topic-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.topic-chip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
}

.topic-chip b {
  color: var(--muted);
}

.topic-chip.strong {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.topic-chip.weak {
  border-color: #fed7aa;
  background: #fff7ed;
}

.clickable-card {
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.award-line {
  margin-top: 12px;
  min-height: 24px;
}

.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 42px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-row span:first-child { color: var(--muted); font-weight: 700; }
.bar-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.bar {
  height: 8px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.bar.pressure > i { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.bar.good > i { background: linear-gradient(90deg, #22c55e, #0ea5e9); }

.training-card.selected {
  outline: 2px solid rgba(37, 99, 235, .38);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.training-card button { margin-top: 10px; }

.training-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.intensity-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.intensity-group button {
  background: #f1f5f9;
  color: #475569;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
}

.intensity-group button.active {
  background: #eef4ff;
  color: #1d4ed8;
}

.log-line {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  color: #334155;
  line-height: 1.6;
}
.log-line:last-child { border-bottom: 0; }
.log-line small { color: var(--muted); margin-right: 8px; }

.event-card strong { display: block; margin-bottom: 6px; }
.event-card p { margin: 0; color: var(--muted); line-height: 1.65; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th, .table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.table th { color: var(--muted); font-size: 12px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.contest-modal {
  width: min(980px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 24px;
  background: #fff;
}

.modal-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-title h3 { margin: 0; font-size: 24px; }
.modal-title p { margin: 6px 0 0; color: var(--muted); }

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 18px;
}

@media (max-width: 920px) {
  .auth-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .auth-card {
    max-height: none;
    overflow: visible;
  }

  .start-card, .game-shell, .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .start-card.wide,
  .school-grid,
  .setup-form-grid,
  .start-actions {
    grid-template-columns: 1fr;
  }
  .start-page {
    place-items: start center;
    padding: 14px;
  }
  .hero,
  .setup-panel {
    padding: 22px;
  }
  .start-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .start-school-title h1 { font-size: 34px; }
}

/* Game console layout */
.game-shell {
  display: block;
  min-height: 100vh;
  padding: 32px 20px 56px;
  background: #f6f7f9;
}

.game-wrap {
  width: min(1360px, 100%);
  margin: 0 auto;
}

.game-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.game-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-title h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.game-title p {
  margin: 4px 0 0;
  color: #5f6b7a;
  font-size: 13px;
}

.game-header .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: none;
}

.header-stats {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #5f6b7a;
  font-size: 14px;
}

.header-stats b {
  color: #172033;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-actions .ghost-btn,
.header-actions .danger-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
}

.game-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.play-area {
  min-width: 0;
}

.game-shell .panel {
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  box-shadow: none;
  padding: 16px;
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2,
.game-shell .panel h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.section-head p {
  margin: 4px 0 0;
  color: #5f6b7a;
  line-height: 1.5;
}

.compact-student-list {
  display: grid;
  gap: 10px;
}

.compact-student {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fcfdff;
  color: inherit;
  transition: border-color .16s ease, background .16s ease;
}

.compact-student:hover,
.clickable-card:hover {
  border-color: #c7d2fe;
  background: #f8fbff;
}

.compact-student:focus-visible,
.clickable-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.compact-student.inactive {
  opacity: .62;
  background: #f8fafc;
}

.student-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: start;
  gap: 12px;
}

.compact-name {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 900;
  font-size: 18px;
}

.compact-name > span {
  color: #42526a;
  font-size: 13px;
  font-weight: 800;
}

.compact-meta {
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 5px;
}

.status-dot.good { background: #16a34a; }
.status-dot.warn { background: #f59e0b; }
.status-dot.bad { background: #ef4444; }

.compact-pressure {
  text-align: right;
  font-size: 12px;
}

.compact-pressure b {
  display: block;
  font-size: 17px;
}

.compact-pressure span {
  color: #667085;
}

.compact-pressure.good b { color: #15803d; }
.compact-pressure.warn b { color: #b45309; }
.compact-pressure.bad b { color: #be123c; }

.mini-topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mini-topic {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 7px;
  background: #edf4ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.mini-topic.strong {
  background: #dcfce7;
  color: #15803d;
}

.mini-topic.weak {
  background: #fff7ed;
  color: #c2410c;
}

.mini-tag-row {
  margin-top: 8px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.slim-panel {
  min-height: 180px;
}

.slim-panel h3 {
  margin-bottom: 10px;
}

.facility-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f5;
  color: #42526a;
  font-size: 14px;
}

.facility-line:last-child {
  border-bottom: 0;
}

.facility-line strong {
  color: #172033;
}

.text-btn {
  background: transparent;
  color: #1d4ed8;
  padding: 0;
  font-weight: 800;
  font-size: 13px;
}

.text-btn:disabled {
  color: #98a2b3;
}

.next-contest {
  display: grid;
  gap: 8px;
  color: #5f6b7a;
}

.next-contest strong {
  color: #172033;
  font-size: 18px;
}

.calendar-link {
  justify-self: start;
  margin-top: 2px;
}

.contest-calendar {
  display: grid;
  gap: 10px;
}

.contest-calendar-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 136px;
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  background: #fff;
}

.contest-calendar-row.urgent {
  border-color: #f59e0b;
  background: #fffbeb;
}

.contest-date {
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
}

.contest-date strong {
  font-size: 24px;
  line-height: 1;
}

.contest-date span {
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.contest-main {
  min-width: 0;
}

.contest-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.contest-row-title strong {
  font-size: 17px;
}

.contest-main p {
  margin: 6px 0 0;
  color: #5f6b7a;
  line-height: 1.5;
  font-size: 13px;
}

.contest-side {
  display: grid;
  align-content: center;
  gap: 6px;
  color: #5f6b7a;
  font-size: 12px;
}

.contest-side span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.contest-side b {
  color: #172033;
}

.action-panel {
  position: sticky;
  top: 18px;
}

.action-panel .panel {
  margin-bottom: 14px;
}

.intensity-group.compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 12px;
}

.intensity-group.compact button {
  border-radius: 10px;
  padding: 9px 10px;
}

.action-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 660px);
  overflow: auto;
  padding-right: 2px;
}

.action-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  color: #172033;
}

.action-card.selected {
  border-color: #2563eb;
  background: #eef4ff;
}

.action-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f1f5f9;
  font-weight: 900;
}

.action-card strong,
.action-card small,
.action-card em {
  display: block;
}

.action-card strong {
  font-size: 17px;
}

.action-card small {
  margin-top: 4px;
  color: #5f6b7a;
  line-height: 1.45;
}

.action-card em {
  margin-top: 7px;
  color: #0f766e;
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}

.weekly-action-list {
  max-height: none;
  overflow: visible;
}

.weekly-action-card {
  min-height: 96px;
  align-items: center;
}

.weekly-action-card:hover,
.modal-choice-card:hover {
  border-color: #2563eb;
  background: #f8fbff;
}

.weekly-action-card.danger-action em {
  color: #be123c;
}

.action-modal {
  width: min(760px, 100%);
  border-radius: 18px;
}

.modal-close {
  width: auto;
  white-space: nowrap;
}

.modal-control-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  background: #f8fafc;
}

.modal-control-row label {
  color: #334155;
  font-weight: 900;
}

.modal-control-row select {
  width: 100%;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: #172033;
  background: #fff;
}

.modal-card-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 2px;
}

.modal-card-list.compact-list {
  max-height: none;
  overflow: visible;
  margin-bottom: 12px;
}

.modal-choice-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  color: #172033;
}

.modal-choice-card.recommended-task {
  border-color: #86efac;
  background: #f0fdf4;
}

.modal-choice-card.recommended-task .action-icon {
  background: #dcfce7;
  color: #15803d;
}

.modal-choice-card.featured-choice {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.modal-choice-card.featured-choice .action-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.modal-choice-card strong,
.modal-choice-card small,
.modal-choice-card em {
  display: block;
}

.modal-choice-card strong {
  font-size: 18px;
}

.modal-choice-card small {
  margin-top: 4px;
  color: #5f6b7a;
  line-height: 1.45;
}

.modal-choice-card em {
  margin-top: 8px;
  color: #0f766e;
  font-style: normal;
  font-weight: 850;
  font-size: 13px;
}

.task-preview-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  color: #5f6b7a;
  font-size: 12px;
  font-weight: 750;
}

.fit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
}

.fit-badge.good {
  background: #dcfce7;
  color: #15803d;
}

.fit-badge.warn {
  background: #fef3c7;
  color: #b45309;
}

.fit-badge.bad {
  background: #ffe4e6;
  color: #be123c;
}

.risk-text {
  color: #be123c;
}

.student-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 14px;
}

.student-detail-main,
.student-detail-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.detail-block {
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.detail-block h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.detail-bars {
  display: grid;
  gap: 9px;
}

.detail-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-action-list {
  display: grid;
  gap: 8px;
}

.detail-action-btn {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid #e8ebf0;
  border-radius: 10px;
  background: #fff;
  color: #172033;
}

.detail-action-btn strong,
.detail-action-btn small,
.detail-action-btn em {
  display: block;
}

.detail-action-btn strong {
  font-size: 14px;
}

.detail-action-btn small {
  margin-top: 4px;
  color: #5f6b7a;
  line-height: 1.45;
}

.detail-action-btn em {
  margin-top: 6px;
  color: #0f766e;
  font-style: normal;
  font-weight: 850;
  font-size: 12px;
}

.detail-action-btn:hover {
  border-color: #2563eb;
  background: #f8fbff;
}

.annual-summary-grid,
.honor-layout {
  display: grid;
  gap: 14px;
}

.year-summary-list {
  display: grid;
  gap: 10px;
}

.year-summary-card {
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.year-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.year-summary-head strong,
.year-summary-head span {
  display: block;
}

.year-summary-head span {
  margin-top: 3px;
  color: #5f6b7a;
  font-size: 12px;
}

.year-summary-head b {
  min-width: 46px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef4ff;
  color: #1d4ed8;
}

.year-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.year-summary-card p {
  margin: 0 0 10px;
  color: #5f6b7a;
  font-size: 13px;
  line-height: 1.5;
}

.honor-table td,
.honor-table th {
  white-space: nowrap;
}

.leaderboard-wrap {
  overflow: auto;
}

.leaderboard-table td,
.leaderboard-table th {
  white-space: nowrap;
}

.leaderboard-table small {
  color: #667085;
}

.modal-footer-btn {
  width: 100%;
  margin-top: 14px;
}

.detail-facts {
  display: grid;
  gap: 2px;
}

.qualification-list {
  display: grid;
  gap: 8px;
}

.qualification-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #5f6b7a;
  font-size: 13px;
}

.qualification-line strong {
  color: #172033;
}

.detail-note {
  margin: 0;
  color: #42526a;
  line-height: 1.6;
  font-size: 14px;
}

.detail-awards {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.week-report-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.week-report-kpi {
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.week-report-kpi span,
.week-report-kpi small {
  display: block;
  color: #5f6b7a;
  font-size: 12px;
  font-weight: 750;
}

.week-report-kpi strong {
  display: block;
  margin: 4px 0;
  color: #15803d;
  font-size: 20px;
}

.week-report-kpi.negative strong {
  color: #be123c;
}

.week-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 14px;
}

.mock-result-block {
  margin-bottom: 14px;
  overflow: auto;
}

.mock-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mock-result-head h4 {
  margin-bottom: 4px;
}

.mock-result-head p {
  margin: 0;
  color: #5f6b7a;
  font-size: 13px;
}

.mock-score-table {
  min-width: 620px;
}

.week-student-list,
.week-event-list {
  display: grid;
  gap: 8px;
}

.week-student-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) repeat(3, auto);
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f5;
  color: #5f6b7a;
  font-size: 13px;
}

.week-student-row:last-child {
  border-bottom: 0;
}

.week-student-row strong {
  color: #172033;
}

.advance-btn {
  margin-top: 12px;
  border-radius: 10px;
}

.coach-note .log-line {
  padding: 8px 0;
}

.compact-empty {
  padding: 18px;
  border-radius: 10px;
}

.game-shell .kpi {
  padding: 9px 0;
}

.game-shell .kpi span,
.game-shell .log-line small,
.game-shell .table th {
  color: #667085;
}

@media (max-width: 1100px) {
  .game-header,
  .game-board,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .header-stats {
    justify-content: flex-start;
  }

  .action-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .start-kicker,
  .start-school-title,
  .setup-head,
  .label-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .start-metrics,
  .start-rule-list div,
  .candidate,
  .coach-stat-row,
  .year-summary-metrics {
    grid-template-columns: 1fr;
  }

  .coach-stepper {
    width: 100%;
    grid-template-columns: 34px 1fr 34px;
  }

  .auth-card {
    padding: 20px;
  }

  .auth-title h1 {
    font-size: 28px;
  }

  .auth-code-row,
  .auth-mini-grid {
    grid-template-columns: 1fr;
  }

  .candidate {
    gap: 8px;
  }

  .candidate-score {
    text-align: left;
  }

  .game-shell {
    padding: 12px;
  }

  .game-header,
  .student-row-main {
    grid-template-columns: 1fr;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .compact-pressure {
    text-align: left;
  }

  .modal-control-row,
  .modal-choice-card,
  .weekly-action-card,
  .contest-calendar-row,
  .student-detail-grid,
  .week-report-grid,
  .week-student-row {
    grid-template-columns: 1fr;
  }

  .detail-topic-grid {
    grid-template-columns: 1fr;
  }

  .contest-side span {
    justify-content: flex-start;
  }
}

/* Final compact workstation pass */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --text: #111827;
  --muted: #4b5563;
  --line: #dfe5ee;
  --brand: #2357d6;
  --brand-2: #6d3be8;
  --shadow: 0 8px 20px rgba(15, 23, 42, .08);
  --radius: 12px;
}

html,
body {
  height: 100%;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(35, 87, 214, .08), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(109, 59, 232, .07), transparent 28%),
    var(--bg);
}

button:hover {
  transform: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(35, 87, 214, .9);
  outline-offset: 2px;
}

.hero,
.setup-panel,
.panel,
.student-card,
.training-card,
.facility-card,
.event-card,
.contest-modal,
.auth-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.compact-btn,
.text-btn {
  border-radius: 10px;
}

.primary-btn {
  background: #2357d6;
  box-shadow: none;
}

.secondary-btn {
  background: #eaf1ff;
  color: #1747b5;
}

.ghost-btn {
  background: #eef2f7;
  color: #273244;
}

.danger-btn {
  background: #fff0f2;
  color: #b4233a;
}

.badge,
.tag,
.pill,
.school-option-metrics i,
.start-specials span {
  border-radius: 999px;
}

@media (min-width: 1101px) {
  .auth-shell,
  .start-page,
  .game-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .auth-shell {
    padding: 24px;
  }

  .auth-card {
    height: min(760px, calc(100dvh - 48px));
    width: min(1180px, 100%);
    grid-template-columns: minmax(360px, .72fr) minmax(560px, 1fr);
  }

  .auth-side {
    min-height: 0;
    padding: 28px;
  }

  .auth-main {
    max-height: none;
    overflow: auto;
    padding: 28px;
  }

  .start-page {
    padding: 16px;
    place-items: stretch;
  }

  .start-card,
  .start-card.wide {
    width: min(1500px, 100%);
    height: calc(100dvh - 32px);
    margin: 0 auto;
    grid-template-columns: minmax(360px, .64fr) minmax(760px, 1.36fr);
    gap: 14px;
    min-height: 0;
  }

  .hero,
  .setup-panel {
    min-height: 0;
    padding: 20px;
  }

  .hero {
    overflow: auto;
  }

  .hero {
    gap: 14px;
  }

  .start-school-title h1 {
    font-size: 34px;
  }

  .start-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .start-metric {
    padding: 10px;
  }

  .start-info-block,
  .coach-builder {
    padding: 12px;
  }

  .start-rule-list div {
    padding: 10px 12px;
  }

  .setup-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    overflow: hidden;
  }

  .setup-panel h2 {
    font-size: 22px;
  }

  .setup-panel-body {
    min-height: 0;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 12px;
    padding-right: 2px;
  }

  .setup-form-grid {
    grid-template-columns: minmax(0, 1fr) 150px;
  }

  .coach-stat-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coach-stat-row {
    padding: 8px;
  }

  .coach-stat-row small {
    display: none;
  }

  .school-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .school-option {
    min-height: 96px;
    padding: 11px;
  }

  .candidate-section {
    min-height: 0;
  }

  .candidate-list {
    max-height: none;
    height: min(38vh, 360px);
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    align-content: start;
    gap: 10px;
  }

  .candidate {
    min-height: 104px;
    grid-template-columns: 22px minmax(0, 1fr) 58px;
    align-items: center;
    padding: 12px;
    overflow: hidden;
  }

  .candidate input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    justify-self: center;
    align-self: center;
  }

  .candidate-main {
    min-width: 0;
  }

  .candidate-main strong,
  .candidate-main small {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .candidate-main strong {
    white-space: nowrap;
  }

  .candidate small {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }

  .candidate-topics {
    white-space: nowrap;
    display: block !important;
  }

  .start-actions {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 34%);
    z-index: 2;
  }

  .game-shell {
    display: block;
    padding: 14px;
  }

  .game-wrap {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .game-header {
    min-height: 74px;
    grid-template-columns: minmax(330px, .9fr) minmax(360px, 1fr) auto;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
  }

  .game-title h1 {
    font-size: 20px;
  }

  .game-title p {
    max-width: 68ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: end;
    gap: 6px 12px;
    font-size: 12px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 6px;
  }

  .header-actions .ghost-btn,
  .header-actions .danger-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .game-board {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 342px;
    gap: 12px;
    align-items: stretch;
  }

  .play-area,
  .action-panel {
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }

  .action-panel {
    position: static;
  }

  .game-shell .panel {
    padding: 13px;
    margin-bottom: 12px;
  }

  .section-head {
    margin-bottom: 10px;
  }

  .section-head h2,
  .game-shell .panel h3 {
    font-size: 18px;
  }

  .section-head p {
    font-size: 12px;
  }

  .compact-student-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .compact-student {
    padding: 10px;
  }

  .compact-name {
    font-size: 16px;
  }

  .compact-meta,
  .compact-pressure,
  .mini-topic,
  .tag,
  .pill {
    font-size: 11px;
  }

  .mini-topic-row {
    gap: 4px;
    margin-top: 8px;
  }

  .mini-tag-row {
    margin-top: 6px;
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .slim-panel {
    min-height: 0;
  }

  .game-shell .kpi {
    padding: 7px 0;
    font-size: 13px;
  }

  .log-line {
    padding: 7px 0;
    font-size: 13px;
    line-height: 1.45;
  }

  .action-list {
    gap: 8px;
    max-height: none;
  }

  .action-card {
    min-height: 0;
    grid-template-columns: 34px 1fr;
    padding: 10px;
  }

  .action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .action-card strong,
  .modal-choice-card strong {
    font-size: 15px;
  }

  .action-card small,
  .action-card em {
    font-size: 12px;
  }

  .coach-note {
    max-height: 240px;
    overflow: auto;
  }
}

.modal-backdrop {
  padding: 24px;
  z-index: 60;
}

.contest-modal {
  width: min(1120px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
}

.action-modal {
  width: min(1060px, 100%);
}

.modal-title {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-title h3 {
  font-size: 22px;
}

.modal-title p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.modal-body {
  min-height: 0;
  overflow: auto;
}

.modal-footer-btn {
  margin-top: 0;
}

.modal-card-list {
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.modal-card-list.compact-list {
  margin-bottom: 10px;
}

.modal-control-row {
  margin-bottom: 10px;
}

.modal-choice-card {
  min-height: 104px;
  border-radius: 10px;
  padding: 12px;
}

.student-detail-grid,
.week-report-grid,
.contest-result-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 12px;
}

.student-detail-main,
.student-detail-side,
.detail-block,
.contest-rank-block,
.contest-problem-block {
  min-height: 0;
}

.student-detail-side,
.contest-problem-block,
.year-summary-list {
  max-height: calc(100dvh - 210px);
  overflow: auto;
}

.detail-block {
  border-radius: 10px;
}

.detail-block h4 {
  color: #273244;
}

.table-scroll,
.leaderboard-wrap,
.mock-result-block {
  overflow: auto;
}

.table {
  font-size: 13px;
}

.table th,
.table td {
  padding: 9px 10px;
}

.ending-number {
  display: block;
  font-size: 30px;
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .contest-modal {
    max-height: calc(100dvh - 24px);
  }

  .modal-card-list,
  .student-detail-grid,
  .week-report-grid,
  .contest-result-grid {
    grid-template-columns: 1fr;
  }

  .student-detail-side,
  .contest-problem-block,
  .year-summary-list {
    max-height: none;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
