/* ==========================================================================
   Belle Prairie Games — the site's only stylesheet.
   Self-hosted fonts, no external requests. One first-party script (theme.js).
   ========================================================================== */

/* --- Fonts (SIL Open Font License; licences sit alongside the files) ------ */

@font-face {
  font-family: "Russo One";
  src: url("../fonts/RussoOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
/* Display faces for the alternate themes. A browser only downloads a face it
   actually renders, so these cost nothing until their theme is selected. */
@font-face {
  font-family: "Black Ops One";
  src: url("../fonts/BlackOpsOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Bungee";
  src: url("../fonts/Bungee-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------
   A game page overrides --accent (and only --accent) via its body class;
   every rule below reads it.
   ------------------------------------------------------------------------ */

:root {
  color-scheme: dark;

  --bg:          #0b0d10;
  --bg-raised:   #12161c;
  --bg-inset:    #080a0d;
  --line:        rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text:       #e8eaed;
  --text-dim:   #98a1ac;
  --text-faint: #6b747f;

  --accent:     #e5b33d;   /* prairie gold — the studio colour */
  --accent-ink: #0b0d10;

  --display: "Russo One", Impact, system-ui, sans-serif;
  --body: "Chakra Petch", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* Nukestorm's own face is Share Tech Mono, which is a Google font — the site
     loads nothing external, so it falls back to the platform monospace. */
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Courier New", monospace;

  --wrap: 1120px;
  --radius: 14px;
  --step: clamp(3rem, 7vw, 5.5rem);

  /* Decoration knobs a theme can retune. */
  --grid-size: 64px;      /* the hairline grid over the background */
  --grid-opacity: 0.3;
  --wash: 16%;            /* how strongly the accent washes the top of a page */
  --glow: 0.55;           /* multiplier for accent glows */

  /* Each game's identity colour, named once so a theme can restate all four. */
  --g-blastomino: #35e0e0;   /* neon cyan */
  --g-chess:      #8fb96a;   /* board green */
  --g-hexalode:   #f0a03c;   /* ore amber */
  --g-linecraft:  #5aa2ff;   /* blueprint blue */
  --g-nukestorm:  #33ff66;   /* phosphor green */
}

body.game-blastomino         { --accent: var(--g-blastomino); }
body.game-conscription-chess { --accent: var(--g-chess); }
body.game-hexalode           { --accent: var(--g-hexalode); }
body.game-linecraft          { --accent: var(--g-linecraft); }
body.game-nukestorm          { --accent: var(--g-nukestorm); }

/* ==========================================================================
   THEMES
   Set with data-theme on <html> by assets/js/theme.js. Each block restates
   only the tokens it changes; everything else inherits from :root above.
   ========================================================================== */

/* --- Sci-fi industrial: cold steel, hazard orange, stencil type ----------- */
:root[data-theme="industrial"] {
  color-scheme: dark;
  --bg:          #0e1215;
  --bg-raised:   #161c21;
  --bg-inset:    #090c0e;
  --line:        rgba(150, 180, 200, 0.14);
  --line-strong: rgba(150, 180, 200, 0.28);

  --text:       #dbe4ea;
  --text-dim:   #8c9aa6;
  --text-faint: #61707c;

  --accent:     #ff8a2b;
  --accent-ink: #100a03;

  --display: "Black Ops One", "Arial Black", Impact, sans-serif;

  --radius: 3px;
  --grid-size: 40px;
  --grid-opacity: 0.5;
  --wash: 12%;
  --glow: 0.4;

  --g-blastomino: #4bc6d8;
  --g-chess:      #9aa87b;
  --g-hexalode:   #ff8a2b;
  --g-linecraft:  #6fa8ff;
  --g-nukestorm:  #6fe38a;
}

/* --- Western: parchment and leather, the one light theme ----------------- */
:root[data-theme="western"] {
  color-scheme: light;
  --bg:          #efe2c8;
  --bg-raised:   #e5d4b3;
  --bg-inset:    #dcc79f;
  --line:        rgba(90, 60, 32, 0.22);
  --line-strong: rgba(90, 60, 32, 0.42);

  --text:       #2f2117;
  --text-dim:   #6b5238;
  --text-faint: #8a7052;

  --accent:     #9c3016;
  --accent-ink: #f7efdc;

  --display: Georgia, "Times New Roman", "Book Antiqua", serif;
  --body: Georgia, "Times New Roman", serif;

  --radius: 6px;
  --grid-size: 56px;
  --grid-opacity: 0.35;
  --wash: 20%;
  --glow: 0;             /* nothing glows in daylight */

  --g-blastomino: #1f6f7a;
  --g-chess:      #4f6b2f;
  --g-hexalode:   #a8631a;
  --g-linecraft:  #2f5d8a;
  --g-nukestorm:  #7a2f12;
}

/* --- Neon futuristic: deep violet, magenta and cyan, everything glowing --- */
:root[data-theme="neon"] {
  color-scheme: dark;
  --bg:          #0a0618;
  --bg-raised:   #170e33;
  --bg-inset:    #06030f;
  --line:        rgba(190, 130, 255, 0.20);
  --line-strong: rgba(190, 130, 255, 0.42);

  --text:       #f4ecff;
  --text-dim:   #b7a3d8;
  --text-faint: #8574a8;

  --accent:     #ff2fd0;
  --accent-ink: #12002c;

  --display: "Bungee", "Russo One", Impact, sans-serif;

  --radius: 18px;
  --grid-size: 48px;
  --grid-opacity: 0.5;
  --wash: 26%;
  --glow: 1;

  --g-blastomino: #22e8ff;
  --g-chess:      #7cff6b;
  --g-hexalode:   #ffb038;
  --g-linecraft:  #4d8dff;
  --g-nukestorm:  #ff2fd0;
}

/* --- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.68;
  overflow-x: hidden;
}

/* A faint accent wash at the top of the page and a hairline grid over the
   ground. Both are decoration only. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 70vh;
  background: radial-gradient(120% 100% at 50% -25%,
    color-mix(in srgb, var(--accent) var(--wash), transparent) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  opacity: var(--grid-opacity);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* Everything real sits above the two decorative layers. */
.site-header, main, .site-footer { position: relative; z-index: 1; }

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

/* The attribute has to win over every display rule below, or a hidden grid or
   button shows anyway. The challenge page relies on it. */
[hidden] { display: none !important; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
}

/* --- Header -------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}
.wordmark::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: none;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) calc(var(--glow) * 70%), transparent);
}
.wordmark:hover { color: var(--accent); }

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.9rem);
  flex-wrap: wrap;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding-block: 0.15rem;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

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

.hero {
  padding-block: clamp(3.5rem, 10vw, 7rem) var(--step);
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 8vw, 5rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); }
.hero .tagline {
  margin: 1.5rem auto 0;
  max-width: 46ch;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  color: var(--text-dim);
  text-wrap: balance;
}

.rule {
  width: 70px;
  height: 3px;
  margin: 2rem auto 0;
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) calc(var(--glow) * 60%), transparent);
}

/* --- Sections ------------------------------------------------------------ */

.section { padding-block: var(--step); }
.section + .section { padding-top: 0; }

.section-title {
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-family: var(--body);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.prose { max-width: 62ch; }
.prose p { margin: 0 0 1.15rem; }
.prose p:last-child { margin-bottom: 0; }
/* Subheadings inside long prose (the privacy page) need their own rhythm —
   the global h1/h2/h3 reset zeroes margins, which jams them into the text. */
.prose h2 {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem);
  margin: 2.5rem 0 0.9rem;
  color: var(--text);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin: 1.75rem 0 0.6rem;
}
.prose a { text-decoration: underline; }
.prose .lead {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  line-height: 1.5;
  color: var(--text);
}

/* --- Game cards (home) --------------------------------------------------- */

/* Two columns rather than auto-fit: with four games, auto-fit gave three cards
   and a lone fourth on its own row. With an odd number of games, the last card
   spans both columns instead of sitting alone in one. */
.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-grid > .game-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.75;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-raised));
}
.game-card .art {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  object-fit: contain;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  padding: 6px;
}
.game-card h3 {
  font-size: 1.28rem;
  color: var(--text);
  text-wrap: balance;
}
.game-card:hover h3 { color: var(--accent); }
.game-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
  flex: 1;
}
.game-card .more {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* Per-card accent on the home grid. */
.game-card.c-blastomino         { --accent: var(--g-blastomino); }
.game-card.c-conscription-chess { --accent: var(--g-chess); }
.game-card.c-hexalode           { --accent: var(--g-hexalode); }
.game-card.c-linecraft          { --accent: var(--g-linecraft); }
.game-card.c-nukestorm          { --accent: var(--g-nukestorm); }

/* Nukestorm has no icon art, so its card tile is a terminal monogram. */
.game-card .art.art-mono {
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: 0 0 14px color-mix(in srgb, var(--accent) calc(var(--glow) * 55%), transparent);
}

/* --- Chips --------------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.chip {
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-dim);
  white-space: nowrap;
}
.chip.is-status {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* --- Game page hero ------------------------------------------------------ */

.game-hero {
  padding-block: clamp(2.5rem, 7vw, 4.5rem) var(--step);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.game-hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  text-transform: uppercase;
  text-wrap: balance;
}
.game-hero .kicker {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}
.game-hero .tagline {
  margin: 1.25rem 0 1.75rem;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem);
  color: var(--text-dim);
  max-width: 34ch;
  text-wrap: balance;
}

.hero-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(70% 70% at 50% 45%,
      color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 70%),
    var(--bg-inset);
  padding: clamp(1.5rem, 5vw, 3rem);
  overflow: hidden;
}
/* The game icons are full-bleed squares with their own backgrounds; round them
   so they do not read as a hard box inside the glow. */
