/* BeatMe Games: "sticker pop" design system.
   Cream paper, ink outlines, hard offset shadows, flat bright colors, slightly tilted sticker labels.
   Mobile-first. Light (cream) is the house look; dark ("after hours") is available via the toggle. */

@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-latin.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }

:root {
  --font: "Bricolage", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Brand colors: the same in both themes */
  --tomato: #ff5a36;
  --cobalt: #3d6bff;
  --lemon: #ffd23f;
  --mint: #2ed8a0;
  --pink: #ff8bc2;
  --lilac: #a99bff;
  --ink: #161412;
  --cream: #fff4dc;

  /* Players: challenger tomato, opponent lemon (and the classic cobalt Connect 4 board) */
  --p0: var(--tomato);
  --p1: var(--lemon);

  /* Theme: cream paper */
  --bg: #fff4dc;
  --bg-2: #ffe9bd;
  --surface: #fffcf4;
  --surface-2: #fff6e4;
  --text: #161412;
  --muted: #514a42;
  --faint: #8a8174;
  --line: #161412;          /* outlines */
  --drop: #161412;          /* hard shadows */
  --bw: 2.5px;              /* outline width */
  --shadow-s: 3px 3px 0 var(--drop);
  --shadow: 5px 5px 0 var(--drop);
  --shadow-l: 8px 8px 0 var(--drop);
  --dots: rgba(22, 20, 18, .09);

  --radius-s: 10px;
  --radius: 16px;
  --radius-l: 22px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --bounce: cubic-bezier(.3, 1.6, .5, 1);
  --tap: 46px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #24211d;
  --bg-2: #1b1916;
  --surface: #302c27;
  --surface-2: #3a352f;
  --text: #fff4dc;
  --muted: #d9cdb6;
  --faint: #a59a88;
  --line: #0c0b0a;
  --drop: #0c0b0a;
  --dots: rgba(255, 244, 220, .07);
  color-scheme: dark;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dots) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  color: var(--text);
  font: 500 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
main { flex: 1; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--cobalt); }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.02; margin: 0 0 .45em; letter-spacing: -.025em; font-variation-settings: "opsz" 96; }
h1 { font-size: clamp(2.6rem, 9vw, 5.4rem); }
h2 { font-size: clamp(1.9rem, 5.2vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2.8vw, 1.5rem); letter-spacing: -.015em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--lemon); color: var(--ink); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--lemon); color: var(--ink); padding: 10px 16px; border: var(--bw) solid var(--ink); border-radius: 10px; }
.skip:focus { left: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.fine { font-size: .85rem; color: var(--faint); }
.muted { color: var(--muted); }

/* A highlighter swipe behind a word */
.marker { font-style: normal; background: linear-gradient(transparent 58%, var(--lemon) 58%, var(--lemon) 92%, transparent 92%); padding: 0 .08em; color: inherit; }
[data-theme="dark"] .marker { background: linear-gradient(transparent 58%, var(--tomato) 58%, var(--tomato) 92%, transparent 92%); }

/* Sticker label: the little tilted tag above headings */
.eyebrow {
  display: inline-block; margin-bottom: 1rem; padding: 5px 12px 6px;
  font: 800 .78rem/1 var(--font); letter-spacing: .02em; text-transform: lowercase;
  color: var(--ink); background: var(--lemon); border: var(--bw) solid var(--ink); border-radius: 999px;
  box-shadow: var(--shadow-s); transform: rotate(-3deg);
}
.eyebrow.tomato { background: var(--tomato); }
.eyebrow.mint { background: var(--mint); }
.eyebrow.pink { background: var(--pink); }
.squiggle { display: block; width: 120px; height: 16px; margin: 0 auto 1rem; color: var(--tomato); }

/* ───────── Buttons: they physically press down ───────── */
.btn {
  --b-bg: var(--surface); --b-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--tap); padding: 0 1.3em;
  border: var(--bw) solid var(--line); border-radius: 14px;
  background: var(--b-bg); color: var(--b-fg); box-shadow: var(--shadow-s);
  font: 800 1rem/1 var(--font); letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background-color .15s;
}
.btn:hover { color: var(--b-fg); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--drop); }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: default; pointer-events: none; }
.btn-primary { --b-bg: var(--cobalt); --b-fg: #fff; }
.btn-hot { --b-bg: var(--tomato); --b-fg: var(--ink); }
.btn-ghost { --b-bg: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:active { transform: none; }
.btn-lg { min-height: 58px; padding: 0 1.7em; font-size: 1.12rem; border-radius: 16px; box-shadow: var(--shadow); }
.btn-lg:active { transform: translate(5px, 5px); }
.btn-sm { min-height: 40px; padding: 0 1em; font-size: .9rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--tap); padding: 0; }
@media (hover: hover) {
  .btn:not(.btn-ghost):hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--drop); }
  .btn-lg:not(.btn-ghost):hover { box-shadow: 7px 7px 0 var(--drop); }
  .btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
}

