/* ═══════════════════════════════════════════════════════
   GameLearn Teacher Dashboard — Professional CSS v2.0
   Dark Space / Glassmorphism Theme
═══════════════════════════════════════════════════════ */

:root {
  --purple:        #6c3ce1;
  --purple-light:  #8b5cf6;
  --purple-mid:    #7c4df0;
  --purple-glow:   rgba(108, 60, 225, 0.38);
  --cyan:          #0ea5e9;
  --cyan-light:    #38bdf8;
  --cyan-glow:     rgba(14, 165, 233, 0.28);
  --orange:        #f97316;
  --orange-glow:   rgba(249, 115, 22, 0.28);
  --green:         #22c55e;
  --green-glow:    rgba(34, 197, 94, 0.28);
  --red:           #ef4444;
  --red-glow:      rgba(239, 68, 68, 0.28);
  --yellow:        #facc15;
  --pink:          #ec4899;

  --bg-main:       #080614;
  --bg-deep:       #050410;
  --bg-card:       rgba(20, 14, 40, 0.88);
  --bg-card-solid: #14102a;
  --bg-hover:      rgba(108, 60, 225, 0.12);
  --bg-input:      rgba(255, 255, 255, 0.05);

  --text-main:     #f0eeff;
  --text-muted:    #a09ac4;
  --text-dim:      #5e5880;
  --text-white:    #ffffff;

  --border:        rgba(108, 60, 225, 0.22);
  --border-light:  rgba(255, 255, 255, 0.07);
  --border-hover:  rgba(108, 60, 225, 0.50);
  --border-active: rgba(108, 60, 225, 0.75);

  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  22px;
  --radius-xl:  28px;
  --radius-2xl: 36px;

  --shadow-sm:  0 4px 14px rgba(0,0,0,0.22);
  --shadow-md:  0 12px 32px rgba(0,0,0,0.32);
  --shadow-lg:  0 24px 56px rgba(0,0,0,0.38);
  --shadow-purple: 0 8px 32px rgba(108, 60, 225, 0.32);
  --shadow-cyan:   0 8px 32px rgba(14, 165, 233, 0.24);

  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast:  120ms;
  --t-base:  240ms;
  --t-slow:  420ms;
}

/* ─── Reset ─────────────────────────────────────────── */

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 90% 0%,   rgba(108,60,225,0.18), transparent),
    radial-gradient(ellipse 60% 40% at 0%  60%,  rgba(14,165,233,0.12), transparent),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(249,115,22,0.07), transparent),
    linear-gradient(180deg, #070510 0%, #0d0924 40%, #08101e 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Background Effects ────────────────────────────── */

.bg-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  animation: twinkle var(--duration, 3.2s) infinite alternate ease-in-out;
}

@keyframes twinkle {
  from { opacity: 0.1; transform: scale(0.8); }
  to   { opacity: 0.7; transform: scale(1.2); }
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: float-orb 18s ease-in-out infinite alternate;
}

.orb1 { width: 440px; height: 440px; top: -160px; right: -130px; background: rgba(108,60,225,0.14); animation-delay: 0s; }
.orb2 { width: 360px; height: 360px; left: -100px; bottom: 80px;  background: rgba(14,165,233,0.11); animation-delay: -6s; }
.orb3 { width: 300px; height: 300px; top: 42%; right: 30%;        background: rgba(249,115,22,0.07); animation-delay: -12s; }

@keyframes float-orb {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-40px) scale(1.08); }
}

/* ─── Layout Shell ──────────────────────────────────── */

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────── */

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 26px 20px;
  border-left: 1px solid var(--border-light);
  background: linear-gradient(180deg, rgba(8,5,18,0.96), rgba(12,8,26,0.92));
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 28px;
}

.brand-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  box-shadow: 0 10px 28px var(--purple-glow), inset 0 1px 0 rgba(255,255,255,0.18);
  flex-shrink: 0;
  position: relative;
}

.brand-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  opacity: 0.3;
  filter: blur(8px);
  z-index: -1;
}

.brand-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.55rem;
  line-height: 1;
  color: var(--text-white);
  font-weight: 600;
}

