/* Storm32 — paleta oparta na logo (koliber z pikseli + błyskawice) */
:root {
  --bg: #01091c;
  --bg-2: #061430;
  --panel: #0a1c3e;
  --panel-hi: #12295a;
  --line: #1d3a72;
  --text: #e6ecf5;
  --muted: #93a6c8;
  --silver: #d3dae4;
  --cyan: #3ad6e8;
  --bolt: #a8ecff;
  --green: #72d24a;
  --magenta: #d6358a;
  --purple: #7b44d4;
  --orange: #ff7a1a;
  --red: #e8401c;
  --amber: #ffc23a;
  --px: 4px;
  --font-pixel: "Silkscreen", ui-monospace, monospace;
  --font-body: "VT323", ui-monospace, "Courier New", monospace;
  --maxw: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.35;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; image-rendering: auto; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--bolt); text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--orange); color: var(--bg); padding: 8px 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Skanlinie CRT na całej stronie */
body::after {
  content: ""; 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,.18) 2px 3px);
  mix-blend-mode: multiply;
}

/* ---------- Nawigacja ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(1, 9, 28, .88);
  backdrop-filter: blur(6px);
  border-bottom: var(--px) solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { font-family: var(--font-pixel); font-size: 22px; color: var(--silver); letter-spacing: 1px; white-space: nowrap; }
.brand b { color: var(--orange); font-weight: normal; }
.brand:hover { text-decoration: none; color: #fff; }
.nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; align-items: center; }
.nav ul a { color: var(--muted); font-size: 22px; }
.nav ul a:hover { color: var(--text); text-decoration: none; }
.lang { font-family: var(--font-pixel); font-size: 14px; border: 2px solid var(--line); padding: 6px 8px; color: var(--amber) !important; }
.menu-btn { display: none; background: none; border: 2px solid var(--line); color: var(--text); font-family: var(--font-pixel); font-size: 14px; padding: 8px 10px; cursor: pointer; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav ul {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-2); border-bottom: var(--px) solid var(--line);
  }
  .nav ul.open { display: flex; }
  .nav ul li a { display: block; padding: 14px 16px; border-top: 1px solid var(--line); }
  .nav ul li .lang { display: inline-block; margin: 12px 16px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 40px 0 56px;
  background: radial-gradient(ellipse at 55% 40%, #0b2150 0%, var(--bg) 62%); }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.hero .wrap { position: relative; text-align: center; }
.hero-logo { margin: 8px auto 0; max-width: 700px; width: 100%;
  filter: drop-shadow(0 0 18px rgba(58, 214, 232, .28)) drop-shadow(0 0 42px rgba(123, 68, 212, .22));
  animation: hover-bird 6s ease-in-out infinite; }
@keyframes hover-bird { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero h1 { font-family: var(--font-pixel); font-size: clamp(18px, 3.2vw, 30px); line-height: 1.7; margin: 8px 0 12px; color: var(--silver); text-shadow: 0 0 12px rgba(58,214,232,.35); }
.hero h1 .hl { color: var(--orange); }
.hero p.lead { max-width: 720px; margin: 0 auto 28px; color: var(--muted); font-size: 24px; }
.cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; font-family: var(--font-pixel); font-size: 16px; line-height: 1;
  padding: 16px 20px; color: var(--bg); background: var(--orange); border: 0; cursor: pointer;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.35), inset 4px 4px 0 rgba(255,255,255,.35), 0 0 0 4px var(--bg), 0 0 0 8px var(--red);
}
.btn:hover { text-decoration: none; color: var(--bg); background: #ff9b4d; }
.btn:active { transform: translate(2px, 2px); }
.btn.alt { background: var(--cyan); box-shadow: inset -4px -4px 0 rgba(0,0,0,.35), inset 4px 4px 0 rgba(255,255,255,.35), 0 0 0 4px var(--bg), 0 0 0 8px var(--purple); }
.btn.alt:hover { background: var(--bolt); }

/* Belki "copper" w stylu Amigi */
.copper { height: 24px; background:
  linear-gradient(to bottom,
    var(--purple) 0 3px, var(--magenta) 3px 6px, var(--red) 6px 9px, var(--orange) 9px 12px,
    var(--amber) 12px 15px, var(--green) 15px 18px, var(--cyan) 18px 21px, #2a6ad8 21px 24px); }
.copper.thin { height: 8px; background: linear-gradient(90deg, var(--purple), var(--magenta), var(--orange), var(--green), var(--cyan)); }

/* ---------- Sekcje ---------- */
section { padding: 72px 0; }
section:nth-of-type(even) { background: var(--bg-2); }
h2 { font-family: var(--font-pixel); font-size: clamp(24px, 3.6vw, 34px); line-height: 1.5; margin: 0 0 8px; color: var(--silver); }
h2::before { content: "▶ "; color: var(--orange); }
.sub { color: var(--muted); margin: 0 0 36px; max-width: 760px; }
h3 { font-family: var(--font-pixel); font-size: 19px; line-height: 1.6; margin: 0 0 12px; }

.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Okno w stylu Workbencha */
.win {
  background: var(--panel); border: var(--px) solid var(--line);
  box-shadow: 8px 8px 0 rgba(0,0,0,.45);
}
.win-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: repeating-linear-gradient(to bottom, var(--panel-hi) 0 2px, var(--line) 2px 4px);
  font-family: var(--font-pixel); font-size: 13px; color: var(--silver);
}
.win-bar::before { content: ""; width: 14px; height: 14px; background: var(--silver); box-shadow: inset 4px 4px 0 var(--panel); flex: none; }
.win-body { padding: 20px; }
.win-body p { margin: 0 0 12px; }
.win.cyan { border-color: #1a5f78; }
.win.cyan h3 { color: var(--cyan); }
.win.orange { border-color: #7a3a16; }
.win.orange h3 { color: var(--orange); }
.win.green h3 { color: var(--green); }
.win.magenta h3 { color: var(--magenta); }

ul.px { list-style: none; padding: 0; margin: 0; }
ul.px li { padding-left: 24px; position: relative; margin: 6px 0; }
ul.px li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 8px; height: 8px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.win.orange ul.px li::before { background: var(--orange); box-shadow: 0 0 6px var(--orange); }

/* Karta gry */
.game { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; }
@media (max-width: 820px) { .game { grid-template-columns: 1fr; } }
.game-art {
  position: relative; min-height: 280px; overflow: hidden;
  background:
    linear-gradient(to top, rgba(1,9,28,.9), rgba(1,9,28,0) 60%),
    linear-gradient(160deg, #3a1d0e 0%, #6b3413 35%, #c9631f 62%, #f2a03c 78%, #2b1a14 79%, #1a0f0c 100%);
}
.game-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.game-art .badge { position: absolute; left: 16px; top: 16px; }
.badge { display: inline-block; font-family: var(--font-pixel); font-size: 13px; padding: 6px 8px; background: var(--amber); color: var(--bg); }
.badge.green { background: var(--green); }
.badge.cyan { background: var(--cyan); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tags li { font-size: 18px; border: 2px solid var(--line); padding: 2px 8px; color: var(--muted); }

/* Tabela specyfikacji */
.spec { width: 100%; border-collapse: collapse; }
.spec th, .spec td { text-align: left; padding: 10px 12px; border-bottom: 2px dashed var(--line); vertical-align: top; }
.spec th { font-family: var(--font-pixel); font-size: 14px; color: var(--orange); font-weight: normal; width: 34%; line-height: 1.6; }
@media (max-width: 560px) {
  .spec th, .spec td { display: block; width: 100%; border: 0; padding: 6px 0; }
  .spec tr { display: block; border-bottom: 2px dashed var(--line); padding: 8px 0; }
}

/* Terminal / CLI */
.cli { font-family: var(--font-body); background: #000a14; color: var(--green); padding: 16px; border: var(--px) solid var(--line); overflow-x: auto; white-space: pre; font-size: 20px; }
.cli .c { color: var(--muted); }

/* Stopka */
footer { padding: 40px 0; border-top: var(--px) solid var(--line); color: var(--muted); font-size: 20px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.guru { font-family: var(--font-pixel); font-size: 13px; color: var(--red); }

@media (max-width: 560px) {
  body { font-size: 20px; }
  section { padding: 56px 0; }
  .btn { font-size: 14px; padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* Prawdziwe ekrany z gier */
.game-art.shot { background: var(--panel); min-height: 0; display: flex; align-items: center; }
.game-art.shot img { width: 100%; height: auto; image-rendering: pixelated; }
.game-art.soon { display: grid; place-items: center; min-height: 240px;
  background: repeating-linear-gradient(to bottom, #061430 0 3px, #0a1c3e 3px 6px); }
.game-art.soon p { font-family: var(--font-pixel); font-size: 18px; color: var(--muted); margin: 0; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Przełącznik dźwięku i błysk nieba */
.sound { font-family: var(--font-pixel); font-size: 13px; background: none; border: 2px solid var(--line); color: var(--cyan); padding: 6px 8px; cursor: pointer; }
.sound[aria-pressed="true"] { color: var(--bg); background: var(--cyan); border-color: var(--cyan); }
@media (max-width: 760px) { .nav ul li .sound { margin: 12px 16px 0; } }
.flash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at var(--fx, 50%) 0%, rgba(168,236,255,.35), rgba(168,236,255,0) 70%); opacity: 0; }
.flash.on { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: 1; } 15% { opacity: .2; } 25% { opacity: .8; } 100% { opacity: 0; } }

/* Zakup na itch.io: mały, dyskretny przycisk */
.buy { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn.itch { font-size: 12px; padding: 7px 10px; background: #fa5c5c; color: var(--bg);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.35), inset 2px 2px 0 rgba(255,255,255,.3); }
.btn.itch:hover { background: #ff8a8a; color: var(--bg); }
.btn.itch[aria-disabled="true"] { background: transparent; color: var(--muted); box-shadow: none; border: 2px solid var(--line); padding: 5px 8px; cursor: default; pointer-events: none; }
.buy .price { font-family: var(--font-pixel); font-size: 13px; color: #ff9b4d; }
@media (max-width: 560px) { .btn.itch { font-size: 12px; padding: 7px 10px; } }

/* Panele bez obwódek: przyciski w nagłówku, w hero i itch.io jako pełne, kolorowe płytki */
.btn, .btn.alt { box-shadow: inset -3px -3px 0 rgba(0,0,0,.3), inset 3px 3px 0 rgba(255,255,255,.3); }
.lang, .sound, .menu-btn { border: 0; background: var(--panel-hi); padding: 8px 10px; }
.lang { color: var(--orange) !important; }
.lang:hover { background: var(--line); text-decoration: none; }
.sound[aria-pressed="true"] { background: var(--cyan); color: var(--bg); }
.btn.itch { background: var(--orange); color: var(--bg); box-shadow: inset -2px -2px 0 rgba(0,0,0,.3), inset 2px 2px 0 rgba(255,255,255,.3); }
.btn.itch:hover { background: #ff9b4d; color: var(--bg); }
.btn.itch[aria-disabled="true"] { background: var(--orange); color: var(--bg); opacity: .6; border: 0; padding: 7px 10px; box-shadow: none; }
/* itch.io: dokładnie jak "Nasze gry" (kolor, cieniowanie), także przed podaniem adresu */
.btn.itch, .btn.itch[aria-disabled="true"] { background: var(--orange); color: var(--bg); opacity: 1;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.3), inset 3px 3px 0 rgba(255,255,255,.3); border: 0; padding: 7px 10px; }
/* Przełącznik języka bez tła, na kolorze nagłówka */
.lang, .lang:hover { background: transparent; }
.lang:hover { color: #ff9b4d !important; }
/* Najechanie na pomarańczowe przyciski: jaśniejszy pomarańcz zamiast żółtego */
.btn:not(.alt):hover, .btn.itch:hover { background: #ff9b4d; color: var(--bg); }
/* Obrazki gier z ramką tła z każdej strony */
.game-art.shot { padding: 20px; justify-content: center; }
.game-art.shot img { box-shadow: 0 0 0 2px var(--line); }
.game-art.shot { align-items: flex-start; }

/* Dźwięk, język i menu w jednym bloku po prawej (na telefonie zawsze widoczne w nagłówku) */
.nav ul { margin-left: auto; }
.nav-tools { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  .nav .wrap { gap: 10px; }
  .brand { font-size: 18px; }
  .nav-tools { gap: 6px; }
  .nav-tools .sound, .nav-tools .menu-btn { font-size: 11px; padding: 7px 8px; }
  .nav-tools .lang { font-size: 13px; padding: 6px 4px; }
}
footer .fine { flex-basis: 100%; margin: 0; font-size: 16px; color: var(--muted); opacity: .8; }
.brand-wrap { display: flex; align-items: center; gap: 12px; }
@media (max-width: 760px) { .brand-wrap { gap: 6px; } }
/* Jeden rozmiar miniatur gier: 16:10, kadrowane bez zniekształceń */
.game-art.shot img { aspect-ratio: 16 / 10; height: auto; object-fit: cover; object-position: center 30%; }
/* Język: na komputerze po prawej (jak wcześniej), na telefonie obok STORM32 */
.lang-m { display: none; }
@media (max-width: 760px) { .lang-m { display: inline-block; } .lang-d { display: none; } }
/* Miniatury: ekran tytułowy + 3 plansze, siatka 2x2 kafelków 8:5 */
.game-art.shot .shots { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-art.shot .shots img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; object-position: center; }
/* Lightbox */
.game-art.shot .shots img { cursor: zoom-in; transition: box-shadow .15s; }
.game-art.shot .shots img:hover, .game-art.shot .shots img:focus-visible { box-shadow: 0 0 0 2px var(--orange); outline: none; }
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(1, 9, 28, .94); display: flex; align-items: center; justify-content: center; padding: 56px 16px; }
.lb[hidden] { display: none; }
.lb figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.lb img { max-width: min(1280px, 100%); max-height: calc(100vh - 150px); width: auto; height: auto; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--line); }
.lb figcaption { font-family: var(--font-body, "VT323", monospace); font-size: 20px; color: var(--text); text-align: center; }
.lb-btn { position: absolute; background: none; border: 0; color: var(--orange); font-family: var(--font-pixel); font-size: 26px; line-height: 1; padding: 12px; cursor: pointer; }
.lb-btn:hover, .lb-btn:focus-visible { color: #ff9b4d; outline: none; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }
@media (max-width: 760px) { .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; } .lb img { max-height: calc(100vh - 180px); } }
