:root {
  --navy: #1f2d4a;
  --navy-deep: #14213a;
  --navy-soft: #2b3d5d;
  --cream: #fff8e9;
  --paper: #fffdf7;
  --paper-warm: #fff3dc;
  --sky: #bfeeff;
  --sky-deep: #7bd5f7;
  --yellow: #ffd451;
  --yellow-deep: #f1b93d;
  --coral: #ff6e6e;
  --coral-deep: #e74f62;
  --mint: #8ee3c2;
  --mint-deep: #49b99b;
  --ink-soft: #64708a;
  --line: rgba(31, 45, 74, 0.16);
  --shadow-hard: 0 5px 0 var(--navy);
  --ui-font: "YouYuan", "幼圆", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --display-font: "Arial Rounded MT Bold", "Bahnschrift", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --digit-font: "Bahnschrift", "Arial Black", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #101c30;
  overscroll-behavior: none;
}

body {
  font-family: var(--ui-font);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

svg {
  display: block;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

#stage {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #101c30;
  touch-action: none;
  outline: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.world-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 33, 54, 0.16) 0%, transparent 18%, transparent 72%, rgba(20, 31, 48, 0.2) 100%),
    radial-gradient(ellipse at center, transparent 52%, rgba(13, 24, 40, 0.22) 100%);
  mix-blend-mode: multiply;
}

.grain {
  position: absolute;
  inset: -20%;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
}

.hurt-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse at 34% 68%, transparent 32%, rgba(255, 70, 87, 0.35) 100%),
    linear-gradient(180deg, rgba(255, 117, 117, 0.14), rgba(255, 84, 93, 0.08));
}

.hurt-flash.is-on {
  animation: hurtPulse 0.42s ease-out;
}

.launch-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 30% 66%, #fffdf2 0%, #ffe37e 18%, rgba(255, 212, 81, 0) 58%);
}

.launch-flash.is-on {
  animation: launchFlash 0.66s ease-out;
}

/* ============================== HUD ============================== */

.hud {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding:
    calc(15px + env(safe-area-inset-top))
    calc(18px + env(safe-area-inset-right))
    0
    calc(18px + env(safe-area-inset-left));
  pointer-events: none;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.hud.is-visible {
  opacity: 1;
  transform: none;
}

.hud.is-dimmed {
  opacity: 0.45;
  filter: saturate(0.66);
}

.hud-panel {
  pointer-events: auto;
  background: rgba(255, 250, 241, 0.95);
  border: 2px solid rgba(31, 45, 74, 0.92);
  box-shadow:
    0 4px 0 rgba(25, 39, 65, 0.92),
    0 12px 30px rgba(15, 29, 49, 0.18);
}

.mood-panel {
  justify-self: start;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 158px;
  padding: 8px 12px 9px;
  border-radius: 16px;
}

.mood-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 2px;
  line-height: 1;
}

.mood-label {
  font-size: clamp(9px, 1.04vw, 11px);
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.mood-count {
  font-family: var(--digit-font);
  font-size: clamp(10px, 1.2vw, 13px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--navy);
  opacity: 0.72;
}

.hearts {
  display: flex;
  align-items: center;
  gap: clamp(2px, 0.5vw, 5px);
  height: clamp(24px, 3.4vw, 34px);
}

.heart-slot {
  position: relative;
  display: block;
  width: clamp(27px, 3.8vw, 38px);
  height: 100%;
  flex: none;
}

.heart-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 75%;
  transition: opacity 0.24s ease, transform 0.34s cubic-bezier(0.22, 1.4, 0.4, 1), filter 0.24s ease;
}

.heart-live {
  filter: drop-shadow(0 2px 0 rgba(31, 45, 74, 0.14));
}

.heart-lost {
  opacity: 0;
  transform: scale(0.4) rotate(-18deg);
  filter: saturate(0.8);
}

.heart-slot.is-lost .heart-live {
  opacity: 0;
  transform: scale(0.45) rotate(12deg);
}

.heart-slot.is-lost .heart-lost {
  opacity: 0.95;
  transform: scale(0.9) rotate(-4deg);
}

.heart-slot.is-empty .heart-lost {
  opacity: 0.5;
}

.hearts.is-critical .heart-slot.is-full .heart-live {
  animation: heartBeat 0.78s ease-in-out infinite;
}

.hearts.is-critical .heart-slot.is-full:nth-child(2) .heart-live {
  animation-delay: 0.09s;
}

.hearts.is-critical .heart-slot.is-full:nth-child(3) .heart-live {
  animation-delay: 0.18s;
}

.heart-slot.heart-pop .heart-live {
  animation: heartPop 0.36s cubic-bezier(0.22, 1.4, 0.4, 1);
}

.heart-slot.heart-pop .heart-lost {
  animation: heartBreak 0.42s cubic-bezier(0.22, 1.2, 0.4, 1);
}

.score-panel {
  justify-self: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: clamp(154px, 19vw, 236px);
  padding: 6px 20px 7px;
  border-radius: 17px;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(52, 74, 108, 0.96), rgba(27, 42, 67, 0.98)),
    var(--navy);
  border-color: rgba(255, 248, 233, 0.2);
  box-shadow:
    0 4px 0 rgba(11, 22, 38, 0.7),
    0 12px 30px rgba(15, 29, 49, 0.24);
  text-align: center;
}

.score-label {
  font-family: var(--display-font);
  font-size: clamp(8px, 0.92vw, 10px);
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #a8c2d8;
  white-space: nowrap;
}

.score-value {
  font-family: var(--digit-font);
  font-size: clamp(23px, 3vw, 37px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: 0.045em;
  color: var(--yellow);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  font-variant-numeric: tabular-nums;
}

.score-panel.is-pulse .score-value {
  animation: scorePulse 0.22s ease-out;
}

.level-badge.is-popping {
  animation: levelPop 0.5s cubic-bezier(0.22, 1.4, 0.4, 1);
}

.level-badge {
  position: absolute;
  left: 50%;
  bottom: -11px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 12px;
  border: 1.5px solid rgba(31, 45, 74, 0.85);
  border-radius: 999px;
  background: var(--mint);
  color: var(--navy);
  font-size: clamp(8px, 0.95vw, 10px);
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(31, 45, 74, 0.9);
}

.hud-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(7px, 0.8vw, 10px);
  padding-top: 2px;
}