.hero-art img {
  width: min(78%, 340px);
  border-radius: 24px;
}

/* --- Spec strip ---------------------------------------------------------- */

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
}
.specs > div {
  background: var(--bg-raised);
  padding: 1.15rem 1.35rem;
}
.specs dt {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.specs dd {
  margin: 0.35rem 0 0;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--text);
}

/* --- Feature list -------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.features li {
  padding: 1.5rem 1.6rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.features h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.features p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.97rem;
}

/* --- Screenshots --------------------------------------------------------- */

/* Phone screenshots are capped rather than stretched to the column, so two
   shots on one page and three on another still come out the same size. */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 300px));
  justify-content: start;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 640px) {
  .shots { justify-content: center; }
}
.shots li, .shots figure { margin: 0; }
.shots img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-inset);
}
.shots figcaption {
  margin-top: 0.7rem;
  font-size: 0.86rem;
  color: var(--text-faint);
}
.shots.is-wide {
  grid-template-columns: minmax(0, 1fr);
  max-width: 880px;
}
/* A single hero screenshot, centred and held to a readable width. */
.shots.is-feature {
  grid-template-columns: minmax(0, 1fr);
  max-width: 560px;
}
/* Wide desktop captures: one per row, full content width. These are dense UI
   screenshots — shrunk into a multi-column grid they become unreadable. */