.brand-subtitle {
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Sidebar Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--t-base) var(--ease);
  font-weight: 600;
  font-size: 0.93rem;
  position: relative;
  overflow: hidden;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--purple-glow), transparent);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text-white);
  border-color: var(--border);
  transform: translateX(-3px);
}

.sidebar-nav a.active {
  background: rgba(108,60,225,0.18);
  border-color: var(--border);
  box-shadow: inset 3px 0 0 var(--purple);
}

.sidebar-nav a.active::before,
.sidebar-nav a:hover::before {
  opacity: 1;
}

/* Sidebar Cards */
.sidebar-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(16px);
  transition: border-color var(--t-base) var(--ease);
}

.sidebar-card:hover { border-color: var(--border); }

.sidebar-card-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  margin-bottom: 10px;
}

.sidebar-pin {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 0.16em;
  color: var(--yellow);
  text-shadow: 0 0 20px rgba(250,204,21,0.45);
  font-weight: 600;
  line-height: 1;
}

.sidebar-card-meta {
  margin-top: 9px;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.88rem;
}

/* Live badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,0.18);
  border: 1px solid rgba(34,197,94,0.35);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 8px;
}

.live-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.6); opacity: 0.5; }
}

.mascot-mini { text-align: center; }

.mascot-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-grid;
  place-items: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  box-shadow: var(--shadow-purple);
  margin-bottom: 10px;
}

.mascot-placeholder.large {
  width: 80px;
  height: 80px;
  font-size: 1.4rem;
  border-radius: 24px;
}

/* ─── Main Content ──────────────────────────────────── */

.main-content {
  padding: 32px 36px 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

/* ─── Hero Panel ────────────────────────────────────── */

.hero-panel {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 28px;
  padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--purple-glow), transparent 70%);
  pointer-events: none;
}

.hero-copy { display: flex; flex-direction: column; gap: 16px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(34,197,94,0.38);
  background: rgba(34,197,94,0.10);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
  width: fit-content;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 1.4s ease-in-out infinite;
}

.hero-panel h1 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 900;
  line-height: 1.35;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.hero-panel p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.96rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.93rem;
  transition: all var(--t-base) var(--ease-spring);
  border: 1px solid transparent;
  cursor: pointer;
}

.hero-btn-main {
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #fff;
  box-shadow: var(--shadow-purple);
}

.hero-btn-main:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 40px var(--purple-glow);
}

.hero-btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-main);
  border-color: var(--border-light);
}

.hero-btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--border);
  transform: translateY(-2px);
}

/* Hero preview grid */
.hero-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.mini-stage {
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

.mini-stage:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.blue-stage   { background: linear-gradient(135deg, rgba(14,165,233,0.18), rgba(14,165,233,0.06)); }
.orange-stage { background: linear-gradient(135deg, rgba(249,115,22,0.18), rgba(249,115,22,0.06)); }
.teal-stage   { background: linear-gradient(135deg, rgba(34,197,94,0.18), rgba(34,197,94,0.06)); }

.mini-stage-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stage-placeholder {
  height: 44px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stage-placeholder.tug::before   { content: '🪢'; }
.stage-placeholder.race::before  { content: '🏎️'; }
.stage-placeholder.ladder::before{ content: '🪜'; }

/* Hero Side */
.hero-side { display: flex; flex-direction: column; gap: 16px; }

.hero-auth {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 22px;
}

.panel-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.field.field-wide { grid-column: 1 / -1; }

.field input, .field select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--t-fast) var(--ease);
  outline: none;
  width: 100%;
}

.field input:focus, .field select:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(108,60,225,0.15);
}

.field select option { background: var(--bg-card-solid); }

.auth-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t-base) var(--ease-spring);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  color: #fff;
  box-shadow: 0 4px 16px var(--purple-glow);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--purple-glow);
}

.action-btn.secondary {
  background: rgba(14,165,233,0.18);
  color: var(--cyan-light);
  border: 1px solid rgba(14,165,233,0.28);
}

.action-btn.secondary:hover { background: rgba(14,165,233,0.28); }