.icon-btn {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: clamp(38px, 4.6vw, 48px);
  height: clamp(38px, 4.6vw, 48px);
  border: 2px solid var(--navy);
  border-radius: 14px;
  background: var(--cream);
  color: var(--navy);
  box-shadow: 0 4px 0 var(--navy), 0 10px 20px rgba(15, 29, 49, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.18s ease;
}

.icon-btn svg {
  width: 46%;
  height: 46%;
}

.icon-btn:active,
.icon-btn.is-pressed {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--navy);
}

.icon-sound-off {
  display: none;
}

.icon-btn.is-muted .icon-sound-on {
  display: none;
}

.icon-btn.is-muted .icon-sound-off {
  display: block;
}

.icon-btn.is-muted {
  background: #ffdcd6;
}

.ride-meter {
  position: absolute;
  z-index: 21;
  top: calc(86px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(300px, 56vw);
  padding: 5px 13px 5px 6px;
  border: 2px solid rgba(255, 247, 230, 0.55);
  border-radius: 999px;
  background: rgba(21, 37, 61, 0.9);
  color: var(--cream);
  box-shadow: 0 4px 0 rgba(9, 19, 34, 0.48), 0 12px 24px rgba(14, 27, 45, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -6px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  pointer-events: none;
}

.ride-meter.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.ride-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 212, 81, 0.16);
}

.ride-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(-6deg);
}

.ride-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ride-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}

.ride-line b {
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.08em;
  color: var(--yellow);
}

.ride-line span {
  font-family: var(--digit-font);
  font-size: clamp(9px, 1.1vw, 11px);
  color: #b9d7e9;
  font-variant-numeric: tabular-nums;
}

.ride-track {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.ride-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--yellow), #ff9e69);
  transition: transform 0.08s linear;
}

/* ============================== TOAST / CONTROLS ============================== */

.game-toast {
  position: absolute;
  z-index: 22;
  top: calc(138px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(480px, 84vw);
  padding: 7px 14px 7px 7px;
  border: 2px solid var(--navy);
  border-radius: 15px;
  background: rgba(255, 250, 241, 0.97);
  box-shadow: 0 4px 0 rgba(31, 45, 74, 0.92), 0 12px 26px rgba(13, 28, 47, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px) scale(0.96);
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.22, 1.2, 0.4, 1), visibility 0.24s;
  pointer-events: none;
}

.game-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.toast-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(31, 45, 74, 0.8);
  border-radius: 11px;
  background: var(--yellow);
  color: var(--navy);
  font-family: var(--display-font);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(31, 45, 74, 0.12);
}

.game-toast[data-tone="mint"] .toast-icon {
  background: var(--mint);
}

.game-toast[data-tone="coral"] .toast-icon {
  background: #ffb3ac;
}

.game-toast[data-tone="sky"] .toast-icon {
  background: var(--sky);
}

.toast-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-copy strong {
  font-size: clamp(12px, 1.35vw, 15px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-copy small {
  font-size: clamp(9px, 1.05vw, 11px);
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gesture-note {
  position: absolute;
  z-index: 23;
  bottom: calc(clamp(16px, 3.2vh, 30px) + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(20, 35, 57, 0.62);
  color: rgba(255, 250, 239, 0.9);
  font-size: clamp(9px, 1.1vw, 12px);
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
  pointer-events: none;
}

.gesture-note.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.gesture-line {
  display: block;
  width: 18px;
  height: 1px;
  background: rgba(255, 250, 239, 0.35);
}

/* ============================== BUTTONS & SCREENS ============================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 clamp(18px, 2.4vw, 28px);
  border: 2.5px solid var(--navy);
  border-radius: 16px;
  color: var(--navy);
  font-family: var(--ui-font);
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 900;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.11s ease, box-shadow 0.11s ease, filter 0.15s ease, background 0.15s ease;
}

.btn svg {
  width: 19px;
  height: 19px;
}

.btn-primary {
  background: linear-gradient(180deg, #ffe580 0%, #ffd04d 100%);
  box-shadow:
    0 6px 0 var(--navy),
    0 13px 24px rgba(16, 30, 50, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.btn-primary:hover {
  filter: brightness(1.035);
}

.btn-primary:active,
.btn-primary.is-pressed {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--navy), 0 4px 9px rgba(16, 30, 50, 0.18);
}

.btn-secondary {
  background: #e6fbf4;
  box-shadow: 0 4px 0 var(--navy), 0 9px 18px rgba(16, 30, 50, 0.14);
}

.btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--navy);
}

.btn-ghost {
  border-style: dashed;
  border-width: 2px;
  border-color: rgba(31, 45, 74, 0.44);
  background: rgba(255, 255, 255, 0.25);
  color: var(--navy);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.55);
}

.btn-ghost:active {
  transform: translateY(1px);
}

.btn-arrow {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cream);
  transition: transform 0.2s cubic-bezier(0.22, 1.3, 0.4, 1);
}

.btn-arrow svg {
  width: 17px;
  height: 17px;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px) rotate(-4deg);
}

.btn-shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.btn-shine::after {
  content: "";
  position: absolute;
  top: -30%;
  left: -40%;
  width: 34%;
  height: 160%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: buttonShine 4.2s ease-in-out infinite;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1.5px solid rgba(31, 45, 74, 0.32);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--navy);
  font-family: var(--digit-font);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================== START SCREEN ============================== */

.start-screen {
  z-index: 40;
  overflow: hidden;
}

.start-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 73% 32%, rgba(255, 255, 255, 0.16), transparent 35%),
    linear-gradient(100deg, rgba(12, 25, 44, 0.66) 0%, rgba(12, 25, 44, 0.43) 36%, rgba(12, 25, 44, 0.06) 68%, rgba(12, 25, 44, 0.12) 100%),
    linear-gradient(0deg, rgba(12, 25, 44, 0.42), transparent 38%);
}

.start-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  align-items: center;
  gap: clamp(18px, 3vw, 50px);
  width: 100%;
  height: 100%;
  max-width: 1780px;
  margin: 0 auto;
  padding:
    clamp(18px, 4.4vh, 54px)
    clamp(24px, 6.2vw, 100px)
    clamp(36px, 5.6vh, 66px);
}

.start-card {
  position: relative;
  justify-self: start;
  width: min(635px, 100%);
  padding: clamp(17px, 3.5vh, 34px) clamp(19px, 3.1vw, 38px) clamp(17px, 3.1vh, 30px);
  border: 3px solid var(--navy);
  border-radius: 29px;
  background:
    radial-gradient(rgba(31, 45, 74, 0.05) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 234, 0.98));
  background-size: 16px 16px, auto;
  box-shadow:
    12px 14px 0 rgba(16, 30, 50, 0.44),
    0 34px 64px rgba(8, 18, 33, 0.35);
  transform: rotate(-1.2deg);
  animation: cardArrive 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.start-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(31, 45, 74, 0.12);
  border-radius: 21px;
  pointer-events: none;
}

