:root {
  --sky-top: #8ad7ff;
  --sky-mid: #d8f5ff;
  --sky-bottom: #f7fcff;
  --frame: #14233d;
  --frame-edge: #253552;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --ink: #18304e;
  --ink-soft: rgba(24, 48, 78, 0.74);
  --blue: #2f8fff;
  --blue-strong: #1778f2;
  --blue-soft: #ddf4ff;
  --amber: #ffbf3f;
  --amber-soft: #fff3ce;
  --emerald: #2db67a;
  --emerald-soft: #dff8ed;
  --rose: #ff6f7c;
  --rose-soft: #ffe3e6;
  --slate-soft: rgba(15, 23, 42, 0.08);
  --card-shadow: 0 24px 50px rgba(20, 55, 96, 0.16);
  --font-display: "Avenir Next", "Segoe UI Rounded", "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font-display);
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.95), transparent 14%),
    radial-gradient(circle at 86% 18%, rgba(213, 243, 255, 0.88), transparent 18%),
    linear-gradient(180deg, #edf9ff 0%, #dff4ff 38%, #f8fcff 100%);
}

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

#app {
  min-height: 100dvh;
}

.page-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.page-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
}

.page-glow--a {
  top: 4%;
  left: 8%;
  width: 180px;
  height: 180px;
  background: rgba(131, 217, 255, 0.32);
}

.page-glow--b {
  right: 4%;
  bottom: 8%;
  width: 220px;
  height: 220px;
  background: rgba(255, 219, 127, 0.18);
}

.device-frame {
  position: relative;
  width: min(100vw - 16px, 430px, calc((100dvh - 24px) * 0.56));
  aspect-ratio: 9 / 19.2;
  border-radius: 42px;
  padding: 12px;
  background: linear-gradient(180deg, var(--frame-edge), var(--frame));
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.24);
}

.device-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.94), transparent 16%),
    radial-gradient(circle at 84% 14%, rgba(255, 255, 255, 0.7), transparent 18%),
    radial-gradient(circle at 50% 86%, rgba(255, 255, 255, 0.34), transparent 24%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-bottom) 100%);
  isolation: isolate;
}

.device-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 22%, rgba(117, 212, 255, 0.28), transparent 16%),
    radial-gradient(circle at 82% 34%, rgba(255, 255, 255, 0.2), transparent 18%);
  z-index: 0;
}

.device-screen--game::before {
  opacity: 0.8;
}

.device-notch {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 3;
  width: 112px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 0 0 20px 20px;
  background: rgba(9, 15, 29, 0.94);
}

.portrait-note {
  position: relative;
  z-index: 1;
  padding: 0 18px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(24, 48, 78, 0.56);
}

.screen {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 40px 18px 18px;
  gap: 16px;
}

.screen--menu {
  overflow: hidden;
}

.screen--levels,
.screen--settings {
  overflow: hidden;
}

.screen--game {
  padding: 0;
  gap: 0;
}

.screen--result {
  justify-content: center;
  align-items: center;
  padding-inline: 16px;
  overflow: hidden;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(23, 120, 242, 0.72);
}

.menu-header {
  position: relative;
  text-align: center;
  margin-top: 2px;
}

.menu-header__title {
  margin: 8px 0 10px;
  font-size: clamp(34px, 9vw, 44px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.menu-header__copy {
  margin: 0 auto;
  max-width: 280px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.floating-math {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
}

.math-symbol {
  position: absolute;
  left: var(--symbol-left);
  top: var(--symbol-top);
  font-size: var(--symbol-size);
  font-weight: 900;
  color: rgba(24, 90, 148, 0.92);
  transform: rotate(var(--symbol-rotate));
  animation: floatMath var(--symbol-duration) ease-in-out infinite;
  animation-delay: var(--symbol-delay);
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.hero-sky {
  position: relative;
  min-height: 294px;
  overflow: hidden;
  border-radius: 32px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 46%),
    linear-gradient(180deg, rgba(239, 252, 255, 0.88), rgba(222, 247, 255, 0.58));
  box-shadow: var(--card-shadow);
}

.hero-platform {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 40px;
  height: 86px;
  border-radius: 28px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 38px rgba(77, 169, 255, 0.22);
}

.hero-platform::after {
  content: "";
  position: absolute;
  inset: auto 16px -10px;
  height: 20px;
  border-radius: 999px;
  background: rgba(118, 210, 255, 0.38);
  filter: blur(10px);
}

.hero-cloud,
.scene-cloud,
.result-cloud {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    24px -8px 0 5px rgba(255, 255, 255, 0.9),
    -16px 8px 0 4px rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 10px 16px rgba(101, 186, 255, 0.14));
}

.hero-cloud--1 {
  left: 38px;
  top: 52px;
  width: 42px;
  height: 20px;
  animation: driftCloud 7s ease-in-out infinite;
}

.hero-cloud--2 {
  right: 54px;
  top: 92px;
  width: 34px;
  height: 16px;
  animation: driftCloud 8s ease-in-out infinite reverse;
}

.hero-cloud--3 {
  left: 66px;
  bottom: 118px;
  width: 30px;
  height: 14px;
  animation: driftCloud 9s ease-in-out infinite;
}

.hero-runner {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) !important;
}

.hero-badge {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  box-shadow: 0 10px 24px rgba(64, 129, 179, 0.12);
}

.hero-flag {
  position: absolute;
  right: 56px;
  bottom: 116px;
  width: 8px;
  height: 62px;
  border-radius: 999px;
  background: #8fd4ff;
}

.hero-flag::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 8px;
  width: 28px;
  height: 16px;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(135deg, #ffd76a, #ffb12f);
}

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

.stat-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 12px;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 30px rgba(32, 93, 148, 0.1);
}

