:root {
  color-scheme: dark;
  --zz-bg: #07111f;
  --zz-panel: rgba(12, 25, 43, 0.92);
  --zz-panel-strong: #10243b;
  --zz-border: rgba(148, 180, 210, 0.2);
  --zz-text: #f4f8fb;
  --zz-muted: #9fb2c6;
  --zz-accent: #35d7a1;
  --zz-accent-2: #38bdf8;
  --zz-danger: #fb7185;
  --zz-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--zz-text);
  background:
    radial-gradient(circle at 8% 8%, rgba(56, 189, 248, 0.15), transparent 34%),
    radial-gradient(circle at 92% 2%, rgba(53, 215, 161, 0.13), transparent 31%),
    linear-gradient(145deg, #07111f 0%, #09182a 52%, #07111f 100%);
  overscroll-behavior: none;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.game-shell {
  width: min(100%, 1060px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 2.5vw, 28px);
}

.game-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.game-title-wrap {
  min-width: 0;
}

.game-kicker {
  margin: 0 0 3px;
  color: var(--zz-accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.game-title {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.game-subtitle {
  margin: 7px 0 0;
  color: var(--zz-muted);
  font-size: 0.92rem;
}

.stat-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stat {
  min-width: 72px;
  padding: 8px 11px;
  border: 1px solid var(--zz-border);
  border-radius: 12px;
  background: rgba(8, 19, 33, 0.72);
  text-align: center;
}

.stat-label {
  display: block;
  color: var(--zz-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  margin-top: 1px;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.game-card {
  border: 1px solid var(--zz-border);
  border-radius: 22px;
  background: var(--zz-panel);
  box-shadow: var(--zz-shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.game-stage {
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.4vw, 24px);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px;
  border-top: 1px solid var(--zz-border);
  background: rgba(6, 15, 27, 0.52);
}

.btn {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--zz-border);
  border-radius: 12px;
  color: var(--zz-text);
  background: var(--zz-panel-strong);
  font-weight: 750;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.btn:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: #15304d;
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn-primary {
  border-color: rgba(53, 215, 161, 0.58);
  color: #032118;
  background: var(--zz-accent);
}

.btn-primary:hover {
  background: #5ee6b9;
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fff;
  background: rgba(190, 24, 64, 0.68);
}

.btn-icon {
  display: inline-grid;
  min-width: 48px;
  padding-inline: 12px;
  place-items: center;
  font-size: 1.15rem;
}

.status-line {
  min-height: 1.5em;
  margin: 0;
  color: var(--zz-muted);
  text-align: center;
}

.status-line strong {
  color: var(--zz-text);
}

.control-pad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(2, 46px);
  gap: 7px;
  justify-content: center;
}

.control-pad .up {
  grid-column: 2;
}

.control-pad .left {
  grid-column: 1;
  grid-row: 2;
}

.control-pad .down {
  grid-column: 2;
  grid-row: 2;
}

.control-pad .right {
  grid-column: 3;
  grid-row: 2;
}

.control-pad .btn {
  min-height: 46px;
  padding: 0;
}

.footer-note {
  margin: 12px 0 0;
  color: #7f96ad;
  font-size: 0.78rem;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.9);
  outline-offset: 3px;
}

@media (max-width: 680px) {
  .game-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stat-grid {
    width: 100%;
    justify-content: stretch;
  }

  .stat {
    flex: 1 1 70px;
  }

  .game-card {
    border-radius: 18px;
  }
}

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