.shots.is-landscape {
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
.shots.is-landscape img {
  border-radius: 8px;
  /* The captures are of a black terminal UI, so a plain border would vanish
     against it. A faint accent edge separates the shot from the page. */
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong));
}
/* Phone screenshots vary in height; top-align them rather than stretching. */
.shots > li { align-self: start; }

/* --- HexaLode hero: a hex field composed from the game's own tile art ----- */

.hex-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.hex-scene .tile {
  position: absolute;
  width: 36%;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}
/* A bedrock plateau with two ore territories around it — the game's own premise. */
.hex-scene .t1 { top: 14%; left: 32%; }
.hex-scene .t2 { top: 36%; left: 6%;  }
.hex-scene .t3 { top: 36%; left: 58%; }

/* Overseer.png is a 2x2 sheet of four poses; show only the top-left one. */
.hex-scene .overseer {
  position: absolute;
  top: 64%;
  left: 42%;
  width: 20%;
  aspect-ratio: 1 / 1;
  background-image: url("../img/hexalode/overseer.png");
  background-size: 200% 200%;
  background-position: 0 0;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  z-index: 2;
}
.hex-scene .ship {
  position: absolute;
  top: 2%;
  right: 2%;
  width: 21%;
  image-rendering: pixelated;
  opacity: 0.9;
}

.pixel { image-rendering: pixelated; }

/* --- Nukestorm: a terminal wordmark, not a mock-up of the game's UI -------- */

body.game-nukestorm .hero-art {
  /* Scanlines over the standard hero frame. */
  background:
    repeating-linear-gradient(
      to bottom,
      color-mix(in srgb, var(--accent) 7%, transparent) 0 1px,
      transparent 1px 4px),
    radial-gradient(70% 70% at 50% 45%,
      color-mix(in srgb, var(--accent) 18%, transparent) 0%, transparent 70%),
    var(--bg-inset);
}

.terminal-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  font-family: var(--mono);
}
.terminal-mark .tm-prompt {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: color-mix(in srgb, var(--accent) 65%, var(--text-faint));
}
.terminal-mark .tm-word {
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 22px color-mix(in srgb, var(--accent) calc(var(--glow) * 50%), transparent);
  word-break: break-word;
}
.terminal-mark .tm-rule {
  width: 100%;
  height: 1px;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}
.terminal-mark .tm-sub {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
/* The caret is the only moving thing on the site; it stops for reduced motion. */
.terminal-mark .tm-caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.15em;
  background: var(--accent);
  vertical-align: -0.12em;
  animation: tm-blink 1.1s steps(1, end) infinite;
}
@keyframes tm-blink { 50% { opacity: 0; } }

