/* Tokens mirror Assets/Scripts/Utils/DesignSystem.cs in the game repo. */
:root {
  --red: #C44C4E;
  --green: #5B8C5A;
  --blue: #4C79D8;
  --yellow: #D9C041;
  --purple: #8E6AB7;
  --orange: #D47E3F;
  --brown: #8B6C42;
  --gray: #8A8A8A;
  --brown-text: #A9824E;

  --backdrop: #16171B;
  --light-blue: #A0AEC0;
  --light-slate: #404D61;
  --slate: #373D4D;
  --locked: #2A2C31;
  --gold: #BFA640;
  --win-panel: #232833;
  --pip-empty: #39404E;

  --text: #F4F5F7;
  --description: #B3B3B3;
  --sub: #B9BEC8;
  --muted: #8D9199;
  --faint: #6E7480;
  --quiet: #5C6067;

  --card: rgba(64, 77, 97, .3);
  --card-edge: rgba(160, 174, 192, .10);

  --r-tile: 9px;
  --r-inner: 5px;
  --r-card: 14px;
  --r-panel: 22px;
  --r-pill: 28px;

  --gutter: 16px;
  --max: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--backdrop);
  color: var(--text);
  font: 400 17px/1.6 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--light-blue); text-underline-offset: 3px; }
a:hover { color: var(--text); }

:focus-visible { outline: 2px solid var(--light-blue); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -.015em; }
h1 { font-weight: 900; font-size: clamp(44px, 8vw, 84px); }
h2 { font-weight: 900; font-size: clamp(30px, 4.6vw, 46px); }
h3 { font-weight: 700; font-size: 21px; letter-spacing: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { color: var(--text); font-weight: 700; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--sub); font-weight: 500; line-height: 1.5; }
.muted { color: var(--muted); }

/* The faint 7x7 board from the store art, fading out of the top corner. */
.board-bg {
  position: absolute;
  inset: 0 0 auto auto;
  width: min(760px, 100%);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: .055;
  background:
    repeating-linear-gradient(90deg, transparent 0 82px, var(--backdrop) 82px 98px),
    repeating-linear-gradient(180deg, #fff 0 82px, var(--backdrop) 82px 98px);
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000 0, transparent 70%);
  mask-image: radial-gradient(circle at 100% 0, #000 0, transparent 70%);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(22, 23, 27, .82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: rgba(160, 174, 192, .08); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand svg { width: 26px; height: 26px; flex: none; }

.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--sub);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-pill);
}
.nav a:hover { color: var(--text); background: var(--card); }
.nav a[aria-current="page"] { color: var(--text); background: var(--card); }

@media (max-width: 520px) {
  .brand span { display: none; }
  .nav a { padding: 8px 10px; }
}

/* ---------- buttons ---------- */

.stores { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 22px 10px 18px;
  border-radius: var(--r-card);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.15;
  transition: transform .15s, background-color .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 26px; height: 26px; flex: none; }
.btn small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .04em; opacity: .75; }
.btn span { font-size: 18px; }

.btn-primary { background: var(--light-blue); color: var(--backdrop); }
.btn-primary:hover { background: #B8C3D2; color: var(--backdrop); box-shadow: 0 8px 30px rgba(160, 174, 192, .25); }

.btn-ghost { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--card-edge); }
.btn-ghost:hover { background: rgba(64, 77, 97, .5); color: var(--text); }

.btn-small { min-height: 40px; padding: 8px 16px; border-radius: var(--r-pill); font-size: 15px; }

/* ---------- hero ---------- */

/* Mirrors the feature graphic in StoreListing/store_art.py. */
.hero {
  position: relative;
  overflow: hidden;
  padding: 48px 0 72px;
  background:
    radial-gradient(ellipse 55% 95% at 78% 55%, rgba(76, 121, 216, .30), transparent 70%),
    linear-gradient(115deg, #1C1E25, #121317);
}
.hero .wrap { display: grid; gap: 56px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 72px 0 88px; }
  .hero .wrap { grid-template-columns: 1.1fr .9fr; }
}

