:root {
  color-scheme: dark;
  --bg: #050706;
  --panel: rgba(13, 17, 16, 0.76);
  --panel-strong: rgba(16, 22, 21, 0.92);
  --line: rgba(177, 205, 193, 0.18);
  --line-strong: rgba(89, 214, 161, 0.5);
  --ink: #eef7f1;
  --muted: #9aa9a1;
  --accent: #42d392;
  --cyan: #56b7d4;
  --amber: #e0b85f;
  --danger: #e26d6d;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  --danger-glow: rgba(226, 109, 109, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 1ms !important;
}

button,
input {
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 66%, var(--line));
  border-radius: 8px;
  padding: 9px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent));
  color: #04110d;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 12px 34px rgba(66, 211, 146, 0.18);
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button:active {
  transform: translateY(0) scale(0.985);
}

button:disabled {
  cursor: not-allowed;
  border-color: rgba(177, 205, 193, 0.13);
  background: rgba(70, 81, 76, 0.46);
  color: rgba(238, 247, 241, 0.46);
  box-shadow: none;
  filter: none;
}

button:disabled:hover {
  transform: none;
}

button.secondary {
  background: rgba(19, 28, 27, 0.84);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(177, 205, 193, 0.2);
  border-radius: 8px;
  padding: 10px 70px 10px 12px;
  background: rgba(3, 7, 6, 0.72);
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(66, 211, 146, 0.16);
}

#sceneCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 34%, transparent 0 36%, rgba(0, 0, 0, 0.44) 78%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.38));
}

.hud {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  pointer-events: none;
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
}

.brand,
.stats,
.control-panel,
.play-copy {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(66, 211, 146, 0.56);
  border-radius: 8px;
  object-fit: cover;
  background: rgba(8, 13, 12, 0.78);
  box-shadow: 0 0 28px rgba(66, 211, 146, 0.18);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 2.4vw, 36px);
  line-height: 1;
  font-weight: 920;
}

.brand p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats {
  display: grid;
  grid-template-columns: 176px 132px 112px;
  gap: 8px;
}

.stats div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  background:
    linear-gradient(135deg, rgba(66, 211, 146, 0.12), transparent 58%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.stats div > span,
.answer span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats strong,
.answer strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-card strong,
.run-card strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.score-card small,
.run-card small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-transform: uppercase;
}

.run-card {
  position: relative;
  overflow: hidden;
}

.run-card::after {
  content: "";
  position: absolute;
  inset: auto 12px 8px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--cyan), transparent);
  opacity: 0.58;
}

.stats div.hud-pop {
  animation: hud-pop 820ms cubic-bezier(0.16, 1, 0.3, 1);
}

.timer-card.live {
  border-color: rgba(66, 211, 146, 0.52);
  animation: timer-hud-breathe 1350ms ease-in-out infinite;
}

body.final-attempt .timer-card.live,
body.timer-danger .timer-card.live {
  border-color: rgba(226, 109, 109, 0.62);
  animation: danger-breathe 780ms ease-in-out infinite;
}

#timer.warning {
  color: var(--amber);
}

#timer.urgent {
  color: var(--danger);
  animation: pulse 900ms ease-in-out infinite;
}

.play-copy {
  align-self: end;
  width: min(520px, calc(100vw - 420px));
  margin: 0 0 28px 26px;
  padding: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.62);
}

.play-copy span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.play-copy span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(66, 211, 146, 0.8);
  animation: standby-led 1400ms ease-in-out infinite;
}

.play-copy h2 {
  margin-top: 7px;
  font-size: clamp(32px, 5vw, 70px);
  line-height: 0.96;
  font-weight: 950;
}

.play-copy p {
  max-width: 42ch;
  margin-top: 12px;
  color: #c6d2cc;
  font-size: 17px;
  line-height: 1.45;
}

.control-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(370px, calc(100vw - 40px));
  max-height: calc(100vh - 112px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  background:
    linear-gradient(150deg, rgba(66, 211, 146, 0.1), transparent 42%),
    var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  scrollbar-color: rgba(66, 211, 146, 0.46) rgba(3, 7, 6, 0.34);
  scrollbar-width: thin;
}

.control-panel::-webkit-scrollbar {
  width: 8px;
}

.control-panel::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(3, 7, 6, 0.34);
}

