:root {
  color-scheme: dark;
  --bg: #080a10;
  --panel: rgba(17, 24, 38, 0.86);
  --line: rgba(142, 225, 255, 0.24);
  --text: #edf7ff;
  --muted: #8ea1b5;
  --cyan: #58dcff;
  --green: #9effb3;
  --red: #ff6f89;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  --mood-a: rgba(88, 220, 255, 0.18);
  --mood-b: rgba(158, 255, 179, 0.12);
  --mood-c: rgba(255, 159, 222, 0.08);
  --mood-angle: 135deg;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(88, 220, 255, 0.20), transparent 34%),
    radial-gradient(circle at 80% 70%, rgba(158, 255, 179, 0.14), transparent 32%),
    linear-gradient(135deg, #080a10 0%, #101726 48%, #080a10 100%);
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  opacity: 0.92;
  background:
    radial-gradient(circle at 22% 20%, var(--mood-a), transparent 34%),
    radial-gradient(circle at 78% 72%, var(--mood-b), transparent 36%),
    linear-gradient(var(--mood-angle), rgba(255, 255, 255, 0.04), transparent 44%, var(--mood-c));
  mix-blend-mode: screen;
  transition: background 180ms ease, opacity 180ms ease;
}

body::after {
  z-index: 0;
  opacity: 0;
  background: repeating-linear-gradient(115deg, transparent 0 18px, rgba(237, 247, 255, 0.07) 18px 20px);
  transform: translate3d(0, 0, 0);
  transition: opacity 180ms ease;
}

body[data-mood="panic"],
body[data-mood="brake"] {
  --mood-a: rgba(255, 111, 137, 0.22);
  --mood-b: rgba(255, 241, 166, 0.08);
  --mood-c: rgba(255, 111, 137, 0.12);
  --mood-angle: 92deg;
}

body[data-mood="speed"] {
  --mood-a: rgba(88, 220, 255, 0.26);
  --mood-b: rgba(203, 251, 255, 0.12);
  --mood-c: rgba(88, 220, 255, 0.16);
  --mood-angle: 78deg;
}

body[data-mood="happy"],
body[data-mood="shine"],
body[data-mood="lucky"],
body[data-mood="burst"] {
  --mood-a: rgba(255, 241, 166, 0.22);
  --mood-b: rgba(158, 255, 179, 0.16);
  --mood-c: rgba(88, 220, 255, 0.1);
}

body[data-mood="sleep"],
body[data-mood="float"] {
  --mood-a: rgba(201, 212, 255, 0.18);
  --mood-b: rgba(224, 214, 255, 0.12);
  --mood-c: rgba(201, 212, 255, 0.08);
  --mood-angle: 160deg;
}

body[data-mood="faint"],
body[data-mood="quiet"],
body[data-mood="secret"] {
  --mood-a: rgba(189, 167, 255, 0.12);
  --mood-b: rgba(237, 247, 255, 0.07);
  --mood-c: rgba(189, 167, 255, 0.06);
}

body[data-mood="heavy"],
body[data-mood="dark"] {
  --mood-a: rgba(79, 76, 120, 0.18);
  --mood-b: rgba(0, 0, 0, 0.18);
  --mood-c: rgba(168, 156, 255, 0.08);
  --mood-angle: 180deg;
}

body[data-mood="rain"],
body[data-mood="ice"] {
  --mood-a: rgba(142, 189, 255, 0.2);
  --mood-b: rgba(167, 236, 255, 0.14);
  --mood-c: rgba(142, 189, 255, 0.09);
  --mood-angle: 120deg;
}

body[data-mood="fire"],
body[data-mood="hungry"] {
  --mood-a: rgba(255, 138, 77, 0.2);
  --mood-b: rgba(255, 209, 155, 0.12);
  --mood-c: rgba(255, 111, 137, 0.1);
  --mood-angle: 28deg;
}

body[data-mood="money"],
body[data-mood="calm"],
body[data-mood="clean"],
body[data-mood="focus"] {
  --mood-a: rgba(158, 255, 179, 0.18);
  --mood-b: rgba(88, 220, 255, 0.13);
  --mood-c: rgba(223, 252, 255, 0.07);
}

