:root {
  color-scheme: dark;
  --bg: #10130f;
  --panel: #1b2018;
  --text: #f5f4ea;
  --muted: #aeb6a3;
  --line: #394232;
  --lime: #c7f36b;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
body {
  padding: 12px;
}
.game-shell {
  width: min(740px, 100%);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, #1d2419, #141812 60%);
  box-shadow: 0 15px 48px rgba(0, 0, 0, 0.25);
}
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 1px 3px 11px;
}
.game-top h1 {
  margin: 0;
  font-size: clamp(17px, 3vw, 22px);
  letter-spacing: -0.04em;
}
.game-top p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.game-stats {
  display: flex;
  gap: 7px;
}
.stat {
  min-width: 67px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #141812;
  text-align: center;
}
.stat span,
.stat strong {
  display: block;
}
.stat span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat strong {
  margin-top: 1px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.stat-hearts {
  color: var(--lime);
}
.canvas-wrap {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #46533a;
  border-radius: 13px;
  background: #182017;
  touch-action: manipulation;
}
.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 640/620;
  touch-action: manipulation;
}
.game-message {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 22px;
  background: rgba(13, 17, 12, 0.8);
  text-align: center;
  backdrop-filter: blur(4px);
}
.game-message[hidden] {
  display: none;
}
.game-message strong {
  font-size: clamp(21px, 5vw, 32px);
  letter-spacing: -0.04em;
}
.game-message p {
  max-width: 340px;
  margin: 0;
  color: #d0d5c8;
  font-size: 12px;
  line-height: 1.65;
}
.message-score {
  color: var(--lime);
  font-weight: 700;
}
.game-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 11px 0 0;
}
.game-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #526047;
  border-radius: 10px;
  color: var(--text);
  background: #22291d;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.game-button:hover {
  border-color: var(--lime);
}
.game-button:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}
.game-button-primary {
  border-color: var(--lime);
  color: #171c10;
  background: var(--lime);
}
.lane-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: min(100%, 520px);
  margin: 9px auto 0;
}
.lane-button {
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #151a13;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.lane-button:active {
  border-color: var(--lime);
  color: var(--lime);
  background: #242e1d;
}
.lane-button[aria-pressed="true"] {
  border-color: #82975f;
  color: var(--lime);
  background: #242e1d;
}
.game-help {
  margin: 10px 3px 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}
.game-help kbd {
  padding: 1px 5px;
  border: 1px solid #58634d;
  border-radius: 4px;
  color: var(--text);
  font: inherit;
}
.status-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
@media (max-width: 430px) {
  body {
    padding: 7px;
  }
  .game-shell {
    padding: 8px;
    border-radius: 12px;
  }
  .game-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .game-stats {
    width: 100%;
  }
  .stat {
    flex: 1;
  }
  .canvas-wrap {
    border-radius: 10px;
  }
  .game-button {
    flex: 1;
  }
  .game-help {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-shell * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
