:root {
  --bg: #14110f;
  --bg2: #1d1814;
  --panel: #2a211b;
  --panel-hi: #3a2d22;
  --edge: #0b0907;
  --gold: #f5b82e;
  --gold-hi: #ffd76a;
  --gold-lo: #b9781a;
  --grass: #5fbf3a;
  --grass-lo: #37801f;
  --crystal: #4fb3ff;
  --text: #f3eadb;
  --muted: #b9a993;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --body: "VT323", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --px: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font: 22px/1.35 var(--body);
  background-color: var(--bg);
  /* stone-block texture */
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.025) 2px, transparent 2px),
    linear-gradient(rgba(255,255,255,.025) 2px, transparent 2px),
    linear-gradient(90deg, rgba(0,0,0,.25) 2px, transparent 2px),
    linear-gradient(rgba(0,0,0,.25) 2px, transparent 2px);
  background-size: 64px 64px, 64px 64px, 32px 32px, 32px 32px;
  background-position: 0 0, 0 0, 30px 30px, 30px 30px;
  image-rendering: pixelated;
}
a { color: var(--gold-hi); }
a:hover { color: #fff; }
code { font-family: var(--body); background: #0008; padding: 0 .35em; border: 2px solid #0006; color: var(--gold-hi); white-space: nowrap; }
@media (max-width: 600px) { code { white-space: normal; overflow-wrap: anywhere; } }
h1, h2, h3 { font-family: var(--pixel); font-weight: 400; line-height: 1.4; margin: 0 0 .8em; }
h1 { font-size: clamp(18px, 3.2vw, 32px); color: var(--gold); text-shadow: 4px 4px 0 var(--edge), 0 0 24px rgba(245,184,46,.35); }
h2 { font-size: clamp(16px, 2.4vw, 24px); text-align: center; color: var(--gold); text-shadow: 3px 3px 0 var(--edge); }
h3 { font-size: 13px; color: var(--text); }

/* pixel frame: stepped corners made of box-shadows */
.pixel-frame, .card, .btn, .framed, .gallery a, .stats div {
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--edge),
    0 var(--px) 0 0 var(--edge),
    calc(-1 * var(--px)) 0 0 0 var(--edge),
    var(--px) 0 0 0 var(--edge),
    0 calc(2 * var(--px)) 0 0 rgba(0,0,0,.45);
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(12px, 4vw, 40px);
  background: rgba(20,17,15,.92);
  border-bottom: 4px solid var(--edge);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); font-family: var(--pixel); font-size: 12px; }
.nav nav { display: flex; align-items: center; gap: clamp(8px, 2vw, 22px); flex-wrap: wrap; justify-content: flex-end; }
.nav nav a { color: var(--text); text-decoration: none; font-size: 22px; }
.nav nav a:hover { color: var(--gold-hi); }
.lang { font-family: var(--pixel); font-size: 10px; background: var(--panel-hi); color: var(--gold-hi); border: 0; padding: 8px 10px; cursor: pointer; box-shadow: 0 0 0 3px var(--edge); }
@media (max-width: 720px) { .nav nav a:not([href^="https"]) { display: none; } }

/* hero */
.hero { position: relative; overflow: hidden; text-align: center; padding: clamp(28px, 6vw, 64px) 16px clamp(48px, 8vw, 88px); border-bottom: 8px solid var(--grass-lo); }
.hero::after { /* grass + dirt strip at the bottom */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px;
  background: repeating-linear-gradient(90deg, var(--grass) 0 16px, #4aa82c 16px 32px, var(--grass) 32px 40px, #6fd047 40px 48px);
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20,17,15,.35), rgba(20,17,15,.85) 75%, var(--bg)), url("assets/hero.jpg") center 30% / cover no-repeat;
  filter: saturate(1.1);
}
.hero-inner { position: relative; max-width: 960px; margin: 0 auto; }
.logo { width: min(340px, 70vw); height: auto; filter: drop-shadow(0 0 30px rgba(245,184,46,.35)) drop-shadow(0 10px 0 rgba(0,0,0,.4)); animation: bob 4s ease-in-out infinite; image-rendering: auto; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .logo { animation: none; } html { scroll-behavior: auto; } }
.lead { font-size: clamp(22px, 2.6vw, 28px); color: var(--text); max-width: 720px; margin: 0 auto 28px; text-shadow: 2px 2px 0 var(--edge); }