body[data-mood="glitch"],
body[data-mood="messy"],
body[data-mood="pop"],
body[data-mood="loud"] {
  --mood-a: rgba(255, 159, 222, 0.18);
  --mood-b: rgba(88, 220, 255, 0.17);
  --mood-c: rgba(255, 111, 137, 0.11);
  --mood-angle: 105deg;
}

body[data-mood="speed"]::after,
body[data-mood="rain"]::after,
body[data-mood="glitch"]::after,
body[data-mood="messy"]::after,
body[data-mood="burst"]::after,
body[data-mood="fire"]::after {
  opacity: 0.48;
  animation: moodFlow 620ms linear infinite;
}

body[data-mood="rain"]::after {
  opacity: 0.42;
  background: repeating-linear-gradient(104deg, transparent 0 18px, rgba(142, 189, 255, 0.16) 18px 20px);
  animation-duration: 900ms;
}

body[data-mood="glitch"]::after,
body[data-mood="messy"]::after {
  opacity: 0.4;
  background: repeating-linear-gradient(90deg, rgba(255, 159, 222, 0.08) 0 2px, transparent 2px 22px);
  animation: moodJitter 180ms steps(2, end) infinite;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 14px 22px;
  color: #061017;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(88, 220, 255, 0.22);
}

button:active {
  transform: translateY(1px);
}

.game {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100vw - 48px));
  height: min(700px, calc(100vh - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

#fxCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 4.2vw, 52px);
  line-height: 0.95;
  letter-spacing: 0;
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 10px;
}

.stats div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 10, 18, 0.68);
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
}

.card {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

#startPanel {
  overflow: hidden;
}

.startHero {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(420px, 1.26fr);
  align-items: center;
  gap: 34px;
}

.startCopy {
  display: grid;
  justify-items: start;
  gap: 22px;
}

.startMode {
  margin: 0;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 950;
}

.reactPreview {
  position: relative;
  display: grid;
  gap: 12px;
}

.reactPreview::before {
  content: "";
  position: absolute;
  inset: -42px -28px;
  background:
    radial-gradient(circle at 22% 26%, rgba(88, 220, 255, 0.2), transparent 30%),
    radial-gradient(circle at 74% 70%, rgba(255, 159, 222, 0.14), transparent 34%);
  filter: blur(2px);
}

.previewLine {
  position: relative;
  min-height: 86px;
  display: grid;
  grid-template-columns: 78px 1fr 168px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(237, 247, 255, 0.13);
  border-radius: 8px;
  background: rgba(2, 7, 14, 0.5);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  transform: translateX(var(--shift, 0));
}

.previewLine:nth-child(2) {
  --shift: -18px;
}

.previewLine:nth-child(3) {
  --shift: 14px;
}

.previewLine:nth-child(4) {
  --shift: -6px;
}

.previewLine span {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 950;
}

.previewLine strong {
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 950;
  line-height: 1.05;
  white-space: nowrap;
}

.previewLine em {
  color: rgba(237, 247, 255, 0.48);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
  text-align: right;
}

.preview-faint strong {
  color: rgba(237, 247, 255, 0.42);
  filter: saturate(0.4);
}

.preview-speed strong {
  color: #cbfbff;
  transform: skewX(-8deg);
  text-shadow: 9px 0 rgba(88, 220, 255, 0.26), 18px 0 rgba(88, 220, 255, 0.12);
}

.preview-secret strong {
  color: #c9c3ff;
  opacity: 0.72;
  text-shadow: 0 0 14px rgba(189, 167, 255, 0.24);
}

.preview-fire strong {
  color: #fff1a6;
  text-shadow: 0 0 18px rgba(255, 241, 166, 0.65), 0 0 48px rgba(255, 138, 77, 0.22);
}

.lead {
  max-width: 330px;
  margin: 0;
  color: var(--text);
  font-size: clamp(27px, 3.2vw, 40px);
  font-weight: 950;
  line-height: 1.18;
  text-align: left;
}

.play {
  overflow: hidden;
  grid-template-rows: auto auto auto auto auto;
  place-items: stretch;
  gap: 16px;
}

.play > * {
  position: relative;
  z-index: 1;
}

.play::before,
.play::after {
  content: "";
  position: absolute;
  inset: 16px;
  z-index: 0;
  border-radius: 8px;
  pointer-events: none;
}

