:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --navy: #0f2c59;
  --text: #0f172a;
  --muted: #475569;
  --border: #cbd5e1;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #dbeafe;
  --emerald: #047857;
  --emerald-soft: #d1fae5;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --rose: #be123c;
  --rose-soft: #ffe4e6;
  --purple: #6d28d9;
  --purple-soft: #ede9fe;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(15, 44, 89, 0.08);
  --font-scale: 1;
}

body.projector-mode {
  --font-scale: 1.18;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: calc(1rem * var(--font-scale));
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.09), transparent 36%),
    radial-gradient(circle at 88% 12%, rgba(16, 185, 129, 0.08), transparent 34%),
    var(--bg);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #dbe4f0;
}

.header-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0.72rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f2c59, #2563eb);
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
}

.brand-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}

.brand-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

/* Tabbed interface (WCAG 1.4.1 shape indicator) */
.mode-switch,
.stage-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0.25rem;
  scrollbar-width: thin;
}

.mode-tab,
.stage-tab {
  position: relative;
  flex: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0.52rem 0.85rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
}

.mode-tab[aria-selected="true"],
.stage-tab[aria-selected="true"] {
  color: var(--primary);
  background: var(--primary-soft);
}

.mode-tab[aria-selected="true"]::after,
.stage-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 3px solid var(--primary);
}

/* Layout & Cards */
.main-container {
  max-width: 1260px;
  margin: 1.15rem auto 2.5rem;
  padding: 0 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.15rem;
}

.subcard {
  background: var(--surface-alt);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.54rem 0.92rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary {
  background: linear-gradient(135deg, #047857, #059669);
  color: #fff;
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { background: var(--surface-alt); }
.btn-outline[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm { padding: 0.36rem 0.7rem; font-size: 0.83rem; }
.btn-lg { padding: 0.78rem 1.25rem; font-size: 1rem; }
.full-width { width: 100%; }

/* Pills */
.pill {
  display: inline-block;
  padding: 0.22rem 0.68rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.pill-blue { background: var(--primary-soft); color: var(--primary); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-emerald { background: var(--emerald-soft); color: var(--emerald); }
.pill-purple { background: var(--purple-soft); color: var(--purple); }
.pill-slate { background: #e2e8f0; color: #334155; }

/* Onboarding */
.onboarding-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}
.onboarding-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.hero-copy h2 {
  margin: 0.5rem 0 0.45rem;
  font-size: 1.6rem;
  color: var(--navy);
}
.lead { color: var(--muted); margin-top: 0.2rem; }

.feature-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}
.feature-tile {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem;
}
.feature-tile p { margin: 0.15rem 0 0; font-size: 0.83rem; color: var(--muted); }
.tile-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.start-form {
  background: #fff;
  border: 2px solid #dbeafe;
  border-radius: 14px;
  padding: 1.25rem;
}
.start-form h3 { margin-top: 0; color: var(--navy); }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
}
.field input,
.field select,
#t-search-student {
  width: 100%;
  padding: 0.6rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.mono-input { font-family: 'JetBrains Mono', monospace; }
.req { color: var(--rose); }
.muted-note { font-size: 0.8rem; color: var(--muted); margin: 0.55rem 0 0; }

/* Student topbar + Gamification HUD */
.student-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
}
.student-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.gamification-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.gami-chip {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
}
.chip-xp { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.chip-streak { background: #ffe4e6; color: #9f1239; border: 1px solid #fda4af; }
.chip-badge { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }

/* Stage common */
.stage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.stage-header h2 { margin: 0.3rem 0 0; font-size: 1.24rem; color: var(--navy); }

.timer-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-alt);
  padding: 0.42rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.timer-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  color: var(--primary);
  min-width: 3ch;
  text-align: center;
}
.timer-value.urgent { color: var(--rose); }

.progress-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width 0.25s ease;
}
.progress-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.4rem 0 0.9rem;
}
.progress-meta { font-size: 0.85rem; color: var(--muted); }

/* Stage 1 */
.stage1-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.25rem;
}

.diagram-box {
  background: var(--surface-alt);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
}

.svg-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 205px;
}

.math-statement {
  border-top: 1px dashed var(--border);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}
.math-statement p { margin: 0.35rem 0; }