.tape {
  position: absolute;
  z-index: 2;
  width: clamp(52px, 6vw, 80px);
  height: 19px;
  background: rgba(255, 212, 81, 0.7);
  border: 1px solid rgba(31, 45, 74, 0.18);
  box-shadow: 0 2px 4px rgba(31, 45, 74, 0.12);
  opacity: 0.9;
}

.tape-left {
  top: -8px;
  left: 9%;
  transform: rotate(-4deg);
}

.tape-right {
  top: -7px;
  right: 12%;
  transform: rotate(3deg);
  background: rgba(142, 227, 194, 0.68);
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 clamp(5px, 1.3vh, 11px);
  color: var(--ink-soft);
  font-family: var(--display-font);
  font-size: clamp(9px, 1vw, 11px);
  font-weight: 900;
  letter-spacing: 0.15em;
  line-height: 1.3;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint-deep);
  box-shadow: 0 0 0 3px rgba(73, 185, 155, 0.14);
  animation: dotBlink 2.7s ease-in-out infinite;
}

.eyebrow-cn {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(31, 45, 74, 0.08);
  color: var(--navy);
  font-family: var(--ui-font);
  font-size: clamp(8px, 0.95vw, 10px);
  letter-spacing: 0.06em;
}

.game-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0.02em;
  margin: 0;
  color: var(--navy);
  font-family: var(--display-font);
  font-size: clamp(42px, min(8vw, 13.8vh), 98px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.095em;
  white-space: nowrap;
}

.game-title > span {
  display: inline-block;
}

.title-wyf {
  color: #a9e8ff;
  -webkit-text-stroke: 2px var(--navy);
  text-shadow:
    0 3px 0 var(--navy),
    0 6px 0 rgba(31, 45, 74, 0.22);
  transform: rotate(-4deg) translateY(-0.02em);
}

.title-cn {
  color: var(--navy);
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.7);
}

.title-cdut {
  color: var(--yellow);
  -webkit-text-stroke: 2px var(--navy);
  text-shadow:
    0 3px 0 var(--navy),
    0 6px 0 rgba(31, 45, 74, 0.22);
  transform: rotate(2deg) translateY(0.02em);
}

.title-spark {
  align-self: flex-start;
  margin-left: 0.12em;
  color: var(--coral);
  font-family: var(--ui-font);
  font-size: 0.24em;
  -webkit-text-stroke: 0;
  text-shadow: none;
  transform: translateY(-0.1em) rotate(12deg);
  animation: sparkTwinkle 2.8s ease-in-out infinite;
}

.tagline {
  position: relative;
  z-index: 1;
  margin: clamp(6px, 1.2vh, 10px) 0 0;
  color: #4f5f7b;
  font-size: clamp(12px, 1.3vw, 16px);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.rule-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 0.8vw, 10px);
  margin: clamp(10px, 2.1vh, 18px) 0 clamp(12px, 2.4vh, 21px);
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: clamp(44px, 6.4vh, 58px);
  padding: 5px 7px;
  border: 1.5px solid rgba(31, 45, 74, 0.17);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
}

.rule-art {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(29px, 4.2vh, 42px);
  height: clamp(29px, 4.2vh, 42px);
}

.rule-art img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 1px rgba(31, 45, 74, 0.12));
}

.rule-food .rule-art img {
  transform: rotate(-5deg);
}

.rule-bike .rule-art img {
  transform: rotate(-3deg) scale(1.06);
}

.rule-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.1;
}

.rule-copy small {
  color: var(--ink-soft);
  font-size: clamp(9px, 0.95vw, 11px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.rule-copy b {
  color: var(--navy);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 900;
  white-space: nowrap;
}

.start-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-width: clamp(196px, 19vw, 244px);
  min-height: clamp(48px, 6.4vh, 61px);
  padding: 0 15px 0 26px;
  font-size: clamp(16px, 1.65vw, 20px);
  border-radius: 18px;
  overflow: hidden;
  animation: ctaBreathe 3.2s ease-in-out infinite;
}

.start-btn .btn-label {
  position: relative;
  z-index: 1;
}

.start-btn .btn-arrow {
  position: relative;
  z-index: 1;
  width: clamp(29px, 3.4vh, 35px);
  height: clamp(29px, 3.4vh, 35px);
}

.start-hints {
  position: relative;
  z-index: 1;
  margin: clamp(10px, 1.8vh, 16px) 0 0;
  min-height: 28px;
}

.hint {
  margin: 0;
  color: rgba(31, 45, 74, 0.62);
  font-size: clamp(10px, 1.02vw, 12px);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.55;
}

.hint kbd {
  margin: 0 1px;
  vertical-align: 1px;
}

.hint-touch {
  display: none;
}

.hint-extra {
  margin-top: 2px;
  color: rgba(31, 45, 74, 0.42);
  font-size: clamp(8px, 0.9vw, 10px);
}

.tap-glyph {
  display: inline-block;
  font-size: 1.35em;
  transform: rotate(-14deg);
  line-height: 0.5;
}

.start-footer {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding:
    0
    calc(clamp(24px, 4vw, 44px) + env(safe-area-inset-right))
    calc(13px + env(safe-area-inset-bottom))
    calc(clamp(24px, 4vw, 44px) + env(safe-area-inset-left));
  color: rgba(255, 250, 241, 0.58);
  font-family: var(--display-font);
  font-size: clamp(8px, 0.9vw, 10px);
  font-weight: 700;
  letter-spacing: 0.13em;
  pointer-events: none;
}

.best-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 250, 241, 0.78);
  white-space: nowrap;
}