/* ───────── Header ───────── */
.site-head { position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); background: var(--bg); border-bottom: var(--bw) solid var(--line); }
.head-row { display: flex; align-items: center; gap: 14px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); flex: none; }
.logo:hover { color: var(--text); }
.logo-mark { width: 40px; height: 40px; transition: transform .35s var(--bounce); }
.logo:hover .logo-mark { transform: rotate(-12deg) scale(1.06); }
.logo-word { font: 800 1.45rem/1 var(--font); letter-spacing: -.04em; font-variation-settings: "opsz" 96; }
.logo-word em { font-style: normal; color: var(--tomato); }
.main-nav { display: none; gap: 2px; margin-left: 10px; }
.main-nav a { color: var(--text); text-decoration: none; font-weight: 700; font-size: .98rem; padding: 8px 12px; border-radius: 10px; border: var(--bw) solid transparent; }
.main-nav a:hover { border-color: var(--line); background: var(--surface); }
.main-nav a[aria-current] { background: var(--lemon); border-color: var(--line); color: var(--ink); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.head-cta { display: none; }
.theme-toggle, .menu-toggle {
  width: var(--tap); height: var(--tap); display: grid; place-items: center;
  border: var(--bw) solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer;
  box-shadow: var(--shadow-s); -webkit-tap-highlight-color: transparent; transition: transform .12s, box-shadow .12s;
}
.theme-toggle:active, .menu-toggle:active { transform: translate(3px, 3px); box-shadow: none; }
.theme-toggle .icon { width: 22px; height: 22px; }
[data-theme="dark"] .i-sun, [data-theme="light"] .i-moon { display: none; }
.mobile-nav { display: grid; gap: 8px; padding: 10px var(--gutter) 18px; border-top: var(--bw) solid var(--line); background: var(--bg-2); }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 14px 16px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.1rem; border: var(--bw) solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-s); }
@media (min-width: 920px) { .main-nav { display: flex; } .menu-toggle, .mobile-nav { display: none !important; } }
@media (min-width: 560px) { .head-cta { display: inline-flex; } }