.stat-chip span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(24, 48, 78, 0.5);
}

.stat-chip strong {
  font-size: 19px;
  letter-spacing: -0.04em;
}

.menu-actions {
  margin-top: auto;
}

.menu-actions__row,
.result-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 26px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button--large {
  width: 100%;
  min-height: 64px;
  margin-bottom: 12px;
  font-size: 22px;
}

.button--primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), #42d6ff);
  box-shadow: 0 20px 38px rgba(43, 130, 246, 0.32);
}

.button--secondary {
  color: var(--ink);
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 26px rgba(35, 78, 120, 0.1);
}

.button--dark {
  color: white;
  background: linear-gradient(180deg, #18304e, #0f2135);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar--game {
  padding: 40px 16px 0;
}

.topbar__title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.topbar__title {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.topbar__back {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 28px rgba(38, 91, 140, 0.11);
  flex: 0 0 auto;
}

.topbar__back-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: translate(-35%, -50%) rotate(45deg);
}

.pill,
.summary-card,
.setting-card,
.controls-card,
.result-stat,
.bottom-tip,
.progress-strip,
.game-help,
.question-card,
.result-card,
.hero-card,
.result-banner,
.summary-row,
.level-card,
.stat-chip {
  backdrop-filter: blur(8px);
}

.pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 24px rgba(36, 84, 130, 0.1);
}

.pill strong {
  font-size: 15px;
  line-height: 1;
}

.pill__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(24, 48, 78, 0.5);
}

.hud-pills {
  display: flex;
  gap: 8px;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.summary-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 28px rgba(37, 91, 140, 0.09);
  text-align: center;
}

.summary-card span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(24, 48, 78, 0.5);
}

.summary-card strong {
  font-size: 24px;
  letter-spacing: -0.05em;
}

.levels-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-right: 3px;
}

.levels-grid::-webkit-scrollbar {
  width: 6px;
}

.levels-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(24, 48, 78, 0.18);
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 110px;
  padding: 12px 8px 10px;
  border-radius: 26px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 34px rgba(41, 104, 158, 0.12);
  transition: transform 180ms ease, opacity 180ms ease;
}

.level-card.is-unlocked:hover {
  transform: translateY(-2px);
}

.level-card.is-locked {
  opacity: 0.56;
  background: rgba(225, 235, 244, 0.92);
}

.level-card__number {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.level-card__name {
  min-height: 30px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--ink-soft);
}

.level-card__stars {
  display: inline-flex;
  gap: 3px;
}

.level-card__meta {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(24, 48, 78, 0.52);
}

.star {
  width: 15px;
  height: 15px;
  display: inline-block;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 92%,
    50% 70%,
    21% 92%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  background: rgba(148, 163, 184, 0.34);
}