.hero h1 { font-size: clamp(56px, 9vw, 104px); line-height: .98; letter-spacing: -.02em; }
.hero h1 .gray { color: var(--gray); }
.tagline { font-size: clamp(26px, 3.6vw, 36px); font-weight: 700; color: var(--sub); margin: 22px 0 0; letter-spacing: -.01em; }
.t-orange { color: var(--orange); }
.t-red { color: var(--red); }
.t-blue { color: var(--blue); }
.hero .lede { margin: 20px 0 32px; max-width: 36ch; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.chip {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 8px 16px;
  border-radius: 99px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* ---------- phone ---------- */

.phone {
  position: relative;
  padding: 2.6%;
  background: #0A0A0C;
  border-radius: 15% / 7%;
  box-shadow: 0 0 0 2px #2C2F38, 0 40px 90px rgba(0, 0, 0, .6);
}
.phone img { width: 100%; border-radius: 13% / 6%; }
.phone::before {
  content: "";
  position: absolute;
  top: 4.2%;
  left: 50%;
  width: 30%;
  height: 2.6%;
  transform: translateX(-50%);
  background: #0A0A0C;
  border-radius: 99px;
  z-index: 1;
}

.hero-phones { position: relative; width: min(420px, 100%); margin: 0 auto; aspect-ratio: 420 / 560; }
.hero-phones .phone { position: absolute; width: 62%; }
.hero-phones .front { left: 0; top: 6%; transform: rotate(-6deg); z-index: 2; }
.hero-phones .back { right: 0; top: 0; transform: rotate(7deg); }
@media (max-width: 899px) {
  .hero-phones { aspect-ratio: 420 / 600; width: min(380px, 100%); }
}

/* ---------- sections ---------- */

.section { padding: 72px 0; position: relative; }
@media (min-width: 900px) { .section { padding: 104px 0; } }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head .lede { margin-top: 16px; }

h2 b { display: block; color: var(--accent, var(--light-blue)); font-weight: 900; }

/* The slides' accent glow from the top edge, toned down for a page that scrolls. */
.section.glow::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 520px;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%);
}
.section > .wrap { position: relative; }

.card {
  background: var(--card);
  border-radius: var(--r-panel);
  padding: 28px;
  box-shadow: inset 0 0 0 1px var(--card-edge);
}
.card h3 { margin-bottom: 12px; }
.card p, .card li { color: var(--description); }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 800px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.grid-3 { display: grid; gap: 16px; }
@media (min-width: 800px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.step-num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-tile);
  font-weight: 900;
  color: var(--backdrop);
  margin-bottom: 16px;
}

/* ---------- demo board ---------- */

.demo { display: grid; gap: 32px; align-items: start; }
.demo-panel { max-width: 440px; width: 100%; margin: 0 auto; }
@media (min-width: 900px) { .demo { grid-template-columns: minmax(0, 440px) 1fr; gap: 64px; align-items: center; } }

.demo-panel {
  background: #1C1D22;
  border-radius: var(--r-panel);
  padding: 18px;
  box-shadow: inset 0 0 0 1px var(--card-edge), 0 30px 80px rgba(0, 0, 0, .35);
  user-select: none;
  -webkit-user-select: none;
}

.demo-hud { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-bottom: 14px; }
.hud-card { background: var(--card); border-radius: var(--r-card); padding: 12px 14px; }
.hud-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.hud-value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.hud-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.hud-goal { display: flex; gap: 14px; align-items: center; }

.goal-map { display: grid; grid-template-columns: repeat(7, 7px); gap: 3px; flex: none; }
.goal-map i { width: 7px; height: 7px; border-radius: 2px; background: var(--quiet); }