.play::before {
  opacity: 0.48;
  background:
    radial-gradient(circle at 50% 25%, var(--mood-a), transparent 36%),
    radial-gradient(circle at 50% 72%, var(--mood-b), transparent 38%);
  filter: blur(4px);
}

.play::after {
  opacity: 0;
  background: linear-gradient(115deg, transparent 0 38%, rgba(237, 247, 255, 0.18) 42%, transparent 48%);
}

.mood-snap .play::before {
  animation: stageSnap 360ms ease-out;
}

.mood-speed .play::after,
.mood-brake .play::after {
  opacity: 0.74;
  background: repeating-linear-gradient(100deg, transparent 0 18px, rgba(88, 220, 255, 0.22) 18px 22px, transparent 22px 42px);
  animation: stageRush 420ms linear infinite;
}

.mood-brake .play::after {
  background: repeating-linear-gradient(80deg, transparent 0 18px, rgba(255, 111, 137, 0.28) 18px 24px, transparent 24px 44px);
  animation-direction: reverse;
}

.mood-panic .play::after,
.mood-glitch .play::after,
.mood-messy .play::after {
  opacity: 0.58;
  background:
    linear-gradient(90deg, rgba(255, 111, 137, 0.18), transparent 22%, rgba(88, 220, 255, 0.14), transparent 48%),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(237, 247, 255, 0.09) 13px 15px);
  animation: stageJitter 160ms steps(2, end) infinite;
}

.mood-fire .play::after,
.mood-burst .play::after,
.mood-shine .play::after,
.mood-happy .play::after,
.mood-lucky .play::after {
  opacity: 0.68;
  background: radial-gradient(circle at 50% 48%, rgba(255, 241, 166, 0.26), transparent 34%);
  animation: stagePulse 760ms ease-in-out infinite;
}

.mood-rain .play::after,
.mood-ice .play::after {
  opacity: 0.58;
  background: repeating-linear-gradient(106deg, transparent 0 22px, rgba(142, 189, 255, 0.22) 22px 25px);
  animation: stageRain 900ms linear infinite;
}

.mood-float .play::after,
.mood-sleep .play::after {
  opacity: 0.42;
  background: radial-gradient(ellipse at 50% 40%, rgba(224, 214, 255, 0.18), transparent 44%);
  animation: stageFloat 1.7s ease-in-out infinite;
}

.mood-faint .play::after,
.mood-secret .play::after,
.mood-quiet .play::after,
.mood-dark .play::after {
  opacity: 0.38;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.28), transparent 44%);
}

.mood-loud .play::after,
.mood-pop .play::after {
  opacity: 0.6;
  background: radial-gradient(circle at 50% 48%, rgba(255, 159, 222, 0.2), transparent 28%);
  animation: stagePulse 520ms ease-in-out infinite;
}

.mood-money .play::after {
  opacity: 0.62;
  background:
    radial-gradient(circle at 18% 34%, rgba(158, 255, 179, 0.28) 0 4px, transparent 5px),
    radial-gradient(circle at 72% 28%, rgba(255, 241, 166, 0.3) 0 5px, transparent 6px),
    radial-gradient(circle at 58% 70%, rgba(158, 255, 179, 0.22) 0 4px, transparent 5px),
    repeating-linear-gradient(120deg, transparent 0 42px, rgba(158, 255, 179, 0.12) 42px 45px);
  animation: stageCoins 1.1s linear infinite;
}

.mood-clean .play::after {
  opacity: 0.58;
  background:
    linear-gradient(105deg, transparent 0 44%, rgba(223, 252, 255, 0.26) 48%, transparent 54%),
    repeating-linear-gradient(0deg, rgba(223, 252, 255, 0.06) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(223, 252, 255, 0.06) 0 1px, transparent 1px 28px);
  animation: stageSweep 1.15s ease-in-out infinite;
}

.mood-hard .play::after {
  opacity: 0.62;
  background:
    linear-gradient(180deg, rgba(215, 221, 230, 0.2), transparent 48%),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(215, 221, 230, 0.18) 34px 39px);
  animation: stageImpact 520ms ease-in-out infinite;
}