.star.is-filled {
  background: linear-gradient(180deg, #ffd76a, #ffb12f);
}

.star--large {
  width: 28px;
  height: 28px;
}

.star--large:nth-child(1) {
  animation: starLift 1.6s ease-in-out infinite;
}

.star--large:nth-child(2) {
  animation: starLift 1.6s ease-in-out 0.12s infinite;
}

.star--large:nth-child(3) {
  animation: starLift 1.6s ease-in-out 0.24s infinite;
}

.bottom-tip,
.game-help {
  padding: 14px 16px;
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 28px rgba(31, 90, 139, 0.08);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-card,
.controls-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 16px;
  border-radius: 28px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 32px rgba(33, 96, 148, 0.1);
}

.setting-card h2,
.controls-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.setting-card p,
.controls-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.toggle {
  position: relative;
  width: 68px;
  height: 38px;
  border-radius: 999px;
  padding: 3px;
  background: rgba(148, 163, 184, 0.36);
  transition: background 180ms ease;
  flex: 0 0 auto;
}

.toggle.is-on {
  background: linear-gradient(135deg, #46c8ff, #23a8ff);
}

.toggle__thumb {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  transition: transform 180ms ease;
}

.toggle.is-on .toggle__thumb {
  transform: translateX(30px);
}

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

.controls-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-list div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.controls-list strong {
  font-size: 14px;
}

.controls-list span {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.game-mount {
  height: 100%;
}

.progress-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 14px 10px;
  padding: 12px 14px;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 26px rgba(35, 91, 136, 0.1);
}

.progress-strip__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.progress-strip__copy span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(24, 48, 78, 0.5);
}

.progress-strip__copy strong {
  font-size: 16px;
  letter-spacing: -0.04em;
}

.progress-strip__dots {
  display: flex;
  gap: 6px;
}

.progress-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(146, 165, 188, 0.3);
  transition: transform 180ms ease, background 180ms ease;
}

.progress-dot.is-active {
  background: #43b4ff;
  transform: scale(1.14);
}

