﻿:root {
  color-scheme: light;
  --ink: #111111;
  --paper: #f7f5f0;
  --paper-shadow: #e1ddd5;
  --accent: #111111;
  --frame: #0f0f0f;
  --panel: rgba(15, 15, 15, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #ffffff 0%, #f2efe8 35%, #ded9cf 100%);
  color: var(--ink);
  font-family: "Orbitron", "Eurostile", "Impact", sans-serif;
  letter-spacing: 0.02em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.04) 0, rgba(0, 0, 0, 0.04) 1px, transparent 1px, transparent 8px);
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.4;
}

.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 32px clamp(16px, 4vw, 48px);
  gap: 24px;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
}

.brand {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 700;
}

.brand-number {
  font-size: clamp(24px, 4.5vw, 40px);
  display: inline-block;
  padding: 2px 10px;
  border: 2px solid var(--frame);
  margin-right: 8px;
}

.stats {
  display: flex;
  gap: 16px;
  font-size: clamp(14px, 2.5vw, 18px);
  align-items: center;
  background: var(--panel);
  padding: 8px 14px;
  border: 1px solid rgba(15, 15, 15, 0.15);
  border-radius: 999px;
}

.score,
.highscore {
  min-width: 70px;
  text-align: right;
}

.stage {
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-shell {
  width: min(960px, 100%);
  position: relative;
  border: 3px solid var(--frame);
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f5f0 0%, #e9e4da 100%);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

#game {
  display: block;
  width: 100%;
  height: clamp(200px, 34vw, 320px);
}

.touch-controls {
  display: none;
  gap: 12px;
  padding: 12px 16px;
  border-top: 2px solid var(--frame);
  background: rgba(15, 15, 15, 0.04);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.touch-zone {
  flex: 1;
  border: 1px dashed rgba(15, 15, 15, 0.3);
  padding: 10px 8px;
  text-align: center;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  text-align: center;
  padding: 24px;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  border: 2px dashed var(--frame);
  padding: 20px 26px;
  background: #ffffff;
  text-transform: uppercase;
  animation: rise 0.6s ease;
}

@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.title {
  font-size: clamp(18px, 3vw, 24px);
  margin-bottom: 8px;
}

.subtitle {
  font-size: clamp(12px, 2.2vw, 14px);
  opacity: 0.7;
}

.btn {
  margin-top: 14px;
  padding: 10px 18px;
  background: var(--ink);
  color: #ffffff;
  border: none;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 3px;
}

.panel {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  text-transform: uppercase;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle input {
  accent-color: var(--ink);
}

.hint {
  opacity: 0.6;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .hud {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .game-shell {
    border-radius: 12px;
  }

  .touch-controls {
    display: flex;
  }

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

@media (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}