.mood-hungry .play::after {
  opacity: 0.6;
  background:
    radial-gradient(ellipse at 50% 58%, rgba(255, 209, 155, 0.26), transparent 34%),
    repeating-radial-gradient(circle at 50% 58%, rgba(255, 209, 155, 0.12) 0 2px, transparent 2px 22px);
  animation: stageHunger 1.05s ease-in-out infinite;
}

.mood-focus .play::after {
  opacity: 0.68;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(88, 220, 255, 0.22) 49%, transparent 51%),
    linear-gradient(0deg, transparent 0 48%, rgba(88, 220, 255, 0.22) 49%, transparent 51%),
    radial-gradient(circle at 50% 50%, transparent 0 18%, rgba(88, 220, 255, 0.18) 19%, transparent 24%);
  animation: stageFocus 900ms ease-in-out infinite;
}

.mood-secret .play::after {
  opacity: 0.58;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 0 24%, rgba(0, 0, 0, 0.42) 54%),
    linear-gradient(90deg, rgba(189, 167, 255, 0.08), transparent 36%, rgba(189, 167, 255, 0.08));
  animation: stageSecret 1.25s ease-in-out infinite;
}

.mood-faint .play::after {
  opacity: 0.5;
  background:
    radial-gradient(ellipse at 48% 42%, rgba(237, 247, 255, 0.08), transparent 30%),
    linear-gradient(90deg, rgba(237, 247, 255, 0.08), transparent 28%, rgba(237, 247, 255, 0.04));
  animation: stageFade 1.2s ease-in-out infinite;
}

.prompt {
  text-align: center;
}

.word {
  margin: 0;
  font-size: clamp(48px, 7vw, 84px);
  font-weight: 950;
  line-height: 1.05;
  transition: color 160ms ease, filter 160ms ease, opacity 160ms ease, text-shadow 160ms ease, transform 160ms ease;
}

.reading {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
  transition: color 160ms ease, opacity 160ms ease;
}

.romaji {
  min-height: 78px;
  padding: 18px 20px;
  border: 1px solid rgba(88, 220, 255, 0.25);
  border-radius: 8px;
  background: rgba(2, 7, 14, 0.58);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  transition: border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, filter 160ms ease;
}

.mood-faint .word,
.mood-faint .reading,
.mood-faint .romaji {
  opacity: 0.48;
  filter: saturate(0.45);
}

.mood-faint .word {
  color: rgba(237, 247, 255, 0.56);
  text-shadow: none;
}

.mood-sleep .word {
  color: #c9d4ff;
  filter: blur(0.4px);
  transform: rotate(-1deg);
  text-shadow: 0 0 22px rgba(153, 173, 255, 0.28);
}

.mood-panic .word {
  color: #ff8ba0;
  animation: panicText 140ms steps(2, end) infinite;
  text-shadow: 2px 0 rgba(88, 220, 255, 0.55), -2px 0 rgba(255, 111, 137, 0.5);
}

.mood-heavy .word {
  color: #b6c0cc;
  transform: translateY(5px);
  text-shadow: 0 10px 20px rgba(0, 0, 0, 0.44);
}

.mood-happy .word,
.mood-shine .word {
  color: #fff1a6;
  text-shadow: 0 0 18px rgba(255, 241, 166, 0.45), 0 0 34px rgba(158, 255, 179, 0.28);
}

.mood-money .word {
  color: #a8ffbf;
  text-shadow: 0 0 18px rgba(158, 255, 179, 0.38);
}

.mood-pop .word {
  color: #ff9fde;
  text-shadow: 0 0 22px rgba(255, 159, 222, 0.4), 0 0 24px rgba(88, 220, 255, 0.24);
}

.mood-glitch .word {
  color: #e9fbff;
  text-shadow: 3px 0 rgba(88, 220, 255, 0.55), -3px 0 rgba(255, 111, 137, 0.45);
}

.mood-calm .word {
  color: #c9ffe0;
  text-shadow: 0 0 18px rgba(158, 255, 179, 0.2);
}

.mood-hungry .word {
  color: #ffd19b;
  text-shadow: 0 0 18px rgba(255, 209, 155, 0.36);
}

.mood-quiet .word,
.mood-secret .word {
  color: #c9c3ff;
  opacity: 0.72;
  filter: blur(0.2px);
  text-shadow: 0 0 14px rgba(189, 167, 255, 0.24);
}