.best-label b {
  color: var(--yellow);
  font-family: var(--digit-font);
  font-size: 1.4em;
  letter-spacing: 0.03em;
}

/* start art */
.start-art {
  position: relative;
  align-self: stretch;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 600px;
  min-height: 0;
  pointer-events: none;
}

.hero-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(84%, 470px);
  aspect-ratio: 1;
  transform: translate(-50%, -49%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(235, 252, 255, 0.8) 0%, rgba(188, 236, 255, 0.44) 36%, rgba(167, 226, 250, 0.06) 69%, transparent 72%);
  filter: blur(2px);
  animation: haloBreathe 5.2s ease-in-out infinite;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1.5px dashed rgba(255, 250, 241, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-one {
  width: min(79%, 450px);
  aspect-ratio: 1;
  animation: orbitSpin 34s linear infinite;
}

.orbit-two {
  width: min(62%, 350px);
  aspect-ratio: 1;
  border-color: rgba(255, 212, 81, 0.3);
  animation: orbitSpin 22s linear infinite reverse;
}

.orbit-one::after,
.orbit-two::after {
  content: "";
  position: absolute;
  top: 8%;
  right: 11%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255, 212, 81, 0.16);
}

.orbit-two::after {
  top: auto;
  right: auto;
  bottom: 8%;
  left: 16%;
  width: 7px;
  height: 7px;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(142, 227, 194, 0.14);
}

.start-hero {
  position: relative;
  z-index: 2;
  height: clamp(230px, 62vh, 545px);
  width: auto;
  max-width: 88%;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 22px rgba(15, 29, 49, 0.24))
    drop-shadow(0 2px 0 rgba(15, 29, 49, 0.1));
  transform-origin: 50% 94%;
  animation: heroBob 4.4s ease-in-out infinite;
}

.hero-shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: clamp(4%, 6vh, 9%);
  width: min(48%, 260px);
  height: clamp(16px, 3vh, 28px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(15, 29, 49, 0.24);
  filter: blur(8px);
  animation: shadowBreathe 4.4s ease-in-out infinite;
}

.hero-dust {
  position: absolute;
  z-index: 1;
  bottom: 7.8%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 250, 239, 0.8);
  opacity: 0;
}

.dust-a {
  left: 35%;
  animation: dustPuff 3.2s ease-out infinite;
}

.dust-b {
  left: 47%;
  width: 5px;
  height: 5px;
  animation: dustPuff 3.2s 0.18s ease-out infinite;
}

.dust-c {
  left: 58%;
  width: 11px;
  height: 11px;
  animation: dustPuff 3.2s 0.34s ease-out infinite;
}

.art-spark {
  position: absolute;
  z-index: 3;
  color: var(--yellow);
  font-size: clamp(16px, 2.4vw, 28px);
  text-shadow: 0 2px 0 rgba(31, 45, 74, 0.2);
  animation: sparkTwinkle 3.1s ease-in-out infinite;
}

.art-spark-a {
  top: 13%;
  right: 12%;
}

.art-spark-b {
  top: 31%;
  left: 5%;
  color: #ff9c99;
  font-size: clamp(10px, 1.5vw, 18px);
  animation-delay: 1.1s;
}

.sticker {
  position: absolute;
  z-index: 4;
  border: 2px solid var(--navy);
  box-shadow: 0 4px 0 rgba(31, 45, 74, 0.9), 0 11px 20px rgba(15, 29, 49, 0.16);
}

.sticker-note {
  left: 0;
  bottom: 18%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 13px 8px;
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: clamp(8px, 0.95vw, 10px);
  font-weight: 700;
  letter-spacing: 0.05em;
  transform: rotate(-5deg);
  animation: stickerFloat 5s ease-in-out infinite;
}

.sticker-note b {
  color: var(--navy);
  font-size: 1.32em;
  letter-spacing: 0.03em;
}

.sticker-note i {
  width: 28px;
  height: 3px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--yellow);
}

.sticker-hearts {
  top: 12%;
  left: 1%;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 6px 6px;
  border-radius: 13px;
  background: rgba(255, 250, 241, 0.96);
  transform: rotate(4deg);
  animation: stickerFloat 4.2s 0.4s ease-in-out infinite;
}

.sticker-hearts img {
  width: clamp(24px, 3.2vh, 34px);
  height: auto;
}

.sticker-hearts span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.sticker-hearts b {
  color: var(--navy);
  font-family: var(--digit-font);
  font-size: clamp(12px, 1.5vw, 17px);
  letter-spacing: 0.02em;
}

.sticker-hearts small {
  color: var(--ink-soft);
  font-size: clamp(7px, 0.8vw, 9px);
  font-weight: 700;
  white-space: nowrap;
}

.go-badge {
  position: absolute;
  z-index: 4;
  right: 4%;
  bottom: 14%;
  display: grid;
  place-items: center;
  width: clamp(51px, 7.3vh, 76px);
  aspect-ratio: 1;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  box-shadow: 0 4px 0 var(--navy), 0 12px 22px rgba(15, 29, 49, 0.2);
  transform: rotate(9deg);
  animation: badgeWiggle 4.4s ease-in-out infinite;
}