/* The way to a game that has shipped: its store page. Text in the accent
   rather than Google's badge image, because the site loads nothing it does
   not host and the badge comes with its own artwork rules. */
.store-cta { margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
button.store-button { border: 0; font: inherit; cursor: pointer; }

/* The /b/ challenge page: the score is the whole hero, and its code is one long word. */
.challenge-hero { grid-template-columns: minmax(0, 1fr); }
#challenge-code { overflow-wrap: anywhere; }
.store-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 0 calc(var(--glow) * 22px) color-mix(in srgb, var(--accent) 45%, transparent);
}
.store-button::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.45em 0 0.45em 0.72em;
  border-color: transparent transparent transparent currentColor;
}
.store-button:hover,
.store-button:focus-visible { color: var(--bg); filter: brightness(1.08); }
.store-note { margin: 0.6rem 0 0; color: var(--text-dim); font-size: 0.9rem; }

/* A second way in beside the store - the Blastomino browser demo. Outlined in
   the accent rather than filled, so the store stays the headline and the two
   never read as a choice between equals. */
.store-button.is-secondary {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.store-button.is-secondary:hover,
.store-button.is-secondary:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  filter: none;
}

/* A chip for something built but not yet shipped. */
.chip.is-soon {
  color: var(--text);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* Callout for a feature that is finished but not live yet. */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 1.1rem 1.35rem;
  margin-bottom: 2rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-raised));
}
.notice strong {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.notice span { color: var(--text-dim); font-size: 0.95rem; }

/* Prose introducing a feature grid needs air between the two. */
.prose + .features { margin-top: 2rem; }

/* --- Pull quote ---------------------------------------------------------- */

.quote {
  margin: 0;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.quote::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}
.quote p {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.28rem);
  line-height: 1.5;
  color: var(--text);
  text-wrap: balance;
}
.quote p:last-of-type { margin-bottom: 0; }
.quote footer {
  margin-top: 1.1rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --- Back link ----------------------------------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-dim);
}
.back-link::before { content: "\2190"; color: var(--accent); }
.back-link:hover { color: var(--accent); }

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  margin-top: var(--step);
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3.5rem;
  color: var(--text-faint);
  font-size: 0.87rem;
}
.site-footer .wrap > .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: baseline;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }
.site-footer .credits {
  margin: 1.25rem 0 0;
  max-width: 64ch;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-faint);
}

/* --- The theme easter egg ------------------------------------------------
   "Games" in the home page title is a real button that cycles the theme. It
   is styled back down to look exactly like the word it replaced.
   ------------------------------------------------------------------------ */

.hero h1 .theme-toggle {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  line-height: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s;
}
.hero h1 .theme-toggle:hover { filter: brightness(1.2); }
.hero h1 .theme-toggle:active { filter: brightness(0.9); }

/* Says which theme you just landed on; built and removed by theme.js. */
.theme-toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 20;
  transform: translateX(-50%) translateY(0.5rem);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text);
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.theme-toast[data-show] {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.theme-toast .swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 820px) {
  .game-hero { grid-template-columns: minmax(0, 1fr); }
  .game-hero .hero-art { order: -1; width: 100%; max-width: 400px; }
  .game-hero .tagline { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .game-card:hover { transform: none; }
}

@media print {
  body::before, body::after { display: none; }
  body { background: #fff; color: #000; }
}

/* --- Blastomino: the "Make it yours" shop section ------------------------ */
.subhead {
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  margin: 3rem 0 0.8rem;
}
.gallery-note { margin: 0 0 1.2rem; color: var(--text-dim); }
.prose + .shots, .features + .shots { margin-top: 2.2rem; }

.theme-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.theme-gallery figure { margin: 0; }
.theme-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-inset);
}
.theme-gallery figcaption { margin-top: 0.5rem; font-size: 0.82rem; color: var(--text-faint); }
.theme-gallery figcaption b { display: block; color: var(--text); font-weight: 600; font-size: 0.9rem; }

.split { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 820px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.shots.is-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 1.5rem 0 2.2rem;
  padding: 0;
}
.tiers li {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.1rem 1.4rem;
  text-align: center;
}
.tiers img { display: block; margin: 0 auto; width: 120px; height: 120px; image-rendering: pixelated; }
.tiers h3 { margin: 0.5rem 0 0.35rem; font-family: var(--display); font-size: 1.15rem; }
.tiers p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }
#make-it-yours .store-cta { margin-top: 2.4rem; }
