/* Shared styles for the generated pages (games/*.html). The landing page
   keeps its own inline copy of the primitives (tokens, header, buttons, FAQ),
   so change both when the look changes. */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #07090b;
  --bg-2: #0b0e11;
  --surface: #0f1316;
  --surface-2: #151a1e;
  --line: #222a30;
  --line-hi: #34403a;
  --text: #ecf2ee;
  --dim: #9aa6a0;
  --muted: #7d8a84;
  --brand: #1fb87e;
  --neon: #4cf0b2;
  --neon-dim: rgba(76,240,178, 0.14);
  --amber: #ffb547;
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --cut: 14px;
  --wrap: 1200px;
  --game: var(--neon);
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
::selection { background: var(--neon); color: #04110a; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--neon); color: #04110a; padding: 8px 14px; font-weight: 600; }
.skip:focus { top: 12px; }

.label { font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.label b { color: var(--neon); font-weight: 500; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: .95; text-transform: uppercase; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h3 { font-size: 1.25rem; line-height: 1.15; }
.hl { color: var(--neon); }
.lede { color: var(--dim); font-size: 1.1rem; max-width: 40em; }
code { font-family: var(--mono); font-size: .88em; color: var(--text); background: var(--surface-2); padding: 1px 6px; overflow-wrap: anywhere; }
.prose { display: grid; gap: 14px; color: var(--dim); max-width: 68ch; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a, .faq-list .ans a, .note a { color: var(--neon); }
.prose ul { list-style: none; display: grid; gap: 8px; }
.prose li { padding-left: 18px; position: relative; }
.more { color: var(--dim); }
.more a { color: var(--neon); }
.prose li::before { content: ">"; position: absolute; left: 0; color: var(--neon); font-family: var(--mono); }

.btn {
  --cut: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 15px 26px; text-decoration: none; border: 0; cursor: pointer; white-space: nowrap;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background .2s, color .2s, transform .2s;
}
.btn-primary { background: var(--neon); color: #04110a; }
.btn-primary:hover { background: #7dffb2; transform: translateY(-2px); }
.btn-ghost { background: var(--line-hi); color: var(--text); position: relative; isolation: isolate; }
.btn-ghost::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--bg); clip-path: inherit; }
.btn-ghost:hover { background: var(--neon); color: var(--neon); }
.btn:focus-visible { outline: 2px solid var(--neon); outline-offset: -5px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

.cut { position: relative; isolation: isolate; background: var(--line); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.cut::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--surface); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }

.section { padding: 88px 0; position: relative; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.sec-head { display: grid; gap: 16px; margin-bottom: 40px; max-width: 760px; }

/* header / footer */
.header { position: sticky; top: 0; z-index: 50; background: rgba(7, 9, 11, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--dim); font-size: .9rem; font-weight: 500; transition: color .2s; }
.nav a:hover { color: var(--text); }
.nav .btn { color: #04110a; padding: 10px 18px; font-size: .85rem; }
footer { border-top: 1px solid var(--line); padding: 40px 0; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-links a { color: var(--dim); text-decoration: none; font-size: .9rem; }
.foot-links a:hover { color: var(--neon); }
.foot small { display: block; color: var(--muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; margin-top: 6px; }

/* game hero */
.crumbs { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line-hi); }
.crumbs a { text-decoration: none; color: var(--dim); }
.crumbs a:hover { color: var(--neon); }
.game-hero { padding: 56px 0 72px; overflow: hidden; }
.game-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; opacity: .3;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.game-hero-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: center; margin-top: 32px; }
.game-hero h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); margin: 18px 0 24px; }
.game-hero h1 .hl { display: block; }
.game-hero .lede { margin-bottom: 32px; }
.game-tag { display: inline-flex; align-items: center; gap: 10px; }
.game-tag::before { content: ""; width: 9px; height: 9px; background: var(--game); transform: rotate(45deg); flex: none; }
.trust { margin-top: 24px; font-family: var(--mono); font-size: .78rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.trust span + span::before { content: " / "; color: var(--line-hi); }
.shot { border: 1px solid var(--line-hi); padding: 8px; background: var(--surface); box-shadow: 0 40px 90px -40px rgba(76,240,178,.35), 0 30px 60px -20px #000; }
.shot figcaption { font-family: var(--mono); font-size: .7rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding: 10px 4px 2px; }

/* what syncs */
.sync-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; }
.folders { width: 100%; border-collapse: collapse; font-size: .95rem; }
.folders th { text-align: left; font: 500 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 16px 12px 0; border-bottom: 1px solid var(--line-hi); }
.folders td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--dim); }
.folders td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.folders td small { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.where { --cut: 16px; padding: 26px; display: grid; gap: 14px; }
.where dl { display: grid; gap: 12px; }
.where dt { font: 500 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.where dd { color: var(--dim); font-size: .92rem; }
.ticks { list-style: none; display: grid; gap: 10px; color: var(--dim); font-size: .95rem; }
.ticks li { padding-left: 20px; position: relative; }
.ticks li::before { content: ">"; position: absolute; left: 0; color: var(--neon); font-family: var(--mono); }
.ticks strong { color: var(--text); font-weight: 600; }

/* steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: s; border-top: 1px solid var(--line-hi); }
.step { padding: 32px 28px 8px 0; position: relative; }
.step + .step { padding-left: 28px; border-left: 1px solid var(--line); }
.step::before { counter-increment: s; content: "0" counter(s); display: block; font-family: var(--display); font-weight: 700; font-size: 4rem; line-height: 1; margin-bottom: 16px; color: transparent; -webkit-text-stroke: 1.5px var(--line-hi); }
.step::after { content: ""; position: absolute; top: -1px; left: 0; width: 48px; height: 2px; background: var(--neon); }
.step + .step::after { left: 28px; }
.step h3 { margin-bottom: 10px; }
.step p { color: var(--dim); font-size: .95rem; }
.note { margin-top: 32px; display: flex; gap: 12px; font-size: .92rem; color: var(--dim); padding: 14px 16px; border-left: 2px solid var(--amber); background: rgba(255,181,71,.06); max-width: 68ch; }
.note strong { color: var(--amber); font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; padding-top: 3px; font-weight: 500; text-transform: uppercase; flex: none; }

/* problems */
.problems { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.problem { --cut: 14px; padding: 26px; display: grid; gap: 10px; align-content: start; }
.problem h3 { font-size: 1.1rem; }
.problem p { color: var(--dim); font-size: .95rem; }
.problem .fix { color: var(--text); }
.problem .fix::before { content: "SyncCrate: "; font: 500 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--neon); }

/* faq */
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.faq-list { border-top: 1px solid var(--line-hi); }
details { border-bottom: 1px solid var(--line-hi); }
summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; font-family: var(--display); font-weight: 600; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .02em; transition: color .2s; }
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--neon); }
summary::after { content: "+"; font-family: var(--mono); font-size: 1.4rem; color: var(--neon); transition: transform .25s; flex: none; line-height: 1; }
details[open] summary::after { transform: rotate(45deg); }
details .ans { padding: 0 0 24px; color: var(--dim); max-width: 62ch; display: grid; gap: 12px; }

/* buy links (affiliate) */
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; }
.buy a { font: 500 .8rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); text-decoration: none; border: 1px solid var(--line-hi); padding: 8px 12px; }
.buy a:hover { color: var(--neon); border-color: var(--neon); }
.buy small { color: var(--muted); font-size: .8rem; flex-basis: 100%; }