.go-badge span {
  font-family: var(--digit-font);
  font-size: clamp(18px, 2.8vh, 27px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

.go-badge small {
  margin-top: -7px;
  font-family: var(--display-font);
  font-size: 0.35em;
  font-weight: 900;
  letter-spacing: 0.2em;
  opacity: 0.45;
}

.float-heart {
  position: absolute;
  z-index: 3;
  color: var(--coral);
  font-family: var(--display-font);
  font-size: clamp(13px, 1.8vw, 23px);
  text-shadow: 0 2px 0 rgba(31, 45, 74, 0.15);
  animation: heartFloat 5.2s ease-in-out infinite;
}

.float-a {
  top: 27%;
  right: 2%;
}

.float-b {
  top: 44%;
  left: 0;
  color: #ffa39d;
  font-size: 0.75em;
  animation-delay: 0.8s;
}

.float-c {
  top: 36%;
  right: 12%;
  color: var(--yellow-deep);
  font-size: 0.55em;
  animation-delay: 1.6s;
}

/* ============================== MODAL SCREENS ============================== */

.modal-screen {
  z-index: 45;
  display: grid;
  place-items: center;
  padding:
    calc(14px + env(safe-area-inset-top))
    calc(14px + env(safe-area-inset-right))
    calc(14px + env(safe-area-inset-bottom))
    calc(14px + env(safe-area-inset-left));
}

.screen-dim {
  position: absolute;
  inset: 0;
  background: rgba(10, 21, 38, 0.5);
  backdrop-filter: blur(6px) saturate(0.82);
  -webkit-backdrop-filter: blur(6px) saturate(0.82);
}

.screen.is-active .screen-dim {
  animation: dimIn 0.3s ease-out both;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(88vw, 600px);
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  scrollbar-width: thin;
  border: 3px solid var(--navy);
  border-radius: 27px;
  background:
    radial-gradient(rgba(31, 45, 74, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #fffdf6, #fff6e5);
  background-size: 17px 17px, auto;
  box-shadow:
    10px 12px 0 rgba(13, 26, 44, 0.55),
    0 30px 70px rgba(5, 14, 26, 0.38);
  color: var(--navy);
  padding: clamp(17px, 3.2vh, 33px) clamp(18px, 3.1vw, 36px);
}

.screen.is-active .modal-card {
  animation: cardPop 0.45s cubic-bezier(0.22, 1.1, 0.36, 1) both;
}

.modal-kicker {
  margin: 0 0 5px;
  color: var(--coral-deep);
  font-family: var(--display-font);
  font-size: clamp(8px, 0.96vw, 10px);
  font-weight: 900;
  letter-spacing: 0.16em;
}

.modal-card h2 {
  margin: 0;
  color: var(--navy);
  font-family: var(--display-font);
  font-size: clamp(23px, 3.2vh, 36px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.modal-sub {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: clamp(10px, 1.15vw, 13px);
  font-weight: 700;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: clamp(12px, 2.2vh, 22px);
}

.modal-actions > .btn {
  width: 100%;
}

.modal-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.modal-row .btn {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  font-size: clamp(11px, 1.2vw, 13px);
}

.modal-tip {
  margin: clamp(9px, 1.5vh, 15px) 0 0;
  color: rgba(31, 45, 74, 0.42);
  font-size: clamp(8px, 0.9vw, 10px);
  font-weight: 700;
  text-align: center;
}

.pause-card {
  width: min(86vw, 500px);
}

.pause-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: clamp(12px, 2vh, 20px);
}

.pause-summary div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1.5px solid rgba(31, 45, 74, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.52);
}

.pause-summary span {
  color: var(--ink-soft);
  font-size: clamp(7px, 0.8vw, 9px);
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pause-summary b {
  font-family: var(--digit-font);
  font-size: clamp(16px, 2.4vh, 23px);
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

/* game over */
.over-card {
  width: min(91vw, 648px);
  padding-top: clamp(14px, 2.5vh, 27px);
}

.over-head {
  display: flex;
  align-items: center;
  gap: clamp(11px, 1.7vw, 20px);
  padding-bottom: clamp(9px, 1.5vh, 14px);
  border-bottom: 1.5px dashed rgba(31, 45, 74, 0.17);
}

.broken-art {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(70px, 15vh, 128px);
  height: clamp(62px, 13vh, 105px);
}

.broken-art img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(31, 45, 74, 0.18));
  transform: rotate(-4deg);
  animation: brokenFloat 3.6s ease-in-out infinite;
}

.broken-halo {
  position: absolute;
  width: 92%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 143, 138, 0.3), transparent 68%);
  animation: haloBreathe 3.6s ease-in-out infinite;
}

.over-copy {
  min-width: 0;
}

.over-copy .modal-kicker {
  color: var(--coral-deep);
}

.over-copy h2 {
  font-size: clamp(24px, 3.7vh, 40px);
}

.final-score-block {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 14px;
  margin: clamp(9px, 1.6vh, 15px) 0;
  padding: clamp(8px, 1.4vh, 13px) clamp(11px, 1.7vw, 17px);
  border: 2px solid rgba(31, 45, 74, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.62);
}

.final-score-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.final-score-main span {
  flex: none;
  color: var(--ink-soft);
  font-size: clamp(9px, 1vw, 11px);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.final-score-main strong {
  color: var(--navy);
  font-family: var(--digit-font);
  font-size: clamp(28px, 5.4vh, 50px);
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 0.92;
  font-variant-numeric: tabular-nums;
}

.final-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 7px;
  color: var(--ink-soft);
  font-family: var(--display-font);
  font-size: clamp(8px, 0.93vw, 10px);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: right;
}

.final-meta > span:not(.new-best) {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(31, 45, 74, 0.07);
  white-space: nowrap;
}

.new-best {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 9px;
  box-shadow: 0 2px 0 var(--navy);
  animation: badgeBounce 1.5s ease-in-out infinite;
}

.new-best[hidden] {
  display: none;
}

.best-line {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: rgba(31, 45, 74, 0.48);
  font-size: clamp(8px, 0.9vw, 10px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.best-line b {
  color: var(--navy);
  font-family: var(--digit-font);
  font-size: 1.2em;
}

.healing-note {
  position: relative;
  margin: 0 0 clamp(9px, 1.6vh, 15px);
  padding: clamp(8px, 1.4vh, 13px) clamp(12px, 1.8vw, 18px);
  border: 1.5px solid rgba(255, 110, 110, 0.26);
  border-left: 4px solid #ff8e88;
  border-radius: 10px 14px 14px 10px;
  background: linear-gradient(100deg, rgba(255, 240, 229, 0.96), rgba(255, 250, 241, 0.8));
  color: #5d5060;
  font-size: clamp(13px, 1.65vw, 17px);
  font-weight: 700;
  line-height: 1.58;
  letter-spacing: 0.015em;
}

.healing-note p {
  margin: 0;
  padding-left: clamp(8px, 1vw, 13px);
}

.healing-note span:not(.quote-mark):not(.quote-spark) {
  color: var(--coral-deep);
  font-weight: 900;
}

.quote-mark {
  position: absolute;
  top: 1px;
  left: 6px;
  color: rgba(255, 110, 110, 0.38);
  font-family: Georgia, serif;
  font-size: clamp(27px, 4.2vh, 39px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.quote-spark {
  position: absolute;
  top: 50%;
  right: 9px;
  color: rgba(255, 110, 110, 0.36);
  font-size: 11px;
  transform: translateY(-50%) rotate(11deg);
}

.over-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.over-actions .btn-primary {
  flex: 1;
}

.over-actions .btn-ghost {
  flex: none;
  min-height: 44px;
}

/* ============================== LOADING / ROTATE ============================== */

.loading-screen {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(56, 89, 127, 0.52), transparent 43%),
    linear-gradient(160deg, #172942, #101d30 70%);
  color: var(--cream);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.loading-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    radial-gradient(rgba(255, 235, 186, 0.45) 1px, transparent 1px),
    radial-gradient(rgba(146, 220, 247, 0.34) 1px, transparent 1px);
  background-position: 0 0, 22px 22px;
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 42%, #000, transparent 68%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000, transparent 68%);
}

.loading-screen.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(84vw, 360px);
  text-align: center;
}

.loading-heart {
  position: relative;
  width: clamp(44px, 6.6vh, 62px);
  aspect-ratio: 1;
  margin-bottom: clamp(20px, 3.4vh, 34px);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.24));
  animation: loadingBeat 1.1s ease-in-out infinite;
}

.loading-heart span {
  position: absolute;
  top: 12%;
  width: 62%;
  height: 62%;
  border-radius: 50% 50% 4% 50%;
  background: linear-gradient(135deg, #ff8f84, #ef5264);
}

.loading-heart span:first-child {
  left: 0;
  transform: rotate(9deg);
}

.loading-heart span:last-child {
  right: 0;
  transform: rotate(81deg);
}

.loading-heart::after {
  content: "";
  position: absolute;
  top: 9%;
  left: 21%;
  width: 22%;
  height: 13%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(-35deg);
}

.loading-eyebrow {
  justify-content: center;
  margin-bottom: 6px;
  color: rgba(188, 236, 255, 0.7);
}

.loading-inner h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(23px, 3.1vw, 34px);
  letter-spacing: -0.045em;
  color: var(--cream);
}

.loading-bar {
  width: 100%;
  height: 7px;
  margin-top: clamp(20px, 3.4vh, 33px);
  border-radius: 999px;
  background: rgba(255, 248, 234, 0.16);
  overflow: hidden;
}

.loading-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--yellow), #ffeec2);
  transition: transform 0.2s ease;
}

.loading-text {
  margin: 11px 0 0;
  color: rgba(255, 250, 239, 0.52);
  font-size: clamp(9px, 1vw, 11px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.rotate-screen {
  display: none;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #13233c;
  color: var(--cream);
  font-size: 16px;
  text-align: center;
}

/* ============================== KEYFRAMES ============================== */

@keyframes hurtPulse {
  0% { opacity: 0; }
  16% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes launchFlash {
  0% { opacity: 0; transform: scale(0.7); }
  22% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.35); }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.16); }
  28% { transform: scale(0.98); }
  42% { transform: scale(1.08); }
}

