/* The game guides (games/<id>/): how to play, controls, tips and questions, in the hub's look.
   Night, and one torch: the same four tokens as index.html. A guide's own accent (--accent, set on <html>)
   colors only its rules and numbers, the way each game's colors appear only in its own art on the hub. */
:root {
  --night: #0d0b09;
  --bone: #efe6d6;
  --ash: #a39888;
  --ember: #f0a64a;
  --line: rgba(239, 230, 214, 0.12);
  --raise: #15110d;
  --gutter: clamp(16px, 4vw, 56px);
  --display: "Anybody", "Arial Narrow", sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--night); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font: 400 1.0625rem/1.65 var(--body);
  overflow-x: hidden;
}
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--ember); }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.display { margin: 0; font-family: var(--display); font-stretch: 80%; font-weight: 800; line-height: 0.95; letter-spacing: -0.01em; text-transform: uppercase; }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 1.02rem/1 var(--display); font-stretch: 80%;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
}
.wordmark:hover { color: inherit; }
.wordmark img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(239, 230, 214, 0.22); }
.top nav { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; justify-content: flex-end; font-weight: 500; font-size: 0.98rem; }
.top nav a { text-decoration: none; padding: 8px 0; }
.top nav a:hover { color: var(--bone); text-decoration: underline; }
@media (max-width: 520px) { .top nav .opt { display: none; } }

/* the hero: the game's own art, its logo, and the way in */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero__art { position: absolute; inset: 0; z-index: -1; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; }
.hero__art::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--night) 0%, rgba(13, 11, 9, 0.88) 38%, rgba(13, 11, 9, 0.35) 75%, rgba(13, 11, 9, 0.2)),
    linear-gradient(0deg, var(--night) 0%, transparent 40%);
}
@media (max-width: 760px) {
  .hero__art::after { background: linear-gradient(0deg, var(--night) 8%, rgba(13, 11, 9, 0.82) 55%, rgba(13, 11, 9, 0.45)); }
}
.hero__body { display: grid; gap: 18px; justify-items: start; padding: clamp(56px, 10vw, 120px) 0 clamp(44px, 7vw, 80px); max-width: 620px; }
.crumbs { margin: 0; color: var(--ash); font-size: 0.92rem; }
.crumbs a { color: var(--ash); }
.hero__logo { height: var(--logo-h, clamp(60px, 8vw, 92px)); width: auto; filter: drop-shadow(0 4px 22px rgba(0, 0, 0, 0.7)); }
.hero h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero__hook { margin: 0; font: 800 clamp(1.5rem, 3vw, 2.2rem)/1.1 var(--display); font-stretch: 80%; }
.hero__lede { margin: 0; color: #cfc4b2; font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 54ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.facts li {
  padding: 6px 12px 5px;
  border: 1px solid rgba(239, 230, 214, 0.22);
  border-radius: 999px;
  background: rgba(13, 11, 9, 0.55);
  font-size: 0.88rem;
  font-weight: 500;
}
.play {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 0 24px; margin-top: 6px;
  border-radius: 999px;
  background: var(--ember); color: var(--night);
  font: 700 1.02rem/1 var(--body); text-decoration: none;
  transition: background-color 0.25s ease;
}
.play:hover { background: #f6b867; color: var(--night); }
.play svg { width: 15px; height: 15px; transition: transform 0.35s var(--ease-out); }
.play:hover svg { transform: translateX(3px); }

/* the guide: a contents list beside the sections on wide screens */
.guide { display: grid; gap: 40px; padding: clamp(40px, 6vw, 72px) var(--gutter) 0; }
@media (min-width: 980px) {
  .guide { grid-template-columns: 220px minmax(0, 1fr); gap: 64px; align-items: start; }
  .toc { position: sticky; top: 28px; }
}
.toc { font-size: 0.95rem; }
.toc p { margin: 0 0 10px; color: var(--ash); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.toc a { display: block; padding: 4px 0; color: var(--ash); text-decoration: none; }
.toc a:hover { color: var(--bone); }
@media (max-width: 979px) {
  .toc ol { display: flex; flex-wrap: wrap; gap: 6px 18px; }
}

.guide__body { min-width: 0; max-width: 760px; }
.guide__body section { scroll-margin-top: 24px; }
.guide__body section + section { margin-top: clamp(48px, 6vw, 72px); }
.guide__body h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 18px; }
.guide__body h3 { margin: 28px 0 8px; font: 800 1.3rem/1.15 var(--display); font-stretch: 80%; }
.guide__body p, .guide__body li { color: #cfc4b2; }
.guide__body p { margin: 0 0 14px; }
.guide__body strong { color: var(--bone); font-weight: 600; }
.guide__body ul, .guide__body ol { margin: 0 0 14px; padding-left: 1.3em; }
.guide__body li + li { margin-top: 8px; }
.guide__body li::marker { color: var(--accent, var(--ember)); }

/* numbered steps */
.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding: 16px 18px 16px 62px; margin: 0 !important; border: 1px solid var(--line); border-radius: 14px; background: var(--raise); }
.steps li::before {
  content: counter(step);
  position: absolute; left: 18px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent, var(--ember)); color: var(--night);
  font: 800 0.95rem/1 var(--display);
}
.steps b { display: block; color: var(--bone); font-weight: 600; }

