/* MiniArcade Unified Game Shell v1 — единый layout, доступность и
   HUD-структура нативных игр. Совпадает с токенами каталога
   (assets/css/main.css): тот же фокус #fbbf24, тот же радиус 12px, та же
   типографика system-ui. Цвет страницы и шапки — исторический, свой
   у каждой игры (блок в конце её style.css); акценты борда/кнопок/канваса —
   через --game / --game-deep.
   Подключается ПЕРЕД style.css игры:
   <link rel="stylesheet" href="../../assets/css/game-shared.css"> */

:root {
  color-scheme: dark;
  --bg: #0c1132;
  --bg-hi: #141b52;
  --bg-lo: #0a0e2c;
  --surface: #1b2368;
  --surface-hover: #242c7d;
  --board: #0a0e2c;
  --text: #f2f4ff;
  --text-soft: #c3cdf2;
  --muted: #aab4e0;
  --accent: #4d7cff;
  --accent-hover: #3b6bf0;
  --focus: #fbbf24;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --ok: #22c55e;
  --hairline: rgb(93 120 255 / 0.25);
  --header-bg: rgb(13 19 50 / 0.94);
  --radius: 12px;
  --radius-s: 8px;
  --font: system-ui, Arial, sans-serif;
  --motion-fast: 0.12s ease;
  --motion-med: 0.2s ease;
  --shadow-board: 0 8px 24px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(91 141 239 / 0.12);
  /* Переопределяется в style.css каждой игры: */
  --game: var(--accent);
  --game-deep: var(--surface);
  --game-ink: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font);
  line-height: 1.5;
  text-align: center;
  color: var(--text);
  background:
    radial-gradient(70rem 34rem at 80% -10%, rgb(64 86 200 / 0.4), transparent 62%),
    radial-gradient(55rem 30rem at 8% 108%, rgb(40 56 160 / 0.35), transparent 60%),
    linear-gradient(160deg, var(--bg-hi) 0%, var(--bg) 55%, var(--bg-lo) 100%),
    var(--bg);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection { background: rgb(77 124 255 / 0.45); }

/* HUD: единая плашка под каталог, акцент игры — тонкой линией снизу. */
.hud {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--hairline);
  box-shadow: inset 0 -2px 0 var(--game);
}

.hud h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.hud__score, .hud p {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 560px;
  padding: 1rem;
}

/* Игровые поля: единый фрейм, фон и тень. Цвет бордюра — акцент игры. */
canvas, .board {
  display: block;
  max-width: 100%;
  background: var(--board);
  border: 1px solid var(--game);
  border-radius: var(--radius);
  box-shadow: var(--shadow-board);
  touch-action: none;
}

/* Кнопки: единая геометрия, типографика и моушн. Цвет — акцент игры. */
.button, .pad__btn, .cols__btn {
  font: inherit;
  font-weight: 600;
  color: var(--game-ink);
  background: var(--game);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform var(--motion-fast), background-color var(--motion-fast), opacity var(--motion-fast);
}

.button {
  padding: 0.5rem 1.5rem;
}

.button:hover:not(:disabled), .pad__btn:hover:not(:disabled), .cols__btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.button:active:not(:disabled), .pad__btn:active:not(:disabled) {
  transform: scale(0.96);
}

.button:disabled, .pad__btn:disabled, .cols__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Пэды: только раскладка, цвета — из унифицированных кнопок выше. */
.pad {
  display: grid;
  gap: 8px;
  margin-top: 0.5rem;
}

.pad__btn {
  min-height: 44px;
  min-width: 56px;
  font-size: 1.25rem;
}

.status {
  min-height: 1.5rem;
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

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