.option-list,
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.choice-btn {
  width: 100%;
  text-align: left;
  padding: 0.78rem 0.95rem;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.choice-btn:hover:not(:disabled) { border-color: #93c5fd; background: #f8fbff; }
.choice-btn.selected { border-color: var(--primary); background: var(--primary-soft); }
.choice-btn.correct { border-color: var(--emerald); background: var(--emerald-soft); }
.choice-btn.wrong { border-color: var(--rose); background: var(--rose-soft); }
.choice-btn.dimmed { opacity: 0.38; }

.feedback-box {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  background: var(--surface-alt);
}
.feedback-box.ok { border-left-color: var(--emerald); background: var(--emerald-soft); }
.feedback-box.err { border-left-color: var(--rose); background: var(--rose-soft); }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

/* Stage 2 */
.problem-banner {
  background: var(--surface-alt);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 1rem;
}
.problem-banner h3 { margin: 0 0 0.35rem; color: var(--navy); }
.problem-banner p { margin: 0.25rem 0; }
.question-highlight { color: var(--primary); font-weight: 600; }

.stage2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Stage 3 */
.stage3-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.interactive-canvas-card {
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  overflow: hidden;
}

.canvas-toolbar,
.explore-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  background: #fff;
  font-size: 0.85rem;
}
.canvas-toolbar { border-bottom: 1px solid #e2e8f0; }
.explore-bar { border-top: 1px solid #e2e8f0; justify-content: space-between; }

.zoom-control { display: flex; align-items: center; gap: 0.45rem; }
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
  cursor: pointer;
  font-size: 0.84rem;
}

.svg-viewport {
  overflow: auto;
  min-height: 295px;
  max-height: 440px;
  display: grid;
  place-items: center;
  padding: 0.6rem;
  background: #f1f5f9;
}
.svg-zoom-target {
  transform-origin: center center;
  transition: transform 0.2s ease;
}

.tier-badge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.input-with-btn { display: flex; gap: 0.5rem; }
.input-with-btn input { flex: 1; }

.hint-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.hint-box {
  padding: 0.85rem;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}
.hint-l2 { background: var(--amber-soft); border-left: 4px solid var(--amber); }
.hint-l3 { background: var(--purple-soft); border-left: 4px solid var(--purple); }

/* Mini-game */
.minigame-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  margin-top: 0.8rem;
}
.col-title { margin: 0 0 0.6rem; color: var(--navy); }
.choice-btn.matched {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  opacity: 0.8;
}

/* Stage 4 & Teacher Dashboard */
.header-actions-inline,
.teacher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.teacher-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.teacher-toolbar h2 { margin: 0.25rem 0 0; color: var(--navy); }

.sync-banner {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  margin-bottom: 1rem;
  font-weight: 600;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.kpi-label { font-size: 0.83rem; color: var(--muted); }
.kpi-value { font-size: 1.55rem; color: var(--primary); font-family: 'JetBrains Mono', monospace; }
.kpi-sub { font-size: 0.8rem; color: var(--muted); }

.diagnosis-grid,
.teacher-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.radar-wrap,
.histogram-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
}

.radar-hist-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}
.badge-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.82rem;
}
.badge-item.locked { opacity: 0.45; filter: grayscale(1); }
.badge-item.unlocked { border-color: #fcd34d; background: #fffbeb; }
.badge-icon { font-size: 1.35rem; }

.skill-bars { display: flex; flex-direction: column; gap: 0.65rem; }
.skill-row-head { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 600; margin-bottom: 0.2rem; }
.skill-track { height: 11px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.skill-fill { height: 100%; border-radius: 999px; transition: width 0.3s ease; }

.prescription-list { padding-left: 1.2rem; margin: 0.5rem 0 0; }
.prescription-list li { margin-bottom: 0.42rem; }

.hotspot-box {
  margin-top: 0.95rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: var(--rose-soft);
}
.hotspot-box h4 { margin: 0 0 0.35rem; color: var(--rose); }

.leaderboard-box {
  margin-top: 0.9rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.leaderboard-box h4 { margin: 0 0 0.4rem; color: var(--emerald); }
.leaderboard-list { margin: 0; padding-left: 1.25rem; font-size: 0.9rem; }
.leaderboard-list li { margin-bottom: 0.25rem; }

/* Responsive Table (Modern Web Guidance) */
.table-header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.table-header-row h3 { margin: 0; }
#t-search-student { max-width: 280px; }

.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(480px, 75vh);
  container-type: inline-size;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.responsive-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.89rem;
}
.responsive-data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: #f1f5f9;
}
.responsive-data-table th,
.responsive-data-table td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
.responsive-data-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: #fff;
  font-weight: 600;
}