.board { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(4px, 1.4vw, 8px); }
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 18%;
  background: var(--c);
  transition: background-color .18s, filter .2s, box-shadow .2s;
  cursor: pointer;
}
.tile.dim { filter: brightness(.66) saturate(.9); }
.tile.target { box-shadow: inset 0 0 0 2.5px var(--light-blue); }
.tile.target.done { box-shadow: inset 0 0 0 2.5px #7FB07E; }
.tile.target.done::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #7FB07E url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%2316171B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.tile.pop { animation: pop .32s ease-out; }
@keyframes pop { 40% { transform: scale(1.08); } }

.board, .start-row { touch-action: none; }
.start-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(4px, 1.4vw, 8px); margin-top: clamp(10px, 3vw, 18px); }
.start-row .slot { aspect-ratio: 1; cursor: pointer; }

.player {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 18%;
  background: var(--c, var(--gray));
  box-shadow: 0 0 0 2.5px #E8EAEE, 0 8px 20px rgba(0, 0, 0, .5);
  transition: transform .14s cubic-bezier(.3, .7, .4, 1), background-color .18s;
  pointer-events: none;
  display: grid;
  place-items: center;
  z-index: 2;
}
.player i {
  width: 34%;
  height: 34%;
  border-radius: 22%;
  background: var(--under, transparent);
  box-shadow: 0 0 0 2px rgba(22, 23, 27, .5);
  transition: background-color .18s;
}
.player.empty i { box-shadow: none; }

.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.demo-msg { font-size: 14px; color: var(--muted); min-height: 1.6em; }
.demo-msg.win { color: var(--text); font-weight: 700; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--card);
  color: var(--light-blue);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: rgba(64, 77, 97, .55); }
.icon-btn svg { width: 20px; height: 20px; }

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.rules li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; }
.rules .step-num { margin: 0; }
.rules h3 { margin: 4px 0 6px; }
.rules p { color: var(--description); }

/* ---------- patterns ---------- */

.patterns { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.pattern {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--card-edge);
}
.pattern b { display: block; font-size: 16px; }
.pattern small { color: var(--muted); font-size: 13px; }
.mini { display: grid; grid-template-columns: repeat(3, 12px); gap: 3px; flex: none; }
.mini i { width: 12px; height: 12px; border-radius: 3px; background: var(--light-slate); }
.mini i.on { background: var(--light-blue); }

/* ---------- colour-blind swatches ---------- */

.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 22px; }
.swatch {
  width: 52px;
  height: 52px;
  border-radius: var(--r-tile);
  background: var(--c);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .92);
}
.swatch svg { width: 46%; height: 46%; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.symbols-on .swatch svg { opacity: 1; transform: none; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
.switch .track {
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: #595E6B;
  position: relative;
  transition: background-color .2s;
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.switch[aria-checked="true"] .track { background: var(--green); }
.switch[aria-checked="true"] .track::after { transform: translateX(18px); }

.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 30px; color: var(--description); }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--light-slate);
  box-shadow: inset 0 0 0 4px var(--backdrop), inset 0 0 0 9px var(--light-blue);
}

/* ---------- par meter ---------- */

.meter { display: flex; gap: 4px; margin: 6px 0 18px; }
.meter i { height: 6px; flex: 1; border-radius: 3px; background: var(--pip-empty); }
.meter i.on { background: var(--light-blue); }
.meter i.par { background: var(--gold); }