/* other games */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; font-weight: 500; text-decoration: none; transition: border-color .2s, background .2s; }
.chip::before { content: ""; width: 7px; height: 7px; background: var(--chip-color, var(--neon)); transform: rotate(45deg); flex: none; }
a.chip:hover { border-color: var(--chip-color, var(--line-hi)); background: var(--surface-2); }

/* final cta */
.final { padding: 40px 0 100px; }
.final-box { --cut: 28px; padding: clamp(36px, 6vw, 72px); overflow: hidden; }
.final-box::before { background: radial-gradient(ellipse 70% 90% at 100% 100%, rgba(76,240,178,.12), transparent 60%), var(--surface); }
.final-box h2 { margin: 16px 0 20px; max-width: 16ch; }
.final-box .lede { margin-bottom: 32px; }

@media (max-width: 900px) {
  .nav a:not(.btn) { display: none; }
  .game-hero-grid, .sync-grid, .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step, .step + .step { padding: 28px 0 20px; border-left: 0; border-bottom: 1px solid var(--line); }
  .step + .step::after { left: 0; }
  .problems { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 72px 0; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .cta-row .btn { flex: 1 1 100%; }
  .folders thead { display: none; }
  .folders, .folders tbody, .folders tr, .folders td { display: block; }
  .folders tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .folders td { border: 0; padding: 2px 0; }
  .problem, .where { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* game guide index */
.finder { margin-top: 36px; display: grid; gap: 14px; max-width: 900px; }
.finder input { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line-hi); color: var(--text); font: 500 1rem var(--body); padding: 14px 16px; outline: none; }
.finder input:focus { border-color: var(--neon); }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { font: 500 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 7px 12px; background: var(--bg); color: var(--dim); border: 1px solid var(--line-hi); cursor: pointer; }
.fchip:hover { color: var(--text); }
.fchip[aria-pressed="true"] { color: var(--neon); border-color: var(--neon); background: var(--neon-dim); }
.guides { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.guide a { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; align-items: start; height: 100%; padding: 16px 18px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--game); text-decoration: none; transition: border-color .2s, transform .2s; }
.guide.big a { grid-template-columns: minmax(0, 1fr); padding: 0 0 18px; gap: 0; }
.g-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.guide.big .g-body { padding: 16px 20px 0; }
.g-cover, .g-banner { position: relative; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--game) 22%, var(--bg)); border: 1px solid var(--line); }
.g-cover { aspect-ratio: 2 / 3; }
.g-banner { aspect-ratio: 460 / 215; border: 0; border-bottom: 1px solid var(--line); }
.g-cover b, .g-banner b { font: 700 1.8rem var(--display); color: var(--game); opacity: .7; }
.g-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.guide a:hover .g-art { transform: scale(1.04); }
.guide a:hover { border-color: var(--game); transform: translateY(-2px); }
.guide a:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.guide h3 { font-size: 1.05rem; }
.guide.big h3 { font-size: 1.3rem; }
.guide p { color: var(--dim); font-size: .9rem; }
.g-tags { display: flex; gap: 6px; font: 500 .65rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); min-height: 1em; }
.g-tags span + span::before { content: "/ "; color: var(--line-hi); }
.g-covers { font-size: .8rem !important; color: var(--muted) !important; }
.g-meta { font-family: var(--mono); font-size: .72rem !important; color: var(--muted) !important; margin-top: 4px; }
.g-meta span { color: var(--game); text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; }
.g-meta span + span, .g-meta span:not(:first-child) { margin-left: 8px; }
.guide[hidden], .section[hidden] { display: none; }
.empty { color: var(--dim); margin-top: 8px; }
.empty a { color: var(--neon); }
.chip.muted { color: var(--dim); }
/* game page extras */
.toc { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font: 500 .75rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.toc a { color: var(--dim); text-decoration: none; }
.toc a:hover { color: var(--neon); }
.covers { margin-top: 14px; color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) { .guides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .guides { grid-template-columns: minmax(0, 1fr); } }

/* game page: cover and faint hero art */
.game-hero { position: relative; }
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 85%); mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 85%); }
.hero-art { width: 100%; height: 100%; object-fit: cover; opacity: .14; filter: saturate(.8) blur(1px); }
.game-hero > .wrap { position: relative; z-index: 1; }
.hero-id { display: flex; align-items: center; gap: 18px; }
.hero-cover { position: relative; overflow: hidden; flex: none; width: 76px; aspect-ratio: 2 / 3; display: grid; place-items: center; background: color-mix(in srgb, var(--game) 22%, var(--bg)); border: 1px solid var(--line-hi); box-shadow: 0 18px 40px -18px #000; }
.hero-cover b { font: 700 1.6rem var(--display); color: var(--game); opacity: .7; }
@media (max-width: 640px) { .hero-cover { width: 60px; } }
.buy small a { color: var(--dim); }
.legal h2 { margin-top: 12px; } .legal .prose { max-width: 72ch; }