@container (width < 600px) {
  .responsive-data-table,
  .responsive-data-table thead,
  .responsive-data-table tbody,
  .responsive-data-table tr,
  .responsive-data-table th,
  .responsive-data-table td {
    display: block;
  }
  .responsive-data-table thead { display: none; }
  .responsive-data-table tr {
    margin-block-end: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }
  .responsive-data-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: #eff6ff;
  }
  .responsive-data-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--muted);
  }
}

/* Native <dialog> (Modern Web Guidance) */
dialog {
  width: min(760px, calc(100vw - 2rem));
  max-height: 88vh;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
  overscroll-behavior: contain;
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid #e2e8f0;
}
.dialog-header h1 { margin: 0; font-size: 1.12rem; color: var(--navy); }
.btn-icon-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
}
.dialog-body {
  padding: 1.15rem 1.2rem;
  overflow-y: auto;
  max-height: 66vh;
}
.dialog-footer {
  padding: 0.85rem 1.2rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}

.formula-card {
  background: var(--surface-alt);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.75rem;
}
.formula-card h3 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--primary); }

.qr-dialog-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.qr-box-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.qr-code-canvas {
  min-width: 170px;
  min-height: 170px;
  display: grid;
  place-items: center;
}
.url-preview {
  word-break: break-all;
  font-size: 0.8rem;
  color: var(--muted);
}

.calc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.calc-result {
  margin-top: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
}

@media (max-width: 920px) {
  .onboarding-grid,
  .feature-tiles,
  .stage1-grid,
  .stage2-grid,
  .stage3-grid,
  .minigame-grid,
  .diagnosis-grid,
  .teacher-charts-grid,
  .radar-hist-split,
  .badges-grid,
  .qr-dialog-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media print {
  .app-header, .student-topbar, .header-actions-inline { display: none !important; }
  .card { box-shadow: none; border-color: #94a3b8; }
}

/* Bục Vinh Danh & Xếp Hạng Trực Tiếp Máy Chiếu */
.podium-dialog {
  width: min(1140px, 96vw);
  max-height: 92vh;
  background: linear-gradient(160deg, #0b1f44 0%, #16356b 60%, #0f2c59 100%);
  color: #f8fafc;
  border: 2px solid rgba(250, 204, 21, 0.45);
  overflow: hidden;
  position: relative;
}

.podium-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.podium-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.25rem;
  background: rgba(7, 17, 38, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.podium-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.podium-title-group h1 {
  margin: 0;
  font-size: 1.32rem;
  letter-spacing: 0.02em;
  color: #fde047;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.25);
  border: 1px solid #fb7185;
  color: #fecdd3;
  font-size: 0.78rem;
  font-weight: 800;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fb7185;
  animation: livePulse 1.3s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.podium-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.podium-controls select {
  padding: 0.38rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #0f172a;
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
}
.podium-stat-pill {
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
  font-weight: 700;
  font-size: 0.85rem;
}

.podium-body {
  position: relative;
  z-index: 2;
  padding: 1.1rem 1.25rem 1.35rem;
  overflow-y: auto;
  max-height: calc(92vh - 76px);
}

.podium-stage {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.15rem;
}

.podium-col {
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
}
.podium-col.rank-1 {
  order: 2;
  min-height: 215px;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.24), rgba(234, 179, 8, 0.08));
  border: 2px solid #facc15;
  box-shadow: 0 10px 30px rgba(250, 204, 21, 0.2);
}
.podium-col.rank-2 {
  order: 1;
  min-height: 180px;
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.2), rgba(148, 163, 184, 0.08));
  border: 1.5px solid #cbd5e1;
}
.podium-col.rank-3 {
  order: 3;
  min-height: 162px;
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.2), rgba(194, 65, 12, 0.08));
  border: 1.5px solid #fb923c;
}

.podium-medal {
  font-size: 1.9rem;
  line-height: 1;
}
.podium-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.podium-class {
  font-size: 0.84rem;
  color: #cbd5e1;
}
.podium-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.65rem;
  font-weight: 800;
  color: #fde047;
}
.podium-meta {
  font-size: 0.82rem;
  color: #bae6fd;
}

.podium-rest-wrap h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #cbd5e1;
}
.podium-rest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem 0.9rem;
}
.podium-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.94rem;
}
.podium-row-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.podium-rank-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.podium-row-score {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #fde047;
}

@media (max-width: 780px) {
  .podium-stage,
  .podium-rest-grid {
    grid-template-columns: 1fr;
  }
  .podium-col.rank-1 { order: 1; }
  .podium-col.rank-2 { order: 2; }
  .podium-col.rank-3 { order: 3; }
}