.progress-dot.is-complete {
  background: linear-gradient(180deg, #ffd86c, #ffb334);
}

.game-scene {
  position: relative;
  flex: 1;
  margin: 0 14px;
  overflow: hidden;
  border-radius: 34px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(180deg, #80d8ff 0%, #c7efff 56%, #effaff 100%);
  box-shadow: 0 20px 40px rgba(33, 94, 145, 0.16);
  touch-action: none;
}

.game-scene__glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(34px);
}

.game-scene__glow--a {
  width: 120px;
  height: 120px;
  left: -18px;
  top: 32px;
  background: rgba(255, 255, 255, 0.42);
}

.game-scene__glow--b {
  width: 150px;
  height: 150px;
  right: -24px;
  top: 140px;
  background: rgba(126, 216, 255, 0.28);
}

.scene-cloud--1 {
  left: 36px;
  top: 72px;
  width: 42px;
  height: 20px;
  animation: driftCloud 8s ease-in-out infinite;
}

.scene-cloud--2 {
  right: 44px;
  top: 120px;
  width: 34px;
  height: 18px;
  animation: driftCloud 9s ease-in-out infinite reverse;
}

.scene-cloud--3 {
  left: 58px;
  top: 220px;
  width: 28px;
  height: 14px;
  animation: driftCloud 7.2s ease-in-out infinite;
}

.scene-cloud--4 {
  right: 38px;
  bottom: 180px;
  width: 44px;
  height: 20px;
  animation: driftCloud 9.2s ease-in-out infinite;
}

.scene-cloud--5 {
  left: 92px;
  bottom: 120px;
  width: 30px;
  height: 14px;
  animation: driftCloud 7.6s ease-in-out infinite reverse;
}

.question-card {
  position: absolute;
  top: 16px;
  left: 14px;
  right: 14px;
  z-index: 4;
  padding: 16px 18px;
  border-radius: 28px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 38px rgba(29, 88, 136, 0.16);
  text-align: center;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.question-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.question-card__expression {
  margin: 8px 0 6px;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.question-card__subtext,
.question-card__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.question-card__hint {
  margin-top: 6px;
  font-weight: 700;
}

.world {
  position: absolute;
  left: 50%;
  top: 0;
  width: 360px;
  height: 1000px;
  margin-left: -180px;
  transform: translateY(0);
  will-change: transform;
}

.track-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.finish-flag {
  position: absolute;
  width: 44px;
  height: 62px;
  transform: translate(-50%, -50%);
}

.finish-flag__pole {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 62px;
  border-radius: 999px;
  background: #7bd6ff;
}

.finish-flag__banner {
  position: absolute;
  left: 8px;
  top: 4px;
  width: 30px;
  height: 18px;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(135deg, #ffe27d, #ffb83c);
  box-shadow: 0 8px 14px rgba(255, 184, 60, 0.3);
}

.finish-flag.is-finished .finish-flag__banner {
  animation: flagPop 0.7s ease-in-out infinite alternate;
}

.gates-layer {
  position: absolute;
  inset: 0;
}

.answer-gate {
  position: absolute;
  width: 124px;
  transform: translate(-50%, -50%);
  z-index: 3;
  animation: gateFloat 2.8s ease-in-out infinite;
}

.answer-gate--right {
  animation-delay: 0.2s;
}

.answer-gate__button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
}

.answer-gate__button::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: -16px;
  height: 26px;
  border-radius: 0 0 24px 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 18px rgba(42, 104, 158, 0.12);
}

.answer-gate--left .answer-gate__button::after {
  transform: skewX(16deg);
}

.answer-gate--right .answer-gate__button::after {
  transform: skewX(-16deg);
}

.answer-gate__label {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(23, 120, 242, 0.7);
}

.answer-gate__value {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border-radius: 28px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 34px rgba(36, 98, 148, 0.16);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.answer-gate.is-correct .answer-gate__value {
  background: linear-gradient(180deg, #f3fff7, #e0fff0);
  color: #19885b;
}

.answer-gate.is-correct .answer-gate__label {
  color: rgba(25, 136, 91, 0.78);
}

.answer-gate.is-wrong .answer-gate__value {
  background: linear-gradient(180deg, #fff7f8, #ffe9eb);
  color: #d14e63;
}

.answer-gate.is-wrong .answer-gate__label {
  color: rgba(209, 78, 99, 0.8);
}

.runner {
  --runner-x: 0px;
  --runner-y: 0px;
  --runner-tilt: 0deg;
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 80px;
  transform: translate3d(calc(var(--runner-x) - 23px), calc(var(--runner-y) - 58px), 0)
    rotate(var(--runner-tilt));
  transform-origin: 50% 72%;
  z-index: 4;
}

.stickman__head,
.stickman__body,
.stickman__arm,
.stickman__leg {
  position: absolute;
  background: #14233d;
  border-radius: 999px;
}

.stickman__head {
  left: 50%;
  top: 0;
  width: 18px;
  height: 18px;
  transform: translateX(-50%);
}

.stickman__body {
  left: 50%;
  top: 16px;
  width: 4px;
  height: 28px;
  transform: translateX(-50%);
}

.stickman__arm,
.stickman__leg {
  height: 4px;
  transform-origin: left center;
}

.stickman__arm--left {
  left: 23px;
  top: 28px;
  width: 18px;
  transform: rotate(28deg);
}

.stickman__arm--right {
  right: 23px;
  top: 28px;
  width: 18px;
  transform: rotate(-28deg);
  transform-origin: right center;
}

.stickman__leg--left {
  left: 23px;
  top: 48px;
  width: 20px;
  transform: rotate(48deg);
}

.stickman__leg--right {
  right: 23px;
  top: 48px;
  width: 20px;
  transform: rotate(-48deg);
  transform-origin: right center;
}

.runner--run {
  animation: runnerBounce 0.5s ease-in-out infinite;
}

.runner--run .stickman__arm--left {
  animation: armLeft 0.5s ease-in-out infinite;
}

.runner--run .stickman__arm--right {
  animation: armRight 0.5s ease-in-out infinite;
}

.runner--run .stickman__leg--left {
  animation: legLeft 0.5s ease-in-out infinite;
}

.runner--run .stickman__leg--right {
  animation: legRight 0.5s ease-in-out infinite;
}

.runner--stop {
  animation: none;
}

.runner--stop .stickman__arm--left {
  transform: rotate(16deg);
}

.runner--stop .stickman__arm--right {
  transform: rotate(-16deg);
}

.runner--stop .stickman__leg--left {
  transform: rotate(24deg);
}

.runner--stop .stickman__leg--right {
  transform: rotate(-24deg);
}

.runner--win {
  animation: winBounce 0.9s ease-in-out infinite;
}

.runner--win .stickman__arm--left {
  transform: rotate(48deg);
}

.runner--win .stickman__arm--right {
  transform: rotate(-48deg);
}

.runner--win .stickman__leg--left {
  transform: rotate(70deg);
}

.runner--win .stickman__leg--right {
  transform: rotate(-22deg);
}

.runner--fail {
  animation: failShake 0.4s ease-in-out both;
}

.runner--fail .stickman__arm--left {
  transform: rotate(-18deg);
}

.runner--fail .stickman__arm--right {
  transform: rotate(32deg);
}

.runner--fail .stickman__leg--left {
  transform: rotate(-8deg);
}

.runner--fail .stickman__leg--right {
  transform: rotate(62deg);
}

.game-help {
  margin: 10px 14px 14px;
  text-align: center;
}

.result-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.result-cloud--1 {
  left: 56px;
  top: 110px;
  width: 40px;
  height: 18px;
  animation: driftCloud 8.4s ease-in-out infinite;
}

.result-cloud--2 {
  right: 54px;
  top: 168px;
  width: 34px;
  height: 16px;
  animation: driftCloud 9.2s ease-in-out infinite reverse;
}

.result-cloud--3 {
  left: 82px;
  bottom: 152px;
  width: 30px;
  height: 14px;
  animation: driftCloud 7.8s ease-in-out infinite;
}

.result-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 330px;
  padding: 26px 22px 20px;
  border-radius: 34px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 28px 54px rgba(30, 84, 129, 0.18);
  text-align: center;
}

.result-card.is-success::before,
.result-card.is-fail::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 8px;
  border-radius: 34px 34px 0 0;
}

.result-card.is-success::before {
  background: linear-gradient(90deg, #32d18a, #62f3b0);
}

.result-card.is-fail::before {
  background: linear-gradient(90deg, #ff8190, #ff667a);
}

.result-card h1 {
  margin: 10px 0 10px;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.result-card__copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

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

.result-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: rgba(242, 250, 255, 0.9);
  box-shadow: 0 12px 24px rgba(31, 84, 126, 0.08);
}

.result-stat span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(24, 48, 78, 0.48);
}

.result-stat strong {
  font-size: 24px;
  letter-spacing: -0.05em;
}

.result-banner {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--emerald-soft);
  color: #1a7d56;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.target-times {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.target-times span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  background: rgba(242, 250, 255, 0.92);
  box-shadow: 0 10px 20px rgba(31, 84, 126, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(24, 48, 78, 0.7);
}

.result-banner--fail {
  background: var(--rose-soft);
  color: #c24860;
}

.result-actions {
  margin-top: 18px;
}

@keyframes floatMath {
  0%,
  100% {
    transform: translateY(0) rotate(var(--symbol-rotate));
  }
  50% {
    transform: translateY(-8px) rotate(calc(var(--symbol-rotate) + 4deg));
  }
}

@keyframes driftCloud {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(10px, -4px, 0);
  }
}

@keyframes runnerBounce {
  0%,
  100% {
    transform:
      translate3d(calc(var(--runner-x) - 23px), calc(var(--runner-y) - 58px), 0)
      rotate(var(--runner-tilt));
  }
  50% {
    transform:
      translate3d(calc(var(--runner-x) - 23px), calc(var(--runner-y) - 62px), 0)
      rotate(var(--runner-tilt));
  }
}

@keyframes armLeft {
  0%,
  100% {
    transform: rotate(32deg);
  }
  50% {
    transform: rotate(-14deg);
  }
}

@keyframes armRight {
  0%,
  100% {
    transform: rotate(-32deg);
  }
  50% {
    transform: rotate(14deg);
  }
}

@keyframes legLeft {
  0%,
  100% {
    transform: rotate(48deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

@keyframes legRight {
  0%,
  100% {
    transform: rotate(-48deg);
  }
  50% {
    transform: rotate(-12deg);
  }
}

@keyframes winBounce {
  0%,
  100% {
    transform:
      translate3d(calc(var(--runner-x) - 23px), calc(var(--runner-y) - 58px), 0)
      rotate(var(--runner-tilt));
  }
  50% {
    transform:
      translate3d(calc(var(--runner-x) - 23px), calc(var(--runner-y) - 68px), 0)
      rotate(var(--runner-tilt));
  }
}

@keyframes failShake {
  0% {
    transform:
      translate3d(calc(var(--runner-x) - 23px), calc(var(--runner-y) - 58px), 0)
      rotate(var(--runner-tilt));
  }
  35% {
    transform:
      translate3d(calc(var(--runner-x) - 21px), calc(var(--runner-y) - 58px), 0)
      rotate(calc(var(--runner-tilt) - 5deg));
  }
  70% {
    transform:
      translate3d(calc(var(--runner-x) - 25px), calc(var(--runner-y) - 56px), 0)
      rotate(calc(var(--runner-tilt) + 6deg));
  }
  100% {
    transform:
      translate3d(calc(var(--runner-x) - 23px), calc(var(--runner-y) - 58px), 0)
      rotate(var(--runner-tilt));
  }
}

@keyframes gateFloat {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, calc(-50% - 5px));
  }
}

@keyframes starLift {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.04);
  }
}

@keyframes flagPop {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

@media (max-height: 760px) {
  .portrait-note {
    display: none;
  }
}

@media (max-width: 390px) {
  .screen {
    padding-inline: 14px;
  }

  .progress-strip,
  .game-scene,
  .game-help {
    margin-inline: 10px;
  }

  .levels-grid {
    gap: 10px;
  }
}

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