/* LoopLoose's website. One file, no framework.
   The game's candy toy look: chunky rounded type, white cards and buttons standing on a
   raised edge, glossy pills, and the game's own skies. Home opens on world 1's sky, Breeze,
   and the footer is world 8's, Midnight: the same trip the 250 stages take. Colours are
   the app's (Views/Theme.swift); the type is the app's too, SF Pro Rounded, asked of the
   device and never downloaded. See README "Design choices". */

:root {
  /* Theme.swift */
  --ink: #22103f;
  --soft: #2e1a66;
  --orange: #ff7a1a;
  --orange-edge: #c25a00;
  --purple: #7a3cff;
  --purple-edge: #5521c7;
  --teal: #14c8b0;
  --teal-edge: #0a8573;
  --yellow: #ffc83d;
  --yellow-edge: #c48f00;
  --lilac: #c9a7ff;
  --lilac-edge: #9b74e6;
  --white-edge: #e2d6ff;
  --chip: #f6f1ff;
  --paper: #fbf8ff;
  --night-text: #dccfff;
  /* Text that must pass 4.5:1 on white and on the paper. */
  --muted: #4f3d7d;

  /* World 1, Breeze, and world 8, Midnight: top, middle (45%), bottom. */
  --breeze: linear-gradient(166deg, #6fc0ff 0%, #b49aff 45%, #ffa258 100%);
  --midnight: linear-gradient(166deg, #08123a 0%, #1e0c5c 45%, #7a2d0c 100%);

  --display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Varela Round", system-ui, sans-serif;
  --body: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1140px;
  --read: 38rem;
  --gutter: clamp(1rem, 5vw, 2.5rem);
  --lift: 0 8px 0 var(--white-edge), 0 26px 40px -26px rgba(34, 16, 63, 0.45);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--purple-edge); text-decoration-thickness: 0.09em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.15em; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 30;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 12px; font-weight: 700;
}
.skip:focus { top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { margin: 0; font-family: var(--display); color: var(--ink); text-wrap: balance; }
h2 { font-size: clamp(1.95rem, 4.4vw, 3rem); font-weight: 900; line-height: 1.04; letter-spacing: -0.015em; margin-bottom: 1rem; max-width: 18ch; }
h3 { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
p { margin: 0 0 1rem; max-width: var(--read); }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.55; font-weight: 500; }

/* The app's little labels ("Gold · Mastery" on a badge card): a white pill on its edge. */
.label {
  display: inline-block; margin: 0 0 1rem; padding: 0.38rem 0.85rem 0.34rem;
  font: 800 0.74rem/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--purple-edge); background: #fff; border-radius: 999px;
  box-shadow: 0 3px 0 var(--white-edge);
}
.label.tilt { transform: rotate(-2deg); }

/* ---------- The masthead ---------- */

/* It sits over the sky the page opens on (the hero, or an inner page's head). */
.masthead { position: absolute; left: 0; right: 0; top: 0; z-index: 5; padding: 1rem 0; }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lockup { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; flex: none; }
.lockup .icon { width: 2.6rem; height: 2.6rem; border-radius: 22.4%; box-shadow: 0 3px 0 rgba(34, 16, 63, 0.18); }
.lockup .mark { width: 8.6rem; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.5rem; }
nav a {
  display: block; padding: 0.5rem 0.9rem; border-radius: 999px; text-decoration: none;
  font-weight: 800; font-size: 0.95rem; color: var(--ink); background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 3px 0 rgba(85, 33, 199, 0.18);
}
nav a:hover { background: #fff; }
nav a[aria-current="page"] { background: #fff; box-shadow: 0 3px 0 var(--lilac-edge); }

/* ---------- Candy buttons (CandyButtonStyle): a face on a raised edge, a gloss strip, a tilt ---------- */

.candy {
  --fill: var(--orange); --edge: var(--orange-edge); --text: var(--ink); --tilt: -1.5deg;
  position: relative; top: 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.6rem; padding: 0.6rem 1.7rem; border: 0; border-radius: 22px; cursor: pointer;
  font: 800 1.15rem/1.1 var(--display); color: var(--text); text-decoration: none; text-align: center;
  background: var(--fill); box-shadow: 0 5px 0 var(--edge), 0 16px 24px -14px rgba(34, 16, 63, 0.55);
  transform: rotate(var(--tilt));
}
.candy::before {
  content: ""; position: absolute; left: 5px; right: 5px; top: 4px; height: 46%; border-radius: 18px 18px 10px 10px;
  background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)); pointer-events: none;
}
.candy svg { width: 1.3em; height: 1.3em; flex: none; }
.candy small { display: block; font-size: 0.78rem; font-weight: 700; opacity: 0.75; }
.candy:active { top: 4px; box-shadow: 0 1px 0 var(--edge), 0 8px 14px -10px rgba(34, 16, 63, 0.5); }
.candy.purple { --fill: var(--purple); --edge: var(--purple-edge); --text: #fff; --tilt: 1.5deg; }
.candy.teal { --fill: var(--teal); --edge: var(--teal-edge); --tilt: 1deg; }
.candy.lilac { --fill: var(--lilac); --edge: var(--lilac-edge); --tilt: -1deg; }
.candy.white { --fill: #fff; --edge: var(--white-edge); --tilt: 1deg; }
@media (prefers-reduced-motion: no-preference) {
  .candy { transition: top 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease; }
  .candy:hover { filter: brightness(1.05) saturate(1.05); }
}

/* App Store buttons: written in, hidden until launch. LAUNCH: swap these two (README). */
.store-live { display: none; }
.soon { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0; font-weight: 700; }
.soon::before {
  content: ""; width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: none;
  background: var(--teal); box-shadow: 0 0 0 4px rgba(20, 200, 176, 0.3);
}

/* ---------- A real screen, in a white toy frame on a raised edge ---------- */

.phone { margin: 0; position: relative; width: min(100%, 300px); justify-self: center; }
.phone img {
  width: 100%; border-radius: 40px; border: 7px solid #fff; background: #fff;
  box-shadow: 0 9px 0 var(--white-edge), 0 34px 50px -26px rgba(34, 16, 63, 0.6);
  transform: rotate(var(--tilt, 2.5deg));
}
.phone.left { --tilt: -2.5deg; }
.phone figcaption { margin-top: 1.4rem; font-size: 0.92rem; line-height: 1.45; color: var(--muted); max-width: 30ch; }

/* ---------- Home: the hero, on Breeze's sky ---------- */

.sky { background: var(--breeze); }
.hero { position: relative; padding: 4.6rem 0 clamp(3.5rem, 8vw, 6rem); overflow: hidden; border-radius: 0 0 50% 50% / 0 0 2.5rem 2.5rem; }
.hero::after { /* the soft glow the game puts behind the board */
  content: ""; position: absolute; left: 50%; top: 42%; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 1; display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); padding-top: clamp(1rem, 4vw, 2.5rem);
}
.title { display: grid; justify-items: start; }
/* The title screen's logo: the icon on a white rim, tilted, bobbing, with sparkles round it. */
.logo { position: relative; width: clamp(6.5rem, 13vw, 9rem); margin: 0 0 1.4rem 0.4rem; }
.logo img {
  width: 100%; border-radius: 22.4%; border: 5px solid #fff; transform: rotate(-4deg);
  box-shadow: 0 9px 0 rgba(34, 16, 63, 0.2);
}
.sparkle { position: absolute; fill: #fff; filter: drop-shadow(0 1px 2px rgba(85, 33, 199, 0.35)); }
.logo .s1 { width: 1.7rem; right: -1.6rem; top: -0.6rem; }
.logo .s2 { width: 1rem; left: -1.2rem; top: 1.8rem; }
.logo .s3 { width: 1.25rem; right: -1.1rem; bottom: 0.4rem; }
.hero h1 { width: min(100%, 34rem); margin: 0 0 0.6rem -0.6rem; }
.hero h1 img { width: 100%; }
.tagline {
  font: 900 clamp(1.6rem, 3.6vw, 2.5rem)/1.1 var(--display); letter-spacing: -0.01em; color: var(--ink);
  margin-bottom: 1rem;
}
.hero .lead { color: var(--ink); max-width: 33rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem 1.6rem; margin-top: 1.6rem; }
.hero-phones { position: relative; display: grid; justify-items: center; }
.hero-phones .back { position: absolute; width: 64%; left: 0; top: 7%; --tilt: -7deg; }
.hero-phones .front { width: min(100%, 310px); margin-left: 22%; }
@media (prefers-reduced-motion: no-preference) {
  .logo img { animation: bob 3.6s ease-in-out infinite; }
  .sparkle { animation: twinkle 2.4s ease-in-out infinite; }
  .logo .s2 { animation-delay: 0.8s; }
  .logo .s3 { animation-delay: 1.6s; }
  .breathe { animation: breathe 1.8s ease-in-out infinite; }
}
@keyframes bob { 50% { transform: rotate(-4deg) translateY(-8px); } }
@keyframes twinkle { 50% { transform: scale(0.6) rotate(20deg); opacity: 0.6; } }
@keyframes breathe { 50% { transform: rotate(var(--tilt)) scale(1.03); } }

/* ---------- Home: the sections between the two skies ---------- */

.band { padding: clamp(4rem, 9vw, 6.5rem) 0; position: relative; }
.band + .band { padding-top: 0; }
.split { display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: center; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.split.flip { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
.split.flip > .phone { order: -1; }
.intro { max-width: 40rem; }
.card {
  background: #fff; border-radius: 30px; padding: clamp(1.4rem, 4vw, 2.6rem);
  box-shadow: var(--lift);
}

/* Try stage 1: the steps beside the real stage. */
.try-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; margin-top: 2.2rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; counter-reset: step; }
.steps li { position: relative; padding-left: 4.3rem; min-height: 3.3rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -0.1rem; width: 3.2rem; height: 3.2rem; border-radius: 50%;
  display: grid; place-items: center; font: 900 1.35rem/1 var(--display); color: var(--ink);
  background: var(--c, var(--orange)); box-shadow: 0 4px 0 var(--e, var(--orange-edge));
}
.steps li:nth-child(2) { --c: var(--lilac); --e: var(--lilac-edge); }
.steps li:nth-child(3) { --c: var(--teal); --e: var(--teal-edge); }
.steps h3 { margin-bottom: 0.25rem; }
.steps p { margin: 0; font-size: 1rem; color: var(--soft); }

/* The playable board (assets/play.js), on Breeze's sky like the game's stage 1. */
.play {
  position: relative; border-radius: 34px; padding: 1rem 1rem 1.25rem; overflow: hidden;
  background: var(--breeze); box-shadow: 0 9px 0 var(--white-edge), 0 30px 50px -28px rgba(34, 16, 63, 0.6);
}
.play::before {
  content: ""; position: absolute; inset: 15% 5% 20%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}
.play > * { position: relative; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; }
.hud-title { grid-column: 2; text-align: center; }
.hud-title strong { display: block; font: 900 1.45rem/1.1 var(--display); }
.hud-sub { font-size: 0.86rem; font-weight: 600; color: var(--soft); }
.moves {
  justify-self: end; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  border-radius: 999px; background: var(--orange); box-shadow: 0 4px 0 var(--orange-edge); transform: rotate(3deg);
  font: 800 0.82rem/1 var(--body);
}
.moves .coin { display: grid; place-items: center; min-width: 1.9rem; height: 1.9rem; padding: 0 0.3rem; border-radius: 999px; background: #fff; font: 900 1rem/1 var(--display); }
.chips { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; justify-content: center; gap: 0.5rem; }
.chips li {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.28rem 0.7rem 0.28rem 0.32rem; border-radius: 999px;
  background: #fff; box-shadow: 0 3px 0 var(--e, var(--white-edge)); font-size: 0.82rem; font-weight: 800;
}
.chips li:nth-child(odd) { transform: rotate(-2deg); }
.chips li:nth-child(even) { transform: rotate(1.5deg); }
.bead { width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--c); box-shadow: inset 0 -3px 0 var(--e), inset 0 2px 0 rgba(255, 255, 255, 0.55); }
.chips .free { display: none; color: var(--teal-edge); }
.chips li.is-free .free { display: inline; }
.board { width: 100%; aspect-ratio: 4 / 3; margin: 0.4rem auto 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.board svg { width: 100%; height: 100%; overflow: visible; }
.hint { text-align: center; margin: 0.2rem auto 0.9rem; font-weight: 700; font-size: 0.95rem; color: var(--soft); min-height: 1.6em; }
.play-actions { display: flex; justify-content: center; }
.play-actions .candy { min-width: min(100%, 16rem); }
.play noscript p, .play .fallback { text-align: center; margin: 2rem auto; font-weight: 700; }

/* Board pieces, drawn as Classic draws them (Textures.swift): bands with a darker edge and a
   sheen, cream pegs on a lilac side with the band wrapped round the base, a white spark on a
   red-orange glow at every crossing. */
.band-edge, .band-fill, .band-sheen, .tension { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.band-edge { stroke-width: 11; }
.band-fill { stroke-width: 7.5; }
.band-sheen { stroke-width: 2; stroke-opacity: 0.7; }
.tension { stroke: #ff4d6d; stroke-width: 20; stroke-opacity: 0.32; }
.peg { cursor: pointer; outline: none; }
.peg-body { transform-box: fill-box; transform-origin: center; }
.peg .hit { fill: transparent; }
.peg .shadow { fill: rgba(34, 16, 63, 0.18); }
.peg .side { fill: var(--lilac); }
.peg .cap { fill: #fffaf0; }
.peg .shine { fill: #fff; }
.peg .pick { fill: none; stroke: #fff; stroke-width: 5; opacity: 0; }
.peg .focus { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 5 4; opacity: 0; }
.peg:focus-visible .focus { opacity: 1; }
.peg.picked .pick { opacity: 1; }
.peg.picked .peg-body { transform: translateY(-5px) scale(1.18); }
.spark-glow { fill: #ff6a3d; opacity: 0.5; }
.spark-star { fill: #fff; }
.burst { fill: none; stroke: #fff; stroke-width: 3; }
@media (prefers-reduced-motion: no-preference) {
  .peg-body { transition: transform 0.16s cubic-bezier(0.3, 1.6, 0.5, 1); }
  .spark { animation: spark 0.84s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .peg.picked .pick { animation: breathe-ring 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .burst { animation: burst 0.3s ease-out forwards; transform-box: fill-box; transform-origin: center; }
}
@keyframes spark { 50% { transform: scale(1.22); } }
@keyframes breathe-ring { 50% { transform: scale(1.12); } }
@keyframes burst { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* The solved card slides up over the board, like the game's. */
.solved {
  position: absolute; left: 1rem; right: 1rem; bottom: 1rem; z-index: 3; text-align: center;
  background: #fff; border-radius: 28px; padding: 1.1rem 1rem 1.25rem; box-shadow: 0 8px 0 var(--white-edge), 0 20px 40px -20px rgba(34, 16, 63, 0.6);
}
.solved[hidden] { display: none; }
.solved .stars { display: flex; justify-content: center; gap: 0.4rem; margin-bottom: 0.3rem; }
.solved .stars svg { width: 2.6rem; height: 2.6rem; }
.solved .stars .on { fill: var(--orange); stroke: var(--orange-edge); }
.solved .stars .off { fill: var(--white-edge); stroke: var(--lilac-edge); }
.solved h3 { font-size: 1.7rem; font-weight: 900; }
.solved p { margin: 0.2rem auto 0.9rem; font-size: 0.95rem; color: var(--soft); }
.solved .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.9rem; }
.solved .candy { min-height: 3rem; font-size: 1rem; padding: 0.5rem 1.2rem; }
@media (prefers-reduced-motion: no-preference) {
  .solved { animation: rise 0.45s cubic-bezier(0.25, 1.4, 0.5, 1); }
  .solved .stars svg { animation: pop 0.4s cubic-bezier(0.3, 1.8, 0.5, 1) backwards; }
  .solved .stars svg:nth-child(2) { animation-delay: 0.15s; }
  .solved .stars svg:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes rise { from { transform: translateY(60%); opacity: 0; } }
@keyframes pop { from { transform: scale(0); } }

/* Stars and par. */
.rules { list-style: none; margin: 1.5rem 0 2rem; padding: 0; display: grid; gap: 0.8rem; max-width: 36rem; }
.rules li { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: 0.85rem 1.1rem; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 var(--white-edge); }
.rules .got { display: flex; gap: 0.15rem; }
.rules .got svg { width: 1.45rem; height: 1.45rem; }
.rules p { margin: 0; font-size: 1rem; }
.rules strong { font-weight: 800; }
.got .on { fill: var(--orange); stroke: var(--orange-edge); }
.got .off { fill: var(--white-edge); stroke: var(--lilac-edge); }

/* Eight worlds, each on its own sky (Theme.worlds), tilted like the paywall's swatches. */
.worlds { list-style: none; margin: 2.4rem 0 0; padding: 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.worlds li {
  position: relative; min-height: 8.6rem; padding: 0.95rem 1.05rem; border-radius: 24px; color: var(--ink);
  border: 4px solid #fff; box-shadow: 0 6px 0 var(--white-edge), 0 18px 30px -20px rgba(34, 16, 63, 0.6);
  display: flex; flex-direction: column; justify-content: space-between;
}
.worlds li:nth-child(odd) { transform: rotate(-1.5deg); }
.worlds li:nth-child(even) { transform: rotate(1.2deg); }
.worlds .no { font: 800 0.72rem/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; }
.worlds h3 { font-size: 1.45rem; font-weight: 900; }
.worlds .range { font-size: 0.86rem; font-weight: 700; }
.worlds .free-tag { position: absolute; right: 0.7rem; top: 0.7rem; padding: 0.22rem 0.55rem; border-radius: 999px; background: #fff; color: var(--teal-edge); font-size: 0.7rem; font-weight: 800; box-shadow: 0 2px 0 var(--white-edge); }
.w1 { background: linear-gradient(166deg, #6fc0ff, #b49aff 45%, #ffa258); }
.w2 { background: linear-gradient(166deg, #7fd6ff, #a8e6cc 45%, #ffcf7a); }
.w3 { background: linear-gradient(166deg, #ff9a55, #c08af0 45%, #5c8dff); }
.w4 { background: linear-gradient(166deg, #5cb8ff, #86a8ff 45%, #a98bff); }
.w5 { background: linear-gradient(166deg, #ffa6b8, #e9aef2 45%, #ff8a70); }
.w6 { background: linear-gradient(166deg, #e2b8ff, #c9a2ff 45%, #ff9a55); }
.w7 { background: linear-gradient(166deg, #0f2547, #1b5c6e 45%, #5b3a9e); }
.w8 { background: linear-gradient(166deg, #08123a, #1e0c5c 45%, #7a2d0c); }
.worlds .w7, .worlds .w8 { color: #fff; }
.worlds .w7 h3, .worlds .w8 h3 { color: #fff; }
.facts { display: flex; flex-wrap: wrap; gap: 0.7rem 1.4rem; margin: 2.2rem 0 0; padding: 0; list-style: none; }
.facts li { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; }
.facts .bead { width: 1rem; height: 1rem; }

/* Twenty themes, like the Themes screen's cards. */
.themes { list-style: none; margin: 2.4rem 0 0; padding: 0; display: grid; gap: 1.25rem 1rem; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.theme { margin: 0; background: #fff; border-radius: 22px; padding: 0.45rem 0.45rem 0.65rem; box-shadow: 0 5px 0 var(--white-edge), 0 16px 26px -20px rgba(34, 16, 63, 0.5); position: relative; }
.theme img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; background: var(--chip); }
.theme figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; padding: 0.5rem 0.3rem 0; font-size: 0.86rem; font-weight: 800; line-height: 1.2; }
.theme .need { flex: none; display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.8rem; color: var(--muted); }
.theme .need svg { width: 0.85rem; height: 0.85rem; fill: var(--orange); }
.theme .season {
  position: absolute; left: 50%; top: 0.9rem; transform: translateX(-50%) rotate(-3deg); white-space: nowrap;
  padding: 0.25rem 0.6rem; border-radius: 999px; background: #fff; color: var(--ink);
  font-size: 0.68rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; box-shadow: 0 3px 0 var(--orange-edge);
}
.themes li:nth-child(4n+1) .theme { transform: rotate(-1deg); }
.themes li:nth-child(4n+3) .theme { transform: rotate(1deg); }
@media (prefers-reduced-motion: no-preference) {
  .theme { transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1); }
  .themes li:hover .theme { transform: rotate(0) translateY(-4px); }
}
/* The seasons, on Bone Yard's own night sky (design/skins.md). */
.season-card {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: clamp(2rem, 5vw, 3.5rem); align-items: center;
  margin-top: clamp(3.5rem, 8vw, 5rem); padding: clamp(1.6rem, 5vw, 3.2rem); border-radius: 36px; color: #eadcff;
  background: linear-gradient(166deg, #140c2b 0%, #33194f 45%, #6e2e4a 100%);
  box-shadow: 0 9px 0 #c8b4ff, 0 30px 50px -28px rgba(34, 16, 63, 0.7);
}
.season-card h3 { color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 900; margin-bottom: 0.7rem; }
.season-card strong { color: #fff; }
.season-card .label { color: var(--orange-edge); box-shadow: 0 3px 0 var(--orange-edge); }
.season-card .phone { width: min(100%, 250px); }
.season-card .phone img { border-color: #2b1846; box-shadow: 0 9px 0 #0d0720, 0 30px 40px -20px rgba(0, 0, 0, 0.7); }
.season-list { list-style: none; margin: 1.2rem 0 1.4rem; padding: 0; display: grid; gap: 0.8rem; }
.season-list li { display: grid; grid-template-columns: 1.3rem minmax(0, 1fr); gap: 0.8rem; align-items: start; }
.season-list .bead { margin-top: 0.25rem; }
.season-list strong { font-weight: 800; }

/* Badges: the three tiers. */
.tiers { list-style: none; display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.6rem 0 1.6rem; padding: 0; }
.tiers li { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.45rem 1rem 0.45rem 0.45rem; border-radius: 999px; background: #fff; box-shadow: 0 4px 0 var(--white-edge); font-weight: 800; }
.medal { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font: 900 0.9rem/1 var(--display); color: var(--ink); }
.bronze { background: radial-gradient(circle at 35% 30%, #f6c7a0, #c98a5a 70%); box-shadow: inset 0 -3px 0 #9a5f35; }
.silver { background: radial-gradient(circle at 35% 30%, #ffffff, #b9bfd6 70%); box-shadow: inset 0 -3px 0 #8a90aa; }
.gold { background: radial-gradient(circle at 35% 30%, #fff1a8, #f3b833 70%); box-shadow: inset 0 -3px 0 #b07f00; }

/* The honest bit: promises as the game's loop chips. */
.promises { list-style: none; margin: 1.6rem 0 1.8rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.promises li { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.5rem 1rem 0.5rem 0.5rem; border-radius: 999px; background: #fff; box-shadow: 0 4px 0 var(--e); font-weight: 800; }
.promises li:nth-child(odd) { transform: rotate(-1.5deg); }
.promises li:nth-child(even) { transform: rotate(1deg); }
.promises .bead { width: 1.4rem; height: 1.4rem; display: grid; place-items: center; }
.promises .bead svg { width: 0.8rem; height: 0.8rem; fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.c-orange { --c: var(--orange); --e: var(--orange-edge); }
.c-purple { --c: var(--purple); --e: var(--purple-edge); }
.c-teal { --c: var(--teal); --e: var(--teal-edge); }
.c-yellow { --c: var(--yellow); --e: var(--yellow-edge); }
.c-lilac { --c: var(--lilac); --e: var(--lilac-edge); }

/* ---------- The footer, on Midnight's sky ---------- */

.footer {
  position: relative; color: var(--night-text); padding: clamp(3.5rem, 8vw, 5rem) 0 2.5rem; font-size: 0.95rem;
  background-color: #1e0c5c;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(1px 1px at 34% 44%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.6px 1.6px at 71% 14%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(1px 1px at 86% 52%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 52% 26%, rgba(255, 255, 255, 0.65), transparent 60%),
    radial-gradient(1px 1px at 22% 60%, rgba(255, 255, 255, 0.45), transparent 60%),
    var(--midnight);
  background-size: 360px 260px, 360px 260px, 360px 260px, 360px 260px, 360px 260px, 360px 260px, auto;
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, no-repeat;
}
.footer::before { /* the soft curve where the paper meets the night */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2.5rem;
  background: var(--paper); border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.page .footer::before { background: var(--paper); }
.footer-row { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: center; }
.footer .mark { width: clamp(11rem, 26vw, 15rem); }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; }
.footer a { color: #fff; font-weight: 700; }
.footer-note { margin: 2rem 0 0; color: var(--night-text); font-size: 0.86rem; max-width: none; }
.consent-open { font: inherit; color: #fff; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* ---------- Inner pages (About, Privacy, Contact, 404) ---------- */

.page-head { position: relative; overflow: hidden; padding: 4.6rem 0 clamp(2.5rem, 6vw, 3.8rem); border-radius: 0 0 50% 50% / 0 0 2rem 2rem; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 3.9rem); font-weight: 900; line-height: 1.02; letter-spacing: -0.02em; }
.page-head .sub { margin: 0.8rem 0 0; font-weight: 700; color: var(--soft); }
.page-head .wrap { position: relative; z-index: 1; padding-top: clamp(1rem, 4vw, 2rem); }
.page-body { padding: clamp(2.5rem, 6vw, 3.5rem) 0 clamp(4rem, 9vw, 6rem); }
.page-body h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 900; margin: 2.6rem 0 0.7rem; max-width: none; }
.page-body h2:first-child { margin-top: 0; }
.page-body ul { padding-left: 1.2rem; max-width: var(--read); }
.page-body li { margin-bottom: 0.5rem; }
.page-body .wrap > * { max-width: 44rem; }
.note {
  margin: 0 0 2.2rem; padding: 1.2rem 1.4rem; border-radius: 24px; background: #fff;
  box-shadow: 0 6px 0 var(--teal), 0 18px 30px -22px rgba(34, 16, 63, 0.5);
}
.note p:last-child { margin: 0; }
.mail {
  display: inline-block; font: 900 clamp(1.3rem, 4vw, 1.9rem)/1.2 var(--display); color: var(--ink);
  text-decoration-color: var(--orange); text-decoration-thickness: 0.12em; overflow-wrap: anywhere;
}
.qa { display: grid; gap: 1rem; margin-top: 1.4rem; }
.qa article { background: #fff; border-radius: 24px; padding: 1.15rem 1.35rem 0.4rem; box-shadow: 0 5px 0 var(--white-edge); }
.qa h3 { font-size: 1.12rem; font-weight: 800; margin-bottom: 0.45rem; }
.qa p { font-size: 1rem; }
.side-icon { float: right; width: min(36%, 11rem); margin: 0.4rem 0 1rem 1.8rem; }
.side-icon img { width: 100%; border-radius: 22.4%; border: 5px solid #fff; transform: rotate(4deg); box-shadow: 0 8px 0 var(--white-edge); }
.credits { border-collapse: separate; border-spacing: 0; width: 100%; max-width: 44rem; font-size: 0.97rem; background: #fff; border-radius: 22px; box-shadow: 0 5px 0 var(--white-edge); overflow: hidden; }
.credits th, .credits td { text-align: left; padding: 0.75rem 1rem; vertical-align: top; }
.credits tr + tr td, .credits tbody tr:first-child td { border-top: 2px solid var(--chip); }
.credits th { font: 800 0.72rem/1.2 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--purple-edge); background: var(--chip); }
.lost-board { width: min(70%, 15rem); margin: 0 0 1.2rem; }

/* The analytics question (assets/analytics.js): small, plain, two equal candy buttons. */
.consent {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 20; max-width: 30rem;
  background: #fff; color: var(--ink); border-radius: 26px; padding: 1.1rem 1.25rem 1.3rem;
  box-shadow: 0 7px 0 var(--white-edge), 0 24px 44px -18px rgba(34, 16, 63, 0.6);
}
.consent p { margin: 0 0 0.75rem; font-size: 0.95rem; }
.consent .consent-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 0.35rem; }
.consent-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.4rem; }
/* Equal on purpose: the same size, shape and weight, one orange and one purple, so neither
   is the "easy" choice. Side by side on wide screens, both full width when they stack. */
.consent button {
  position: relative; top: 0; flex: 1 1 12rem; min-height: 3.1rem; padding: 0.7rem 1rem; border: 0; border-radius: 18px; cursor: pointer;
  font: 800 0.98rem/1.1 var(--display);
}
.consent button[data-choice="yes"] { background: var(--orange); color: var(--ink); box-shadow: 0 4px 0 var(--orange-edge); }
.consent button[data-choice="no"] { background: var(--purple); color: #fff; box-shadow: 0 4px 0 var(--purple-edge); }
.consent button:active { top: 3px; box-shadow: none; }
.consent button:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .hero-grid, .split, .split.flip, .try-grid, .season-card { grid-template-columns: minmax(0, 1fr); }
  .split.flip > .phone { order: 2; } /* text first on a phone, then the screen */
  .phone { width: min(68%, 260px); }
  .hero-phones { margin-top: 0.5rem; }
  .hero-phones .back { display: none; }
  .hero-phones .front { margin-left: 0; width: min(72%, 280px); }
  .worlds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .themes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .lockup .mark { display: none; }
  nav ul { gap: 0.35rem; }
  nav a { padding: 0.45rem 0.7rem; font-size: 0.9rem; }
  .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 0.6rem; }
  .theme { padding: 0.3rem 0.3rem 0.5rem; border-radius: 18px; }
  .theme img { border-radius: 13px; }
  .theme figcaption { flex-direction: column; gap: 0.1rem; font-size: 0.78rem; padding: 0.4rem 0.2rem 0; }
  .theme .season { font-size: 0.58rem; padding: 0.2rem 0.45rem; top: 0.6rem; }
  .worlds li { min-height: 7.4rem; }
  .hud-title strong { font-size: 1.25rem; }
  .moves { font-size: 0.75rem; }
  .rules li { grid-template-columns: 4.6rem minmax(0, 1fr); padding: 0.75rem 0.9rem; gap: 0.8rem; }
  .rules .got svg { width: 1.25rem; height: 1.25rem; }
  .side-icon { float: none; width: 7.5rem; margin: 0 0 1.5rem; }
}
