/* Shared layout for the game pages. Each page sets a theme class on <body>:
   .t-logos (sunset pixels), .t-codecraft (control room), .t-battle (staff map paper). */
:root {
  --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-body: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --f-code: "JetBrains Mono", Consolas, "Courier New", monospace;
  --f-pixel: "Press Start 2P", "Courier New", monospace;
  --f-stencil: "Russo One", "Arial Black", sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --added: #4cc38a;
  --changed: #f2b84b;
  --fixed: #6aa8ff;
}
.t-logos {
  color-scheme: dark;
  --bg: #1a1033; --bg-2: #261645; --surface: #2f1b52; --line: #4a2f73;
  --text: #fbefe6; --muted: #d6bccf; --accent: #ff8a3d; --accent-2: #c2477f; --on-accent: #1b0f05;
  --h-font: var(--f-display); --label-font: var(--f-pixel);
  --hero-fade: #1a1033;
}
.t-codecraft {
  color-scheme: dark;
  --bg: #07101c; --bg-2: #0b1726; --surface: #0f1f33; --line: #1f3a55;
  --text: #e6f3ff; --muted: #97b5cc; --accent: #3ee0ff; --accent-2: #f29b38; --on-accent: #03141c;
  --h-font: var(--f-display); --label-font: var(--f-code);
  --hero-fade: #07101c;
}
.t-battle {
  color-scheme: light;
  --bg: #eee2c4; --bg-2: #e6d6ae; --surface: #f6eedb; --line: #c9b78d;
  --text: #2a2620; --muted: #5d5444; --accent: #c8382e; --accent-2: #2f56c9; --on-accent: #fff6ea;
  --h-font: var(--f-stencil); --label-font: var(--f-code);
  --hero-fade: #1d1a14;
  --added: #2e8b57; --changed: #b7791f; --fixed: #2f56c9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.6 var(--f-body); overflow-x: hidden; }
.t-battle body, body.t-battle {
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px);
  background-size: 40px 40px;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
img { max-width: 100%; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1rem var(--f-display); }
.brand img { width: 34px; height: 34px; }
.games-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.games-nav a { text-decoration: none; font-size: .88rem; padding: 6px 12px; border-radius: 999px; color: var(--muted); }
.games-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.games-nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.brand { white-space: nowrap; }
@media (max-width: 640px) { .games-nav { display: none; } .lang { margin-left: auto; } }

/* hero */
.hero { position: relative; color: #fff; background: #000; }
picture { display: contents; }
picture > source { display: none; }
.hero > img, .hero > picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.t-logos .hero img { image-rendering: pixelated; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--hero-fade) 30%, transparent) 45%, var(--hero-fade) 100%); }
.hero .wrap { position: relative; z-index: 1; padding-block: clamp(140px, 22vw, 260px) 40px; }
.crumbs { font: 600 .78rem var(--f-code); letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.hero h1 { font: 900 clamp(2.6rem, 7vw, 5.2rem)/1 var(--h-font); letter-spacing: .02em; margin-top: 12px; text-shadow: 0 4px 30px #0009; }
.t-battle .hero h1 { font-weight: 400; text-transform: uppercase; }
.hero .tagline { margin-top: 14px; font-size: 1.2rem; max-width: 36em; color: #f1ece4; text-shadow: 0 2px 12px #000a; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font: 600 .98rem var(--f-body); text-decoration: none; border: 2px solid transparent; transition: transform .15s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-main { background: var(--accent); color: var(--on-accent); }
.btn-line { border-color: #ffffff70; color: #fff; }
.btn-line:hover { border-color: #fff; }
.t-battle .btn { border-radius: 4px; }
.status { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font: 600 .82rem var(--f-code); padding: 6px 12px; border-radius: 999px; background: #0008; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--added); box-shadow: 0 0 0 4px color-mix(in srgb, var(--added) 30%, transparent); }
.status.closed i { background: #aaa; box-shadow: none; }

/* facts strip */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.facts div { background: var(--bg-2); padding: 18px 20px; }
.facts b { display: block; font: 700 1.5rem var(--h-font); color: var(--accent); font-variant-numeric: tabular-nums; }
.t-battle .facts b { font-weight: 400; color: var(--accent-2); }
.facts span { font-size: .85rem; color: var(--muted); }

/* sections */
section.block { padding-block: 72px; }
section.block.alt { background: var(--bg-2); }
.label { font: 400 .72rem/1.6 var(--label-font); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.t-logos .label { font-size: .62rem; letter-spacing: .04em; }
.block h2 { font: 700 clamp(1.7rem, 3.6vw, 2.5rem)/1.1 var(--h-font); margin-top: 10px; }
.t-battle .block h2 { font-weight: 400; text-transform: uppercase; }
.lead { margin-top: 16px; max-width: 42em; color: var(--muted); font-size: 1.08rem; }
.lead b { color: var(--text); font-weight: 600; }
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.two > * { min-width: 0; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 28px; } }
.prose p + p { margin-top: 14px; }
.prose { color: var(--muted); max-width: 40em; }
.prose b { color: var(--text); font-weight: 600; }

.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.features li { padding: 18px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.features b { display: block; font-weight: 600; margin-bottom: 4px; }
.features span { color: var(--muted); font-size: .95rem; }
.t-battle .features li { border-radius: 4px; border-width: 2px; }

/* generic table */
.table-wrap { overflow-x: auto; margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 .76rem var(--f-code); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* gallery + lightbox */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 28px; }
.gallery figure { margin: 0; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
.gallery img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .3s ease; }
.gallery button:hover img { transform: scale(1.03); }
.gallery figcaption { margin-top: 8px; font-size: .86rem; color: var(--muted); }
.gallery .wide { grid-column: span 2; }
@media (max-width: 640px) { .gallery .wide { grid-column: auto; } }
.t-battle .gallery button { border-radius: 3px; border: 2px solid var(--text); }
.t-codecraft .gallery button { border: 1px solid var(--line); }
dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: min(96vw, 1600px); max-height: 94vh; }
dialog.lightbox::backdrop { background: #000d; }
dialog.lightbox img { display: block; max-width: 100%; max-height: 86vh; border-radius: 8px; margin-inline: auto; }
dialog.lightbox p { color: #eee; text-align: center; margin-top: 10px; font-size: .95rem; }
dialog.lightbox .lb-nav { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
dialog.lightbox button { font: 600 .9rem var(--f-body); padding: 8px 16px; border-radius: 999px; border: 1px solid #ffffff55; background: #0008; color: #fff; cursor: pointer; }

/* release timeline */
.timeline { list-style: none; padding: 0; margin: 32px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.release { position: relative; padding-left: 48px; padding-bottom: 26px; }
.release::before { content: ""; position: absolute; left: 7px; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.release.latest::before { background: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
.release.wip::before { border-style: dashed; border-color: var(--muted); }
.rel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.ver { font: 700 1.1rem var(--h-font); }
.t-battle .ver { font-weight: 400; }
.date { font: 600 .82rem var(--f-code); color: var(--muted); font-variant-numeric: tabular-nums; }
.pill { font: 600 .72rem var(--f-code); padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent); letter-spacing: .04em; }
.pill.soft { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--muted); }
.rel-title { margin-top: 4px; font-weight: 600; }
.rel-body { margin-top: 10px; display: grid; gap: 8px; }
.grp { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; }
.grp > span { font: 600 .72rem var(--f-code); text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; border-radius: 6px; text-align: center; }
.grp.add > span { background: color-mix(in srgb, var(--added) 18%, transparent); color: var(--added); }
.grp.chg > span { background: color-mix(in srgb, var(--changed) 18%, transparent); color: var(--changed); }
.grp.fix > span { background: color-mix(in srgb, var(--fixed) 18%, transparent); color: var(--fixed); }
.grp ul { margin: 0; padding-left: 18px; color: var(--muted); }
.grp li + li { margin-top: 3px; }
.grp li b { color: var(--text); font-weight: 600; }
.tester { font: 600 .68rem var(--f-code); color: var(--accent); white-space: nowrap; }
@media (max-width: 560px) { .grp { grid-template-columns: 1fr; gap: 4px; } .grp > span { justify-self: start; } }
details.older > summary { cursor: pointer; list-style: none; display: inline-flex; gap: 8px; align-items: center; margin: 6px 0 0 48px; font-weight: 600; color: var(--accent); }
details.older > summary::-webkit-details-marker { display: none; }
details.older > summary::before { content: "＋"; }
details.older[open] > summary::before { content: "－"; }
details.older > .timeline { margin-top: 18px; }

/* plans */
.plans { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.plans li { padding: 16px 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.plans b { display: block; color: var(--text); font-weight: 600; }

/* footer */
.join { padding-block: 64px; text-align: left; }
.join .box { border-radius: 20px; padding: clamp(24px, 4vw, 44px); background: var(--surface); border: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.join h2 { font: 700 clamp(1.5rem, 3vw, 2.1rem)/1.1 var(--h-font); }
.t-battle .join h2 { font-weight: 400; text-transform: uppercase; }
.join p { color: var(--muted); margin-top: 8px; max-width: 34em; }
.join .btn-line { color: var(--text); border-color: var(--line); }
footer { padding-block: 24px 36px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }

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

/* language switcher */
.top .games-nav { margin-left: auto; }
.lang { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; flex: none; }
.lang a { font: 600 .74rem var(--f-code); letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.lang a:hover { color: var(--text); }
.lang a[aria-current] { background: var(--text); color: var(--bg); }

/* studio pages (press kit): the night palette of the home page */
.t-studio {
  color-scheme: dark;
  --bg: #10123a; --bg-2: #1a1d52; --surface: #20245f; --line: #343a85;
  --text: #f6f1e4; --muted: #aeb0d8; --accent: #ff8a3d; --accent-2: #3ee0ff; --on-accent: #1b0f05;
  --h-font: var(--f-display); --label-font: var(--f-code);
  --hero-fade: #10123a;
}
.contact { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contact code { font: 600 1rem var(--f-code); color: var(--text); user-select: all; }
.contact button { font: 600 .8rem var(--f-body); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.contact button:hover { color: var(--text); border-color: var(--text); }

/* gameplay video */
figure.video { margin: 28px 0 0; }
figure.video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; }
.t-battle figure.video video { border-radius: 4px; border: 2px solid var(--text); box-shadow: 0 26px 50px -24px #0008; }
