:root {
  --bg: #06121d;
  --bg2: #0a2030;
  --card: rgba(8, 24, 38, 0.86);
  --card2: rgba(11, 34, 51, 0.92);
  --gold: #d9a24a;
  --gold2: #f0c06c;
  --text: #f7f3e8;
  --muted: #b9c7d4;
  --line: rgba(217, 162, 74, 0.32);
  --danger: #ff7a7a;
  --success: #7ee09b;
  --info: #8dd7ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --app-gradient:
    radial-gradient(circle at top right, rgba(217, 162, 74, 0.18), transparent 35%),
    radial-gradient(circle at bottom left, rgba(35, 132, 160, 0.18), transparent 32%),
    linear-gradient(135deg, var(--bg), var(--bg2));
  --stage-bg: var(--app-gradient);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; min-height: 100%; overflow: hidden; }
[hidden] { display: none !important; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--app-gradient);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.38;
}

a { color: var(--gold2); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.58; }

.app-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  height: 100dvh;
  padding: 12px 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.teacher-mode .app-shell {
  width: 100vw;
  padding: 0 14px 12px 0;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold2);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 0 24px rgba(217,162,74,.15);
}
.brand-text { min-width: 0; }
.brand-text strong {
  display: block;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text span { color: var(--muted); font-size: .88rem; }

.connection-status {
  border: 1px solid rgba(255,255,255,.12);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: .86rem;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  white-space: nowrap;
}
.connection-status.ok { color: var(--success); border-color: rgba(126,224,155,.32); }
.connection-status.warning { color: var(--gold2); border-color: rgba(240,192,108,.34); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.hero-home {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  align-items: stretch;
  overflow: hidden;
}
.panel, .card {
  background: linear-gradient(180deg, rgba(13,37,55,.92), rgba(6,18,29,.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.transition-host {
  position: relative;
  overflow: hidden;
}
.transition-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.transition-ghost {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.fx-slide-next-in { animation: fxSlideNextIn .5s cubic-bezier(.2,.8,.2,1) both; }
.fx-slide-next-out { animation: fxSlideNextOut .5s cubic-bezier(.55,.02,.3,1) both; }
.fx-slide-prev-in { animation: fxSlidePrevIn .5s cubic-bezier(.2,.8,.2,1) both; }
.fx-slide-prev-out { animation: fxSlidePrevOut .5s cubic-bezier(.55,.02,.3,1) both; }
.fx-center-in { animation: fxCenterIn .62s cubic-bezier(.2,.78,.2,1) both; }
.fx-center-out { animation: fxCenterOut .62s cubic-bezier(.6,.02,.7,.28) both; }
.fx-deteriorate-in { animation: fxDeteriorateIn .72s ease-out both; }
.fx-deteriorate-out { animation: fxDeteriorateOut .72s ease-in both; }
.fx-sweep-in { animation: fxSweepIn .62s cubic-bezier(.2,.8,.2,1) both; }
.fx-sweep-out { animation: fxSweepOut .62s ease-in both; }
.fx-tilt-in { animation: fxTiltIn .68s cubic-bezier(.2,.78,.18,1) both; }
.fx-tilt-out { animation: fxTiltOut .68s ease-in both; }
.fx-screen-in,
.fx-question-in,
.fx-live-in,
.fx-result-in,
.fx-ranking-in,
.fx-podium-in { animation: fxScreenIn .45s ease-out both; }
.fx-screen-out,
.fx-question-out,
.fx-live-out,
.fx-result-out,
.fx-ranking-out,
.fx-podium-out { animation: fxScreenOut .35s ease-in both; }
.fx-countdown-in { animation: fxCountdownIn .42s ease-out both; }
.fx-countdown-out { animation: fxScreenOut .32s ease-in both; }
.fx-result-in .option-btn {
  animation: optionRise .42s ease-out both;
}
.fx-live-in .option-btn:nth-child(2),
.fx-result-in .option-btn:nth-child(2) { animation-delay: .06s; }
.fx-live-in .option-btn:nth-child(3),
.fx-result-in .option-btn:nth-child(3) { animation-delay: .12s; }
.fx-live-in .option-btn:nth-child(4),
.fx-result-in .option-btn:nth-child(4) { animation-delay: .18s; }
.fx-question-in .question-text { animation: questionFloatIn .48s ease-out both; }
.fx-live-in .question-text { animation: questionToTop .32s cubic-bezier(.2,.85,.2,1) both; }
.fx-live-in .option-btn:nth-child(odd) { animation: optionFromLeft .42s cubic-bezier(.2,.85,.2,1) both; }
.fx-live-in .option-btn:nth-child(even) { animation: optionFromRight .42s cubic-bezier(.2,.85,.2,1) both; }
.fx-live-in .option-btn:nth-child(2) { animation-delay: .06s; }
.fx-live-in .option-btn:nth-child(3) { animation-delay: .12s; }
.fx-live-in .option-btn:nth-child(4) { animation-delay: .18s; }

@keyframes fxSlideNextIn {
  from { opacity: .92; transform: translateX(100%); filter: brightness(.82); }
  to { opacity: 1; transform: translateX(0); filter: brightness(1); }
}
@keyframes fxSlideNextOut {
  to { opacity: .78; transform: translateX(-100%); filter: brightness(.74); }
}
@keyframes fxSlidePrevIn {
  from { opacity: .92; transform: translateX(-100%); filter: brightness(.82); }
  to { opacity: 1; transform: translateX(0); filter: brightness(1); }
}
@keyframes fxSlidePrevOut {
  to { opacity: .78; transform: translateX(100%); filter: brightness(.74); }
}
@keyframes fxCenterIn {
  from { opacity: 0; transform: scale(.18); filter: saturate(.7) blur(8px); }
  70% { opacity: 1; transform: scale(1.025); filter: saturate(1.05) blur(0); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes fxCenterOut {
  to { opacity: 0; transform: scale(.08); filter: blur(10px) saturate(.55); }
}
@keyframes fxDeteriorateIn {
  from { opacity: 0; transform: scale(1.04); clip-path: inset(0 0 100% 0); filter: contrast(1.25) grayscale(.4); }
  to { opacity: 1; transform: scale(1); clip-path: inset(0); filter: none; }
}
@keyframes fxDeteriorateOut {
  0% { opacity: 1; clip-path: inset(0); filter: none; }
  45% { opacity: .82; filter: contrast(1.4) grayscale(.6); }
  100% { opacity: 0; clip-path: polygon(0 0, 100% 8%, 92% 22%, 100% 38%, 88% 55%, 100% 72%, 80% 100%, 0 94%); transform: scale(.96); filter: blur(6px) grayscale(1); }
}
@keyframes fxSweepIn {
  from { opacity: 0; transform: translateX(16%) scale(.98); clip-path: inset(0 100% 0 0); }
  to { opacity: 1; transform: translateX(0) scale(1); clip-path: inset(0); }
}
@keyframes fxSweepOut {
  to { opacity: 0; transform: translateX(-18%) scale(.98); clip-path: inset(0 0 0 100%); }
}
@keyframes fxTiltIn {
  from { opacity: 0; transform: perspective(900px) rotateY(-22deg) translateY(18px) scale(.96); filter: brightness(.75); }
  to { opacity: 1; transform: perspective(900px) rotateY(0) translateY(0) scale(1); filter: brightness(1); }
}
@keyframes fxTiltOut {
  to { opacity: 0; transform: perspective(900px) rotateY(22deg) translateY(-12px) scale(.96); filter: brightness(.65); }
}
@keyframes fxScreenIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fxScreenOut {
  to { opacity: 0; transform: translateY(-10px) scale(.985); }
}
@keyframes fxCountdownIn {
  from { opacity: 0; transform: translateY(10px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes questionFloatIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes questionToTop {
  from { opacity: .78; transform: translateY(26px) scale(1.05); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes optionRise {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes optionFromLeft {
  from { opacity: 0; transform: translateX(-42px) scale(.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes optionFromRight {
  from { opacity: 0; transform: translateX(42px) scale(.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.home-panel { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; }
.eyebrow { color: var(--gold2); text-transform: uppercase; letter-spacing: 0; font-size: .82rem; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.25rem, 7vw, 5.4rem);
  line-height: .95;
  margin-bottom: 18px;
}
.gold { color: var(--gold2); }
.lead { color: var(--muted); font-size: clamp(1rem, 1.75vw, 1.18rem); line-height: 1.65; max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.btn {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 17px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.08); border-color: rgba(240,192,108,.55); }
.btn:disabled { transform: none; }
.btn.primary { background: linear-gradient(135deg, #d9a24a, #f0c06c); color: #111b24; border-color: transparent; font-weight: 800; }
.btn.danger { border-color: rgba(255,122,122,.35); color: #ffd6d6; }
.btn.success { border-color: rgba(126,224,155,.35); color: #c6ffd5; }
.btn.block { width: 100%; }
.btn.small { padding: 9px 12px; min-height: 38px; border-radius: 12px; font-size: .92rem; }
.btn.active { border-color: rgba(240,192,108,.8); background: rgba(217,162,74,.18); color: var(--gold2); }
.icon-btn {
  width: 42px;
  min-width: 42px;
  flex: 0 0 42px;
  padding: 9px;
}
.shortcut-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-block;
  color: currentColor;
}
.presentation-icon {
  border: 2px solid currentColor;
  border-radius: 4px;
}
.presentation-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  bottom: -6px;
  width: 8px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.presentation-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -8px;
  width: 14px;
  border-bottom: 2px solid currentColor;
}
.gear-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow:
    0 -7px 0 -4px currentColor,
    0 7px 0 -4px currentColor,
    7px 0 0 -4px currentColor,
    -7px 0 0 -4px currentColor,
    5px 5px 0 -4px currentColor,
    -5px 5px 0 -4px currentColor,
    5px -5px 0 -4px currentColor,
    -5px -5px 0 -4px currentColor;
}
.gear-icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.gamepad-icon {
  width: 26px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid currentColor;
  border-radius: 9px 9px 8px 8px;
}
.gamepad-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 3px -3px 0 -1px currentColor, 3px 3px 0 -1px currentColor;
}
.gamepad-icon::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -5px 4px 0 0 currentColor;
}
.chevron-icon::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.chevron-next::before { transform: rotate(45deg); }
.chevron-prev::before { transform: rotate(-135deg); }
.hourglass-icon {
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.hourglass-icon::before,
.hourglass-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 14px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.hourglass-icon::before {
  top: 2px;
  transform: skewX(28deg);
}
.hourglass-icon::after {
  bottom: 2px;
  transform: skewX(-28deg);
}
.unlock-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 1px;
  width: 10px;
  height: 12px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: translateX(-5px) rotate(-24deg);
}
.unlock-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 2px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(currentColor, currentColor) center 6px / 2px 5px no-repeat;
}
.diamond-icon::before,
.diamond-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  transform: rotate(45deg);
}
.diamond-icon::before {
  left: 6px;
  top: 1px;
}
.diamond-icon::after {
  left: 6px;
  top: 11px;
  box-shadow: -8px -5px 0 -2px currentColor, 8px -5px 0 -2px currentColor;
}
.list-icon {
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.list-icon::before,
.list-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid currentColor;
}
.list-icon::before { top: 7px; }
.list-icon::after { top: 14px; }
.reset-icon {
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}
.reset-icon::before {
  content: "";
  position: absolute;
  right: -1px;
  top: 1px;
  border-left: 6px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: rotate(34deg);
}
.fullscreen-icon::before,
.fullscreen-icon::after,
.fullscreen-exit-icon::before,
.fullscreen-exit-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: currentColor;
  border-style: solid;
}
.fullscreen-icon::before {
  left: 1px;
  top: 1px;
  border-width: 2px 0 0 2px;
  box-shadow: 11px 0 0 -1px transparent;
}
.fullscreen-icon::after {
  right: 1px;
  bottom: 1px;
  border-width: 0 2px 2px 0;
}
.fullscreen-exit-icon::before {
  right: 2px;
  top: 2px;
  border-width: 0 0 2px 2px;
}
.fullscreen-exit-icon::after {
  left: 2px;
  bottom: 2px;
  border-width: 2px 2px 0 0;
}
.fullscreen-icon {
  background:
    linear-gradient(currentColor, currentColor) right 1px top 1px / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right 1px top 1px / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) left 1px bottom 1px / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left 1px bottom 1px / 2px 8px no-repeat;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.eye-icon {
  position: relative;
  width: 20px;
  height: 14px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 50% / 65%;
}
.eye-icon::before {
  content: "";
  position: absolute;
  inset: 3px 6px;
  border-radius: 50%;
  background: currentColor;
}
.eye-icon::after {
  content: "";
  position: absolute;
  left: -3px;
  top: 5px;
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-38deg) scaleX(0);
  transform-origin: center;
}
.icon-btn.is-crossed .eye-icon::after {
  transform: rotate(-38deg) scaleX(1);
}

.home-side { padding: 22px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.step { padding: 18px; border: 1px solid rgba(255,255,255,.09); border-radius: 18px; background: rgba(255,255,255,.035); }
.step strong { color: var(--gold2); display: block; margin-bottom: 4px; }
.step p { color: var(--muted); margin: 0; line-height: 1.5; }

.grid-controller {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(300px, 20vw, 380px) minmax(0, 1fr) clamp(390px, 24vw, 480px);
  gap: 12px;
  align-items: start;
  overflow: hidden;
}
.teacher-workspace,
.config-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.teacher-workspace {
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 0;
}
.config-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.teacher-presentation-active .app-shell {
  width: 100vw;
  padding: 0;
}
.teacher-presentation-active .teacher-workspace,
.teacher-presentation-active .teacher-presentation-view,
.teacher-presentation-active #presentationStage {
  width: 100vw;
  height: 100dvh;
}
.teacher-presentation-active .teacher-workspace {
  gap: 0;
}
.teacher-presentation-view {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--stage-bg);
  touch-action: pan-y;
  user-select: none;
}
.presentation-slide,
.presentation-status {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--stage-bg);
}
.presentation-slide-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  background: var(--stage-bg);
  user-select: none;
  -webkit-user-drag: none;
}
.slide-visual {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--stage-bg);
  color: var(--text);
}
.slide-visual-bg,
.slide-visual-shade {
  position: absolute;
  inset: 0;
}
.slide-visual-bg {
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.slide-full-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--stage-bg);
  user-select: none;
  -webkit-user-drag: none;
}
.slide-visual-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(2,7,11,.9) 0%, rgba(2,7,11,.68) 43%, rgba(2,7,11,.18) 100%),
    linear-gradient(0deg, rgba(2,7,11,.82) 0%, transparent 34%, rgba(2,7,11,.26) 100%);
}
.tone-light .slide-visual-shade {
  background:
    linear-gradient(90deg, rgba(2,7,11,.86) 0%, rgba(2,7,11,.54) 48%, rgba(2,7,11,.18) 100%),
    linear-gradient(0deg, rgba(2,7,11,.74) 0%, transparent 38%, rgba(2,7,11,.18) 100%);
}
.slide-visual-content {
  position: relative;
  z-index: 2;
  width: min(760px, 68%);
  min-height: 100%;
  padding: 7.4rem 5.4rem 4.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}
.slide-kicker {
  color: var(--gold2);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 1rem;
  font-weight: 900;
}
.slide-title {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 4.3rem;
  line-height: .98;
  max-width: 12ch;
  text-shadow: 0 16px 42px rgba(0,0,0,.48);
}
.slide-subtitle {
  max-width: 48ch;
  margin: 0;
  color: #fff3d5;
  font-size: 1.45rem;
  line-height: 1.35;
}
.slide-bullets {
  display: grid;
  gap: .65rem;
  margin: .25rem 0 0;
  padding-left: 1.2rem;
  max-width: 54ch;
}
.slide-bullets li {
  color: #f7f3e8;
  font-size: 1.16rem;
  line-height: 1.38;
}
.slide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  max-width: 800px;
}
.slide-column {
  border: 1px solid rgba(240,192,108,.32);
  border-radius: 8px;
  padding: .9rem;
  background: rgba(4,14,23,.56);
}
.slide-column h3 {
  margin: 0 0 .45rem;
  color: var(--gold2);
  font-size: 1.05rem;
}
.slide-column ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: .35rem;
}
.slide-column li {
  color: #f7f3e8;
  font-size: .98rem;
  line-height: 1.28;
}
.slide-quote {
  max-width: 46ch;
  margin: .2rem 0 0;
  color: var(--gold2);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.55rem;
  line-height: 1.28;
}
.slide-footer {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .98rem;
}
.slide-visual-card .slide-visual-content {
  width: 72%;
  padding: 2rem 2.1rem 1.8rem;
  gap: .45rem;
}
.slide-visual-card .slide-kicker { font-size: .62rem; }
.slide-visual-card .slide-title { font-size: 1.55rem; }
.slide-visual-card .slide-subtitle { font-size: .72rem; }
.slide-visual-card .slide-bullets { gap: .22rem; padding-left: .8rem; }
.slide-visual-card .slide-bullets li { font-size: .58rem; line-height: 1.18; }
.slide-visual-card .slide-columns { gap: .32rem; }
.slide-visual-card .slide-column { padding: .42rem; border-radius: 6px; }
.slide-visual-card .slide-column h3 { font-size: .58rem; margin-bottom: .18rem; }
.slide-visual-card .slide-column ul { gap: .12rem; padding-left: .65rem; }
.slide-visual-card .slide-column li { font-size: .48rem; line-height: 1.12; }
.slide-visual-card .slide-quote { font-size: .72rem; }
.slide-visual-card .slide-footer { font-size: .52rem; }
.teacher-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  flex: 0 0 auto;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  max-width: calc(100vw - 28px);
  padding: 0;
}
.teacher-toolbar-status {
  min-width: 0;
  display: flex;
  align-items: center;
  margin-right: 2px;
}
.teacher-toolbar .btn,
.teacher-toolbar .icon-btn {
  width: 42px;
  min-width: 42px;
  flex: 0 0 42px;
}
.teacher-notes-overlay {
  position: absolute;
  z-index: 10;
  top: 74px;
  right: 24px;
  width: min(50vw, 900px);
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid rgba(240,192,108,.34);
  border-radius: 18px;
  background: rgba(4,14,23,.58);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.teacher-notes-drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.teacher-notes-overlay.is-dragging,
.teacher-notes-overlay.is-dragging .teacher-notes-drag-handle {
  cursor: grabbing;
}
.teacher-notes-overlay h2 {
  margin-bottom: 8px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
}
.teacher-notes-subtitle {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.teacher-notes-overlay ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.teacher-notes-overlay li {
  line-height: 1.45;
  color: #fff6df;
}
.teacher-note-detail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(240,192,108,.24);
  display: grid;
  gap: 10px;
}
.teacher-note-detail p {
  margin: 0;
  color: #f7f3e8;
  line-height: 1.52;
}
.teacher-notes-hidden .teacher-notes-overlay {
  display: none;
}
.presentation-status .screen-game,
.presentation-status .countdown-panel,
.presentation-status .podium-view,
.presentation-status .ranking-panel {
  width: min(1100px, calc(100vw - 40px));
  height: min(760px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
}
#mainPreview { min-height: 0; height: 100%; overflow: hidden; }
.fill-panel { height: 100%; min-height: 0; }
.slide-card { overflow: hidden; }
.grid-controller .slide-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.grid-controller .slide-card .slide-image-wrap {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
}
.slide-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--stage-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.slide-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--stage-bg);
}
.slide-meta {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(4,14,23,.72);
}
.slide-meta-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 6px;
}
.slide-meta h2 { margin: 0; font-size: clamp(1.2rem, 2.1vw, 1.8rem); }
.slide-meta p { color: var(--muted); margin-bottom: 0; line-height: 1.5; }
.speaker-note { margin-top: 12px !important; color: #ffe9c1 !important; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(240,192,108,.26);
  border-radius: 999px;
  color: var(--gold2);
  background: rgba(217,162,74,.08);
  font-size: .82rem;
  margin-bottom: 10px;
}
.slide-meta-head .pill {
  margin: 2px 0 0;
  white-space: nowrap;
}

.controls-panel {
  padding: 74px 14px 14px;
  position: sticky;
  top: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.controls-panel h2 { font-size: 1.25rem; margin-bottom: 12px; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.teacher-report-time {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 7px;
  align-items: center;
}
.teacher-report-time .compact-field {
  margin: 0;
}
.teacher-final-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}
.compact-btn {
  min-height: 34px;
  padding: 7px 7px;
  border-radius: 11px;
  font-size: .74rem;
  line-height: 1.1;
  white-space: nowrap;
}
.control-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
  max-height: min(26dvh, 240px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}
.slide-nav-panel {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 10px 8px 10px 0;
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.slide-nav-panel .control-list {
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0 2px 0 8px;
}
.slide-jump {
  width: 100%; text-align: left; justify-content: flex-start; padding: 11px 12px;
  white-space: normal;
}
.slide-nav-panel .slide-jump {
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 9px;
  border-radius: 11px;
  font-size: .86rem;
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slide-nav-panel .slide-jump strong { flex: 0 0 auto; }
.slide-nav-panel .slide-jump span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slide-jump.active { border-color: rgba(240,192,108,.85); background: rgba(217,162,74,.14); }
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
.stat { padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.035); }
.stat strong { display: block; font-size: 1.5rem; color: var(--gold2); }
.stat span { color: var(--muted); font-size: .82rem; }

.report-toggle {
  width: 100%;
  justify-content: center;
  color: #111b24;
}
.reports-modal {
  position: fixed;
  inset: 0;
  z-index: 88;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.72);
}
.reports-modal-panel {
  width: min(1120px, calc(100vw - 36px));
  height: min(86dvh, 820px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  overflow: hidden;
}
.reports-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.reports-modal-head h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}
.reports-modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.report-list {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.report-toolbar span {
  color: var(--muted);
  font-size: .84rem;
}
.report-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: .86rem;
}
.report-table th,
.report-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  vertical-align: middle;
}
.report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(8,24,38,.98);
}
.report-table th button {
  border: 0;
  background: transparent;
  color: var(--gold2);
  font: inherit;
  font-weight: 800;
  padding: 0;
}
.report-table td strong {
  color: var(--text);
  font-weight: 700;
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-actions.compact {
  gap: 6px;
  flex-wrap: nowrap;
}
.report-thumb-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, 190px);
  align-content: start;
  justify-content: start;
  align-items: start;
  gap: 12px;
  padding-right: 2px;
}
.report-thumb-card {
  width: 190px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}
.report-thumb-card > button {
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: var(--stage-bg);
}
.report-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.report-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.72);
}
.report-modal-panel {
  width: min(980px, calc(100vw - 36px));
  height: min(92dvh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.report-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.report-modal img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: var(--stage-bg);
}

.pin-gate {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pin-card { width: min(460px, 100%); padding: 26px; }
.field { display: grid; gap: 7px; margin: 12px 0; }
.field label { color: var(--gold2); font-weight: 700; }
.field input {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.2);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}
.field input:focus { border-color: rgba(240,192,108,.72); box-shadow: 0 0 0 3px rgba(240,192,108,.12); }
.compact-field {
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
}
.compact-field input {
  width: 76px;
  min-height: 34px;
  padding: 0 8px;
  text-align: center;
}
.hint { color: var(--muted); font-size: .9rem; line-height: 1.5; }

.student-main, .screen-main {
  width: min(980px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 10px 0;
  height: 100dvh;
  overflow: hidden;
}
.student-main { display: flex; flex-direction: column; }
#studentApp, #studentView {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
#studentView { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.student-slide {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.student-slide .slide-card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.student-slide .slide-meta { display: none; }
.student-slide .slide-image-wrap {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 18px;
}
.student-banner {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(4,14,23,.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}
.student-banner strong { color: var(--gold2); }

.game-card { padding: clamp(18px, 4vw, 28px); }
.game-card h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.65rem, 6vw, 3rem); margin-bottom: 10px; }
.game-card .prompt { font-size: clamp(1.05rem, 4.5vw, 1.35rem); line-height: 1.55; color: var(--text); }
.student-question {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  gap: 8px;
}
.student-question h2 { font-size: clamp(1.35rem, 5vw, 2.35rem); margin-bottom: 0; }
.question-text {
  position: relative;
  z-index: 1;
  max-width: 26ch;
  justify-self: center;
  align-self: center;
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.8rem, 6vw, 4rem);
  line-height: 1.04;
  margin: 0;
}
.question-live .question-text,
.screen-question .question-text,
.teacher-question .question-text {
  max-width: 34ch;
  justify-self: start;
  align-self: start;
  text-align: left;
  font-size: clamp(1.35rem, 4vw, 2.9rem);
}
.student-question .prompt {
  font-size: clamp(.98rem, 3.7vw, 1.2rem);
  line-height: 1.35;
  margin-bottom: 0;
}
.student-question .option-grid {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(4, minmax(48px, 1fr));
  gap: 9px;
  margin-top: 0;
  overflow: hidden;
}
.teacher-question {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
}
.question-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.question-header.timer-only {
  justify-content: flex-end;
  margin-bottom: 0;
}
.timer-card {
  min-width: 118px;
  border: 1px solid rgba(240,192,108,.3);
  border-radius: 16px;
  padding: 8px 10px;
  background: rgba(0,0,0,.18);
}
.timer-card span {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.timer-card strong {
  display: block;
  color: var(--gold2);
  font-size: 1.35rem;
  line-height: 1.1;
}
.timer-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
  margin-top: 6px;
}
.timer-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--gold2));
}
.timer-card.is-low {
  border-color: rgba(255,122,122,.55);
}
.timer-card.is-low .timer-fill {
  background: linear-gradient(90deg, #ff9a7a, var(--danger));
}
.option-grid { display: grid; gap: 12px; margin-top: 18px; }
.option-btn {
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  min-height: 62px;
  padding: 15px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.35;
}
.student-question .option-btn {
  min-height: 0;
  padding: 10px 12px;
  font-size: clamp(.9rem, 3.3vw, 1rem);
}
.option-btn .letter {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(217,162,74,.15);
  color: var(--gold2);
  border: 1px solid rgba(217,162,74,.25);
  font-weight: 900;
}
.option-btn:hover { border-color: rgba(240,192,108,.65); background: rgba(217,162,74,.1); }
.option-btn.selected { border-color: rgba(240,192,108,.75); background: rgba(217,162,74,.12); }
.option-btn.correct { border-color: rgba(126,224,155,.7); background: rgba(126,224,155,.1); }
.option-btn.incorrect { border-color: rgba(255,122,122,.65); background: rgba(255,122,122,.08); }
.feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  line-height: 1.55;
}
.feedback.success { border-color: rgba(126,224,155,.45); color: #d2ffdc; }
.feedback.danger { border-color: rgba(255,122,122,.45); color: #ffd4d4; }
.answer-locked { animation: answerLocked .42s ease-out both; }
.result-feedback { position: relative; overflow: hidden; }
body.student-mode.wrong-flash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: rgba(255, 24, 24, .34);
  animation: wrongFlash .68s ease-out both;
}
.waiting { text-align: center; padding: min(12vh, 90px) 18px; }
.waiting.fill-panel {
  display: grid;
  place-content: center;
  padding: 18px;
  overflow: hidden;
}
.waiting h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2rem, 7vw, 4rem); }
.waiting p { color: var(--muted); font-size: 1.05rem; line-height: 1.55; }
.countdown-panel {
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 18px;
  overflow: hidden;
}
.countdown-panel h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.8rem, 10vw, 7rem);
  line-height: .95;
  margin: 0;
  color: var(--gold2);
  text-shadow: 0 18px 48px rgba(0,0,0,.42), 0 0 28px rgba(240,192,108,.28);
  animation: countdownPulse .7s ease-in-out infinite alternate;
}
.countdown-number {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(6rem, 26vw, 14rem);
  line-height: .85;
  color: var(--gold2);
  text-shadow: 0 18px 48px rgba(0,0,0,.42), 0 0 28px rgba(240,192,108,.28);
  animation: countdownPulse .7s ease-in-out infinite alternate;
}
.countdown-panel p { color: var(--muted); font-size: 1.1rem; }
.question-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-content: center;
  justify-items: center;
  gap: 0;
  isolation: isolate;
}
.teacher-question.question-intro .question-text {
  justify-self: center;
  align-self: center;
  text-align: center;
  max-width: 26ch;
}
.question-stage {
  overflow: hidden;
}
.question-stage::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: 0;
  background:
    radial-gradient(circle at 28% 30%, rgba(240,192,108,.24), transparent 28%),
    radial-gradient(circle at 72% 68%, rgba(141,215,255,.18), transparent 30%),
    rgba(255,255,255,.035);
  filter: blur(18px);
  opacity: .9;
}
.question-locked-note {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(141,215,255,.28);
  background: rgba(141,215,255,.08);
  color: #d8f3ff;
  line-height: 1.45;
}
.question-result {
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-content: center;
  padding: clamp(18px, 5vw, 42px);
}
.question-result .question-text {
  align-self: end;
  margin-bottom: clamp(12px, 3vw, 28px);
}
.correct-answer-card {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(820px, 100%);
  border: 1px solid rgba(126,224,155,.42);
  border-radius: 20px;
  background: rgba(7, 25, 35, .72);
  padding: clamp(14px, 3vw, 24px);
  text-align: center;
  box-shadow: 0 16px 44px rgba(0,0,0,.32);
}
.correct-answer-card span {
  display: block;
  color: var(--success);
  text-transform: uppercase;
  font-size: .82rem;
  font-weight: 900;
}
.correct-answer-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.25rem, 4vw, 2.4rem);
  line-height: 1.1;
}
.clean-mark {
  width: 84px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
}
.clean-mark span {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #8dd7ff, #7ee09b);
  border: 1px solid rgba(255,255,255,.62);
  transform: rotate(45deg) scale(.4);
  box-shadow: 0 0 18px rgba(126,224,155,.42);
  animation: cleanDiamond .62s cubic-bezier(.2,.85,.2,1) forwards;
}
.clean-mark span:nth-child(2) { animation-delay: .08s; }
.clean-mark span:nth-child(3) { animation-delay: .16s; }

