/* Insert Cartridge — общий стиль. Палитра и шрифт взяты из заглушки. */

@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/press-start-2p-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/press-start-2p-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --sky: #0d0221;
  --sky-2: #2a0f4f;
  --panel: #170833;
  --line: #3a1c6e;
  --magenta: #ff2a6d;
  --cyan: #05d9e8;
  --amber: #ffd319;
  --ink: #e8f9ff;
  --muted: #9fb3d9;
  --nes: var(--magenta);
  --snes: var(--amber);
  --genesis: var(--cyan);
  --pixel: 'Press Start 2P', ui-monospace, 'Courier New', monospace;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--sky); color: var(--ink); }
body {
  min-height: 100vh;
  font-family: var(--pixel);
  -webkit-font-smoothing: none;
  background: var(--sky);
  color: var(--ink);
}
a { color: var(--cyan); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px dashed var(--amber); outline-offset: 3px; }

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

/* CRT-полоски поверх всей страницы */
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.16) 2px 3px);
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  font: inherit; font-size: 11px; line-height: 1.4;
  color: var(--ink); text-decoration: none; text-transform: uppercase;
  background: rgba(13,2,33,.8);
  border: 3px solid var(--ink);
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--magenta);
  transition: transform .08s steps(2), box-shadow .08s steps(2);
}
.btn:hover { color: var(--cyan); border-color: var(--cyan); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--magenta); }
.btn--primary { background: var(--magenta); border-color: var(--magenta); box-shadow: 4px 4px 0 var(--cyan); color: #fff; }
.btn--primary:hover { background: #ff4f88; color: #fff; border-color: #ff4f88; }
.btn--primary:active { box-shadow: 0 0 0 var(--cyan); }
.btn--small { font-size: 9px; padding: 8px 10px; border-width: 2px; box-shadow: 3px 3px 0 var(--magenta); }

/* Кнопка паузы анимации (из заглушки) */
.motion {
  font: inherit; font-size: 8px; color: var(--ink);
  background: rgba(13,2,33,.75); border: 2px solid var(--muted);
  padding: 8px 10px; cursor: pointer; white-space: nowrap;
}
.motion:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- шапка внутренних страниц ---------- */
.topbar {
  position: relative;
  height: 168px;
  overflow: hidden;
  border-bottom: 3px solid var(--magenta);
  box-shadow: 0 6px 24px rgba(255,42,109,.25);
}
.topbar canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.topbar__inner {
  position: relative; z-index: 1;
  height: 100%;
  max-width: 1200px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 16px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.logo {
  display: inline-block;
  font-size: clamp(14px, 3.4vw, 26px); line-height: 1.3;
  color: var(--cyan); text-decoration: none;
  text-shadow: 3px 3px 0 var(--magenta), 0 0 16px rgba(5,217,232,.5);
}
.logo small { display: block; font-size: .42em; color: var(--amber); text-shadow: 2px 2px 0 #000; margin-top: 8px; letter-spacing: .08em; }

/* ---------- общий контейнер ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }

.footer {
  text-align: center; font-size: 8px; color: var(--muted); line-height: 2;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  text-shadow: 1px 1px 0 #000;
}

.footer--split {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  max-width: 1200px; margin: 0 auto;
}

/* платформенные ярлыки */
.badge {
  display: inline-block; font-size: 8px; line-height: 1; padding: 5px 6px 4px;
  color: #0d0221; background: var(--muted);
}
.badge--nes { background: var(--nes); color: #fff; }
.badge--snes { background: var(--snes); }
.badge--genesis { background: var(--genesis); }

/* ---------- игровой HUD: сердечки и счёт (для красоты) ---------- */
.hud { display: flex; align-items: center; gap: 22px; pointer-events: none; }
.hud__lives { display: flex; align-items: center; gap: 4px; }
.hud__lives span { font-size: 10px; margin-left: 6px; color: var(--ink); text-shadow: 2px 2px 0 #000; }
.heart { width: 20px; height: auto; display: block; filter: drop-shadow(2px 2px 0 #000); }
.heart.full { fill: var(--magenta); }
.heart.empty { fill: #6a5a9e; opacity: .7; }
.heart.full:nth-child(3) { animation: beat 1.2s steps(1) infinite; }
@keyframes beat { 50% { fill: #ff7aa5; } }
.hud__score { display: flex; flex-direction: column; align-items: center; gap: 6px; text-shadow: 2px 2px 0 #000; }
.hud__score span { font-size: 8px; color: var(--amber); text-transform: uppercase; letter-spacing: .1em; }
.hud__score b { font-weight: 400; font-size: 14px; color: var(--ink); letter-spacing: .08em; }
body.still .heart { animation: none; }

/* подпись автора */
.byline {
  font-size: 9px; color: var(--muted); letter-spacing: .06em;
  text-shadow: 1px 1px 0 #000;
}
.byline b { font-weight: 400; color: var(--magenta); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