.mood-secret .word {
  animation: secretText 1.2s ease-in-out infinite;
}

.mood-speed .word {
  color: #cbfbff;
  transform: skewX(-8deg);
  text-shadow: 10px 0 rgba(88, 220, 255, 0.24), 20px 0 rgba(88, 220, 255, 0.12);
}

.mood-brake .word {
  color: #ff9aac;
  transform: skewX(8deg) translateX(-4px);
  text-shadow: -10px 0 rgba(255, 111, 137, 0.18), -20px 0 rgba(255, 111, 137, 0.08);
}

.mood-loud .word {
  color: #fff1a6;
  transform: scale(1.08);
  text-shadow: 0 0 18px rgba(255, 241, 166, 0.5), 0 0 42px rgba(255, 111, 137, 0.25);
}

.mood-messy .word {
  color: #f7eaff;
  text-shadow: 4px 3px rgba(255, 159, 222, 0.42), -5px -2px rgba(88, 220, 255, 0.28);
  transform: rotate(-1deg);
}

.mood-clean .word {
  color: #eaffff;
  letter-spacing: 0.04em;
  text-shadow: 0 0 20px rgba(223, 252, 255, 0.34);
}

.mood-rain .word {
  color: #b8ccff;
  text-shadow: 0 10px 0 rgba(142, 189, 255, 0.08), 0 0 22px rgba(142, 189, 255, 0.26);
}

.mood-ice .word {
  color: #c9f7ff;
  filter: contrast(1.08);
  text-shadow: 0 0 16px rgba(167, 236, 255, 0.34);
}

.mood-fire .word {
  color: #ffb15c;
  animation: fireText 420ms ease-in-out infinite alternate;
  text-shadow: 0 0 16px rgba(255, 138, 77, 0.54), 0 0 38px rgba(255, 111, 137, 0.24);
}

.mood-float .word {
  color: #eee6ff;
  animation: floatText 1.8s ease-in-out infinite;
  text-shadow: 0 0 18px rgba(224, 214, 255, 0.36);
}

.mood-hard .word {
  color: #d7dde6;
  transform: scaleY(0.92);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.mood-lucky .word {
  color: #c9ffd6;
  text-shadow: 0 0 18px rgba(158, 255, 179, 0.45), 0 0 36px rgba(255, 241, 166, 0.22);
}

.mood-focus .word {
  color: #dffbff;
  text-shadow: 0 0 10px rgba(88, 220, 255, 0.42);
}

.mood-burst .word {
  color: #fff1a6;
  transform: scale(1.04);
  text-shadow: 0 0 18px rgba(255, 241, 166, 0.65), 0 0 48px rgba(88, 220, 255, 0.22);
}

.mood-dark .word {
  color: #b3aaff;
  opacity: 0.82;
  text-shadow: 0 0 18px rgba(168, 156, 255, 0.28);
}

.mood-panic .romaji {
  border-color: rgba(255, 111, 137, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 111, 137, 0.08);
}

.mood-happy .romaji,
.mood-shine .romaji,
.mood-pop .romaji,
.mood-lucky .romaji,
.mood-burst .romaji {
  border-color: rgba(158, 255, 179, 0.42);
  box-shadow: 0 0 24px rgba(88, 220, 255, 0.1);
}

@keyframes panicText {
  0% { transform: translateX(-1px); }
  100% { transform: translateX(2px); }
}

@keyframes secretText {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.8; }
}

@keyframes fireText {
  0% { transform: translateY(1px) scale(1); }
  100% { transform: translateY(-2px) scale(1.025); }
}

