/* Аркада — общая тема. Пластиковая «кубиковая» ночь:
   глубокий синий фон, игрушечные цвета блоков, шпильки-студы как мотив. */

:root {
  --bg: #131729;
  --panel: #1c2340;
  --panel-2: #232b4d;
  --line: #303a66;
  --ink: #f1f3fc;
  --mut: #8f99c2;

  --c-red: #ff6262;
  --c-green: #55d06e;
  --c-blue: #57a5ff;
  --c-yellow: #ffc94d;
  --c-purple: #b48bff;
  --c-orange: #ff9d4d;
  --c-gray: #525b7a;

  --r-lg: 22px;
  --r-md: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100%;
  overscroll-behavior: none;
}

body {
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

h1, h2, h3, .display {
  font-family: "Unbounded", "Rubik", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

/* Верх игровой страницы */
.gamebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
}
.gamebar .back {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  flex: none;
}
.gamebar .back svg { width: 18px; height: 18px; }
.gamebar h1 { font-size: 17px; font-weight: 600; flex: 1; }
.gamebar .hud {
  font-family: "Unbounded", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--mut);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.96); }
.btn.primary {
  background: var(--c-green);
  border-color: transparent;
  color: #0c2415;
}
.btn.ghost { background: transparent; }

/* Оверлей результата */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 26, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  width: min(86vw, 340px);
  text-align: center;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s ease;
}
.overlay.show .card { transform: none; }
.overlay .card h2 { font-size: 22px; margin-bottom: 6px; }
.overlay .card p { color: var(--mut); margin: 0 0 20px; font-size: 14px; }
.overlay .card .row { display: flex; gap: 10px; justify-content: center; }