.action-btn.ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.action-btn.ghost:hover { background: rgba(255,255,255,0.10); color: var(--text-main); }

.action-btn.danger {
  background: rgba(239,68,68,0.18);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.28);
}

.action-btn.danger:hover { background: rgba(239,68,68,0.28); }

.hero-mascot-card {
  background: rgba(108,60,225,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  text-align: center;
}

.hero-mascot-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 10px;
}

/* ─── Stats Grid ────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card {
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(40px);
  pointer-events: none;
}

.metric-card.purple { background: rgba(108,60,225,0.14); border-color: rgba(108,60,225,0.28); }
.metric-card.purple::before { background: var(--purple); }

.metric-card.cyan { background: rgba(14,165,233,0.12); border-color: rgba(14,165,233,0.26); }
.metric-card.cyan::before { background: var(--cyan); }

.metric-card.green { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.26); }
.metric-card.green::before { background: var(--green); }

.metric-card.orange { background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.26); }
.metric-card.orange::before { background: var(--orange); }

.metric-label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.metric-value {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1;
  margin: 8px 0 4px;
  transition: all var(--t-slow) var(--ease);
}

.metric-sub { font-size: 0.78rem; color: var(--text-dim); }

/* ─── Dashboard Grid ─────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}

/* ─── Glass Cards ────────────────────────────────────── */

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: 28px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
  transition: border-color var(--t-base) var(--ease);
}

.glass-card:hover { border-color: var(--border); }

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

.section-tag {
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-light);
  margin-bottom: 6px;
}

.section-head h2 {
  font-size: 1.22rem;
  font-weight: 900;
  color: var(--text-white);
}

.section-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
  background: rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
}

.section-note.success { color: var(--green); background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.22); }
.section-note.error   { color: #fca5a5; background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.22); }
.section-note.warning { color: var(--yellow); background: rgba(250,204,21,0.10); border-color: rgba(250,204,21,0.22); }

/* ─── Form Grid ──────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.submit-btn {
  grid-column: 1 / -1;
  padding: 15px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-purple);
  transition: all var(--t-base) var(--ease-spring);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px var(--purple-glow); }
.submit-btn:hover::before { transform: translateX(100%); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ─── List Panel ─────────────────────────────────────── */

.list-panel { display: flex; flex-direction: column; gap: 10px; }

.list-item {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  transition: all var(--t-base) var(--ease);
}

.list-item:hover { background: rgba(255,255,255,0.07); border-color: var(--border); }
.list-item strong { font-size: 0.95rem; color: var(--text-main); }

.list-meta { margin-top: 6px; font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }
.list-meta > * + * { margin-top: 2px; }

/* ─── Session Cards ──────────────────────────────────── */

.session-cards { display: flex; flex-direction: column; gap: 12px; }

.session-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  transition: all var(--t-base) var(--ease);
  cursor: pointer;
}

.session-card:hover { border-color: var(--border); background: rgba(108,60,225,0.08); transform: translateX(-3px); }
.session-card.live-active { border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.06); }

.session-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.session-topline strong { font-size: 0.98rem; color: var(--text-white); font-weight: 800; }

.session-pin-badge {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--yellow);
  background: rgba(250,204,21,0.12);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(250,204,21,0.24);
  letter-spacing: 0.12em;
}

.session-pill-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

.session-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
}

.session-link { margin-top: 10px; }
.session-link a { font-size: 0.83rem; color: var(--cyan-light); text-decoration: none; font-weight: 700; }
.session-link a:hover { text-decoration: underline; }

.live-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.24);
  font-size: 0.82rem;
  color: var(--green);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

/* ─── Live Preview Card ──────────────────────────────── */

.live-preview-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: rgba(0,0,0,0.2);
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.live-preview-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