/* ───────── Footer ───────── */
.site-foot { margin-top: clamp(64px, 11vw, 120px); border-top: var(--bw) solid var(--line); background: var(--ink); color: var(--cream); padding-bottom: env(safe-area-inset-bottom); }
.site-foot .logo, .site-foot .logo:hover { color: var(--cream); }
.foot-grid { display: grid; gap: 28px; padding-top: 48px; padding-bottom: 32px; grid-template-columns: 1fr 1fr; }
.foot-brand { grid-column: 1 / -1; max-width: 400px; color: #d9cdb6; }
.foot-brand .logo { margin-bottom: 14px; }
.foot-brand .fine { color: #a59a88; }
.foot-h { font: 800 .85rem/1 var(--font); color: var(--lemon); margin: 6px 0 14px; text-transform: lowercase; }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.foot-links a { color: var(--cream); text-decoration: none; display: inline-block; padding: 6px 0; font-weight: 600; }
.foot-links a:hover { color: var(--lemon); text-decoration: underline; }
.foot-base { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 18px; padding-bottom: 26px; border-top: 2px dashed #4a443d; color: #a59a88; font-size: .85rem; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } .foot-brand { grid-column: auto; } }

/* ───────── Hero ───────── */
.hero { position: relative; isolation: isolate; padding: clamp(44px, 9vw, 100px) 0 clamp(36px, 7vw, 80px); text-align: center; overflow: hidden; }
.hero h1 { max-width: 12ch; margin: 0 auto .3em; }
.hero-sub { max-width: 560px; margin: 0 auto 1.8rem; color: var(--muted); font-size: clamp(1.06rem, 2.6vw, 1.28rem); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.hero-proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 2rem; }
.hero-proof span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: .9rem; }
.hero-proof span:nth-child(1) .icon { color: var(--mint); }
.hero-proof span:nth-child(2) .icon { color: var(--cobalt); }
.hero-proof span:nth-child(3) .icon { color: var(--tomato); }
/* Floating sticker shapes around the hero */
.hero-deco { position: absolute; z-index: -1; border: var(--bw) solid var(--ink); box-shadow: var(--shadow); pointer-events: none; }
.hero-deco.d1 { width: 70px; height: 70px; border-radius: 50%; background: var(--tomato); left: 6%; top: 16%; animation: wobble 6s ease-in-out infinite; }
.hero-deco.d2 { width: 58px; height: 58px; border-radius: 14px; background: var(--cobalt); right: 8%; top: 22%; rotate: 14deg; animation: wobble 7s ease-in-out infinite reverse; }
.hero-deco.d3 { width: 46px; height: 46px; border-radius: 50%; background: var(--lemon); left: 12%; bottom: 14%; animation: wobble 8s ease-in-out infinite; }
.hero-deco.d4 { width: 52px; height: 52px; border-radius: 12px; background: var(--mint); right: 12%; bottom: 18%; rotate: -10deg; animation: wobble 6.5s ease-in-out infinite reverse; }
@media (max-width: 700px) { .hero-deco.d1 { left: -22px; top: 6%; } .hero-deco.d2 { right: -18px; top: 9%; } .hero-deco.d3, .hero-deco.d4 { display: none; } }
@keyframes wobble { 50% { translate: 0 -10px; } }

/* Hero illustration, with the demo "chat bubble with a link" stuck on its corner */
.hero-art { position: relative; margin: clamp(36px, 7vw, 60px) auto 0; max-width: 900px; }
.hero-art img { display: block; width: 100%; height: auto; border-radius: var(--radius-l); border: var(--bw) solid var(--line); box-shadow: var(--shadow-l); transform: rotate(-1deg); background: var(--surface); }
.hero-card {
  position: absolute; left: clamp(-10px, -2vw, -24px); bottom: clamp(-26px, -3vw, -34px); max-width: min(420px, 82%); text-align: left;
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: 20px 20px 20px 6px; background: var(--surface);
  border: var(--bw) solid var(--line); box-shadow: var(--shadow); transform: rotate(2deg);
}
.hero-card-thumb { width: 84px; aspect-ratio: 1.91; border-radius: 10px; background: var(--cobalt); display: grid; place-items: center; border: 2px solid var(--ink); }
.hero-card-thumb svg { width: 30px; height: 30px; }
.hero-card b { display: block; font-size: .98rem; font-weight: 800; }
.hero-card small { color: var(--faint); font-size: .8rem; font-weight: 600; }
@media (max-width: 560px) { .hero-card { position: relative; left: auto; bottom: auto; max-width: none; margin: -22px 10px 0; } .hero-card-thumb { width: 64px; } }

/* ───────── Sections ───────── */
.section { padding: clamp(48px, 8vw, 88px) 0 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto clamp(26px, 5vw, 44px); }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.prose { max-width: 740px; }
.prose h2 { margin-top: 1.5em; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.prose h3 { margin-top: 1.3em; }
.prose p, .prose li { color: var(--muted); font-size: 1.05rem; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--tomato); }
.prose a { color: var(--cobalt); font-weight: 700; }
.prose code { font-size: .9em; background: var(--surface); border: 2px solid var(--line); border-radius: 6px; padding: 0 5px; }
.page-intro { padding: clamp(36px, 7vw, 72px) 0 10px; }
.page-intro p { color: var(--muted); max-width: 640px; font-size: 1.12rem; }
.crumbs { font-size: .88rem; font-weight: 700; color: var(--faint); margin-bottom: 1.1rem; }
.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--cobalt); text-decoration: underline; }