.control-panel::-webkit-scrollbar-thumb {
  border: 2px solid rgba(3, 7, 6, 0.46);
  border-radius: 999px;
  background: rgba(66, 211, 146, 0.55);
}

.answer {
  min-height: 66px;
  border: 1px solid rgba(66, 211, 146, 0.45);
  border-radius: 8px;
  padding: 12px;
  background: rgba(66, 211, 146, 0.1);
  animation: pop 240ms ease-out;
}

.answer.revealing {
  animation: answer-reveal 560ms cubic-bezier(0.16, 1, 0.3, 1);
}

.answer.staged.revealing {
  animation: answer-reveal-staged 920ms cubic-bezier(0.16, 1, 0.3, 1);
}

.answer strong {
  font-size: 20px;
  line-height: 1.15;
}

.guess-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  align-items: stretch;
}

.input-wrap {
  position: relative;
  min-width: 0;
}

.hint-button {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 28px;
  border-color: transparent;
  border-radius: 999px;
  padding: 3px 9px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 12px;
  transform: translateY(-50%);
  white-space: nowrap;
}

.hint-button:hover {
  background: rgba(66, 211, 146, 0.12);
  color: var(--ink);
  transform: translateY(-50%);
}

.hint-button:active {
  transform: translateY(-50%) scale(0.985);
}

.hint-button:disabled,
.hint-button:disabled:hover {
  background: transparent;
  transform: translateY(-50%);
}

#guessButton {
  flex-direction: column;
  gap: 1px;
  white-space: nowrap;
}

#guessButton small {
  display: block;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.82;
  text-transform: uppercase;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hint {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid rgba(224, 184, 95, 0.5);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(224, 184, 95, 0.12);
  color: var(--ink);
  font-weight: 850;
  animation: pop 220ms ease-out;
}

.result-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(86, 183, 212, 0.46);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(86, 183, 212, 0.13), transparent 62%),
    rgba(9, 13, 12, 0.72);
  animation: slide-in 220ms ease-out;
}

.result-panel.staged {
  animation: result-staged 980ms cubic-bezier(0.16, 1, 0.3, 1);
}

