:root {
  --bg: #04140f;
  --bg2: #072018;
  --ink: #e7ffe9;
  --muted: #93c3a4;
  --moss: #9be15d;
  --moss-deep: #3aa34a;
  --brass: #e0c36a;
  --brass-dim: #8a7030;
  --pearl: #f4e6c8;
  --danger: #ff6b7a;
  --line: rgba(155, 225, 93, 0.16);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { 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(1200px 600px at 50% -10%, rgba(90, 180, 110, 0.16), transparent 60%),
    var(--bg);
  min-height: 100dvh;
}
img { max-width: 100%; height: auto; }
a { color: var(--moss); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pearl); }
.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(4, 20, 15, 0.72);
  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: 12px;
  box-shadow: 0 0 0 1px rgba(155, 225, 93, 0.35), 0 0 24px rgba(90, 255, 140, 0.18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
}
.site-nav { display: flex; gap: 18px; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.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(--moss); }
.copyright { margin: 0; color: var(--ink); }
.marks { margin: 0; max-width: 70ch; }

.page-head { padding: 48px 0 10px; }
.page-head h1, .gf-panel h1, .gf-panel h2, .section h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0.2em 0 0.4em;
}
.page-head h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
.kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
}
.lede {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--pearl);
  max-width: 42rem;
}
.section { padding: 28px 0 56px; }
.prose { max-width: 66ch; }
.prose h2 { font-size: 1.8rem; }
.prose p { color: #cfead6; }
.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
}
.moss-card {
  margin: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
}
.moss-card img { display: block; width: 100%; }
.moss-card figcaption {
  padding: 10px 14px 14px;
  color: var(--muted);
  font-size: 0.85rem;
}
.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.signal {
  background: linear-gradient(180deg, rgba(155, 225, 93, 0.06), rgba(4, 20, 15, 0.2));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 18px 20px;
}
.signal h3 { margin: 6px 0 8px; font-family: var(--display); font-size: 1.25rem; }
.signal p { margin: 0; color: var(--muted); }
.signal .idx {
  color: var(--brass);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 12px 22px;
  border-radius: 999px;
  color: #04140f;
  background: linear-gradient(180deg, #d4f07a, #4fad45);
  box-shadow: 0 0 0 1px rgba(200, 255, 140, 0.4), 0 10px 30px rgba(80, 220, 120, 0.22);
}
.btn:hover { filter: brightness(1.06); color: #04140f; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600;
}
.btn.ghost:hover { color: var(--moss); box-shadow: inset 0 0 0 1px var(--moss); }

/* Game stage */
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(4, 20, 15, 0.82), rgba(4, 20, 15, 0.05));
  border-bottom: 0;
}
body.is-game .site-footer {
  padding: 8px 0 12px;
  font-size: 0.75rem;
  background: rgba(4, 20, 15, 0.88);
}
body.is-game .site-footer .marks { display: none; }
body.is-game main { min-height: 0; }
.game-stage, .gf-game { height: 100%; position: relative; }
.gf-game { overflow: hidden; background: #03110c; }
#sea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.gf-hud {
  position: absolute;
  top: 58px;
  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 #04140f;
}
.gf-hud-r { justify-self: end; display: flex; gap: 8px; pointer-events: auto; }
.gf-hud-l { display: flex; flex-direction: column; gap: 4px; }
.gf-hud-c { text-align: center; }
.gf-stat span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.gf-stat b {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
}
.gf-combo {
  font-family: var(--display);
  font-style: italic;
  color: var(--moss);
  min-height: 1.2em;
  font-size: 1.05rem;
}
.gf-chart {
  width: 84px;
  height: 6px;
  margin: 6px auto 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.gf-chart i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--moss), var(--brass));
}
.gf-icon-btn {
  pointer-events: auto;
  background: rgba(4, 20, 15, 0.55);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.gf-cds {
  position: absolute;
  left: 12px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}
.gf-cd {
  width: 120px;
  background: rgba(4, 20, 15, 0.45);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 8px 7px;
}
.gf-cd em {
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.gf-cd b {
  display: block;
  height: 4px;
  margin-top: 4px;
  border-radius: 99px;
  background: var(--moss);
  width: 100%;
  transform-origin: left center;
}

.gf-banner {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 4;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--pearl);
  text-align: center;
  text-shadow: 0 8px 40px #04140f;
  pointer-events: none;
  width: min(90vw, 40rem);
}

.gf-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% 30%, rgba(40, 90, 60, 0.35), rgba(4, 20, 15, 0.55) 55%, rgba(4, 20, 15, 0.78));
}
.gf-panel.slim { background: rgba(4, 20, 15, 0.72); backdrop-filter: blur(8px); }
.gf-panel h1 { font-size: clamp(2.4rem, 8vw, 4.4rem); margin: 0.1em 0 0.2em; }
.gf-panel h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.gf-panel .lede { margin: 0 auto 18px; }
.gf-moss {
  width: min(220px, 46vw);
  height: auto;
  border-radius: 50%;
  mask-image: radial-gradient(circle at 50% 46%, #000 54%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 54%, transparent 72%);
  filter: drop-shadow(0 18px 40px rgba(90, 255, 140, 0.28));
  animation: moss-bob 3.6s ease-in-out infinite;
}
@keyframes moss-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.gf-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hint, .best { color: var(--muted); font-size: 0.9rem; }
.gf-over-score { font-family: var(--display); font-size: 1.4rem; color: var(--moss); }

.gf-touch {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.gf-stick {
  position: absolute;
  left: 22px;
  bottom: 28px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(155, 225, 93, 0.25);
  background: rgba(4, 20, 15, 0.28);
  pointer-events: auto;
}
.gf-stick i {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--moss);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(155, 225, 93, 0.5);
}
.gf-touch-btns {
  position: absolute;
  right: 16px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}
.gf-touch-btns button {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(224, 195, 106, 0.4);
  background: rgba(4, 20, 15, 0.55);
  color: var(--pearl);
  font: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[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(4, 20, 15, 0.96);
    border: 1px solid var(--line);
    padding: 12px 16px;
    border-radius: 14px;
  }
  .site-nav.open { display: flex; }
  .gf-cds { display: none; }
  body.is-game .site-footer .marks { display: none; }
}

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