:root {
  --bg: #140e0a;
  --bg2: #1c1510;
  --ink: #f4ead4;
  --muted: #b89a72;
  --amber: #ffb020;
  --tracer: #ffe56a;
  --danger: #ff3a2a;
  --olive: #8a9a48;
  --hud: #d6ff3a;
  --line: rgba(255, 176, 32, 0.18);
  --font: "Segoe UI", system-ui, sans-serif;
  --display: Impact, Haettenschweiler, "Arial Black", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  background:
    radial-gradient(1000px 520px at 50% -8%, rgba(255, 140, 40, 0.14), transparent 58%),
    var(--bg);
  min-height: 100dvh;
}
img { max-width: 100%; height: auto; }
a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--tracer); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 40; background: var(--bg2); padding: 8px 12px; }

.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: relative;
  z-index: 8;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 14, 10, 0.78);
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.35), 0 0 20px rgba(255, 80, 20, 0.22);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-kicker {
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}
.brand-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}
.site-nav { display: flex; gap: 18px; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.site-nav a[aria-current="page"],
.site-nav a:hover { color: var(--ink); }
.nav-toggle {
  display: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 0.86rem;
}
.footer-inner { display: grid; gap: 8px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--amber); }
.copyright { margin: 0; color: var(--ink); }
.marks { margin: 0; max-width: 78ch; }

.page-head { padding: 48px 0 10px; }
.page-head h1, .gb-panel h1, .gb-panel h2, .section h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0.2em 0 0.4em;
  text-transform: uppercase;
}
.page-head h1 { font-size: clamp(2.2rem, 7vw, 4rem); }
.kicker {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}
.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.32rem);
  color: var(--ink);
  max-width: 44rem;
  line-height: 1.4;
}
.section { padding: 28px 0 56px; }
.prose { max-width: 66ch; }
.prose h2 { font-size: 1.8rem; }
.prose p { color: #e6d4b4; }
.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}
.moss-card {
  margin: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}
.moss-card img { display: block; width: 100%; }
.moss-card figcaption {
  padding: 10px 14px 14px;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}
.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.signal {
  background: linear-gradient(180deg, rgba(255, 176, 32, 0.07), rgba(20, 14, 10, 0.2));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 18px 20px;
}
.signal h3 { margin: 6px 0 8px; font-family: var(--display); font-size: 1.2rem; letter-spacing: 0.03em; text-transform: uppercase; }
.signal p { margin: 0; color: var(--muted); }
.signal .idx {
  color: var(--hud);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--mono);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 4px;
  color: #140e0a;
  background: linear-gradient(180deg, #ffe56a, #ff8a18);
  box-shadow: 0 0 0 1px rgba(255, 220, 80, 0.4), 0 10px 30px rgba(255, 80, 20, 0.28);
}
.btn:hover { filter: brightness(1.06); color: #140e0a; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.btn.ghost:hover { color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }

body.is-game {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
body.is-game .site-header {
  background: linear-gradient(to bottom, rgba(20, 14, 10, 0.86), rgba(20, 14, 10, 0.05));
  border-bottom: 0;
}
body.is-game .site-footer {
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
  font-size: 0.72rem;
  background: rgba(20, 14, 10, 0.9);
}
body.is-game .site-footer .marks { display: none; }
body.is-game main { min-height: 0; }
.game-stage, .gb-game { height: 100%; position: relative; }
.gb-game { overflow: hidden; background: #1a120c; }
#gb-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
}

.gb-hud {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
  z-index: 9;
  text-shadow: 0 2px 12px #140e0a;
}
.gb-hud-r { justify-self: end; display: flex; gap: 8px; pointer-events: auto; }
.gb-hud-l { display: flex; flex-direction: column; gap: 4px; }
.gb-hud-c { text-align: center; }
.gb-stat span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hud);
  font-family: var(--mono);
}
.gb-stat b {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.gb-combo {
  font-family: var(--display);
  color: var(--tracer);
  min-height: 1.2em;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.gb-flares {
  margin-top: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  color: var(--amber);
}
.gb-icon-btn {
  pointer-events: auto;
  background: rgba(20, 14, 10, 0.55);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.gb-lock {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  z-index: 6;
  font-family: var(--display);
  letter-spacing: 0.28em;
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  color: var(--danger);
  text-shadow: 0 0 18px rgba(255, 40, 30, 0.8);
  pointer-events: none;
  animation: lock-blink 0.28s steps(2, end) infinite;
}
@keyframes lock-blink {
  50% { opacity: 0.15; }
}

.gb-banner {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translateX(-50%);
  z-index: 4;
  font-family: var(--display);
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  color: var(--tracer);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 8px 40px #140e0a;
  pointer-events: none;
  width: min(90vw, 40rem);
}

.gb-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px 32px;
  background: radial-gradient(600px 400px at 50% 28%, rgba(80, 40, 10, 0.38), rgba(20, 14, 10, 0.58) 55%, rgba(20, 14, 10, 0.82));
}
.gb-panel.slim { background: rgba(20, 14, 10, 0.78); backdrop-filter: blur(8px); }
.gb-panel h1 { font-size: clamp(2.8rem, 10vw, 5.4rem); margin: 0.05em 0 0.15em; }
.gb-panel h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.gb-panel .lede { margin: 0 auto 18px; }
.gb-mascot {
  width: min(200px, 42vw);
  height: auto;
  border-radius: 18px;
  filter: drop-shadow(0 18px 40px rgba(255, 90, 20, 0.32));
}
.gb-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hint, .best { color: var(--muted); font-size: 0.9rem; }
.gb-over-score { font-family: var(--display); font-size: 1.5rem; color: var(--tracer); letter-spacing: 0.04em; }

.gb-touch {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.gb-stick {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid rgba(214, 255, 58, 0.28);
  background: rgba(20, 14, 10, 0.32);
  pointer-events: auto;
  touch-action: none;
}
.gb-stick i {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--hud);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(214, 255, 58, 0.5);
}
.gb-touch-btns {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: auto;
}
.gb-touch-btns button {
  border: 1px solid rgba(255, 176, 32, 0.45);
  background: rgba(20, 14, 10, 0.55);
  color: var(--ink);
  font: inherit;
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  touch-action: none;
}
#gb-flare-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  font-size: 0.78rem;
}
#gb-fire-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  font-size: 1.15rem;
  background: rgba(180, 30, 10, 0.55);
  border-color: rgba(255, 80, 40, 0.7);
  color: #ffe9c8;
  box-shadow: 0 0 24px rgba(255, 50, 20, 0.28);
}
#gb-fire-btn:active, #gb-fire-btn.is-hot {
  background: rgba(255, 70, 20, 0.8);
}

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .split, .signal-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 16px;
    flex-direction: column;
    gap: 8px;
    background: rgba(20, 14, 10, 0.96);
    border: 1px solid var(--line);
    padding: 12px 16px;
    border-radius: 8px;
  }
  .site-nav.open { display: flex; }
  body.is-game .site-footer .marks { display: none; }
}

@media (min-width: 821px) {
  .gb-touch { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .gb-lock { animation: none; }
}