.result-panel strong {
  font-size: 17px;
  line-height: 1.15;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.result-grid span {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-grid b {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.feedback {
  display: grid;
  gap: 9px;
}

.guess-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(9, 13, 12, 0.7);
  animation: slide-in 180ms ease-out;
}

.guess-card.correct {
  border-color: rgba(66, 211, 146, 0.7);
  box-shadow: 0 0 28px rgba(66, 211, 146, 0.13);
}

.guess-card.partial,
.guess-card.close {
  border-color: rgba(224, 184, 95, 0.65);
}

.guess-card.wrong {
  border-color: rgba(226, 109, 109, 0.55);
}

.guess-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.guess-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.guess-score {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 33px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.chip.correct {
  border-color: rgba(66, 211, 146, 0.7);
  color: var(--accent);
  background: rgba(66, 211, 146, 0.08);
}

.chip.close,
.chip.partial {
  border-color: rgba(224, 184, 95, 0.65);
  color: var(--amber);
  background: rgba(224, 184, 95, 0.08);
}

.chip.wrong {
  border-color: rgba(226, 109, 109, 0.58);
  color: var(--danger);
  background: rgba(226, 109, 109, 0.08);
}

.correct-banner {
  position: fixed;
  left: 50%;
  top: 36%;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: min(920px, calc(100vw - 80px));
  border: 1px solid rgba(238, 247, 241, 0.34);
  border-radius: 8px;
  padding: 20px 42px 24px;
  background: linear-gradient(135deg, rgba(66, 211, 146, 0.96), rgba(86, 183, 212, 0.92));
  color: #03100c;
  box-shadow: 0 28px 90px rgba(66, 211, 146, 0.42);
  font-size: clamp(38px, 7.2vw, 94px);
  line-height: 0.9;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%) scale(0.78);
}

.correct-banner.show {
  animation: correct-banner 1600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.correct-banner.perfect {
  background: linear-gradient(135deg, rgba(255, 232, 155, 0.98), rgba(66, 211, 146, 0.94));
  box-shadow: 0 28px 110px rgba(255, 232, 155, 0.36);
}

.correct-banner.clutch {
  background: linear-gradient(135deg, rgba(224, 184, 95, 0.98), rgba(66, 211, 146, 0.94));
}

.wrong-banner {
  position: fixed;
  left: 50%;
  top: 38%;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  border: 1px solid rgba(255, 207, 207, 0.32);
  border-radius: 8px;
  padding: 16px 34px 20px;
  background: linear-gradient(135deg, rgba(226, 109, 109, 0.94), rgba(92, 18, 18, 0.92));
  color: #fff2f2;
  box-shadow: 0 28px 90px rgba(226, 109, 109, 0.34);
  font-size: clamp(34px, 7vw, 82px);
  line-height: 0.9;
  font-weight: 950;
  text-transform: uppercase;
  transform: translate(-50%, -50%) scale(0.84);
}

.wrong-banner.final {
  background: linear-gradient(135deg, rgba(224, 184, 95, 0.94), rgba(92, 18, 18, 0.92));
  color: #fff7df;
  box-shadow: 0 28px 90px rgba(224, 184, 95, 0.28);
}

.wrong-banner.show {
  animation: wrong-banner 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

.milestone-banner {
  position: fixed;
  left: 50%;
  top: 21%;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  border: 1px solid rgba(255, 232, 155, 0.48);
  border-radius: 8px;
  padding: 11px 18px 12px;
  background:
    linear-gradient(135deg, rgba(255, 232, 155, 0.18), rgba(66, 211, 146, 0.14)),
    rgba(4, 14, 12, 0.88);
  color: #fff5c8;
  box-shadow: 0 20px 70px rgba(255, 232, 155, 0.24);
  font-size: clamp(18px, 3vw, 34px);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translate(-50%, 8px) scale(0.92);
}

.milestone-banner.streak {
  border-color: rgba(66, 211, 146, 0.58);
  color: #d8fff0;
  box-shadow: 0 20px 70px rgba(66, 211, 146, 0.24);
}

.milestone-banner.show {
  animation: milestone-banner 1350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.score-float {
  position: fixed;
  right: 174px;
  top: 82px;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  color: var(--accent);
  font-size: 36px;
  font-weight: 950;
  text-shadow: 0 0 24px rgba(66, 211, 146, 0.72);
  transform: translateY(8px) scale(0.9);
}

.score-float.show {
  animation: score-float 1050ms cubic-bezier(0.16, 1, 0.3, 1);
}

.success-wave {
  position: fixed;
  left: 50%;
  top: 47%;
  z-index: 7;
  width: 40vmin;
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0;
  border: 2px solid rgba(142, 245, 197, 0.72);
  border-radius: 50%;
  box-shadow:
    0 0 40px rgba(66, 211, 146, 0.22),
    inset 0 0 34px rgba(86, 183, 212, 0.16);
  transform: translate(-50%, -50%) scale(0.22);
}

.success-wave.show {
  animation: success-wave 780ms ease-out;
}

.reveal-badge {
  position: fixed;
  left: 50%;
  top: 18%;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  border: 1px solid rgba(86, 183, 212, 0.58);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(4, 14, 16, 0.82);
  color: #d8fff0;
  box-shadow: 0 14px 44px rgba(86, 183, 212, 0.24);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: translate(-50%, 8px);
}

.reveal-badge.show {
  animation: reveal-badge 1500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.round-curtain,
.glitch-overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
}

.round-curtain {
  background:
    linear-gradient(180deg, transparent 0 42%, rgba(66, 211, 146, 0.2) 48%, rgba(255, 255, 255, 0.32) 50%, rgba(66, 211, 146, 0.18) 52%, transparent 58%),
    radial-gradient(circle at 50% 38%, rgba(86, 183, 212, 0.2), transparent 44%);
  mix-blend-mode: screen;
}

.round-curtain.show {
  animation: round-curtain 900ms ease-out;
}

.glitch-overlay {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 6px),
    linear-gradient(90deg, transparent, rgba(226, 109, 109, 0.28), transparent);
  mix-blend-mode: screen;
}

.glitch-overlay.show {
  animation: glitch-flash 430ms steps(4, end);
}

body.wrong-flash .vignette {
  background:
    radial-gradient(circle at 50% 34%, transparent 0 34%, rgba(80, 7, 7, 0.36) 72%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.44));
}

body.correct-flash .vignette {
  background:
    radial-gradient(circle at 50% 34%, rgba(66, 211, 146, 0.13) 0 28%, transparent 52%, rgba(0, 0, 0, 0.42) 82%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.28));
}

.settings-toggle {
  justify-self: end;
  min-height: 32px;
  min-width: 96px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(177, 205, 193, 0.13);
  border-radius: 8px;
  background: rgba(3, 7, 6, 0.48);
  animation: settings-drawer 160ms ease-out;
}

.icon-button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.icon-button[aria-pressed="true"] {
  border-color: rgba(224, 184, 95, 0.66);
  color: var(--amber);
}

.volume-control {
  grid-column: 1 / span 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  border: 1px solid rgba(177, 205, 193, 0.13);
  border-radius: 8px;
  padding: 6px 9px;
  background: rgba(3, 7, 6, 0.54);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.volume-control input {
  min-height: 0;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  accent-color: var(--accent);
}

.volume-control strong {
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 12;
  max-width: min(520px, calc(100vw - 44px));
  border: 1px solid rgba(226, 109, 109, 0.58);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(18, 9, 9, 0.94);
  color: #ffd4d4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.shake {
  animation: shake 260ms ease-out;
}

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

  .hud {
    min-height: 100%;
  }

  .hud-top {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .stats {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .play-copy {
    width: auto;
    margin: 0 14px 330px;
  }

  .control-panel {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
    max-height: 310px;
  }

  .settings-toggle {
    justify-self: stretch;
  }
}

@media (max-width: 560px) {
  .stats strong {
    font-size: 20px;
  }

  .guess-form,
  .actions,
  .chips,
  .result-grid,
  .settings-strip,
  .volume-control {
    grid-template-columns: 1fr;
  }

  .volume-control {
    grid-column: auto;
  }

  .score-float {
    right: 24px;
    top: 164px;
  }
}

@keyframes pulse {
  50% {
    text-shadow: 0 0 18px rgba(226, 109, 109, 0.72);
  }
}

@keyframes timer-hud-breathe {
  0%, 100% {
    box-shadow: var(--shadow), 0 0 0 rgba(66, 211, 146, 0);
    transform: translateY(0);
  }
  50% {
    box-shadow: var(--shadow), 0 0 26px rgba(66, 211, 146, 0.18);
    transform: translateY(-1px);
  }
}

@keyframes danger-breathe {
  0%, 100% {
    box-shadow: var(--shadow), 0 0 0 var(--danger-glow);
    transform: translateY(0);
  }
  50% {
    box-shadow: var(--shadow), 0 0 34px var(--danger-glow);
    transform: translateY(-1px);
  }
}

@keyframes hud-pop {
  0% {
    transform: translateY(0) scale(1);
    border-color: var(--line);
  }
  24% {
    transform: translateY(-2px) scale(1.035);
    border-color: rgba(255, 232, 155, 0.78);
    box-shadow: var(--shadow), 0 0 34px rgba(255, 232, 155, 0.28);
  }
  100% {
    transform: translateY(0) scale(1);
    border-color: var(--line);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.985);
  }
  70% {
    transform: scale(1.012);
  }
  100% {
    transform: none;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

@keyframes correct-banner {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -56%) scale(0.98);
  }
}

@keyframes milestone-banner {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.86);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.04);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.98);
  }
}

@keyframes wrong-banner {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72) rotate(-1deg);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotate(1deg);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -54%) scale(0.96);
  }
}

@keyframes score-float {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.86);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }
  80% {
    opacity: 1;
    transform: translateY(-28px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-42px) scale(0.98);
  }
}

@keyframes success-wave {
  0% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(0.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.7);
  }
}

@keyframes reveal-badge {
  0% {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.02);
  }
  78% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.98);
  }
}

@keyframes settings-drawer {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes round-curtain {
  0% {
    opacity: 0;
    transform: translateY(-34%);
  }
  14% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(42%);
  }
}

@keyframes glitch-flash {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  22% {
    opacity: 0.78;
    transform: translateX(-10px);
  }
  44% {
    opacity: 0.36;
    transform: translateX(12px);
  }
  72% {
    opacity: 0.62;
    transform: translateX(-4px);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

@keyframes answer-reveal {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    filter: brightness(1.8);
  }
  70% {
    opacity: 1;
    transform: translateY(-1px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes answer-reveal-staged {
  0%, 30% {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    filter: brightness(1.8);
  }
  74% {
    opacity: 1;
    transform: translateY(-1px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes result-staged {
  0%, 38% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes standby-led {
  0%, 100% {
    opacity: 0.48;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}