/* ───────── Game tiles: stickers on a table ───────── */
.tiles { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-l); text-decoration: none; color: var(--text);
  background: var(--surface); border: var(--bw) solid var(--line); box-shadow: var(--shadow);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .2s var(--bounce), box-shadow .2s var(--ease);
}
.tile:nth-child(3n+1) { --tilt: -1.2deg; }
.tile:nth-child(3n+2) { --tilt: 1deg; }
.tile:nth-child(3n) { --tilt: -.6deg; }
.tile:active { transform: rotate(var(--tilt, 0deg)) translate(4px, 4px); box-shadow: 1px 1px 0 var(--drop); }
.tile-art { display: block; aspect-ratio: 16 / 11; overflow: hidden; background: var(--accent, var(--cobalt)); border-bottom: var(--bw) solid var(--line); }
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--bounce); }
.tile-body { display: grid; gap: 3px; padding: 14px 18px 18px; }
.tile-cat { font: 800 .8rem/1 var(--font); text-transform: lowercase; color: var(--faint); }
.tile-name { font: 800 1.65rem/1.05 var(--font); letter-spacing: -.03em; font-variation-settings: "opsz" 96; }
.tile-tag { color: var(--muted); font-size: .98rem; }
.tile-meta { margin-top: 8px; display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: .85rem; font-weight: 700; }
.tile-meta .icon { width: 1em; height: 1em; }
.badge { position: absolute; top: 14px; right: 14px; z-index: 3; padding: 6px 11px 7px; border: var(--bw) solid var(--ink); border-radius: 999px; box-shadow: var(--shadow-s); font: 800 .8rem/1 var(--font); text-transform: lowercase; color: var(--ink); transform: rotate(6deg); }
.badge-new { background: var(--mint); }
.badge-hot { background: var(--pink); }
@media (hover: hover) {
  .tile:hover { transform: rotate(0deg) translate(-3px, -3px); box-shadow: var(--shadow-l); }
  .tile:hover .tile-art img { transform: scale(1.05); }
}
.tile-soon { pointer-events: none; background: var(--surface-2); border-style: dashed; box-shadow: none; }
.tile-soon .tile-art { display: grid; place-items: center; background: transparent; border-bottom-style: dashed; color: var(--faint); font: 800 3rem/1 var(--font); }

/* Category cards */
.cats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.cat { padding: 22px; border-radius: var(--radius); border: var(--bw) solid var(--line); background: var(--surface); box-shadow: var(--shadow-s); color: var(--ink); }
.cat:nth-child(1) { background: var(--lemon); }
.cat:nth-child(2) { background: var(--pink); }
.cat:nth-child(3) { background: var(--mint); }
.cat:nth-child(4) { background: var(--lilac); }
.cat h3 { margin-bottom: .25em; }
.cat p { margin: 0; font-size: .98rem; }
.cat-num { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 50%; background: var(--ink); color: var(--cream); font: 800 .95rem/1 var(--font); }

/* Steps */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); counter-reset: step; }
.step { position: relative; padding: 24px 22px 22px; border-radius: var(--radius); background: var(--surface); border: var(--bw) solid var(--line); box-shadow: var(--shadow-s); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 14px; border: var(--bw) solid var(--ink); font: 800 1.35rem/1 var(--font); color: var(--ink); background: var(--lemon); box-shadow: var(--shadow-s); transform: rotate(-6deg); }
.step:nth-child(2)::before { background: var(--tomato); transform: rotate(4deg); }
.step:nth-child(3)::before { background: var(--mint); }
.step:nth-child(4)::before { background: var(--pink); transform: rotate(5deg); }
.step:has(.step-art)::before { position: absolute; top: 12px; left: 12px; z-index: 1; margin: 0; }
.step-art { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin: -6px 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); }
.step h3 { margin-bottom: .3em; }
.step p { margin: 0; color: var(--muted); }

/* FAQ */
.faq { max-width: 800px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { border: var(--bw) solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.faq details[open] { background: var(--surface-2); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 58px 18px 20px; font-weight: 800; font-size: 1.05rem; position: relative; min-height: var(--tap); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; translate: 0 -50%; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--lemon); color: var(--ink); font: 800 1.2rem/1 var(--font); transition: rotate .25s var(--bounce); }
.faq details[open] summary::after { rotate: 45deg; background: var(--tomato); }
.faq .faq-a { padding: 0 20px 18px; color: var(--muted); }
.faq .faq-a p:last-child { margin: 0; }

/* ───────── Game landing page ───────── */
.game-hero { padding: clamp(28px, 6vw, 60px) 0 0; }
.game-hero-grid { display: grid; gap: clamp(32px, 4vw, 52px); align-items: center; }
.game-hero h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); }
.game-hero .lede { color: var(--muted); font-size: 1.12rem; max-width: 540px; }
.game-art-frame { position: relative; border-radius: var(--radius-l); overflow: hidden; border: var(--bw) solid var(--line); box-shadow: var(--shadow-l); background: var(--cobalt); transform: rotate(-1deg); }
.game-art-frame img { display: block; width: 100%; height: auto; }
.game-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.game-facts li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 700; }
@media (min-width: 900px) { .game-hero-grid { grid-template-columns: 1.05fr 1fr; } }