.live-preview-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.live-preview-stage {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.stage-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.live-score-strip {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.live-score-box {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.live-score-box.blue { background: rgba(37,99,235,0.85); }
.live-score-box.orange { background: rgba(234,88,12,0.85); }
.live-score-box strong { font-size: 0.82rem; color: #fff; font-weight: 800; }
.live-score-box span { font-size: 0.75rem; color: rgba(255,255,255,0.7); }

.live-stage-characters {
  position: absolute;
  bottom: 44px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
}

.live-character {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.live-character img { width: 54px; }
.blue-tag { font-size: 0.7rem; font-weight: 800; color: #93c5fd; background: rgba(37,99,235,0.6); padding: 2px 8px; border-radius: 999px; }
.orange-tag { font-size: 0.7rem; font-weight: 800; color: #fdba74; background: rgba(234,88,12,0.6); padding: 2px 8px; border-radius: 999px; }

.live-preview-meta {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0,0,0,0.3);
}

.live-preview-chip {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.07);
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}

.live-preview-question { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; }
.live-preview-question strong { color: var(--text-main); font-size: 0.82rem; }

.live-preview-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.live-preview-options span {
  font-size: 0.78rem;
  padding: 4px 10px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* ─── Live Game Control Panel ────────────────────────── */

.live-control-section { display: none; }
.live-control-section.visible { display: block; }

.live-control-panel {
  padding: 26px;
  background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(14,165,233,0.06));
  border: 1px solid rgba(34,197,94,0.30);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(18px);
  box-shadow: 0 0 40px rgba(34,197,94,0.10);
}

.live-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

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

.live-control-title h2 { font-size: 1.2rem; font-weight: 900; color: var(--text-white); }

.live-session-info {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.live-session-info .chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-weight: 700;
}

.live-control-body {
  display: grid;
  grid-template-columns: 1fr 1fr 280px;
  gap: 20px;
}

/* Scores display */
.live-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.score-team-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid transparent;
  transition: transform var(--t-base) var(--ease);
}

.score-team-card.team-a {
  background: rgba(37,99,235,0.16);
  border-color: rgba(37,99,235,0.32);
}

.score-team-card.team-b {
  background: rgba(234,88,12,0.16);
  border-color: rgba(234,88,12,0.32);
}

.score-team-name { font-size: 0.82rem; font-weight: 800; color: var(--text-muted); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.score-team-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 3.2rem;
  font-weight: 600;
  line-height: 1;
  margin: 6px 0 2px;
  color: var(--text-white);
}
.score-team-label { font-size: 0.72rem; color: var(--text-dim); }

/* Question display in live panel */
.live-question-box {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-q-label { font-size: 0.72rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.live-q-text { font-size: 1.05rem; font-weight: 800; color: var(--text-white); line-height: 1.5; }
.live-q-progress { font-size: 0.8rem; color: var(--text-muted); }

.live-q-options { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.live-q-options span {
  font-size: 0.8rem;
  padding: 7px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

/* Timer ring */
.timer-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.timer-ring {
  position: relative;
  width: 90px;
  height: 90px;
}

.timer-ring svg {
  width: 90px;
  height: 90px;
  transform: rotate(-90deg);
}

.timer-ring .track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 7;
}

.timer-ring .progress {
  fill: none;
  stroke: var(--green);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.timer-ring .progress.warning { stroke: var(--yellow); }
.timer-ring .progress.danger  { stroke: var(--red); animation: timer-shake 0.3s ease infinite alternate; }

@keyframes timer-shake {
  from { transform: rotate(-90deg) translateX(-1px); }
  to   { transform: rotate(-90deg) translateX(1px); }
}

.timer-number {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-white);
}

/* Control Buttons */
.ctrl-btns {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t-base) var(--ease-spring);
  letter-spacing: 0.02em;
}

.ctrl-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.ctrl-btn.start {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: #fff;
  box-shadow: 0 4px 20px var(--green-glow);
}

.ctrl-btn.start:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--green-glow);
}

.ctrl-btn.next {
  background: linear-gradient(135deg, var(--cyan), #0284c7);
  color: #fff;
  box-shadow: 0 4px 20px var(--cyan-glow);
}

.ctrl-btn.next:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--cyan-glow);
}

.ctrl-btn.finish {
  background: rgba(239,68,68,0.16);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.32);
}

.ctrl-btn.finish:not(:disabled):hover {
  background: rgba(239,68,68,0.28);
  transform: translateY(-2px);
}

/* QR Panel */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
}

.qr-label { font-size: 0.78rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }

.qr-box {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 10px;
  display: grid;
  place-items: center;
}

.qr-box img { display: block; width: 140px; height: 140px; }

.qr-url {
  font-size: 0.78rem;
  color: var(--cyan-light);
  text-align: center;
  word-break: break-all;
  max-width: 200px;
}

.qr-copy-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(108,60,225,0.12);
  color: var(--purple-light);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t-base) var(--ease-spring);
}