@keyframes scorePulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); color: #fff4c9; }
  100% { transform: scale(1); }
}

@keyframes heartPop {
  0% { transform: scale(0.68) rotate(-9deg); }
  48% { transform: scale(1.18) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes heartBreak {
  0% { transform: scale(0.3) rotate(-22deg); opacity: 0; }
  52% { transform: scale(1.12) rotate(5deg); opacity: 1; }
  100% { transform: scale(0.9) rotate(-4deg); opacity: 0.95; }
}

@keyframes levelPop {
  0% { transform: translateX(-50%) scale(0.72); }
  45% { transform: translateX(-50%) scale(1.12) rotate(-2deg); }
  100% { transform: translateX(-50%) scale(1) rotate(0deg); }
}

@keyframes cardArrive {
  from { opacity: 0; transform: translateY(20px) rotate(-2.8deg) scale(0.97); }
  to { opacity: 1; transform: rotate(-1.2deg) scale(1); }
}

@keyframes cardPop {
  from { opacity: 0; transform: translateY(18px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes heroBob {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-11px) rotate(0.7deg); }
}

@keyframes shadowBreathe {
  0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 0.6; }
  50% { transform: translateX(-50%) scaleX(0.83); opacity: 0.42; }
}

@keyframes haloBreathe {
  0%, 100% { transform: translate(-50%, -49%) scale(0.98); opacity: 0.82; }
  50% { transform: translate(-50%, -49%) scale(1.045); opacity: 1; }
}

@keyframes orbitSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes stickerFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

@keyframes badgeWiggle {
  0%, 100% { transform: rotate(9deg) scale(1); }
  50% { transform: rotate(4deg) scale(1.04); }
}

@keyframes heartFloat {
  0%, 100% { transform: translateY(0) rotate(-7deg); opacity: 0.55; }
  45% { transform: translateY(-15px) rotate(5deg); opacity: 1; }
}

@keyframes sparkTwinkle {
  0%, 100% { transform: scale(0.85) rotate(0deg); opacity: 0.55; }
  50% { transform: scale(1.15) rotate(15deg); opacity: 1; }
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(73, 185, 155, 0.14); }
  50% { opacity: 0.6; box-shadow: 0 0 0 5px rgba(73, 185, 155, 0.06); }
}

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

@keyframes buttonShine {
  0%, 68% { left: -45%; opacity: 0; }
  72% { opacity: 0.7; }
  86%, 100% { left: 130%; opacity: 0; }
}

@keyframes loadingBeat {
  0%, 100% { transform: scale(1); }
  16% { transform: scale(1.12); }
  30% { transform: scale(0.98); }
  46% { transform: scale(1.05); }
}

@keyframes brokenFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes badgeBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-2px) rotate(1deg); }
}

@keyframes dustPuff {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  24% { opacity: 0.42; }
  100% { opacity: 0; transform: translate(-28px, -12px) scale(1.4); }
}

/* ============================== RESPONSIVE ============================== */

@media (hover: none), (pointer: coarse) {
  .hint-desktop { display: none; }
  .hint-touch { display: block; }
}