/* The create-challenge card */
.create { position: relative; padding: clamp(20px, 4vw, 30px); border-radius: var(--radius-l); background: var(--surface); border: var(--bw) solid var(--line); box-shadow: var(--shadow-l); }
.create::before { content: "your move"; position: absolute; top: -16px; right: 22px; padding: 5px 12px 6px; background: var(--tomato); color: var(--ink); border: var(--bw) solid var(--ink); border-radius: 999px; box-shadow: var(--shadow-s); font: 800 .8rem/1 var(--font); transform: rotate(4deg); }
.create h2 { font-size: clamp(1.7rem, 4vw, 2.1rem); margin-bottom: .25em; }
.create > p { color: var(--muted); }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > label, .field-label { font: 800 .9rem/1 var(--font); color: var(--text); }
.input {
  width: 100%; min-height: 54px; padding: 0 16px; border-radius: 14px;
  border: var(--bw) solid var(--line); background: var(--bg); color: var(--text);
  font: 700 1.08rem var(--font); /* ≥16px stops iOS from zooming in on focus */
  transition: box-shadow .15s, background-color .15s;
}
.input::placeholder { color: var(--faint); font-weight: 600; }
.input:focus { outline: none; background: var(--surface); box-shadow: var(--shadow-s); }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 18px; border-radius: 14px; border: var(--bw) solid var(--line); background: var(--surface); font-weight: 800; cursor: pointer; transition: transform .12s, box-shadow .12s, background-color .12s; }
.choice input:checked + span { background: var(--lemon); color: var(--ink); box-shadow: var(--shadow-s); transform: rotate(-2deg); }
.choice input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.form-error { color: var(--tomato); font-weight: 800; min-height: 1.2em; margin: 10px 0 0; }
.create .fine { margin: 12px 0 0; text-align: center; }