.qr-copy-btn:hover { background: rgba(108,60,225,0.24); transform: scale(1.04); }

/* Leaderboard */
.leaderboard-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}

.leaderboard-label { font-size: 0.72rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  transition: all var(--t-fast) var(--ease);
}

.lb-row:hover { background: rgba(255,255,255,0.07); }
.lb-row.rank-1 { background: rgba(250,204,21,0.10); border-color: rgba(250,204,21,0.25); }
.lb-row.rank-2 { background: rgba(156,163,175,0.10); border-color: rgba(156,163,175,0.22); }
.lb-row.rank-3 { background: rgba(180,83,9,0.12); border-color: rgba(180,83,9,0.25); }

.lb-rank {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.lb-row.rank-1 .lb-rank { color: var(--yellow); }
.lb-row.rank-2 .lb-rank { color: #9ca3af; }
.lb-row.rank-3 .lb-rank { color: #b45309; }

.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 0.85rem; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-team { font-size: 0.75rem; color: var(--text-muted); }

.lb-score {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-white);
}

/* Students list */
.students-panel { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.students-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.student-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease);
}

.student-chip.team-a {
  background: rgba(37,99,235,0.14);
  border-color: rgba(37,99,235,0.28);
  color: #93c5fd;
}

.student-chip.team-b {
  background: rgba(234,88,12,0.14);
  border-color: rgba(234,88,12,0.28);
  color: #fdba74;
}

.student-chip .chip-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.students-count {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* ─── Platform/Features Grid ─────────────────────────── */

.platform-grid { display: grid; }

.platform-card { }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  transition: all var(--t-base) var(--ease);
}

.feature-card:hover {
  background: rgba(108,60,225,0.08);
  border-color: var(--border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}

.feature-icon.purple { background: linear-gradient(135deg, var(--purple), var(--purple-light)); box-shadow: 0 6px 20px var(--purple-glow); }
.feature-icon.cyan   { background: linear-gradient(135deg, var(--cyan), var(--cyan-light)); box-shadow: 0 6px 20px var(--cyan-glow); }
.feature-icon.green  { background: linear-gradient(135deg, var(--green), #16a34a); box-shadow: 0 6px 20px var(--green-glow); }
.feature-icon.orange { background: linear-gradient(135deg, var(--orange), #ea580c); box-shadow: 0 6px 20px var(--orange-glow); }

.feature-title { font-size: 0.95rem; font-weight: 900; color: var(--text-white); margin-bottom: 8px; }
.feature-text  { font-size: 0.82rem; color: var(--text-muted); line-height: 1.65; }

/* ─── Questions Grid ─────────────────────────────────── */

.questions-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}

.compact-card {}
.sessions-card {}
.question-form-card {}
.bank-card {}

/* ─── Toast Notifications ────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(18, 12, 36, 0.95);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), 0 0 24px rgba(108,60,225,0.18);
  backdrop-filter: blur(22px);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toast-in var(--t-slow) var(--ease-spring) forwards;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
}

.toast.removing { animation: toast-out var(--t-slow) var(--ease) forwards; }

.toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.toast.success { border-color: rgba(34,197,94,0.35); }
.toast.success .toast-icon { background: rgba(34,197,94,0.18); }

.toast.error { border-color: rgba(239,68,68,0.35); }
.toast.error .toast-icon { background: rgba(239,68,68,0.18); }

.toast.info { border-color: rgba(14,165,233,0.35); }
.toast.info .toast-icon { background: rgba(14,165,233,0.18); }

.toast.warning { border-color: rgba(250,204,21,0.35); }
.toast.warning .toast-icon { background: rgba(250,204,21,0.18); }

.toast-text { flex: 1; line-height: 1.5; }
.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  pointer-events: all;
  flex-shrink: 0;
  transition: color var(--t-fast);
}
.toast-close:hover { color: var(--text-main); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-24px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(-24px) scale(0.9); }
}

/* ─── Shimmer Loading ────────────────────────────────── */

.shimmer-line {
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ─── Scrollbar ──────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,60,225,0.35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108,60,225,0.55); }

/* ─── Responsive ─────────────────────────────────────── */

@media (max-width: 1360px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-preview-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1180px) {
  .page-shell { grid-template-columns: 1fr; }
  .main-content { padding: 24px 22px 44px; }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 20px 22px;
    gap: 16px;
    border-left: none;
    border-bottom: 1px solid var(--border-light);
  }

  .brand-block { margin-bottom: 0; }
  .sidebar-nav { flex-direction: row; margin-bottom: 0; }
  .sidebar-card { margin-top: 0; min-width: 180px; }

  .hero-panel { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .live-control-body { grid-template-columns: 1fr 1fr; }
  .questions-grid { grid-template-columns: 1fr; }
}

}

/* ═══════════════════════════════════════════════════════
   PROJECTOR ARENA & LOCAL GAMEPLAY STYLES
   ═══════════════════════════════════════════════════════ */

.projector-arena {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(108,60,225,0.22), transparent),
    linear-gradient(180deg, #070510 0%, #0c0920 60%, #050b18 100%);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  font-family: 'Tajawal', sans-serif;
  user-select: none;
}

/* Header */
.arena-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.arena-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.arena-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--cyan-light);
}
.arena-title h2 {
  font-size: 1.6rem;
  font-weight: 900;
}
.arena-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.exit-btn {
  padding: 10px 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}
.exit-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-2px);
}

