:root {
  color-scheme: dark;
  --bg: #0c0f14;
  --panel: #151922;
  --line: #2b3444;
  --text: #f2f5f8;
  --muted: #9aa6b8;
  --blue: #1d4b92;
  --red: #e54444;
  --yellow: #f5c542;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 12%, rgba(29, 75, 146, 0.42), transparent 26rem),
    linear-gradient(135deg, #07090d 0%, #151922 58%, #090b10 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: center;
}

.game-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.86);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.hud {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(21, 25, 34, 0.95);
}

.label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.hud p:last-child {
  margin: 0;
  font-size: 22px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

button {
  min-height: 40px;
  border: 1px solid #41506a;
  border-radius: 6px;
  background: #202839;
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
}

#restart {
  margin-left: auto;
  padding: 0 16px;
}

canvas {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #111620;
}

.brief h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.95;
}

.brief p {
  color: #d8dee8;
  line-height: 1.65;
}

.keys {
  color: var(--muted);
  font-size: 14px;
}

.mobile-controls {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 18px 0;
  }

  .brief {
    order: -1;
  }

  .brief h1 {
    font-size: 38px;
  }

  .mobile-controls {
    display: grid;
  }
}