/* controls */
.keys { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 0.98rem; }
.keys caption { text-align: left; padding: 0 0 8px; color: var(--bone); font-weight: 600; }
.keys th, .keys td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.keys th { width: 42%; font-weight: 500; color: var(--bone); }
.keys td { color: #cfc4b2; }
kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 7px 2px; margin: 1px 2px;
  border: 1px solid rgba(239, 230, 214, 0.3); border-bottom-width: 2px; border-radius: 6px;
  background: #1c1712; color: var(--bone);
  font: 600 0.85rem/1.5 var(--body); text-align: center;
}

/* a short list of named things: classes, places, phases */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 18px; padding: 0 !important; list-style: none; }
.cards li { margin: 0 !important; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--raise); font-size: 0.97rem; }
.cards b { display: block; margin-bottom: 4px; color: var(--accent, var(--ember)); font: 800 1.12rem/1.1 var(--display); font-stretch: 80%; text-transform: uppercase; }

.note { padding: 14px 18px; border-left: 3px solid var(--accent, var(--ember)); border-radius: 0 10px 10px 0; background: var(--raise); }
.note p:last-child { margin-bottom: 0; }

/* questions */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 0; cursor: pointer; list-style: none;
  color: var(--bone); font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent, var(--ember)); font-size: 1.4rem; line-height: 1; transition: transform 0.25s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 12px; }

/* the end of a guide: play, then the other guides */
.cta { margin-top: clamp(56px, 8vw, 96px); padding: clamp(28px, 5vw, 48px); border: 1px solid rgba(240, 166, 74, 0.28); border-radius: 22px; background: radial-gradient(ellipse 70% 120% at 100% 100%, rgba(240, 166, 74, 0.14), transparent 70%), var(--raise); display: grid; gap: 14px; justify-items: start; }
.cta h2 { margin: 0 !important; }
.cta p { margin: 0 !important; }
.more { margin-top: clamp(48px, 7vw, 80px); }
.more h2 { font-size: 1.4rem !important; }
.more ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 0 !important; list-style: none; }
.more li { margin: 0 !important; }
.more a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--raise); text-decoration: none; }
.more a:hover { border-color: rgba(239, 230, 214, 0.35); color: inherit; }
.more a b { display: block; color: var(--bone); font-weight: 600; }
.more a span { color: var(--ash); font-size: 0.95rem; }

.foot { margin-top: clamp(64px, 9vw, 112px); padding-top: 28px; padding-bottom: calc(36px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--ash); font-size: 0.93rem; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; }
.foot a { color: var(--ash); }
.foot a:hover { color: var(--bone); }
.foot p { margin: 0; }
