:root {
  --bg: #f3f6f1;
  --card: #ffffff;
  --ink: #1d2a1f;
  --mute: #5d6e60;
  --accent: #2f7d4f;
  --accent-deep: #246340;
  --spot: #d9a441;
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --panel: #e7efe6;
  --danger: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(29, 42, 31, 0.06);
  --shadow-lg: 0 8px 24px rgba(29, 42, 31, 0.08);
  --max: 1120px;
  --prose: 70ch;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-deep); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--spot); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  z-index: 40;
}
.skip:focus { left: 8px; top: 8px; }

.leaf-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 8% -5%, color-mix(in srgb, var(--spot) 18%, transparent), transparent 55%),
    radial-gradient(ellipse 55% 40% at 96% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 50%),
    linear-gradient(180deg, #eef4ec 0%, var(--bg) 40%, #e8efe6 100%);
}
.leaf-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(90deg, transparent 0, transparent 48px, color-mix(in srgb, var(--accent) 5%, transparent) 49px),
    linear-gradient(0deg, transparent 0, transparent 48px, color-mix(in srgb, var(--accent) 5%, transparent) 49px);
  background-size: 50px 50px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 55%, var(--spot) 0 22%, transparent 23%),
    linear-gradient(145deg, var(--accent), var(--accent-deep));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 35%, transparent);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.2;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.site-nav a {
  text-decoration: none;
  color: var(--mute);
  font-weight: 600;
  font-size: 15px;
}
.site-nav a:hover { color: var(--accent); }

.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 64px;
}

.hero { padding-top: 8px; }
.hero-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1.15;
  font-weight: 400;
}
.hero-lead {
  margin: 0 0 16px;
  max-width: var(--prose);
  color: var(--mute);
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #102418;
  box-shadow: var(--shadow-lg);
}
.stage iframe,
.cover,
.loader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage iframe { border: 0; background: #102418; }
.cover {
  display: grid;
  place-items: center;
  background: #163325;
  z-index: 2;
  cursor: pointer;
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.cover-art .ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--spot) 45%, transparent);
}
.cover-art .ring-a {
  width: 220px;
  height: 220px;
  right: 8%;
  top: 12%;
  animation: drift 7s ease-in-out infinite;
}
.cover-art .ring-b {
  width: 140px;
  height: 140px;
  left: 10%;
  bottom: 16%;
  border-style: dashed;
  animation: drift 9s ease-in-out infinite reverse;
}
.cover-art .specimen {
  position: absolute;
  width: 72px;
  height: 72px;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, var(--spot) 0 18%, transparent 19%),
    radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--accent) 70%, #000) 0 48%, transparent 50%);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--spot) 20%, transparent);
  animation: pulse-soft 2.8s ease-in-out infinite;
}
.cover-cta {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 16px;
  text-align: center;
}
.cover-hint {
  margin: 0;
  color: #e8f3ea;
  font-weight: 700;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}
.play-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--radius);
  background: var(--spot);
  color: #1d2a1f;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--spot) 55%, #7a5a12);
  transition: transform 0.15s ease, background 0.15s ease;
}
.play-btn:hover {
  background: #e4b54d;
  transform: translateY(-1px);
}
.cover:hover .play-btn { animation: none; }

.loader {
  display: none;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #2a5a3c 0%, #102418 70%);
  color: #e8f3ea;
  z-index: 3;
}
.loader p { margin: 0; max-width: 22rem; font-weight: 600; }
.vault-spin {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--spot) 30%, transparent);
  border-top-color: var(--spot);
  animation: spin 0.9s linear infinite;
}

.cover[hidden],
.loader[hidden],
.stage[data-gf-state="loading"] .cover,
.stage[data-gf-state="playing"] .cover {
  display: none !important;
}
.stage[data-gf-state="loading"] .loader:not([hidden]) {
  display: grid !important;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 16px 0 8px;
}
.tool-btn {
  appearance: none;
  cursor: pointer;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.tool-btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}
.tool-btn[aria-pressed="true"],
.tool-btn[data-gf-liked] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.share-msg { font-size: 14px; color: var(--mute); font-weight: 600; }
.play-coach {
  margin: 8px 0 0;
  max-width: var(--prose);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: var(--panel);
  color: var(--accent-deep);
  font-size: 15px;
  font-weight: 600;
}
html[data-gf-playing] .play-coach {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
}
.embed-note {
  margin: 12px 0 0;
  max-width: var(--prose);
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 15px;
  color: var(--mute);
}

.prose {
  margin: 48px 0;
  max-width: var(--prose);
}
.prose h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 400;
}
.prose p { margin: 0 0 14px; }
.shot {
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}
.shot img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.shot figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--mute);
}

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative;
  margin: 0 0 12px;
  padding: 14px 14px 14px 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
}
.steps strong { display: block; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--mute); }