/* Scoreboard */
.arena-scoreboard {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}
.score-card {
  width: min(280px, 100%);
  background: rgba(16, 10, 34, 0.75);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s var(--ease-spring);
}
.team-color-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.team-color-indicator.a { background: var(--cyan); }
.team-color-indicator.b { background: var(--orange); }

.score-card .team-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.score-card.team-a .team-name { color: var(--cyan-light); }
.score-card.team-b .team-name { color: #fdba74; }

.score-card .team-score {
  font-family: 'Fredoka', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
}
.score-card .team-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 700;
}
.vs-badge {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dim);
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 50%;
  border: 1px solid var(--border-light);
}

/* Score glows & shakes */
.glow-success {
  border-color: var(--green) !important;
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.35) !important;
  transform: scale(1.05);
}
.shake-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.35) !important;
  animation: shake 0.5s ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Game Visual Field */
.game-visual-container {
  flex: 1;
  background: rgba(10, 6, 26, 0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding: 24px;
  min-height: 200px;
  box-shadow: inset 0 4px 30px rgba(0,0,0,0.5);
  overflow: hidden;
}

/* Tug of War Styles */
.tug-rope-container {
  width: 90%;
  height: 120px;
  position: relative;
  display: flex;
  align-items: center;
}
.tug-rope-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, #3b82f6, #f97316);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(108,60,225,0.4);
}
.tug-ribbon {
  position: absolute;
  font-size: 2.2rem;
  top: 15px;
  transform: translateX(-50%);
  transition: left 0.4s var(--ease-spring);
  z-index: 10;
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.tug-mascot {
  position: absolute;
  font-size: 3.5rem;
  bottom: 0;
}
.tug-mascot.mascot-a { left: 5%; }
.tug-mascot.mascot-b { right: 5%; transform: scaleX(-1); }

/* Car Race Styles */
.race-tracks {
  width: 95%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.race-track {
  display: flex;
  align-items: center;
  gap: 16px;
}
.track-label { font-size: 1.8rem; }
.track-line {
  flex: 1;
  height: 50px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  position: relative;
  display: flex;
  align-items: center;
}
.race-car {
  position: absolute;
  font-size: 2.8rem;
  transition: left 0.4s var(--ease-spring);
}

/* Ladder Climb Styles */
.ladder-container {
  width: 80%;
  height: 100%;
  display: flex;
  justify-content: space-around;
}
.ladder-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
}
.ladder-steps {
  width: 60px;
  flex: 1;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(255,255,255,0.15) 20px, rgba(255,255,255,0.15) 24px);
  border-left: 5px solid rgba(255,255,255,0.2);
  border-right: 5px solid rgba(255,255,255,0.2);
  position: relative;
}
.ladder-climber {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  transition: bottom 0.4s var(--ease-spring);
}
.ladder-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Balance Scale Styles */
.balance-pedestal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  width: 320px;
  position: relative;
}
.balance-beam {
  width: 280px;
  height: 8px;
  background: #cbd5e1;
  position: relative;
  transition: transform 0.4s var(--ease-spring);
  transform-origin: center center;
  margin-bottom: 40px;
}
.balance-cup {
  position: absolute;
  top: 8px;
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.balance-cup.cup-a { left: -20px; }
.balance-cup.cup-b { right: -20px; }

.cup-icon { font-size: 1.6rem; }
.cup-weight {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan-light);
}
.cup-b .cup-weight { color: #fdba74; }

.balance-base {
  width: 40px;
  height: 70px;
  background: #475569;
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
}

/* Question Panel */
.arena-question-card {
  background: rgba(16, 10, 34, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.q-progress {
  font-size: 0.85rem;
  color: var(--cyan-light);
  font-weight: 800;
  margin-bottom: 8px;
}
.q-prompt {
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 20px;
  color: var(--text-white);
}
.q-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  text-align: right;
}
.option-btn .letter {
  background: rgba(108, 60, 225, 0.15);
  color: var(--purple-light);
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}
.option-btn .text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
}
/* Highlight correct choice for the teacher/projector visual aid */
.correct-choice {
  border-color: rgba(34, 197, 94, 0.3) !important;
  background: rgba(34, 197, 94, 0.04) !important;
}
.correct-choice .letter {
  background: rgba(34, 197, 94, 0.25) !important;
  color: #a7f3d0 !important;
}
.correct-choice .text {
  color: var(--text-white) !important;
}

/* Teacher Controls */
.arena-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
  align-items: center;
}
.control-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mid-ctrl {
  align-items: center;
}
.team-ctrl-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
}
.team-ctrl-btns {
  display: flex;
  gap: 10px;
}
.btn-ctrl {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ctrl.correct {
  background: linear-gradient(135deg, #10b981, #047857);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}
.btn-ctrl.correct:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}
.btn-ctrl.wrong {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}
.btn-ctrl.wrong:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.btn-ctrl-center {
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.btn-ctrl-center:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}
.shortcut-tip {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 700;
  margin-top: 8px;
}

/* Victory Screen */
.victory-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(7, 5, 16, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.victory-content {
  text-align: center;
  max-width: 480px;
  padding: 20px;
  animation: scaleUp 0.5s var(--ease-spring);
}
@keyframes scaleUp { from{transform:scale(0.8);opacity:0} to{transform:scale(1);opacity:1} }

.trophy-icon {
  font-size: 5rem;
  animation: bounceTrophy 1.5s infinite ease-in-out alternate;
  margin-bottom: 24px;
}
@keyframes bounceTrophy {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-15px) scale(1.08); text-shadow: 0 10px 25px rgba(250, 204, 21, 0.4); }
}

.victory-content h2 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--yellow), #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.victory-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
}
.victory-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.victory-btn {
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.victory-btn.primary {
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: white;
  box-shadow: 0 6px 20px var(--purple-glow);
}
.victory-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--purple-glow);
}
.victory-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: white;
}
.victory-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Confetti */
.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  animation: fall var(--dur) linear infinite;
  animation-delay: var(--delay);
}
@keyframes fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

/* Extra Setup adjustments */
.sidebar-help-text {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 6px;
}
.mascot-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.mascot-item {
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  padding: 4px 8px;
  border-radius: 8px;
}
.full-width {
  width: 100%;
}
.launcher-card {
  padding: 24px !important;
  margin-top: 24px;
}
@media (max-width: 900px) {
  .arena-controls {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .team-ctrl-btns {
    justify-content: center;
  }
}