@media (max-height: 620px) {
  .start-grid {
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 24px;
  }

  .start-card {
    padding: 15px 20px 14px;
    border-radius: 23px;
    box-shadow:
      8px 9px 0 rgba(16, 30, 50, 0.44),
      0 24px 44px rgba(8, 18, 33, 0.3);
  }

  .rule-strip {
    margin-top: 9px;
    margin-bottom: 11px;
  }

  .rule-item {
    min-height: 39px;
    padding: 4px 6px;
  }

  .rule-art {
    width: 29px;
    height: 29px;
  }

  .start-hints {
    margin-top: 8px;
  }

  .hint-extra {
    display: none;
  }

  .start-footer {
    padding-bottom: 6px;
    font-size: 8px;
  }

  .start-hero {
    height: clamp(200px, 58vh, 390px);
  }

  .sticker-note {
    bottom: 13%;
    padding: 7px 10px 6px;
  }

  .go-badge {
    right: 1%;
    bottom: 10%;
  }

  .sticker-hearts {
    top: 8%;
  }

  .start-art .orbit-two {
    display: none;
  }

  .modal-card {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .over-head {
    gap: 10px;
    padding-bottom: 7px;
  }

  .broken-art {
    width: clamp(65px, 14vh, 96px);
    height: clamp(55px, 12vh, 85px);
  }

  .final-score-block {
    margin: 7px 0;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .healing-note {
    margin-bottom: 7px;
    padding-top: 6px;
    padding-bottom: 6px;
    line-height: 1.48;
  }

  .modal-actions {
    margin-top: 9px;
    gap: 7px;
  }

  .modal-row .btn {
    min-height: 38px;
  }

  .modal-tip {
    display: none;
  }
}

@media (max-height: 450px) {
  .start-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    padding-top: 9px;
    padding-bottom: 12px;
    gap: 10px;
  }

  .start-card {
    padding: 11px 15px 10px;
    border-width: 2px;
    border-radius: 19px;
    box-shadow: 6px 7px 0 rgba(16, 30, 50, 0.4);
  }

  .start-card::after {
    inset: 5px;
    border-radius: 14px;
  }

  .tape {
    height: 14px;
    width: 48px;
    top: -6px;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 8.5px;
    gap: 4px;
  }

  .eyebrow-cn {
    height: 15px;
    padding: 0 6px;
    font-size: 8.5px;
  }

  .eyebrow-dot {
    width: 5px;
    height: 5px;
  }

  .game-title {
    font-size: clamp(39px, min(7.5vw, 13vh), 62px);
  }

  .tagline {
    margin-top: 3px;
    font-size: 11px;
  }

  .rule-strip {
    gap: 5px;
    margin-top: 6px;
    margin-bottom: 7px;
  }

  .rule-item {
    min-height: 33px;
    gap: 3px;
    padding: 3px 4px;
    border-radius: 9px;
  }

  .rule-art {
    width: 24px;
    height: 24px;
  }

  .rule-copy small {
    font-size: 8px;
  }

  .rule-copy b {
    font-size: 9.5px;
  }

  .start-btn {
    min-width: 178px;
    min-height: 41px;
    border-radius: 13px;
    font-size: 15px;
    padding-left: 20px;
    padding-right: 11px;
  }

  .start-btn .btn-arrow {
    width: 25px;
    height: 25px;
  }

  .start-btn .btn-arrow svg {
    width: 14px;
    height: 14px;
  }

  .start-hints {
    margin-top: 5px;
    min-height: 16px;
  }

  .hint {
    font-size: 9.5px;
    line-height: 1.35;
  }

  .hint-touch {
    color: rgba(31, 45, 74, 0.74);
    font-size: 10px;
    font-weight: 800;
  }

  .hint kbd {
    min-width: 16px;
    height: 16px;
    font-size: 8px;
    border-bottom-width: 2px;
  }

  .start-footer {
    display: none;
  }

  .start-hero {
    height: clamp(182px, 62vh, 280px);
  }

  .hero-halo {
    width: min(86%, 330px);
  }

  .orbit-one {
    width: min(82%, 320px);
  }

  .orbit-two {
    display: none;
  }

  .sticker-note {
    left: -1%;
    bottom: 10%;
    padding: 5px 8px;
    font-size: 7px;
  }

  .sticker-hearts {
    top: 3%;
    left: -3%;
    padding: 4px 7px 4px 4px;
  }

  .sticker-hearts img {
    width: 21px;
  }

  .sticker-hearts b {
    font-size: 11px;
  }

  .sticker-hearts small {
    font-size: 6px;
  }

  .go-badge {
    right: -2%;
    bottom: 7%;
    width: 46px;
  }

  .go-badge span {
    font-size: 16px;
  }

  .go-badge small {
    margin-top: -4px;
  }

  .float-heart {
    font-size: 12px;
  }

  .start-art .art-spark {
    font-size: 12px;
  }

  .hud {
    padding-top: calc(8px + env(safe-area-inset-top));
    gap: 7px;
  }

  .mood-panel {
    min-width: 140px;
    padding: 6px 9px;
  }

  .mood-label,
  .mood-count {
    font-size: 9px;
  }

  .hearts {
    height: 22px;
  }

  .heart-slot {
    width: 24px;
  }

  .score-panel {
    min-width: 132px;
    padding: 5px 15px 6px;
  }

  .score-label {
    font-size: 7px;
  }

  .score-value {
    font-size: 24px;
  }

  .level-badge {
    height: 17px;
    bottom: -9px;
    font-size: 8px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .ride-meter {
    top: calc(70px + env(safe-area-inset-top));
    width: min(262px, 54vw);
    padding: 4px 10px 4px 5px;
  }

  .ride-icon {
    width: 27px;
    height: 27px;
  }

  .game-toast {
    top: calc(112px + env(safe-area-inset-top));
    padding: 5px 11px 5px 5px;
  }

  .toast-icon {
    width: 31px;
    height: 31px;
    border-radius: 9px;
    font-size: 17px;
  }

  .toast-copy strong {
    font-size: 12px;
  }

  .toast-copy small {
    font-size: 9px;
  }

  .gesture-note {
    bottom: calc(14px + env(safe-area-inset-bottom));
    font-size: 9px;
    padding: 5px 10px;
  }

  .modal-card {
    width: min(94vw, 610px);
    max-height: calc(100dvh - 12px);
    padding: 11px 16px 12px;
    border-width: 2px;
    border-radius: 19px;
    box-shadow: 6px 7px 0 rgba(13, 26, 44, 0.5);
  }

  .modal-kicker {
    font-size: 8px;
    margin-bottom: 3px;
  }

  .over-card {
    width: min(94vw, 670px);
  }

  .over-head {
    gap: 9px;
    padding-bottom: 5px;
  }

  .broken-art {
    width: 59px;
    height: 52px;
  }

  .modal-card h2 {
    font-size: clamp(21px, 3.4vh, 27px);
  }

  .over-copy h2 {
    font-size: clamp(22px, 3.5vh, 28px);
  }

  .modal-sub {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.3;
  }

  .final-score-block {
    margin: 5px 0;
    padding: 5px 10px;
    border-radius: 11px;
  }

  .final-score-main strong {
    font-size: 29px;
  }

  .final-score-main span {
    font-size: 8px;
  }

  .final-meta {
    gap: 3px 5px;
    font-size: 7px;
  }

  .final-meta > span:not(.new-best) {
    height: 16px;
    padding: 0 5px;
  }

  .new-best {
    height: 17px;
    font-size: 7px;
  }

  .best-line {
    margin-top: 2px;
    font-size: 7px;
  }

  .healing-note {
    padding: 6px 12px 6px 10px;
    border-radius: 8px 10px 10px 8px;
    font-size: 12.5px;
    line-height: 1.46;
  }

  .healing-note p {
    padding-left: 8px;
  }

  .quote-mark {
    top: -1px;
    left: 3px;
    font-size: 23px;
  }

  .quote-spark {
    display: none;
  }

  .over-actions {
    gap: 7px;
  }

  .over-actions .btn {
    min-height: 44px;
    border-width: 2px;
    border-radius: 11px;
    font-size: 13px;
    padding: 0 12px;
  }

  .over-actions .btn-primary {
    box-shadow: 0 4px 0 var(--navy);
  }

  .over-actions .btn-arrow {
    width: 23px;
    height: 23px;
  }

  .over-actions .btn-arrow svg {
    width: 13px;
    height: 13px;
  }

  .pause-summary {
    margin-top: 8px;
    gap: 5px;
  }

  .pause-summary div {
    padding: 5px 7px;
  }

  .pause-summary span {
    font-size: 7px;
  }

  .pause-summary b {
    font-size: 16px;
  }

  .modal-actions {
    margin-top: 7px;
    gap: 6px;
  }

  .modal-actions .btn {
    min-height: 44px;
    border-width: 2px;
    border-radius: 11px;
    font-size: 12px;
  }

  .modal-row .btn {
    min-height: 40px;
    font-size: 10px;
  }

  .modal-tip {
    display: none;
  }
}

@media (max-width: 900px) {
  .start-grid {
    padding-left: clamp(16px, 4vw, 36px);
    padding-right: clamp(16px, 3vw, 30px);
  }

  .start-card {
    width: 100%;
  }

  .start-art {
    max-width: 430px;
  }

  .rule-copy b {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .start-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    gap: 8px;
    padding-left: 14px;
    padding-right: 10px;
  }

  .start-card {
    border-radius: 20px;
    box-shadow: 7px 8px 0 rgba(16, 30, 50, 0.4);
  }

  .game-title {
    letter-spacing: -0.1em;
  }

  .game-title > span {
    -webkit-text-stroke-width: 1.5px;
  }

  .start-art .sticker-note,
  .start-art .sticker-hearts {
    display: none;
  }

  .start-hero {
    max-width: 100%;
  }

  .over-card {
    width: min(94vw, 600px);
  }

  .final-score-block {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .final-meta {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .start-grid {
    grid-template-columns: 1fr;
    padding-left: 12px;
    padding-right: 12px;
  }

  .start-card {
    width: 100%;
  }

  .start-art {
    display: none;
  }

  .start-footer {
    display: none;
  }

  .mood-panel {
    min-width: 0;
  }

  .mood-copy {
    gap: 7px;
  }

  .hud {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  }

  .score-panel {
    justify-self: center;
  }

  .score-label {
    letter-spacing: 0.08em;
  }

  .over-head {
    align-items: flex-start;
  }

  .healing-note br {
    display: none;
  }
}

@media (orientation: portrait) and (pointer: coarse) {
  .rotate-screen {
    position: absolute;
    z-index: 80;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    background:
      radial-gradient(circle at 50% 38%, rgba(80, 116, 154, 0.45), transparent 43%),
      linear-gradient(160deg, #172942, #0e1b2e 72%);
    color: var(--cream);
    text-align: center;
  }

  .rotate-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image: radial-gradient(rgba(255, 235, 186, 0.4) 1px, transparent 1px);
    background-size: 30px 30px;
  }

  .rotate-phone {
    position: relative;
    width: 58px;
    height: 102px;
    margin-bottom: 22px;
    border: 2.5px solid var(--cream);
    border-radius: 14px;
    transform: rotate(0deg);
    animation: phoneRotate 2.8s ease-in-out infinite;
    box-shadow: 0 0 0 6px rgba(255, 248, 233, 0.06);
  }

  .rotate-phone span {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 15px;
    height: 4px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 248, 233, 0.6);
  }

  .rotate-phone i {
    position: absolute;
    right: -18px;
    bottom: -17px;
    width: 26px;
    height: 26px;
    border-right: 2px solid var(--yellow);
    border-bottom: 2px solid var(--yellow);
    border-radius: 0 0 5px 0;
    transform: rotate(45deg);
  }

  .rotate-screen h2 {
    position: relative;
    margin: 0;
    font-family: var(--display-font);
    font-size: 24px;
  }

  .rotate-screen p {
    position: relative;
    margin: 0;
    color: rgba(255, 248, 233, 0.52);
    font-size: 12px;
    line-height: 1.6;
  }

  .rotate-screen .rotate-browser-tip {
    margin-top: 16px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 248, 233, 0.16);
    border-radius: 999px;
    background: rgba(255, 248, 233, 0.055);
    color: rgba(255, 248, 233, 0.76);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.4;
  }
}

@keyframes phoneRotate {
  0%, 18% { transform: rotate(0deg); }
  46%, 72% { transform: rotate(90deg); }
  100% { transform: rotate(360deg); }
}

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