@keyframes answerLocked {
  from { transform: scale(.97); opacity: .5; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes countdownPulse {
  from { transform: scale(.95); }
  to { transform: scale(1.05); }
}
@keyframes cleanDiamond {
  0% { opacity: 0; transform: rotate(45deg) translateY(14px) scale(.2); }
  70% { opacity: 1; transform: rotate(45deg) translateY(-2px) scale(1.12); }
  100% { opacity: 1; transform: rotate(45deg) translateY(0) scale(1); }
}
@keyframes wrongFlash {
  0%, 100% { opacity: 0; }
  18%, 46% { opacity: 1; }
  32%, 64% { opacity: .18; }
}

.teacher-game { display: grid; gap: 12px; }
.teacher-voting-stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.teacher-voting-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.teacher-voting-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.4rem, 3vw, 2.5rem);
}
.teacher-vote-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 12px;
}
.teacher-vote-grid.wide {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
}
.vote-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
  padding: 12px;
  overflow: hidden;
}
.vote-panel h3 {
  margin: 0;
  color: var(--gold2);
  font-size: 1rem;
}
.vote-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 8px;
  padding-right: 3px;
}
.vote-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
  padding: 8px 10px;
}
.vote-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vote-row span {
  color: var(--muted);
  font-size: .82rem;
}
.vote-row b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}
.vote-row.answered b {
  color: #111b24;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
}
.answer-bars { display: grid; gap: 9px; }
.answer-bar { border: 1px solid rgba(255,255,255,.11); border-radius: 14px; padding: 10px; background: rgba(255,255,255,.035); }
.answer-bar-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: .88rem; }
.bar-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 999px; }
.ranking { display: grid; gap: 7px; margin-top: 8px; }
.rank-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); color: var(--muted); }
.rank-row strong { color: var(--text); }
.rank-row.big {
  min-height: 52px;
  align-items: center;
  padding: 12px 14px;
  font-size: 1rem;
}
.rank-row.mine {
  border: 1px solid rgba(240,192,108,.68);
  background: rgba(217,162,74,.13);
}
.podium-view {
  position: relative;
  padding: clamp(14px, 3vw, 24px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}
.podium-view h2,
.ranking-panel h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.7rem, 5vw, 3.4rem);
  margin-bottom: 10px;
}
.podium-image-wrap {
  position: relative;
  z-index: 2;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: var(--stage-bg);
  border: 1px solid rgba(255,255,255,.08);
}
.podium-view > .eyebrow,
.podium-view > h2 {
  position: relative;
  z-index: 3;
}
.confetti-rain {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}
.confetti-rain i {
  position: absolute;
  top: -14px;
  width: var(--size);
  height: calc(var(--size) * 1.55);
  background: var(--color);
  opacity: .92;
  border-radius: 2px;
  transform: translateY(-20px) rotate(0deg);
  animation: confettiFall var(--duration) linear infinite;
  animation-delay: var(--delay);
}
.confetti-rain i:nth-child(3n) { border-radius: 999px; }
.confetti-rain i:nth-child(4n) { height: var(--size); transform: rotate(45deg); }
.confetti-burst {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  overflow: hidden;
}
.confetti-burst i {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: var(--size);
  height: calc(var(--size) * 1.55);
  background: var(--color);
  border-radius: 2px;
  opacity: 0;
  animation: confettiBurst .9s ease-out both;
  animation-delay: var(--delay);
}