.tier-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
  background: var(--card);
}
.tier-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.9fr;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.tier-row:first-child { border-top: 0; }
.tier-head {
  background: var(--panel);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tips { margin: 0; padding-left: 22px; }
.tips li { margin: 0 0 10px; }

.faq-list { display: grid; gap: 8px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 14px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { color: var(--accent); }
.faq-item p { margin: 0 0 14px; color: var(--mute); }

.engage {
  margin: 64px 0 24px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 760px;
}
.engage h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
}
.engage-lead { margin: 0 0 16px; color: var(--mute); }
.comment-form { display: grid; gap: 12px; margin-bottom: 24px; }
.comment-form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.comment-form input,
.comment-form textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.reply-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--mute);
}
.reply-bar:not(:has([data-gf-reply-to]:not(:empty))) { display: none; }
.comments { display: grid; gap: 12px; }
.comments[data-gf-empty] .comments-empty { display: block; }
.comments-empty { display: none; color: var(--mute); font-weight: 600; }
.comment {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.comment.reply { margin-top: 8px; background: var(--card); }
.comment[data-gf-owner] { border-color: var(--accent); }
.comment header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.comment time { font-size: 13px; color: var(--mute); }
.owner-tag {
  display: none;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
}
.comment[data-gf-owner] .owner-tag { display: inline-block; }
[data-gf-c-reply] {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
}
.comment-count-line {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--mute);
  font-weight: 600;
}
.form-msg { margin: 0; color: var(--accent); min-height: 1.2em; }

.legal-page,
.page-block {
  max-width: var(--prose);
  padding-top: 16px;
}
.legal-page h1,
.page-block h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 400;
}
.body-html h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-top: 1.6rem;
  font-weight: 400;
}
.body-html p,
.body-html li { color: color-mix(in srgb, var(--ink) 88%, var(--mute)); }

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--line);
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 22px;
}
.footer-note {
  color: var(--mute);
  font-size: 14px;
  max-width: var(--prose);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 16px 0;
}
.footer-nav a {
  color: var(--mute);
  font-weight: 600;
  text-decoration: none;
}
.footer-nav a:hover { color: var(--accent); }
.footer-copy { margin: 0; font-size: 13px; color: var(--mute); }

/* Embed shell: full-bleed game frame */
body.embed-shell {
  background: #102418;
  min-height: 100%;
}
body.embed-shell .leaf-bg,
body.embed-shell .site-header,
body.embed-shell .site-footer,
body.embed-shell .skip { display: none !important; }
body.embed-shell .site-main {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.ku-root {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  color: #e8f3ea;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(217, 164, 65, 0.18), transparent 45%),
    linear-gradient(180deg, #163325 0%, #102418 55%, #0b1a12 100%);
}
.ku-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(232, 243, 234, 0.12);
}
.ku-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff;
}
.ku-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #b7d0bb;
}
.ku-meta strong { color: var(--spot); font-weight: 700; }
.ku-stage {
  display: grid;
  place-items: center;
  padding: 16px;
}
.ku-card {
  width: min(100%, 560px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 243, 234, 0.14);
  border-radius: 16px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-lg);
}
.ku-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.2;
}
.ku-card p { margin: 0 0 14px; color: #b7d0bb; }
.ku-prompt {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--spot);
  font-weight: 700;
}
.ku-timer-wrap {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0 0 16px;
}
.ku-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--spot), var(--accent));
  transform-origin: left center;
}
.ku-form { display: grid; gap: 10px; }
.ku-form input {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(232, 243, 234, 0.2);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  padding: 10px 12px;
}
.ku-form input:focus {
  outline: 2px solid var(--spot);
  outline-offset: 1px;
}
.ku-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ku-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
}
.ku-btn-primary {
  background: var(--spot);
  color: #1d2a1f;
  flex: 1 1 auto;
}
.ku-btn-primary:hover { filter: brightness(1.05); }
.ku-btn-ghost {
  background: transparent;
  color: #e8f3ea;
  border: 1px solid rgba(232, 243, 234, 0.25);
}
.ku-feedback {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-weight: 700;
  font-size: 0.95rem;
}
.ku-feedback.ok { color: #8fefb0; }
.ku-feedback.bad { color: #ffb4a8; }
.ku-feedback.idle { color: #b7d0bb; }
.ku-result-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.ku-result-list li {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border-left: 3px solid var(--spot);
  font-size: 0.92rem;
}
.ku-result-list .miss { border-left-color: #ffb4a8; opacity: 0.85; }
.ku-board {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(232, 243, 234, 0.12);
}
.ku-board h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--spot);
}
.ku-board ol {
  margin: 0;
  padding-left: 1.2rem;
  color: #b7d0bb;
  font-size: 0.9rem;
}
.ku-hidden { display: none !important; }

@keyframes spin { to { transform: rotate(1turn); } }
@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse-soft {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .site-main { padding: 0 16px 48px; }
  .hero h1 { font-size: 32px; }
  .prose h2,
  .engage h2 { font-size: 24px; }
  .stage {
    min-height: 280px;
    aspect-ratio: 4 / 5;
  }
  .play-btn { width: 100%; }
  .toolbar .tool-btn { flex: 1 1 calc(50% - 8px); }
  .tier-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .vault-spin,
  .cover-art .ring,
  .cover-art .specimen { animation: none; }
}
