:root {
  --ink: #03070f;
  --ink-soft: #07101f;
  --panel: rgba(8, 17, 33, 0.84);
  --panel-strong: rgba(7, 14, 28, 0.96);
  --text: #f4f8ff;
  --muted: #91a4c1;
  --line: rgba(152, 198, 255, 0.16);
  --line-bright: rgba(151, 216, 255, 0.34);
  --cyan: #54e7ff;
  --mint: #2cf0b0;
  --gold: #ffc45a;
  --danger: #ff657c;
  --safe: #42e48a;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html,
body,
body * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html { background: var(--ink); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(ellipse 70% 54% at 50% -12%, rgba(34, 91, 162, 0.34), transparent 75%),
    radial-gradient(circle at 4% 85%, rgba(15, 173, 169, 0.12), transparent 30%),
    radial-gradient(circle at 98% 64%, rgba(59, 79, 237, 0.14), transparent 31%),
    linear-gradient(135deg, #02050d 0%, #071224 48%, #02060e 100%);
}

button { font: inherit; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.ambient-noise,
.background-grid,
.background-glow { position: fixed; pointer-events: none; }

.ambient-noise {
  z-index: -1;
  inset: 0;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

.background-grid {
  z-index: -1;
  inset: 0;
  opacity: 0.72;
  background-image:
    linear-gradient(rgba(100, 178, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 178, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.background-grid::after {
  position: absolute;
  content: "";
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 55px, rgba(96, 221, 255, 0.07) 56px);
  mask-image: radial-gradient(ellipse at 50% 8%, black, transparent 60%);
}

.background-glow {
  z-index: -1;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(105px);
  opacity: 0.26;
}

.background-glow-left { top: -17rem; left: -16rem; background: var(--mint); }
.background-glow-right { right: -17rem; bottom: -21rem; background: #4d5fff; }

.app-shell {
  position: relative;
  width: min(1240px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.2rem 0 3rem;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(137deg, rgba(255,255,255,0.075), transparent 19%),
    linear-gradient(150deg, rgba(13, 29, 55, 0.93), rgba(5, 12, 25, 0.9));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,0.045);
  backdrop-filter: blur(18px);
}

.card::before,
.card::after {
  position: absolute;
  width: 22px;
  height: 22px;
  content: "";
  opacity: 0.7;
  pointer-events: none;
}

.card::before { top: -1px; left: -1px; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); border-radius: 20px 0 0; }
.card::after { right: -1px; bottom: -1px; border-right: 1px solid var(--cyan); border-bottom: 1px solid var(--cyan); border-radius: 0 0 20px; }

.hero-panel {
  max-width: 860px;
  min-height: 530px;
  margin: min(10vh, 5.5rem) auto 0;
  padding: 1.25rem clamp(1.5rem, 5vw, 4.1rem) 2.75rem;
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}

.hero-panel::after {
  z-index: -1;
  width: 460px;
  height: 240px;
  right: -150px;
  bottom: -130px;
  border: 1px solid rgba(84, 231, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(84, 231, 255, 0.025), 0 0 0 70px rgba(84, 231, 255, 0.02);
}

.hero-panel-topline,
.question-topline,
.card-header,
.hero-meta,
.footer-actions { display: flex; align-items: center; }

.hero-panel-topline {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.system-status { display: inline-flex; gap: 0.55rem; align-items: center; }
.system-status i, .question-kicker i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 12px var(--mint);
  animation: statusPulse 1.8s ease-in-out infinite;
}
.build-label { color: rgba(145,164,193,0.65); }

.splash-logo {
  display: block;
  width: min(100%, 700px);
  height: auto;
  margin: 2.15rem auto 0.3rem;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3));
}

.eyebrow,
.label,
.section-kicker,
#run-status { text-transform: uppercase; letter-spacing: 0.13em; }

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--mint);
  font-size: 0.72rem;
  font-weight: 700;
}

h1, h2, .value, .ask-chart-label, .ask-chart-value { font-family: "Orbitron", sans-serif; }
h1 { margin: 0; }

.hero-copy {
  max-width: 58ch;
  margin: 0.5rem auto 0;
  color: #b9c7d9;
  font-size: 1.07rem;
  line-height: 1.7;
}

.hero-meta {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.75rem 0;
}

.meta-chip {
  padding: 0.48rem 0.75rem;
  border: 1px solid rgba(140, 194, 255, 0.18);
  border-radius: 999px;
  background: rgba(62, 109, 172, 0.1);
  color: #b8c9df;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.hero-action { display: grid; justify-items: center; gap: 0.8rem; }
.hero-action p { margin: 0; color: rgba(145,164,193,0.72); font-size: 0.75rem; }

.hero-copyright {
  margin: 1rem 0 0;
  color: rgba(145, 164, 193, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.hero-copyright a {
  color: var(--cyan);
  text-decoration: none;
}

.hero-copyright a:hover {
  text-decoration: underline;
}

.primary-button,
.secondary-button,
.lifeline-button,
.answer-button {
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.lifeline-button:hover:not(:disabled) { transform: translateY(-2px); }

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 3.5rem;
  padding: 0.8rem 1.15rem 0.8rem 1.4rem;
  border-color: rgba(119, 253, 221, 0.65);
  border-radius: 12px;
  background: linear-gradient(110deg, #38e5bd, #52cfff 105%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.22) inset, 0 12px 30px rgba(22, 224, 182, 0.18);
  color: #02131a;
  font-weight: 800;
}

.primary-button b { font-size: 1.4rem; font-weight: 400; line-height: 0; }
.primary-button:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(255,255,255,0.38) inset, 0 16px 36px rgba(22, 224, 182, 0.3); }

.secondary-button {
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border-color: rgba(164, 193, 231, 0.18);
  border-radius: 10px;
  background: rgba(4, 12, 25, 0.56);
  color: #d8e5f5;
  font-size: 0.78rem;
  font-weight: 700;
}
.secondary-button:hover:not(:disabled) { border-color: rgba(255,196,90,0.72); color: #ffe0a7; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1.84fr) minmax(270px, 0.78fr); gap: 1.2rem; }
.game-layout[hidden], .end-screen[hidden] { display: none; }
.left-column { display: grid; gap: 1.15rem; min-width: 0; }

.status-bar { display: grid; grid-template-columns: 1.3fr 1fr 0.72fr; padding: 0.45rem; }
.status-metric { min-width: 0; padding: 0.95rem 1.2rem; border-left: 1px solid rgba(152,198,255,0.1); }
.status-metric:first-child { border-left: 0; }
.status-metric-primary { background: linear-gradient(90deg, rgba(59, 229, 192, 0.13), transparent); border-radius: 15px; }
.label { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.68rem; font-weight: 700; }
.value { margin: 0; color: #e8f6ff; font-size: clamp(0.88rem, 1.7vw, 1.24rem); letter-spacing: -0.04em; white-space: nowrap; }
.status-metric-primary .value { color: var(--mint); text-shadow: 0 0 16px rgba(44,240,176,0.23); }

.lifelines, .question-card, .ladder { padding: 1.35rem; }
.card-header { justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-header h2 { margin: 0.15rem 0 0; font-size: 1.05rem; }
.section-kicker { margin: 0; color: var(--cyan); font-size: 0.62rem; font-weight: 700; }
#run-status { margin: 0; color: var(--mint); font-size: 0.64rem; font-weight: 700; }

.lifeline-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.lifeline-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.72rem;
  min-height: 5.4rem;
  padding: 0.6rem 0.75rem;
  overflow: hidden;
  border-color: rgba(141, 192, 255, 0.15);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(19, 45, 82, 0.74), rgba(5, 14, 28, 0.78));
  color: var(--text);
  text-align: left;
}
.lifeline-button::after { position: absolute; width: 6px; height: 6px; right: 9px; top: 9px; content: ""; border-top: 1px solid rgba(84,231,255,0.5); border-right: 1px solid rgba(84,231,255,0.5); }
.lifeline-button:hover:not(:disabled) { border-color: rgba(84,231,255,0.62); box-shadow: 0 12px 28px rgba(3, 15, 35, 0.35), inset 0 0 25px rgba(84,231,255,0.04); }
.lifeline-icon { width: 3.15rem; height: 3.15rem; object-fit: cover; border: 1px solid rgba(150,213,255,0.25); border-radius: 10px; box-shadow: 0 8px 18px rgba(0,0,0,0.24); }
.lifeline-label { font-size: 0.8rem; font-weight: 700; line-height: 1.28; }
.hint-output { min-height: 1.35rem; margin: 0.85rem 0 0; color: #c2d2e6; font-size: 0.9rem; }
.ask-chart { display: grid; gap: 0.55rem; margin-top: 1rem; }
.ask-chart[hidden] { display: none; }
.ask-chart-row { display: grid; grid-template-columns: 2rem minmax(0,1fr) 3.6rem; align-items: center; gap: 0.6rem; }
.ask-chart-label, .ask-chart-value { font-size: 0.76rem; }
.ask-chart-label { color: #ffe3a1; }
.ask-chart-value { color: #d9ebff; text-align: right; }
.ask-chart-track { height: 0.68rem; overflow: hidden; border: 1px solid rgba(152,198,255,0.12); border-radius: 999px; background: rgba(255,255,255,0.055); }
.ask-chart-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--mint) 70%, var(--cyan)); box-shadow: 0 0 14px rgba(44,240,176,0.32); transition: width 600ms ease; }

.question-card { overflow: hidden; }
.question-card::before { border-color: var(--gold); }
.question-card::after { border-color: var(--gold); }
.question-topline { justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.question-kicker { display: inline-flex; align-items: center; gap: 0.55rem; color: #d9e8f9; }
.question-kicker i { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.question-instruction { color: rgba(145,164,193,0.7); font-size: 0.6rem; }
.question-text { max-width: 33ch; margin: 1.1rem 0 1.35rem; font-family: "Space Grotesk", sans-serif; font-size: clamp(1.35rem, 2.2vw, 1.95rem); font-weight: 600; line-height: 1.34; letter-spacing: -0.025em; }
.answer-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  min-height: 4.55rem;
  margin: -0.35rem 0 1.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
}
.answer-feedback[hidden] {
  display: grid !important;
  visibility: hidden;
  pointer-events: none;
}
.answer-feedback.is-correct { border-color: rgba(66,228,138,0.55); background: linear-gradient(90deg, rgba(26,150,92,0.22), rgba(10,58,44,0.28)); animation: feedbackEnter 420ms cubic-bezier(.2,.85,.3,1) forwards; }
.answer-feedback.is-wrong { border-color: rgba(255,101,124,0.55); background: linear-gradient(90deg, rgba(153,34,59,0.24), rgba(67,12,28,0.3)); animation: feedbackEnter 420ms cubic-bezier(.2,.85,.3,1) forwards; }
.answer-feedback-icon { display: grid; width: 2.4rem; height: 2.4rem; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 1.45rem; font-weight: 700; line-height: 1; }
.answer-feedback.is-correct .answer-feedback-icon { color: var(--safe); box-shadow: 0 0 20px rgba(66,228,138,0.2); }
.answer-feedback.is-wrong .answer-feedback-icon { color: var(--danger); box-shadow: 0 0 20px rgba(255,101,124,0.2); }
.answer-feedback strong { display: block; color: var(--text); font-size: 1rem; }
.answer-feedback p { margin: 0.15rem 0 0; color: #c8d6e8; font-size: 0.85rem; line-height: 1.35; }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.7rem; }
.answer-button {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.25rem;
  padding: 0.7rem 0.85rem;
  border-color: rgba(147, 193, 244, 0.16);
  border-radius: 13px;
  background: linear-gradient(125deg, rgba(16, 37, 70, 0.86), rgba(6, 15, 29, 0.92));
  color: var(--text);
  text-align: left;
}
.answer-button:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(84,231,255,0.72); background: linear-gradient(125deg, rgba(22, 61, 103, 0.92), rgba(9, 25, 45, 0.96)); box-shadow: 0 12px 28px rgba(0,0,0,0.24), inset 0 0 24px rgba(84,231,255,0.055); }
.answer-key { display: inline-grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid rgba(255,196,90,0.52); border-radius: 7px; background: rgba(255,196,90,0.1); color: #ffe4a7; font-family: "Orbitron",sans-serif; font-size: 0.76rem; }
.answer-copy { font-size: 0.91rem; line-height: 1.25; }
.answer-state { color: rgba(84,231,255,0.62); font-size: 1.1rem; font-weight: 700; text-align: right; white-space: nowrap; }
.answer-button.is-correct .answer-state { color: #86f3b5; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.answer-button.is-wrong .answer-state { color: #ff9dac; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.answer-button.is-pending { border-color: var(--gold); background: linear-gradient(125deg, rgba(90,60,11,0.82), rgba(35,20,0,0.9)); animation: answerPulse 0.55s ease-in-out infinite; }
.answer-button.is-locked { border-color: var(--gold); background: linear-gradient(125deg, rgba(90,60,11,0.82), rgba(35,20,0,0.9)); }
.answer-button.is-correct { border-color: var(--safe); background: linear-gradient(125deg, rgba(8,83,51,0.9), rgba(2,39,30,0.94)); animation: answerCorrectReveal 650ms cubic-bezier(.2,.85,.3,1), answerCorrectFlash 0.45s ease 650ms 2; }
.answer-button.is-wrong { border-color: var(--danger); background: linear-gradient(125deg, rgba(103,20,39,0.9), rgba(48,4,18,0.94)); animation: answerWrongReveal 520ms cubic-bezier(.2,.8,.3,1), answerWrongFlash 0.38s ease 520ms 2; }
.answer-button.is-correct,
.answer-button.is-wrong { opacity: 1; }
.answer-button.is-reviewing { cursor: pointer; }
.answer-button.is-correct .answer-key { border-color: rgba(134,243,181,0.72); background: rgba(66,228,138,0.14); color: #a4f8c7; }
.answer-button.is-wrong .answer-key { border-color: rgba(255,157,172,0.72); background: rgba(255,101,124,0.14); color: #ffc0ca; }
.question-card.has-correct-feedback { animation: correctStage 850ms ease; }
.question-card.has-wrong-feedback { animation: wrongStage 600ms ease; }
.answer-button.is-hidden { visibility: hidden; pointer-events: none; }
.footer-actions { justify-content: space-between; gap: 1rem; min-height: 2.5rem; margin-top: 1.1rem; }
.result-banner { flex: 1; min-height: 1.5rem; margin: 0; color: #cbe3f9; font-size: 0.85rem; }

.ladder { padding: 1.25rem 1rem; }
.ladder-list { display: grid; gap: 0.32rem; padding: 0; margin: 0; list-style: none; }
.ladder-item { position: relative; display: grid; grid-template-columns: 1.9rem 1fr auto; align-items: center; gap: 0.38rem; min-height: 2.27rem; padding: 0.35rem 0.55rem; border: 1px solid transparent; border-radius: 9px; background: rgba(4, 11, 24, 0.42); }
.ladder-item::before { width: 2px; height: 11px; content: ""; border-radius: 2px; background: rgba(139,174,216,0.22); }
.ladder-item.is-current { border-color: rgba(44,240,176,0.56); background: linear-gradient(90deg, rgba(44,240,176,0.19), rgba(43,143,255,0.12)); box-shadow: inset 0 0 18px rgba(44,240,176,0.07), 0 0 18px rgba(44,240,176,0.08); animation: currentStepGlow 1.5s ease-in-out infinite; }
.ladder-item.is-current::before { background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.ladder-item.is-complete { opacity: 0.72; }
.ladder-item.is-complete::before { background: var(--gold); }
.ladder-item.is-safe .ladder-amount { color: #ffe29d; }
.ladder-index { color: var(--muted); font-size: 0.7rem; }
.ladder-amount { font-family: "Space Grotesk", sans-serif; font-size: 0.84rem; font-weight: 700; letter-spacing: -0.015em; }
.ladder-badge { color: #ffe09c; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.end-screen { position: relative; max-width: 860px; margin: min(10vh, 5.5rem) auto 0; padding: 3.2rem 2rem; overflow: hidden; text-align: center; isolation: isolate; }
.end-screen::before { z-index: -1; inset: 0; width: auto; height: auto; border: 0; border-radius: 0; background: radial-gradient(circle at 50% 0, rgba(255,255,255,0.1), transparent 31%), linear-gradient(180deg, rgba(255,255,255,0.025), transparent 60%); }
.end-screen.is-win { border-color: rgba(66,228,138,0.54); }
.end-screen.is-walk { border-color: rgba(255,196,90,0.48); }
.end-screen.is-lose { border-color: rgba(255,101,124,0.5); }
.end-screen-orb { width: 7.5rem; height: 7.5rem; margin: 0 auto 1.3rem; border: 1px solid rgba(255,255,255,0.55); border-radius: 50%; background: radial-gradient(circle at 35% 32%, rgba(255,255,255,0.95), rgba(255,255,255,0.08) 29%, transparent 30%), linear-gradient(135deg, var(--mint), var(--cyan)); box-shadow: 0 0 0 12px rgba(44,240,176,0.05), 0 0 52px rgba(44,240,176,0.27); animation: endOrbFloat 2.8s ease-in-out infinite; }
.end-screen.is-walk .end-screen-orb { background: radial-gradient(circle at 35% 32%, rgba(255,255,255,0.95), rgba(255,255,255,0.08) 29%, transparent 30%), linear-gradient(135deg, #ffdb72, #ff8b2b); box-shadow: 0 0 0 12px rgba(255,196,90,0.05), 0 0 52px rgba(255,196,90,0.26); }
.end-screen.is-lose .end-screen-orb { background: radial-gradient(circle at 35% 32%, rgba(255,255,255,0.9), rgba(255,255,255,0.06) 29%, transparent 30%), linear-gradient(135deg, #ff6a7b, #722cff); box-shadow: 0 0 0 12px rgba(255,101,124,0.05), 0 0 52px rgba(255,101,124,0.24); }
.end-screen-title { margin: 0; font-family: "Orbitron", sans-serif; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.03; letter-spacing: -0.06em; }
.end-screen-message { max-width: 44rem; margin: 1rem auto 0; color: #c7d8eb; font-size: 1.05rem; line-height: 1.6; }
.end-screen-prize { margin: 1.35rem 0 0; color: #f6fbff; font-family: "Orbitron", sans-serif; font-size: clamp(1.35rem, 3.5vw, 2.45rem); letter-spacing: -0.06em; text-shadow: 0 0 28px rgba(44,240,176,0.25); }
.end-screen-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }

button:disabled { cursor: not-allowed; opacity: 0.38; }

@keyframes statusPulse { 0%,100% { opacity: 0.5; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes answerPulse { 0%,100% { box-shadow: 0 0 0 rgba(255,196,90,0); } 50% { box-shadow: 0 0 25px rgba(255,196,90,0.35); } }
@keyframes answerCorrectFlash { 0%,100% { box-shadow: 0 0 0 rgba(66,228,138,0); } 35%,75% { box-shadow: 0 0 30px rgba(66,228,138,0.34); } }
@keyframes answerWrongFlash { 0%,100% { box-shadow: 0 0 0 rgba(255,101,124,0); } 35%,75% { box-shadow: 0 0 28px rgba(255,101,124,0.32); } }
@keyframes feedbackEnter { from { opacity: 0; transform: translateY(-8px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes answerCorrectReveal { 0% { transform: scale(0.98); } 58% { transform: scale(1.018); } 100% { transform: scale(1); } }
@keyframes answerWrongReveal { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes correctStage { 0%,100% { box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,0.045); } 45% { box-shadow: 0 0 0 1px rgba(66,228,138,0.45), 0 0 55px rgba(66,228,138,0.18), inset 0 0 45px rgba(66,228,138,0.07); } }
@keyframes wrongStage { 0%,100% { transform: translateX(0); } 22% { transform: translateX(-5px); } 44% { transform: translateX(4px); } 66% { transform: translateX(-2px); } }
@keyframes currentStepGlow { 0%,100% { box-shadow: inset 0 0 18px rgba(44,240,176,0.04), 0 0 8px rgba(44,240,176,0.04); } 50% { box-shadow: inset 0 0 22px rgba(44,240,176,0.12), 0 0 20px rgba(44,240,176,0.14); } }
@keyframes endOrbFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.03); } }

@media (min-width: 901px) {
  body { overflow: hidden; }
  .app-shell { padding-top: 1.25rem; }

  .game-layout {
    min-height: calc(100svh - 3.75rem);
    align-items: center;
  }

  .left-column {
    align-content: center;
    gap: 0.85rem;
  }

  .status-bar {
    order: 1;
    width: 100%;
    justify-self: center;
  }

  .lifelines {
    order: 3;
    width: 100%;
    justify-self: center;
    padding: 1rem 1.15rem;
  }

  .lifelines .card-header { margin-bottom: 0.65rem; }
  .lifelines .card-header h2 { font-size: 1rem; }
  .lifelines .secondary-button { min-height: 2.35rem; padding: 0.48rem 0.8rem; font-size: 0.82rem; }
  .lifeline-buttons { gap: 0.5rem; }

  .lifeline-button {
    min-height: 4.3rem;
    padding: 0.5rem 0.65rem;
  }

  .lifeline-icon { width: 2.65rem; height: 2.65rem; }
  .lifeline-label { font-size: 0.76rem; }
  .hint-output { min-height: 1rem; margin-top: 0.65rem; font-size: 0.84rem; }

  .question-card {
    order: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 960px);
    min-height: clamp(26rem, 48vh, 34rem);
    justify-self: center;
    padding: clamp(1.7rem, 3vw, 3rem) clamp(1.7rem, 4vw, 3.6rem);
    margin: clamp(0.55rem, 2.5vh, 1.35rem) 0;
  }

  .question-topline { margin-bottom: clamp(0.25rem, 1vh, 0.65rem); }

  .question-text {
    max-width: 42ch;
    margin: 0 0 clamp(1.35rem, 3.4vh, 2.35rem);
    font-size: clamp(1.7rem, 2.55vw, 2.35rem);
    line-height: 1.3;
  }

  .answers { gap: 0.85rem; }

  .answer-button {
    min-height: 4.65rem;
    padding: 0.8rem 1rem;
  }

  .answer-copy { font-size: 1.05rem; line-height: 1.4; }

  .ladder { align-self: center; }
}

@media (min-width: 901px) and (max-height: 900px) {
  body { overflow: hidden; }
  .app-shell { padding-top: 0.65rem; padding-bottom: 0.65rem; }
  .game-layout { min-height: calc(100svh - 1.3rem); gap: 0.8rem; }
  .left-column { gap: 0.55rem; }
  .status-bar { padding: 0.25rem; }
  .status-metric { padding: 0.58rem 0.85rem; }
  .label { margin-bottom: 0.2rem; font-size: 0.58rem; }
  .value { font-size: 0.98rem; }
  .question-card { min-height: 0; margin: 0.35rem 0; padding: 1rem 1.5rem; }
  .question-text { margin: 0.6rem 0 0.9rem; font-size: clamp(1.25rem, 2.15vw, 1.8rem); line-height: 1.28; }
  .answers { gap: 0.5rem; }
  .answer-button { min-height: 3.3rem; padding: 0.55rem 0.7rem; }
  .answer-copy { font-size: 0.9rem; line-height: 1.28; }
  .footer-actions { margin-top: 0.65rem; }
  .lifelines { padding: 0.58rem 0.8rem; }
  .lifelines .card-header { margin-bottom: 0.4rem; }
  .lifeline-button { min-height: 3.5rem; padding: 0.35rem 0.5rem; }
  .lifeline-icon { width: 2.15rem; height: 2.15rem; }
  .lifeline-label { font-size: 0.68rem; }
  .hint-output { min-height: 0.8rem; margin-top: 0.4rem; font-size: 0.72rem; }
  .ladder { padding: 0.8rem; }
  .ladder-list { gap: 0.2rem; }
  .ladder-item { min-height: 2rem; padding: 0.25rem 0.4rem; }
  .ladder-index { font-size: 0.62rem; }
  .ladder-amount { font-size: 0.76rem; }
  .ladder-badge { font-size: 0.52rem; }
}

@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  .status-bar { order: 1; }
  .question-card { order: 2; }
  .lifelines { order: 3; }
  .ladder { order: 2; }
  .ladder-list { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0.4rem; }
  .ladder-item { grid-template-columns: 1fr; justify-items: center; min-height: 3.1rem; gap: 0.1rem; padding: 0.34rem 0.2rem; text-align: center; }
  .ladder-item::before, .ladder-badge { display: none; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 1rem, 1000px); padding-top: 0.55rem; }
  .card, .hero-panel { border-radius: 16px; }
  .card::before { border-radius: 16px 0 0; }
  .card::after { border-radius: 0 0 16px; }
  .hero-panel { min-height: 0; margin-top: 0; padding: 1rem 1.1rem 1.75rem; }
  .hero-panel-topline { font-size: 0.54rem; }
  .splash-logo { width: 100%; margin-top: 1.5rem; }
  .hero-copy { font-size: 0.91rem; line-height: 1.55; }
  .hero-meta { gap: 0.4rem; margin: 1.25rem 0; }
  .meta-chip { padding: 0.38rem 0.55rem; font-size: 0.6rem; }
  .status-bar { grid-template-columns: repeat(3, minmax(0,1fr)); padding: 0.28rem; }
  .status-metric { padding: 0.7rem 0.55rem; }
  .label { font-size: 0.56rem; letter-spacing: 0.07em; }
  .value { font-size: 0.76rem; }
  .lifelines, .question-card, .ladder { padding: 1rem; }
  .lifeline-buttons { gap: 0.4rem; }
  .lifeline-button { grid-template-columns: 1fr; min-height: 5.1rem; gap: 0.28rem; padding: 0.5rem 0.22rem; justify-items: center; text-align: center; }
  .lifeline-icon { width: 2.25rem; height: 2.25rem; }
  .lifeline-label { font-size: 0.62rem; }
  .question-topline { font-size: 0.53rem; }
  .question-instruction { display: none; }
  .question-text { max-width: none; margin: 0.85rem 0 1.15rem; font-size: 1.25rem; line-height: 1.38; }
  .answers { grid-template-columns: 1fr; gap: 0.5rem; }
  .answer-button { min-height: 3.6rem; padding: 0.55rem 0.65rem; }
  .answer-copy { font-size: 0.95rem; line-height: 1.35; }
  .answer-feedback { margin-bottom: 0.9rem; padding: 0.75rem; }
  .answer-feedback-icon { width: 2rem; height: 2rem; font-size: 1.15rem; }
  .answer-feedback strong { font-size: 0.92rem; }
  .answer-feedback p { font-size: 0.78rem; }
  .answer-button.is-correct .answer-state,
  .answer-button.is-wrong .answer-state { max-width: 5.5rem; font-size: 0.6rem; white-space: normal; }
  .answer-key { width: 1.75rem; height: 1.75rem; font-size: 0.66rem; }
  .footer-actions { align-items: stretch; flex-direction: column-reverse; margin-top: 0.8rem; }
  .footer-actions .primary-button { width: 100%; }
  .result-banner { font-size: 0.78rem; }
  .ladder-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; }
  .ladder-item { min-height: 3rem; }
  .ladder-index { font-size: 0.58rem; }
  .ladder-amount { font-size: 0.66rem; line-height: 1.15; }
  .end-screen { margin-top: 0; padding: 2rem 1.1rem; }
  .end-screen-actions { flex-direction: column; align-items: stretch; }
}

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