.key-row { display: flex; gap: 10px; margin: 6px 0 18px; }
.key-tile { width: 40px; height: 40px; border-radius: var(--r-tile); display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* ---------- gallery ---------- */

/* The published store screenshots, already framed; shown as-is so the site and the listings agree. */
.gallery {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px var(--gutter) 24px;
  margin: 0 calc(-1 * var(--gutter));
  scrollbar-width: thin;
  scrollbar-color: var(--light-slate) transparent;
}
.gallery img {
  flex: none;
  width: 250px;
  border-radius: 22px;
  scroll-snap-align: center;
  box-shadow: 0 0 0 1px var(--card-edge), 0 20px 50px rgba(0, 0, 0, .45);
}
@media (max-width: 520px) { .gallery img { width: 72vw; } }

/* ---------- CTA ---------- */

.cta { text-align: center; }
.cta .stores { justify-content: center; margin-top: 28px; }
.cta .tagline { margin-top: 14px; }
.cta img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

/* ---------- prose pages ---------- */

.page-hero { position: relative; overflow: hidden; padding: 56px 0 40px; }
@media (min-width: 900px) { .page-hero { padding: 88px 0 56px; } }
.page-hero h1 { font-size: clamp(40px, 6.5vw, 68px); }
.page-hero .lede { margin-top: 18px; max-width: 52ch; }

.doc { display: grid; gap: 40px; padding-bottom: 96px; }
@media (min-width: 960px) { .doc { grid-template-columns: 230px minmax(0, 720px); gap: 64px; } }

.toc { font-size: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 12px; border-radius: var(--r-inner); color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--text); background: var(--card); }
@media (min-width: 960px) { .toc nav { position: sticky; top: 88px; } }
@media (max-width: 959px) { .toc { display: none; } }

.prose { color: var(--description); }
.prose h2 { font-size: 26px; font-weight: 700; color: var(--text); margin: 56px 0 16px; letter-spacing: -.01em; scroll-margin-top: 84px; }
.prose h3 { font-size: 19px; color: var(--text); margin: 32px 0 10px; scroll-margin-top: 84px; }
.prose > :first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--faint); }
.prose em { color: var(--sub); }

.summary {
  background: var(--card);
  border-radius: var(--r-panel);
  padding: 24px 28px;
  box-shadow: inset 0 0 0 1px var(--card-edge), inset 4px 0 0 var(--light-blue);
  color: var(--sub);
}
.summary .eyebrow { margin-bottom: 8px; }

.table-wrap { overflow-x: auto; margin: 0 0 1em; border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--card-edge); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
th, td { text-align: left; padding: 12px 16px; vertical-align: top; }
th { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: var(--card); }
tr + tr td { border-top: 1px solid rgba(160, 174, 192, .08); }
td:first-child { color: var(--text); font-weight: 500; }

.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); margin-top: 20px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; background: var(--card); padding: 2px 6px; border-radius: 5px; color: var(--sub); }

/* ---------- support ---------- */

.contact {
  display: grid;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, rgba(76, 121, 216, .16), rgba(64, 77, 97, .3) 60%);
  border-radius: var(--r-panel);
  padding: 28px;
  box-shadow: inset 0 0 0 1px var(--card-edge);
}
@media (min-width: 760px) { .contact { grid-template-columns: 1fr auto; padding: 36px 40px; } }
.contact h2 { font-size: 28px; }
.contact p { color: var(--sub); margin-top: 10px; }
.contact .email { font-size: 15px; color: var(--muted); margin-top: 12px; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--card); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--card-edge); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 56px 18px 22px;
  font-weight: 700;
  font-size: 17px;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--light-blue);
  border-bottom: 2px solid var(--light-blue);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq .answer { padding: 0 22px 20px; color: var(--description); }
.faq .answer ul { padding-left: 1.2em; margin: 0 0 1em; }

.faq-group + .faq-group { margin-top: 48px; }
.faq-group > h2 { font-size: 22px; font-weight: 700; margin-bottom: 16px; letter-spacing: 0; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid rgba(160, 174, 192, .08); padding: 40px 0 48px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--sub); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- 404 ---------- */

.lost { min-height: calc(100vh - 64px); display: grid; place-items: center; text-align: center; padding: 48px 0; position: relative; overflow: hidden; }
.lost h1 { font-size: clamp(64px, 14vw, 140px); }
.lost .lede { margin: 16px auto 32px; max-width: 32ch; }
.lost .stores { justify-content: center; }