/* ───────── Play page ───────── */
.page-play .site-foot { margin-top: 56px; }
.play { padding: 16px 0 0; }
.play-wrap { max-width: 760px; }
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.play-title { font: 800 .95rem/1 var(--font); text-transform: lowercase; color: var(--muted); }
.play-title a { color: var(--text); text-decoration: none; }
.play-title a:hover { text-decoration: underline; }
.play-live { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--tomato); color: var(--ink); font-size: .82rem; font-weight: 800; }
.play-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Players bar */
.players { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border-radius: 20px; border: var(--bw) solid var(--line); background: var(--surface); box-shadow: var(--shadow-s); margin-bottom: 14px; }
.player { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 9px; border-radius: 14px; border: var(--bw) solid transparent; transition: background-color .2s, border-color .2s, transform .2s var(--bounce); }
.player:last-child { flex-direction: row-reverse; text-align: right; }
.player.is-turn { background: var(--lemon); border-color: var(--ink); color: var(--ink); transform: rotate(-1.5deg); }
.player:last-child.is-turn { transform: rotate(1.5deg); }
.player.is-turn .player-sub { color: var(--ink); }
.player-token { width: 30px; height: 30px; border-radius: 50%; flex: none; position: relative; border: var(--bw) solid var(--ink); }
.player-token.p0 { background: var(--p0); }
.player-token.p1 { background: var(--p1); }
.player-token .online { position: absolute; right: -5px; bottom: -5px; width: 13px; height: 13px; border-radius: 50%; background: #cfc6b6; border: 2px solid var(--ink); }
.player-token .online.on { background: var(--mint); }
.player-name { font-weight: 800; font-size: clamp(.95rem, 3.8vw, 1.05rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.player-sub { display: block; font-size: .78rem; color: var(--faint); font-weight: 700; }
.player-text { min-width: 0; display: grid; }
.score { font: 800 1.5rem/1 var(--font); white-space: nowrap; padding: 6px 10px; border: var(--bw) solid var(--ink); border-radius: 12px; background: var(--ink); color: var(--cream); text-align: center; letter-spacing: -.02em; }
.score small { display: block; font: 800 .62rem/1 var(--font); text-transform: lowercase; color: var(--lemon); margin-top: 4px; letter-spacing: 0; }

/* Status bubble */
.status {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 54px; padding: 10px 18px; margin-bottom: 16px; border-radius: 16px;
  font: 800 1.12rem/1.25 var(--font); border: var(--bw) solid var(--line); background: var(--surface);
  scroll-margin-top: calc(84px + env(safe-area-inset-top));
}
.status.is-mine { background: var(--mint); color: var(--ink); box-shadow: var(--shadow-s); animation: nudge .5s var(--bounce); }
.status.is-win { background: var(--lemon); color: var(--ink); box-shadow: var(--shadow-s); }
@keyframes nudge { 0% { transform: scale(.96); } 100% { transform: none; } }

.stage { position: relative; display: grid; place-items: center; margin: 0 auto; width: 100%; }

/* Panels (share / join / result) */
.panel { position: relative; padding: clamp(18px, 4vw, 26px); border-radius: var(--radius-l); border: var(--bw) solid var(--line); background: var(--surface); box-shadow: var(--shadow); margin-top: 22px; }
.panel h2 { font-size: clamp(1.5rem, 4.4vw, 2rem); margin-bottom: .25em; }
.panel > p { color: var(--muted); }
.share-link { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 14px; border: var(--bw) solid var(--line); background: var(--bg); margin: 14px 0; }
.share-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 1.08rem var(--font); color: var(--cobalt); }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; }
.share-row .btn { flex: 1 1 auto; }
.share-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.share-apps .btn { padding: 0; font-size: .8rem; flex-direction: column; gap: 4px; min-height: 66px; border-radius: 14px; }
.share-apps .icon { width: 22px; height: 22px; }
.share-apps [data-share="whatsapp"] { --b-bg: var(--mint); --b-fg: var(--ink); }
.share-apps [data-share="sms"] { --b-bg: var(--lemon); --b-fg: var(--ink); }
.share-apps [data-share="facebook"] { --b-bg: var(--cobalt); --b-fg: #fff; }
.share-apps [data-share="x"] { --b-bg: var(--ink); --b-fg: var(--cream); }
.join-form { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 560px) { .panel .join-form { grid-template-columns: 1fr auto; } }

/* Result */
.result { text-align: center; }
.result-crown { width: 54px; height: 54px; color: var(--lemon); margin: -4px auto 6px; display: block; transform: rotate(-8deg); stroke: var(--ink); stroke-width: 1.4px; stroke-linejoin: round; }
.result h2 { font-size: clamp(2rem, 6vw, 2.8rem); }
.result-line { color: var(--muted); font-size: 1.08rem; font-weight: 700; }
.brag { margin: 20px auto 16px; max-width: 420px; border-radius: 18px; overflow: hidden; border: var(--bw) solid var(--line); box-shadow: var(--shadow); background: var(--bg-2); aspect-ratio: 1; transform: rotate(-1.5deg); }
.brag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brag.is-loading { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.result-actions { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 560px) { .result-actions { grid-template-columns: 1fr 1fr; } }

/* Tools under the board */
.play-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.play-tools .btn { box-shadow: none; border-color: var(--line); background: var(--surface); }
.play-tools .btn:active { transform: translate(2px, 2px); }
.play-meta { text-align: center; margin-top: 18px; color: var(--faint); font-size: .86rem; font-weight: 600; }
.play-meta button { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px; }

/* Replay bar */
.replay-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; border: var(--bw) solid var(--line); background: var(--lilac); color: var(--ink); box-shadow: var(--shadow-s); margin-top: 16px; }
.replay-bar .btn { --b-bg: #fffcf4; --b-fg: var(--ink); border-color: var(--ink); }
.replay-bar input[type="range"] { flex: 1; accent-color: var(--ink); min-height: var(--tap); }
.replay-bar .replay-label { white-space: nowrap; font-size: .85rem; font-weight: 800; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }

/* Sheets (report, other device) */
dialog.sheet { border: var(--bw) solid var(--line); border-radius: var(--radius-l); background: var(--surface); color: var(--text); padding: 24px; width: min(480px, calc(100vw - 24px)); box-shadow: var(--shadow-l); }
dialog.sheet::backdrop { background: rgba(22, 20, 18, .55); }
dialog.sheet h2 { font-size: 1.7rem; }
dialog.sheet .sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.radio-list { display: grid; gap: 8px; margin: 10px 0 14px; }
.radio-list label { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 700; }
.radio-list input { accent-color: var(--tomato); width: 18px; height: 18px; }
textarea.input { min-height: 90px; padding: 12px 16px; resize: vertical; font-size: 1rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 160%) rotate(-2deg); z-index: 90; padding: 13px 20px; border-radius: 14px; background: var(--lemon); color: var(--ink); border: var(--bw) solid var(--ink); box-shadow: var(--shadow-s); font-weight: 800; font-size: .95rem; transition: transform .4s var(--bounce); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0) rotate(-2deg); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }

/* Missing page */
.missing { text-align: center; padding: clamp(60px, 12vw, 130px) 0 0; }
.missing-art { display: block; width: min(100%, 520px); height: auto; margin: 0 auto 26px; border-radius: var(--radius-l); border: var(--bw) solid var(--line); box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.missing p { color: var(--muted); max-width: 480px; margin: 0 auto 1.6rem; font-size: 1.08rem; }

.ad-slot { margin: 32px auto; min-height: 100px; max-width: 728px; }

/* Consent banner (only when trackers are configured) */
.consent { position: fixed; z-index: 95; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: var(--bw) solid var(--line); box-shadow: var(--shadow); display: grid; gap: 12px; }
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: .92rem; color: var(--muted); }
.consent-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* "You've been challenged" overlay over the board */
.join-overlay {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(22, 20, 18, .5);
  opacity: 0; transition: opacity .25s var(--ease);
}
.join-overlay.show { opacity: 1; }
.join-card {
  position: relative; width: min(100%, 440px); text-align: center;
  padding: 0 clamp(18px, 5vw, 26px) clamp(16px, 4vw, 22px); border-radius: var(--radius-l);
  background: var(--surface); border: var(--bw) solid var(--line); box-shadow: var(--shadow-l);
  transform: translateY(24px) rotate(2deg) scale(.96); transition: transform .45s var(--bounce);
}
.join-overlay.show .join-card { transform: rotate(-1deg); }
.join-art { display: block; margin: 0 calc(-1 * clamp(18px, 5vw, 26px)) 18px; aspect-ratio: 16 / 7; overflow: hidden; border-bottom: var(--bw) solid var(--line); border-radius: calc(var(--radius-l) - 3px) calc(var(--radius-l) - 3px) 0 0; background: var(--cobalt); }
.join-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.join-card .eyebrow { margin-bottom: .8rem; background: var(--tomato); }
.join-card h2 { font-size: clamp(1.6rem, 6.4vw, 2.1rem); margin-bottom: .3em; }
.join-card p { color: var(--muted); font-size: 1rem; margin-bottom: 1.1rem; }
.join-card .join-form { grid-template-columns: 1fr; margin-top: 0; }
.join-skip, .join-watch {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--tap);
  background: none; border: 0; color: var(--text); font: 800 .95rem var(--font); cursor: pointer; padding: 6px 12px;
  text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--tomato); text-underline-offset: 4px;
}
.join-skip:hover, .join-watch:hover { color: var(--cobalt); }
.join-card .join-skip { margin-top: 8px; }
.join-card .join-watch { display: flex; margin: 0 auto; text-decoration: none; color: var(--faint); font-size: .9rem; }
.join-skip.is-busy { opacity: .5; pointer-events: none; }
.panel .join-skip { margin-top: 6px; padding-left: 0; }
body.has-overlay { overflow: hidden; }
@media (max-height: 640px) { .join-art { display: none; } .join-card { padding-top: 22px; } }

/* Small phones: give names room in the players bar */
@media (max-width: 420px) {
  .players { padding: 7px; gap: 4px; }
  .player { gap: 7px; padding: 5px 5px; }
  .player-token { width: 24px; height: 24px; }
  .score { font-size: 1.2rem; padding: 5px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
