/* GOST Arcade — design tokens + shared components */

@font-face {
  font-family: 'Fredoka';
  src: url('../assets/fonts/fredoka.woff2') format('woff2-variations'), url('../assets/fonts/fredoka.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk.woff2') format('woff2-variations'), url('../assets/fonts/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Silkscreen';
  src: url('../assets/fonts/silkscreen.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Silkscreen';
  src: url('../assets/fonts/silkscreen-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg-0: #06041a;
  --bg-1: #0d0927;
  --bg-2: #171039;
  --bg-3: #231a52;
  --panel: rgba(22, 15, 54, 0.78);
  --panel-solid: #161036;
  --line: rgba(190, 170, 255, 0.16);
  --line-strong: rgba(200, 182, 255, 0.32);
  --text: #f5f2ff;
  --text-2: #c9c1ef;
  --muted: #8f87bd;
  --ghost: #ffffff;
  --pink: #ff4fd8;
  --cyan: #45f0ff;
  --lime: #c4ff4d;
  --amber: #ffc845;
  --violet: #a07bff;
  --coral: #ff6b6b;
  --danger: #ff4f6d;
  --ok: #4dffa6;
  --accent: var(--violet);
  --radius-s: 10px;
  --radius: 16px;
  --radius-l: 24px;
  --shadow-1: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-2: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-display: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --font-ui: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-pixel: 'Silkscreen', ui-monospace, monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; overscroll-behavior: none; }

button { font: inherit; color: inherit; }
a { color: inherit; }
img, svg, canvas { display: block; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 12px;
}

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

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-fg: var(--text);
  --btn-line: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0 1.25em;
  border-radius: 999px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s var(--ease-out), background-color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.btn:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(220, 205, 255, 0.5); }
.btn:active { transform: scale(0.96); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

.btn--primary {
  --btn-bg: linear-gradient(180deg, #ffffff 0%, #e9e4ff 100%);
  --btn-fg: #160f38;
  --btn-line: transparent;
  background: var(--btn-bg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset, 0 10px 34px -8px rgba(200, 180, 255, 0.75), 0 0 60px -20px var(--accent);
  font-weight: 700;
}
.btn--primary:hover { background: linear-gradient(180deg, #ffffff 0%, #f3f0ff 100%); box-shadow: 0 0 0 1px #fff inset, 0 14px 40px -8px rgba(210, 190, 255, 0.9), 0 0 80px -16px var(--accent); }

.btn--accent {
  background: var(--accent);
  --btn-fg: #0d0827;
  border-color: transparent;
  box-shadow: 0 10px 30px -10px var(--accent);
  font-weight: 700;
}
.btn--accent:hover { background: var(--accent); filter: brightness(1.08); }

.btn--lg { min-height: 58px; padding: 0 1.7em; font-size: 1.18rem; }
.btn--sm { min-height: 38px; padding: 0 0.95em; font-size: 0.9rem; }
.btn--icon { width: 44px; min-height: 44px; padding: 0; border-radius: 14px; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: transparent; }

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7em;
  height: 1.7em;
  padding: 0 0.45em;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-pixel);
  font-size: 0.72em;
  line-height: 1;
  color: var(--text);
  vertical-align: middle;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 38px;
  padding: 0 0.9em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  white-space: nowrap;
}
.pill__label {
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.pill__value { font-variant-numeric: tabular-nums; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.eyebrow {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 0.95;
}

/* Toast */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(20, 13, 50, 0.92);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1);
  font-family: var(--font-display);
  font-weight: 600;
  animation: toast-in 0.35s var(--ease-spring) both, toast-out 0.3s ease-in 2.2s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* CRT power transitions shared by arcade + games */
.crt {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background: #000;
}
.crt::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  margin-top: -1px;
  background: #fff;
  box-shadow: 0 0 24px 6px rgba(200, 190, 255, 0.9);
  transform: scaleX(0);
  opacity: 0;
}
.crt--on { animation: crt-fade 0.55s 0.18s var(--ease-out) forwards; }
.crt--on::after { animation: crt-line 0.38s var(--ease-out) forwards; }
.crt--off { opacity: 0; animation: crt-fade-in 0.32s ease-in forwards; }
@keyframes crt-fade { to { opacity: 0; } }
@keyframes crt-fade-in { to { opacity: 1; } }
@keyframes crt-line {
  0% { transform: scaleX(0); opacity: 1; }
  45% { transform: scaleX(1); opacity: 1; height: 2px; }
  100% { transform: scaleX(1) scaleY(60); opacity: 0; }
}

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