@keyframes floatText {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes moodFlow {
  0% { transform: translate3d(-24px, -18px, 0); }
  100% { transform: translate3d(24px, 18px, 0); }
}

@keyframes moodJitter {
  0% { transform: translate3d(-3px, 0, 0); }
  100% { transform: translate3d(3px, 0, 0); }
}

@keyframes stageSnap {
  0% { opacity: 0.95; transform: scale(0.98); }
  100% { opacity: 0.48; transform: scale(1); }
}

@keyframes stageRush {
  0% { transform: translate3d(-34px, 0, 0); }
  100% { transform: translate3d(34px, 0, 0); }
}

@keyframes stageJitter {
  0% { transform: translate3d(-4px, 2px, 0); filter: hue-rotate(0deg); }
  100% { transform: translate3d(4px, -2px, 0); filter: hue-rotate(24deg); }
}

@keyframes stagePulse {
  0%, 100% { transform: scale(0.98); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.82; }
}

@keyframes stageRain {
  0% { transform: translate3d(-18px, -24px, 0); }
  100% { transform: translate3d(18px, 24px, 0); }
}

@keyframes stageFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes stageCoins {
  0% { transform: translate3d(0, -12px, 0) rotate(0deg); }
  100% { transform: translate3d(0, 12px, 0) rotate(4deg); }
}

@keyframes stageSweep {
  0% { transform: translateX(-42px); opacity: 0.36; }
  50% { opacity: 0.72; }
  100% { transform: translateX(42px); opacity: 0.36; }
}

@keyframes stageImpact {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.96); }
}

@keyframes stageHunger {
  0%, 100% { transform: scale(0.98); filter: saturate(1); }
  50% { transform: scale(1.04); filter: saturate(1.35); }
}

@keyframes stageFocus {
  0%, 100% { transform: scale(0.98); opacity: 0.52; }
  50% { transform: scale(1.04); opacity: 0.78; }
}

@keyframes stageSecret {
  0%, 100% { opacity: 0.42; filter: blur(0); }
  50% { opacity: 0.66; filter: blur(1px); }
}

@keyframes stageFade {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.58; }
}

@media (prefers-reduced-motion: reduce) {
  .mood-panic .word,
  .mood-secret .word,
  .mood-fire .word,
  .mood-float .word {
    animation: none;
  }

  .play::before,
  .play::after {
    animation: none !important;
  }

  body::after {
    animation: none !important;
  }

  .flash {
    animation: none;
  }
}

.done {
  color: var(--green);
}

.next {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 8px;
}

.rest {
  color: rgba(237, 247, 255, 0.45);
}

.routeHint {
  min-height: 24px;
  margin: -6px 0 0;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.inputWrap {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 14px;
}

.inputWrap span {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

input {
  width: 100%;
  border: 1px solid rgba(237, 247, 255, 0.22);
  border-radius: 8px;
  padding: 18px 20px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 28px;
  outline: none;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(88, 220, 255, 0.13);
}

.message {
  min-height: 28px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.message.good {
  color: var(--green);
}

.message.bad {
  color: var(--red);
}

.result {
  text-align: center;
}

.resultLabel {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(44px, 6vw, 70px);
  line-height: 1;
  word-break: keep-all;
}

#resultText {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.resultStats {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 16px;
}

.resultStats div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(88, 220, 255, 0.22);
  border-radius: 8px;
  background: rgba(2, 7, 14, 0.45);
}

.resultStats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.resultStats strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.sharePreview {
  width: min(620px, 100%);
  min-height: 118px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(158, 255, 179, 0.22);
  border-radius: 8px;
  color: var(--text);
  background: rgba(2, 7, 14, 0.55);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
}

.resultActions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.subButton {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(237, 247, 255, 0.18);
  box-shadow: none;
}

.flash {
  animation: flash 120ms ease;
}

@keyframes flash {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

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

  .game {
    width: min(100vw - 24px, 720px);
    height: auto;
    min-height: calc(100vh - 24px);
    margin: 12px auto;
  }

  .top {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    white-space: normal;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .card {
    padding: 22px;
  }

  .startHero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .startCopy {
    justify-items: center;
    text-align: center;
  }

  .lead {
    max-width: 100%;
    text-align: center;
  }

  .previewLine,
  .previewLine:nth-child(2),
  .previewLine:nth-child(3),
  .previewLine:nth-child(4) {
    min-height: 72px;
    grid-template-columns: 60px 1fr;
    transform: none;
  }

  .previewLine strong {
    font-size: 28px;
  }

  .previewLine em {
    display: none;
  }

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

  .resultStats {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .resultStats div {
    min-height: 64px;
    padding: 10px 12px;
  }

  .resultStats strong {
    margin-top: 5px;
    font-size: 24px;
  }

  h2 {
    font-size: 36px;
  }

  .sharePreview {
    min-height: 104px;
    font-size: 13px;
  }
}