/* buttons */
.cta { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: center; margin: 12px 0; }
.cta.center { margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 16px 26px; text-decoration: none; color: var(--text);
  font-family: var(--pixel); font-size: 12px; line-height: 1.5;
  background: var(--panel-hi); transition: transform .08s ease, filter .08s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); color: #fff; }
.btn:active { transform: translateY(2px); }
.btn:focus-visible, .lang:focus-visible, .gallery a:focus-visible { outline: 4px solid var(--crystal); outline-offset: 6px; }
.btn-play {
  font-size: clamp(14px, 2vw, 20px); padding: 20px 34px; color: #2b1600;
  background: linear-gradient(180deg, var(--gold-hi) 0 50%, var(--gold) 50% 100%);
  box-shadow:
    0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge),
    inset 0 -6px 0 0 var(--gold-lo), inset 0 4px 0 0 #fff3c4,
    0 10px 0 0 rgba(0,0,0,.45), 0 0 40px rgba(245,184,46,.45);
}
.btn-play:hover { color: #2b1600; }
.btn-play b { display: block; font-weight: 400; }
.btn-play small { display: block; font-family: var(--body); font-size: 20px; color: #5a3500; margin-top: 4px; }
.btn-icon { font-size: 1.4em; }
.btn-alt { background: var(--panel); }
.alt-dl { margin: 18px 0 0; color: var(--muted); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1040px; margin: -36px auto 0; padding: 0 16px; position: relative; }
.stats div { background: var(--panel); text-align: center; padding: 18px 8px; }
.stats b { display: block; font-family: var(--pixel); font-weight: 400; font-size: clamp(18px, 2.6vw, 26px); color: var(--crystal); text-shadow: 3px 3px 0 var(--edge); margin-bottom: 6px; }
.stats span { color: var(--muted); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* sections */
.section { padding: clamp(48px, 7vw, 88px) clamp(16px, 4vw, 40px); max-width: 1200px; margin: 0 auto; }
.section.dark { max-width: none; background: rgba(0,0,0,.35); border-top: 4px solid var(--edge); border-bottom: 4px solid var(--edge); }
.section.dark > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.sub, .center-text { text-align: center; color: var(--muted); margin-top: -10px; }
.center-text { max-width: 760px; margin: 0 auto; color: var(--text); }
.grid { display: grid; gap: 28px; }
.features { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); padding: 22px; }
.card p { margin: 0; color: var(--muted); }
.ico { font-size: 34px; margin-bottom: 10px; }
.list { margin: 0; padding-left: 1.2em; }
.list li { margin: 6px 0; }

/* gameplay clips */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; margin-top: 28px; }
.clips figure { margin: 0; background: #000; }
.clips img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; }
.clips figcaption { padding: 10px 12px; font-weight: 700; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; margin-top: 28px; }
.gallery a { display: block; background: #000; line-height: 0; overflow: hidden; }
.gallery img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .25s ease; image-rendering: pixelated; }
.gallery a:hover img { transform: scale(1.04); }

/* co-op */
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 22px 64px; color: var(--muted); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 44px; height: 44px; display: grid; place-items: center; font-family: var(--pixel); font-size: 14px; color: #08243d; background: var(--crystal); box-shadow: 0 0 0 4px var(--edge); }
.steps b { display: block; color: var(--text); font-family: var(--pixel); font-weight: 400; font-size: 12px; margin: 4px 0 8px; }
.framed { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.note { text-align: center; color: var(--muted); margin-top: 28px; }

/* footer */
.footer { text-align: center; color: var(--muted); padding: 36px 16px 48px; border-top: 4px solid var(--edge); background: #0d0b09; font-size: 20px; }
.footer p { margin: 6px auto; max-width: 900px; }

/* lightbox */
dialog#lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
dialog#lightbox::backdrop { background: rgba(0,0,0,.85); }
dialog#lightbox img { display: block; max-width: 96vw; max-height: 92vh; image-rendering: pixelated; box-shadow: 0 0 0 4px var(--edge); }
dialog#lightbox button { position: absolute; top: 8px; right: 8px; font: 16px var(--pixel); background: var(--panel-hi); color: var(--text); border: 0; padding: 8px 12px; cursor: pointer; box-shadow: 0 0 0 3px var(--edge); }
