:root {
  --ink: #07150f;
  --paper: #f5f2e9;
  --lime: #c8ff62;
  --mint: #8fffc4;
  --blue: #65dcff;
  --danger: #ff5c6c;
  --muted: #96a29b;
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(255, 255, 255, 0.045);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 82% 8%, rgba(143, 255, 196, 0.13), transparent 28rem),
    radial-gradient(circle at 8% 88%, rgba(200, 255, 98, 0.07), transparent 24rem),
    var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 4px;
}

.shell {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  padding: 20px 0;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.brand-mark {
  display: grid;
  min-width: 64px;
  height: 34px;
  padding: 0 12px;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.035em;
}

.back-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 15px;
  color: #d8dfdb;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  transition:
    border-color 180ms ease,
    color 180ms ease;
}

.back-link:hover {
  color: var(--lime);
  border-color: rgba(200, 255, 98, 0.35);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(460px, 1.28fr);
  align-items: center;
  gap: clamp(40px, 7vw, 88px);
  padding: 40px 0 72px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  color: #d9e0dc;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(200, 255, 98, 0.12);
}

h1 {
  margin: 0;
  font-size: clamp(52px, 7.5vw, 88px);
  letter-spacing: -0.065em;
  line-height: 0.95;
}

h1 em {
  color: transparent;
  background: linear-gradient(105deg, var(--lime), var(--mint) 55%, var(--blue));
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}

.lead {
  max-width: 450px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 30px;
}

.score-card {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.score-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.score-card strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: clamp(24px, 4vw, 34px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.055em;
  text-overflow: ellipsis;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.button:disabled {
  cursor: default;
  opacity: 0.38;
}

.button-primary {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
}

.button-primary:hover:not(:disabled) {
  background: #dcffa1;
  border-color: #dcffa1;
}

.controls-note {
  margin: 24px 0 0;
  padding-top: 20px;
  color: #7f8b84;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.8;
}

.controls-note strong {
  color: #dce2de;
}

.stage-card {
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}

.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 8px 14px;
}

.stage-label {
  color: #839089;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage-status {
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
}

.stage {
  position: relative;
  overflow: hidden;
  background: #081a11;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  touch-action: none;
  user-select: none;
}

.stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  padding: 22px;
  place-items: center;
  text-align: center;
  background: rgba(7, 21, 15, 0.76);
  backdrop-filter: blur(10px);
}

.game-overlay[hidden] {
  display: none;
}

.overlay-inner {
  width: min(390px, 100%);
}

.overlay-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  border-radius: 50%;
  font-size: 27px;
  box-shadow: 0 0 54px rgba(200, 255, 98, 0.22);
}

.game-overlay h2 {
  margin: 0;
  font-size: clamp(31px, 5.5vw, 48px);
  letter-spacing: -0.055em;
}

.game-overlay p {
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.game-overlay .button {
  min-width: 170px;
  margin-top: 23px;
}

.stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 8px 3px;
  color: #7e8a83;
  font-size: 9px;
}

@media (max-width: 880px) {
  .game-layout {
    grid-template-columns: 1fr;
    max-width: 680px;
    padding-top: 18px;
  }

  .lead {
    max-width: 100%;
  }
}

@media (max-width: 540px) {
  .shell {
    width: min(100% - 24px, 1160px);
  }

  .site-header {
    padding: 16px 0;
  }

  .game-layout {
    gap: 28px;
    padding-bottom: 36px;
  }

  h1 {
    font-size: clamp(52px, 16vw, 76px);
  }

  .lead {
    font-size: 14px;
  }

  .stage-card {
    padding: 7px;
    border-radius: 22px;
  }

  .stage {
    border-radius: 16px;
  }

  .stage-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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