@keyframes confettiFall {
  0% { transform: translate3d(0, -24px, 0) rotate(0deg); }
  100% { transform: translate3d(calc(var(--spin) * 42px), calc(100dvh + 42px), 0) rotate(calc(var(--spin) * 460deg)); }
}
@keyframes confettiBurst {
  0% { opacity: 0; transform: translate3d(-50%, 24px, 0) rotate(0deg) scale(.6); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(calc(-50% + var(--x)), -170px, 0) rotate(calc(var(--spin) * 420deg)) scale(1); }
}
.podium-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.podium-name {
  position: absolute;
  transform: translateX(-50%);
  min-width: 130px;
  max-width: 24%;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(240,192,108,.45);
  background: rgba(3, 11, 18, .82);
  text-align: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}
.podium-name strong {
  display: block;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-name span {
  display: block;
  color: var(--gold2);
  font-weight: 800;
  margin-top: 2px;
}
.podium-name.place-1 { left: 50%; top: 42%; }
.podium-name.place-2 { left: 31%; top: 52%; }
.podium-name.place-3 { left: 69%; top: 55%; }
.ranking-panel {
  padding: clamp(16px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ranking-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}
.mini-ranking {
  max-height: 190px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(5, 15, 24, .96);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: opacity .2s ease, transform .2s ease;
  color: var(--text);
  max-width: calc(100vw - 24px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(126,224,155,.42); }
.toast.danger { border-color: rgba(255,122,122,.42); }

.screen-mode { background: #02070b; }
.screen-mode .app-shell { width: 100vw; padding: 0; }
.screen-mode .topbar { display: none; }
.screen-fullscreen-button {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  background: rgba(5, 15, 24, .72);
  backdrop-filter: blur(10px);
}
.screen-slide { height: 100dvh; display: grid; place-items: center; overflow: hidden; }
.screen-slide .slide-visual { width: 100vw; height: 100dvh; }
.screen-slide .slide-image-wrap { width: 100vw; height: 100dvh; aspect-ratio: auto; border: 0; border-radius: 0; }
.screen-slide .slide-image { object-fit: contain; }
.screen-game {
  width: min(1100px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  margin: 0 auto;
  overflow: hidden;
}
.screen-question {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}
.screen-question .question-text,
.teacher-question .question-text {
  margin-bottom: 0;
}
.screen-question .option-grid {
  min-height: 0;
  overflow: hidden;
  margin-top: 0;
}
.teacher-question .option-grid {
  min-height: 0;
  overflow: hidden;
  margin-top: 0;
}
.screen-mode .podium-view,
.screen-mode .ranking-panel {
  height: calc(100dvh - 40px);
}

@media (max-width: 1440px) {
  .teacher-notes-overlay {
    width: min(75vw, calc(100vw - 48px));
  }
}

@media (max-width: 860px) {
  .hero-home, .grid-controller { grid-template-columns: 1fr; }
  .slide-nav-panel {
    height: auto;
    max-height: 170px;
    padding: 10px;
    border-left: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .slide-nav-panel .control-list {
    max-height: 150px;
    padding: 0;
  }
  .controls-panel { position: static; }
  .topbar { align-items: flex-start; }
  .topbar-actions { align-items: flex-end; }
  .brand-text strong { white-space: normal; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .teacher-vote-grid,
  .teacher-vote-grid.wide {
    grid-template-columns: 1fr;
  }
  .teacher-notes-overlay {
    right: 12px;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }
  .teacher-notes-drag-handle {
    cursor: default;
    touch-action: auto;
  }
}

@media (max-width: 560px) {
  .app-shell { width: min(100vw - 16px, 1180px); padding-top: 10px; }
  .topbar { gap: 8px; padding-bottom: 10px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-text span { display: none; }
  .connection-status { font-size: .78rem; padding: 6px 9px; }
  .topbar-actions {
    gap: 6px;
  }
  .topbar-actions .btn,
  .topbar-actions .icon-btn,
  .teacher-toolbar .btn,
  .teacher-toolbar .icon-btn,
  .screen-fullscreen-button {
    width: 38px;
    min-width: 38px;
    flex-basis: 38px;
    min-height: 38px;
    padding: 8px;
  }
  .home-panel, .home-side, .controls-panel, .pin-card { padding: 16px; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
  .teacher-toolbar {
    top: 8px;
    right: 8px;
    gap: 6px;
    padding: 0;
    flex-wrap: nowrap;
  }
  .teacher-mode .app-shell {
    padding: 0 8px 8px 0;
  }
  .teacher-presentation-active .teacher-toolbar {
    top: 8px;
    right: 8px;
    gap: 6px;
    padding: 0;
    flex-wrap: nowrap;
  }
  .teacher-toolbar .btn,
  .teacher-toolbar .icon-btn {
    width: 38px;
    min-width: 38px;
    flex-basis: 38px;
    min-height: 38px;
    padding: 8px;
  }
  .teacher-final-actions {
    grid-template-columns: 1fr 1fr;
  }
  .compact-btn {
    min-height: 36px;
    white-space: normal;
  }
  .teacher-toolbar .shortcut-icon {
    width: 20px;
    height: 20px;
  }
  .teacher-toolbar .eye-icon {
    width: 19px;
    height: 13px;
  }
  .teacher-notes-overlay {
    top: 58px;
    right: 0;
    left: 0 !important;
    width: 100vw;
    max-width: 100vw;
    max-height: calc(100dvh - 58px);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .control-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .student-main { width: min(100vw - 12px, 980px); }
  .student-banner { display: block; }
  .student-banner span { display: block; margin-top: 4px; }
  .slide-image-wrap { border-radius: 14px; }
  .slide-visual-content {
    width: 84%;
    padding: 5rem 1.3rem 2.5rem;
    gap: .7rem;
  }
  .slide-title {
    font-size: clamp(2rem, 13vw, 3.3rem);
    max-width: 11ch;
  }
  .slide-subtitle {
    font-size: clamp(.95rem, 4.6vw, 1.15rem);
    max-width: 34ch;
  }
  .slide-bullets li {
    font-size: clamp(.88rem, 3.9vw, 1rem);
    line-height: 1.28;
  }
  .slide-columns {
    grid-template-columns: 1fr;
    gap: .5rem;
  }
  .slide-column {
    padding: .6rem .7rem;
  }
  .slide-column li {
    font-size: .82rem;
  }
  .slide-quote {
    font-size: 1.05rem;
  }
  .slide-visual-card .slide-visual-content {
    width: 76%;
    padding: 1.3rem 1rem 1rem;
  }
  .option-btn { min-height: 58px; }
  .question-header { gap: 8px; }
  .timer-card { min-width: 96px; padding: 7px 8px; }
  .timer-card strong { font-size: 1.1rem; }
  .podium-name { min-width: 88px; max-width: 29%; padding: 7px; font-size: .82rem; }
  .rank-row.big { min-height: 48px; font-size: .92rem; }
}

@media (max-height: 700px) {
  .student-main .topbar { padding: 4px 0 8px; }
  .student-question { padding: 12px; gap: 6px; }
  .student-question h2 { font-size: clamp(1.15rem, 4.5vw, 1.7rem); }
  .student-question .question-text { font-size: clamp(1.15rem, 4.5vw, 1.7rem); }
  .student-question .prompt { font-size: .94rem; line-height: 1.25; }
  .student-question .option-grid { gap: 7px; }
  .student-question .option-btn { padding: 8px 10px; }
  .option-btn .letter { flex-basis: 30px; height: 30px; }
  .feedback { margin-top: 8px; padding: 10px; line-height: 1.35; font-size: .9rem; }
  .student-banner { padding: 9px 11px; }
  .waiting h2 { font-size: clamp(1.7rem, 6vw, 2.6rem); }
  .teacher-notes-overlay {
    top: 62px;
    max-height: calc(100dvh - 84px);
  }
  .slide-visual-content {
    padding-top: 4.4rem;
    padding-bottom: 2.2rem;
  }
  .slide-title {
    font-size: clamp(2.3rem, 7vw, 3.7rem);
  }
  .slide-subtitle {
    font-size: 1.05rem;
  }
  .slide-bullets {
    gap: .38rem;
  }
  .slide-bullets li {
    font-size: .9rem;
    line-height: 1.22;
  }
  .slide-column {
    padding: .55rem .65rem;
  }
  .slide-column h3 {
    font-size: .86rem;
  }
  .slide-column li {
    font-size: .76rem;
    line-height: 1.16;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (min-width: 620px) {
  .student-main {
    width: min(100vw - 12px, 980px);
    padding: 4px 0;
  }
  .student-main .topbar {
    padding: 0 0 4px;
    align-items: center;
  }
  .student-main .brand {
    gap: 8px;
  }
  .student-main .brand-mark {
    width: 30px;
    height: 30px;
    font-size: .76rem;
  }
  .student-main .brand-text strong {
    font-size: .92rem;
    line-height: 1.1;
  }
  .student-main .brand-text span {
    display: none;
  }
  .student-main .connection-status {
    font-size: .7rem;
    padding: 4px 7px;
  }
  #studentView,
  .transition-frame {
    gap: 6px;
  }
  .countdown-panel {
    width: 100%;
    flex: 1 1 auto;
    padding: 8px 12px;
  }
  .student-slide .slide-visual-content {
    width: 82%;
    padding: 2.2rem 1.1rem 1.2rem;
    gap: .35rem;
  }
  .student-slide .slide-title {
    font-size: clamp(1.2rem, 5vw, 2rem);
  }
  .student-slide .slide-subtitle,
  .student-slide .slide-bullets li,
  .student-slide .slide-column li {
    font-size: .58rem;
    line-height: 1.12;
  }
  .student-slide .slide-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .28rem;
  }
  .countdown-panel h2 {
    font-size: clamp(2.3rem, 18vmin, 5rem);
  }
  .countdown-number {
    font-size: clamp(4.2rem, 28vmin, 7rem);
  }
  .countdown-panel p {
    margin-bottom: 0;
    font-size: .9rem;
  }
  .student-question {
    padding: 9px;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 5px;
  }
  .student-question .question-header {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }
  .student-question .pill {
    display: none;
  }
  .student-question h2 {
    grid-column: 1;
    grid-row: 2;
    font-size: clamp(.95rem, 2.25vw, 1.25rem);
    line-height: 1.08;
  }
  .student-question .prompt {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    overflow: hidden;
    font-size: .78rem;
    line-height: 1.18;
  }
  .student-question .option-grid {
    grid-column: 2;
    grid-row: 1 / span 4;
    height: 100%;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .student-question .option-btn {
    min-height: 0;
    padding: 6px 8px;
    font-size: .78rem;
    line-height: 1.12;
  }
  .student-question .option-btn .letter {
    flex-basis: 26px;
    height: 26px;
    font-size: .8rem;
  }
  .student-question .feedback {
    grid-column: 1;
    grid-row: 4;
    margin-top: 0;
    padding: 7px 8px;
    font-size: .72rem;
    line-height: 1.18;
    overflow: hidden;
  }
  .student-question .timer-card {
    min-width: 82px;
    padding: 5px 6px;
    border-radius: 12px;
  }
  .student-question .timer-card span {
    font-size: .64rem;
  }
  .student-question .timer-card strong {
    font-size: 1rem;
  }
  .student-question.question-intro {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-content: stretch;
  }
  .student-question.question-intro .pill,
  .student-question.question-intro h2,
  .student-question.question-intro .prompt,
  .student-question.question-intro .question-locked-note {
    grid-column: 1;
  }
  .student-question.question-intro .pill {
    display: inline-flex;
    grid-row: 1;
  }
  .student-question.question-intro h2 {
    grid-row: 2;
  }
  .student-question.question-intro .question-text {
    grid-row: 1 / -1;
    align-self: center;
    justify-self: center;
    max-width: 28ch;
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 2rem);
  }
  .student-question.question-intro .prompt {
    grid-row: 3;
    font-size: .9rem;
  }
  .student-question.question-intro .question-locked-note {
    grid-row: 4;
    margin-top: 0;
    padding: 8px 10px;
    font-size: .78rem;
  }
  .student-banner {
    padding: 6px 9px;
    border-radius: 12px;
    font-size: .8rem;
  }
}

.student-mode {
  background: var(--app-gradient);
}
.student-mode .app-shell.student-main {
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100dvh;
}
.student-mode .student-floating-controls {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  z-index: 80;
  padding: 0;
  justify-content: flex-end;
  pointer-events: none;
}
.student-mode .student-floating-controls .topbar-actions {
  pointer-events: auto;
}
.student-mode .student-floating-controls .connection-status {
  display: none;
}
.student-mode .student-floating-controls .icon-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  background: rgba(5, 15, 24, .42);
  border-color: rgba(240, 192, 108, .28);
  backdrop-filter: blur(10px);
}
.student-mode #studentApp,
.student-mode #studentView,
.student-mode #studentView > .transition-frame {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
}
.student-mode #studentView,
.student-mode #studentView > .transition-frame {
  display: block;
  gap: 0;
}
.student-mode .student-slide,
.student-mode .student-slide .slide-card,
.student-mode .student-slide .slide-image-wrap {
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.student-mode .student-slide .slide-card {
  display: block;
}
.student-mode .student-slide .slide-full-image {
  width: 100vw;
  height: 100dvh;
}
.student-mode .student-slide .slide-meta,
.student-mode .student-banner {
  display: none !important;
}
.student-mode .student-waiting,
.student-mode .student-question,
.student-mode .countdown-panel,
.student-mode .podium-view,
.student-mode .ranking-panel {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
}
.student-mode .student-waiting,
.student-mode .countdown-panel,
.student-mode .podium-view,
.student-mode .ranking-panel {
  padding-left: max(clamp(14px, 4vw, 36px), env(safe-area-inset-left));
  padding-right: max(clamp(14px, 4vw, 36px), env(safe-area-inset-right));
}
.student-mode .student-question {
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
