/* Sibby website. Tokens are ported from the app (Sibby/Core/DesignSystem/Theme.swift, Accent.swift gold).
   Keep them in step when the app's palette changes. */

:root {
  color-scheme: light;
  --bg-top: #FFEDB8;
  --bg: #FFF7E6;
  --surface: #FFFDF8;
  --surface-sunken: #FFF3D9;
  --panel-top: #FFFFFF;
  --border: #F4E2B6;
  --card-edge: #EFD39A;
  --ink: #6B3B00;
  --ink-2: #8E5F3E;
  --muted-ink: #A89580;
  --shadow: rgba(200, 149, 90, .22);
  --texture: rgba(200, 149, 90, .08);
  --rim: rgba(255, 255, 255, .85);
  --cloud-dim: none;

  --accent: #F0A500;
  --accent-light: #FFCF4A;
  --accent-deep: #C07F00;
  --accent-soft: #FFF0C4;
  --accent-text: #926100;
  --on-accent: #4A2A00;

  --pink: #FF5A8E;  --pink-soft: #FFE3EC;
  --blue: #7EC8FF;  --blue-soft: #E0F1FF;
  --purple: #C8A8FF; --purple-soft: #EFE5FF;
  --green: #A7E685; --green-soft: #E9F8DE;
  --coral: #FF8A65; --coral-soft: #FFE7DE;
  --yellow: #FFD166; --yellow-soft: #FFF2CC;

  --tile-top: #F7E6C2;
  --tile-face: #E2C391;
  --tile-edge: #9A6B3C;
  --tile-ink: #6B3B00;
  --soil-top: #B0642F;
  --soil: #9C5426;
  --soil-deep: #7A3F1C;

  --r-lg: 28px;
  --r: 22px;
  --r-sm: 14px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
}

/* Light by default, like the app (build 60). Dark tokens kept for an opt-in later: <html data-theme="dark">. */
:root[data-theme="dark"] {
  color-scheme: dark;
  & {
    --bg-top: #2A2016;
    --bg: #1E1710;
    --surface: #2E241A;
    --surface-sunken: #261D14;
    --panel-top: #382C20;
    --border: #4A3A28;
    --card-edge: #140E09;
    --ink: #FCE7C8;
    --ink-2: #CFAE88;
    --muted-ink: #9C8A74;
    --shadow: rgba(0, 0, 0, .45);
    --texture: rgba(252, 231, 200, .05);
    --rim: rgba(255, 255, 255, .14);
    --cloud-dim: brightness(.42) sepia(.5);

    --accent: #FFBE2E;
    --accent-light: #FFD670;
    --accent-deep: #B88100;
    --accent-soft: #473711;
    --accent-text: #FFBE2E;
    --on-accent: #3A2200;

    --pink: #FF6E9C;  --pink-soft: #4A2533;
    --blue: #5FAFEA;  --blue-soft: #1F3A4F;
    --purple: #A889E6; --purple-soft: #382B52;
    --green: #82C463; --green-soft: #2A4220;
    --coral: #EE7A57; --coral-soft: #4D2A20;
    --yellow: #F2C14E; --yellow-soft: #4A3D18;
  }
}

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

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); font-weight: 700; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.5rem, 7vw, 4.4rem); font-weight: 900; }
h2 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); font-weight: 900; }
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-2); font-weight: 600; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 14px; }

/* ---------- Sky: gradient and drifting painted clouds ---------- */

.sky {
  position: relative;
  background: linear-gradient(var(--bg-top), var(--bg) 85%);
  overflow: hidden;
  isolation: isolate;
}
.cloud {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  filter: var(--cloud-dim);
  animation: drift var(--t, 30s) ease-in-out infinite alternate;
}
.cloud.far { opacity: .45; }
@keyframes drift { from { transform: translateX(calc(var(--d, 36px) * -1)); } to { transform: translateX(var(--d, 36px)); } }

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

/* Fixed over the sky; turns into a floating card-stock pill once the page scrolls (site.js adds .stuck). */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: 0 12px; transition: padding .25s; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-radius: 999px; border: 1.5px solid transparent;
  transition: background .25s, box-shadow .25s, padding .25s, border-color .25s, margin .25s;
}
.site-header.stuck { padding-top: 10px; }
.site-header.stuck .wrap {
  padding: 8px 10px 8px 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-color: var(--border);
  box-shadow: 0 3px 0 var(--card-edge), 0 10px 24px var(--shadow);
}
.sky, .page-top { padding-top: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 1.35rem; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 3px 0 var(--card-edge); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 0 var(--card-edge); }
@media (max-width: 560px) { .nav a.optional { display: none; } }

/* ---------- Letter tiles (LetterTile) ---------- */

.tiles { display: inline-flex; gap: 6px; margin-bottom: 18px; }
.tile {
  --s: 46px;
  position: relative;
  width: var(--s); height: var(--s);
  display: grid; place-items: center;
  border-radius: calc(var(--s) * .2);
  background: linear-gradient(var(--tile-top), var(--tile-face));
  box-shadow: 0 calc(var(--s) * .1) 0 var(--tile-edge), inset 0 1px 0 rgba(255,255,255,.7);
  color: var(--tile-ink);
  font-weight: 900;
  font-size: calc(var(--s) * .58);
  line-height: 1;
  transform: rotate(var(--rot, 0deg));
}
.tile sub {
  position: absolute; right: 12%; bottom: 8%;
  font-size: calc(var(--s) * .22); font-weight: 800;
}
.tiles .tile:nth-child(odd) { --rot: -3deg; }
.tiles .tile:nth-child(even) { --rot: 2deg; }

/* ---------- Raised buttons (RaisedButtonStyle) ---------- */

.btn {
  --face-top: var(--accent-light); --face: var(--accent); --edge: var(--accent-deep); --fg: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px;
  border: 1.2px solid rgba(255,255,255,.35);
  border-radius: 20px;
  background:
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,0) 50%),
    linear-gradient(var(--face-top), var(--face));
  box-shadow: 0 4px 0 var(--edge), 0 10px 18px var(--shadow);
  color: var(--fg);
  font: 800 1.05rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--edge), 0 12px 20px var(--shadow); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), 0 4px 8px var(--shadow); }
.btn.secondary { --face-top: var(--surface); --face: var(--surface-sunken); --edge: var(--border); --fg: var(--ink); border-color: var(--border); }
.btn[aria-disabled="true"] { cursor: default; }
.btn[aria-disabled="true"]:active, .btn[aria-disabled="true"]:hover { transform: none; box-shadow: 0 4px 0 var(--edge), 0 10px 18px var(--shadow); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn small { display: block; font-size: .72rem; font-weight: 700; opacity: .8; margin-bottom: 3px; }
.btn .two-line { text-align: left; line-height: 1.05; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 26px; }

/* ---------- Cards (SquircleCard + PanelTexture) ---------- */

/* Same layers as the app's SquircleBackground: a 4px lip in cardEdge (with the border around it), a glossy
   face with the dotted card-stock texture, a white rim along the top, and the stitched inner seam. */
.card {
  position: relative;
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  background:
    radial-gradient(circle, var(--texture) 1.1px, transparent 1.4px) 0 0 / 14px 12px,
    linear-gradient(color-mix(in srgb, var(--panel-top) 45%, var(--surface)), var(--surface));
  box-shadow:
    inset 0 1.2px 0 var(--rim),
    0 4px 0 0 var(--card-edge),
    0 4px 0 1.5px var(--border),
    0 7px 16px rgba(200, 149, 90, .18);
  padding: 22px;
}
/* The seam: 1.2px dashes of 5 on, 4 off, 5px inside the outer edge, corner radius 5 smaller (the app's
   StrokeStyle(lineWidth: 1.2, dash: [5, 4])). Drawn as an SVG mask so the dash pattern matches exactly;
   the stroke is 2.4px on the rect's edge, and the half outside the box is clipped, leaving 1.2px. */
.card::before {
  content: "";
  position: absolute;
  inset: 3.5px;
  border-radius: calc(var(--r) - 5px);
  background: var(--border);
  opacity: .85;
  pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='17' fill='none' stroke='%23000' stroke-width='2.4' stroke-dasharray='5 4'/%3E%3C/svg%3E");
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='17' fill='none' stroke='%23000' stroke-width='2.4' stroke-dasharray='5 4'/%3E%3C/svg%3E");
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: .85rem; font-weight: 800;
}

/* Colored gem behind feature icons (RaisedPiece). */
.gem {
  --c: var(--accent);
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(rgba(255,255,255,.42), rgba(255,255,255,0) 55%), var(--c);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--c), #000 22%), inset 0 0 0 1.2px rgba(255,255,255,.45);
  color: #fff;
  margin-bottom: 14px;
}
.gem svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.18)); }
.gem.pink { --c: var(--pink); } .gem.blue { --c: var(--blue); } .gem.purple { --c: var(--purple); }
.gem.green { --c: var(--green); } .gem.coral { --c: var(--coral); } .gem.yellow { --c: var(--yellow); }

/* ---------- Hero ---------- */

.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 24px; padding-top: 28px; padding-bottom: 36px; }
.hero h1 { margin-bottom: .35em; }
.hero-copy > * { animation: rise .7s cubic-bezier(.2,.8,.3,1) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; } .hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; } .hero-copy > :nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; translate: 0 18px; } }
.hero-facts { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-weight: 700; font-size: .95rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 7px; }
.hero-facts li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 1.5px 0 var(--accent-deep); }

/* The stage: a phone showing the real Game screen, with Sibby standing in front of it. */
.hero-stage { position: relative; justify-self: end; width: min(100%, 540px); height: clamp(430px, 50vw, 620px); animation: rise .8s cubic-bezier(.2,.8,.3,1) .15s both; }
.hero-stage .phone { --w: clamp(220px, 24vw, 290px); position: absolute; right: 2%; top: 0; rotate: 5deg; }
.hero-sibby {
  position: absolute; left: 0; bottom: 0; width: 48%;
  filter: drop-shadow(0 18px 18px var(--shadow)); animation: bob 3.2s ease-in-out infinite; transform-origin: 50% 100%;
}
.hero-stage::after {
  content: ""; position: absolute; left: 7%; width: 34%; bottom: -8px; height: 22px;
  border-radius: 50%; background: var(--shadow); filter: blur(6px); z-index: -1;
  animation: shadow 3.2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1.5deg); } }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.85); opacity: .7; } }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding-top: 8px; }
  .hero .actions, .hero-facts { justify-content: center; }
  .hero-stage { width: min(90vw, 420px); height: clamp(400px, 112vw, 480px); grid-row: 1; justify-self: center; }
  .hero-stage .phone { --w: clamp(180px, 46vw, 220px); right: 8%; }
  .hero-sibby { width: 50%; }
}
/* Phones: words and the App Store button first, so they're on the first screen; the phone and Sibby follow. */
@media (max-width: 560px) {
  .hero-stage { grid-row: 2; height: clamp(360px, 104vw, 420px); }
}

/* Phone frame around real app screenshots (1206×2622, iPhone 17). */
.phone {
  --w: 250px;
  position: relative; width: var(--w); aspect-ratio: 1206 / 2622; flex: none;
  padding: calc(var(--w) * .032); border-radius: calc(var(--w) * .19);
  background: linear-gradient(160deg, #3A3330, #1B1816 45%, #2A2522);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14), 0 2px 0 rgba(255,255,255,.08), 0 24px 40px rgba(107, 59, 0, .28), 0 6px 12px rgba(107, 59, 0, .18);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--w) * .16); background: var(--bg); }
/* A screen recording: no status bar, so it sits at the bottom of a cream screen and fades in under the island. */
.phone-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: calc(var(--w) * .16); background: #FCEBC2; display: flex; align-items: flex-end; }
.phone-screen video { display: block; width: 100%; height: auto; }
.phone-screen::after { content: ""; position: absolute; inset: 0 0 auto; height: 11%; background: linear-gradient(#FCEBC2 45%, rgba(252, 235, 194, 0)); pointer-events: none; }
.phone::before {
  content: ""; position: absolute; left: 50%; top: calc(var(--w) * .055); translate: -50% 0;
  width: calc(var(--w) * .28); height: calc(var(--w) * .08); border-radius: 999px; background: #0B0A09; z-index: 1;
}

/* ---------- Ground: soil with half-buried S-I-B-B-Y tiles and bushes (GrassyGround) ---------- */

.ground { position: relative; height: 150px; margin-top: -20px; z-index: 1; }
.ground svg.soil { position: absolute; inset: 0; width: 100%; height: 100%; }
.ground .bush { position: absolute; bottom: 92px; width: clamp(90px, 14vw, 150px); filter: var(--cloud-dim); }
.ground .buried {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: clamp(10px, 3vw, 26px); align-items: flex-end;
}
.ground .buried .tile { --s: clamp(34px, 6vw, 52px); }
.ground .buried .tile:nth-child(1) { --rot: -9deg; margin-bottom: 30px; --s: clamp(28px, 4.6vw, 40px); opacity: .9; }
.ground .buried .tile:nth-child(2) { --rot: 6deg; margin-bottom: 6px; }
.ground .buried .tile:nth-child(3) { --rot: -4deg; margin-bottom: 40px; --s: clamp(26px, 4.2vw, 36px); opacity: .85; }
.ground .buried .tile:nth-child(4) { --rot: 10deg; margin-bottom: 12px; }
.ground .buried .tile:nth-child(5) { --rot: -6deg; margin-bottom: 26px; --s: clamp(30px, 5vw, 44px); }
.ground + section { padding-top: 64px; }

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

section { padding: 72px 0; }
.section-head { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.grid { display: grid; gap: 26px; }
.grid.features { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.features .card p { margin: 0; color: var(--ink-2); }

/* ---------- Decorative word board, tilted behind a section (BoardCanvasView look) ---------- */

.has-board { position: relative; isolation: isolate; overflow: hidden; }
.board-deco {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  perspective: 1300px;
  perspective-origin: 72% 260px;
}
.board-deco .board {
  --cell: 40px;
  position: absolute;
  left: calc(50% + 250px);
  top: -110px;
  display: grid;
  grid-template-columns: repeat(15, var(--cell));
  grid-auto-rows: var(--cell);
  gap: 3px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #E0A866, #C4853F 60%, #B4763A);
  box-shadow: 0 14px 0 #95602A, 0 30px 40px rgba(149, 96, 42, .25);
  opacity: .7;
  transform: rotateX(46deg) rotateZ(18deg);
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
}
.board-deco i { font-style: normal; display: grid; place-items: center; }
.board-deco .sq {
  border-radius: 6px;
  background: #FBF1DC;
  font: 900 calc(var(--cell) * .32)/1 var(--font);
  color: rgba(90, 50, 0, .75);
}
.board-deco .tw { background: #FF9A9A; }
.board-deco .dw { background: #FFE08A; }
.board-deco .tl { background: #FAC3DD; }
.board-deco .dl { background: #BFE3FF; }
.board-deco .star { color: #D98A1E; font-size: calc(var(--cell) * .5); }
.board-deco .t {
  position: relative;
  border-radius: calc(var(--cell) * .2);
  background: linear-gradient(135deg, #FFF0CF, #FBE3B0 55%, #F0C987);
  box-shadow: 0 calc(var(--cell) * .06) 0 #D49E52, inset 0 0 0 1px rgba(255, 255, 255, .6);
  font: 900 calc(var(--cell) * .55)/1 var(--font);
  color: #5A3200;
  padding-right: calc(var(--cell) * .08);
}
.board-deco .t b {
  position: absolute; right: calc(var(--cell) * .1); bottom: calc(var(--cell) * .07);
  font: 800 calc(var(--cell) * .22)/1 var(--font);
  color: rgba(90, 50, 0, .8);
}
/* Tiles drop onto the board one by one, in play order, the first time the section scrolls into view.
   site.js adds .armed (tiles lifted and hidden) and then .played. Without JS, or with Reduce Motion, they just sit there. */
.board-deco.armed .t { opacity: 0; transform: translateZ(70px) scale(1.15); }
.board-deco.played .t {
  opacity: 1; transform: none;
  transition: transform .45s cubic-bezier(.3, 1.5, .55, 1), opacity .2s ease-out;
  transition-delay: calc(var(--n) * 90ms + 200ms);
}
.has-board .card { position: relative; }
@media (max-width: 900px) {
  .board-deco .board { --cell: 32px; left: calc(50% + 40px); top: -60px; }
}
@media (max-width: 560px) {
  .board-deco .board { --cell: 26px; left: 34%; top: -40px; opacity: .35; }
}

/* Mascot shelf */
.shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; max-width: 860px; margin: 0 auto; }
@media (max-width: 640px) { .shelf { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
.sibby {
  --c: var(--accent); --soft: var(--accent-soft);
  text-align: center; padding: 16px 12px 14px;
  background:
    radial-gradient(circle, var(--texture) 1.1px, transparent 1.4px) 0 0 / 14px 12px,
    linear-gradient(var(--panel-top), var(--soft));
}
.sibby img { width: 110px; height: 120px; object-fit: contain; margin: 0 auto 8px; transform-origin: 50% 100%; }
.sibby:hover img, .sibby:focus-within img { animation: wiggle .6s ease-in-out; }
.sibby .name { font-weight: 800; display: block; }
.sibby .rarity {
  display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-sunken); color: var(--ink-2);
}
.sibby .rarity.rare { background: var(--blue-soft); color: #2E6FA3; }
.sibby .rarity.epic { background: var(--purple-soft); color: #6E4DB8; }
.sibby .rarity.legendary { background: linear-gradient(90deg, #FFE27A, #F0A500); color: #5A3A00; }
.sibby.epic img { filter: drop-shadow(0 0 10px rgba(200,168,255,.75)); }
.sibby.legendary { background: radial-gradient(circle, var(--texture) 1.1px, transparent 1.4px) 0 0 / 14px 12px, linear-gradient(var(--panel-top), #FFF0C4); }
.sibby.legendary img { filter: brightness(0) drop-shadow(0 0 12px rgba(240,165,0,.9)); opacity: .3; }
.sibby.secret img { filter: brightness(0); opacity: .18; }
.sibby.secret.legendary img { filter: brightness(0) drop-shadow(0 0 12px rgba(240,165,0,.9)); opacity: .3; }
.sibby.secret .name { color: var(--muted-ink); }
.sibby.pink { --soft: var(--pink-soft); } .sibby.blue { --soft: var(--blue-soft); } .sibby.purple { --soft: var(--purple-soft); }
.sibby.green { --soft: var(--green-soft); } .sibby.coral { --soft: var(--coral-soft); } .sibby.yellow { --soft: var(--yellow-soft); }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 45% { transform: rotate(7deg); } 70% { transform: rotate(-5deg); } 85% { transform: rotate(4deg); } }

/* Promise */
.promise { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 34px; }
.promise img { width: 150px; }
.promise .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
@media (max-width: 640px) { .promise { grid-template-columns: 1fr; text-align: center; } .promise img { margin: 0 auto; width: 120px; } .promise .chips { justify-content: center; } }

/* Final call */
.final { text-align: center; }
.final .wrap > img { width: 170px; margin: 0 auto 10px; animation: bob 3.2s ease-in-out infinite; }
.final .actions { justify-content: center; }
.final .price-note { max-width: 520px; margin: -4px auto 22px; color: var(--ink-2); font-weight: 600; font-size: .98rem; }

/* ---------- Document pages (privacy, support) ---------- */

.doc-hero { text-align: center; padding: 28px 0 44px; }
.doc-hero img { width: 120px; margin: 0 auto 6px; }
.doc { max-width: 760px; margin: 0 auto 72px; padding: 30px clamp(20px, 5vw, 44px); }
.doc h2 { font-size: 1.35rem; margin-top: 1.6em; }
.doc h2:first-child { margin-top: 0; }
.doc .updated { color: var(--ink-2); font-weight: 700; }
.faq { display: grid; gap: 14px; }
.faq details { padding: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; font-weight: 800; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 900;
}
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 20px 18px; color: var(--ink-2); }
.faq details > div p:last-child { margin: 0; }

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

.site-footer { background: var(--surface-sunken); border-top: 1.5px solid var(--border); padding: 40px 0 48px; color: var(--ink-2); font-size: .95rem; }
.site-footer .wrap { display: grid; gap: 18px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer nav a { color: var(--ink); }
.site-footer p { margin: 0; }
.site-footer .fine { font-size: .85rem; color: var(--muted-ink); }

/* ---------- Motion off ---------- */

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

/* ---------- Added 2026-11-06: launch-splash moments, Level up, little things ---------- */

/* Flying Sibby crosses the sky once after the page loads, like the app's launch splash. */
.flyer { position: absolute; top: 70px; left: 0; width: clamp(110px, 14vw, 180px); z-index: 1; pointer-events: none;
  transform: translateX(-30vw); animation: fly 3.4s cubic-bezier(.35,.1,.55,.9) 1.1s 1 both; }
.flyer img { width: 100%; height: auto; display: block; animation: flap .5s ease-in-out infinite alternate; filter: drop-shadow(0 10px 10px var(--shadow)); }
@keyframes fly {
  0%   { transform: translate(-30vw, 40px) rotate(6deg); }
  45%  { transform: translate(45vw, -10px) rotate(-3deg); }
  100% { transform: translate(130vw, 30px) rotate(8deg); }
}
@keyframes flap { from { translate: 0 -5px; } to { translate: 0 5px; } }

/* The S-I-B-B-Y tiles drop into the soil one by one. */
.ground .buried.drop .tile { animation: tile-drop .5s cubic-bezier(.5,0,.75,0) both, tile-settle .18s ease-out both; }
.ground .buried.drop .tile:nth-child(1) { animation-delay: .15s, .65s; }
.ground .buried.drop .tile:nth-child(2) { animation-delay: .26s, .76s; }
.ground .buried.drop .tile:nth-child(3) { animation-delay: .37s, .87s; }
.ground .buried.drop .tile:nth-child(4) { animation-delay: .48s, .98s; }
.ground .buried.drop .tile:nth-child(5) { animation-delay: .59s, 1.09s; }
@keyframes tile-drop { from { translate: 0 -420px; } to { translate: 0 0; } }
@keyframes tile-settle { 0% { scale: 1 1; } 50% { scale: 1.08 .9; } 100% { scale: 1 1; } }

/* Level up */
.level { display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; padding: 34px; }
.level-art img { width: 200px; filter: drop-shadow(0 14px 14px var(--shadow)); animation: bob 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.level h2 { margin-bottom: .3em; }
.level .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ladder { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.tier { display: grid; justify-items: center; gap: 6px; font-weight: 800; font-size: .8rem; color: var(--ink-2); }
.tier b {
  --s: 46px; width: var(--s); height: var(--s); border-radius: 12px; display: grid; place-items: center;
  font-size: 1.15rem; font-weight: 900; color: var(--ink-t);
  background: linear-gradient(var(--face-a), var(--face-b));
  box-shadow: 0 4px 0 var(--edge-t), inset 0 1.5px 0 rgba(255,255,255,.6), 0 8px 14px var(--shadow);
}
.tier:nth-child(2) b { --s: 50px; } .tier:nth-child(3) b { --s: 54px; } .tier:nth-child(4) b { --s: 58px; } .tier:nth-child(5) b { --s: 62px; }
.tier.pebble { --face-a: #D9D6D0; --face-b: #A9A49B; --edge-t: #7F7A72; --ink-t: #4A4640; }
.tier.wood   { --face-a: #D8A066; --face-b: #A8642C; --edge-t: #6E3F17; --ink-t: #FFF1DC; }
.tier.ivory  { --face-a: #FFFBF0; --face-b: #EADFC4; --edge-t: #C2B28E; --ink-t: #6B4A1E; }
.tier.golden { --face-a: #FFE27A; --face-b: #E9A21C; --edge-t: #B27610; --ink-t: #6A4100; }
.tier.crystal{ --face-a: #D9F3FF; --face-b: #B9A8FF; --edge-t: #7A6BD9; --ink-t: #3B2C8F; }
.tier.golden b, .tier.crystal b { position: relative; overflow: hidden; }
.tier.golden b::after, .tier.crystal b::after { content: ""; position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.75) 50%, transparent 60%); transform: translateX(-120%); animation: shine 2.4s ease-in-out .6s infinite; }
@keyframes shine { to { transform: translateX(120%); } }
@media (max-width: 720px) { .level { grid-template-columns: 1fr; text-align: center; } .level-art img { width: 150px; margin: 0 auto; } .ladder, .level .chips { justify-content: center; } }

/* Little things */
.grid.minis { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.mini { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; padding: 18px; }
.mini .gem { margin: 0; width: 44px; height: 44px; border-radius: 14px; }
.mini .gem svg { width: 24px; height: 24px; }
.mini h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.mini p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* ---------- Added 2026-11-06 (full polish): reveals, scorer, screens, closing ground ---------- */

/* Scroll reveals: site.js adds .in when an element enters the viewport. Without JS they just show. */
.js .reveal { opacity: 0; translate: 0 22px; transition: opacity .6s ease-out, translate .7s cubic-bezier(.2,.8,.3,1); }
.js .reveal.in { opacity: 1; translate: 0 0; }
.js .stagger > .reveal:nth-child(2) { transition-delay: .07s; } .js .stagger > .reveal:nth-child(3) { transition-delay: .14s; }
.js .stagger > .reveal:nth-child(4) { transition-delay: .21s; } .js .stagger > .reveal:nth-child(5) { transition-delay: .28s; }
.js .stagger > .reveal:nth-child(6) { transition-delay: .35s; } .js .stagger > .reveal:nth-child(7) { transition-delay: .42s; }
.js .stagger > .reveal:nth-child(8) { transition-delay: .49s; }

/* Quick Score playground */
.scorer { max-width: 820px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 36px) 24px; }
.scorer-label { display: block; font-weight: 800; font-size: .9rem; color: var(--ink-2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.scorer-field { position: relative; }
.scorer-input {
  width: 100%; min-height: 64px; padding: 0 56px 0 20px;
  border: 1.5px solid var(--border); border-radius: 18px;
  background: var(--surface-sunken); color: var(--ink);
  font: 900 clamp(1.5rem, 4vw, 2rem)/1 var(--font); letter-spacing: .12em; text-transform: uppercase;
  box-shadow: inset 0 3px 0 rgba(200,149,90,.12);
}
.scorer-input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 3px 0 rgba(200,149,90,.12), 0 0 0 4px var(--accent-soft); }
.scorer-input::placeholder { color: var(--muted-ink); letter-spacing: .04em; text-transform: none; font-weight: 700; font-size: 1.1rem; }
.scorer-clear {
  position: absolute; right: 12px; top: 50%; translate: 0 -50%;
  width: 36px; height: 36px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink-2); font: 900 1.3rem/1 var(--font);
  box-shadow: 0 2px 0 var(--card-edge);
}
.scorer-clear:hover { color: var(--ink); }
.scorer-help { margin: 10px 0 0; font-size: .9rem; color: var(--ink-2); }
.scorer-rack { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 8px; min-height: 92px; padding: 22px 0 8px; }
.scorer-rack:empty::before { content: "Type a word to see its tiles"; align-self: center; color: var(--muted-ink); font-weight: 700; }
/* Each tile sits on a board square; the square shows the bonus the player tapped (like the app's bonus row). */
.sq-btn {
  --c: #FBF1DC; --label: "";
  position: relative; display: grid; place-items: center; gap: 0;
  width: 60px; height: 76px; padding: 0 0 18px; border: 0; cursor: pointer; background: transparent;
  animation: tile-in .35s cubic-bezier(.3,1.5,.55,1) both;
}
.sq-btn::before {
  content: ""; position: absolute; inset: 4px 2px 0; border-radius: 10px;
  background: var(--c); box-shadow: inset 0 0 0 1.5px rgba(90,50,0,.1);
  transition: background .2s;
}
.sq-btn .tile { --s: 48px; --rot: 0deg; position: relative; transition: transform .15s; }
.sq-btn:hover .tile { transform: translateY(-2px); }
.sq-btn:active .tile { transform: translateY(2px); }
.sq-btn::after {
  content: var(--label); position: absolute; left: 0; right: 0; bottom: 0; height: 18px;
  font: 900 .68rem/18px var(--font); color: rgba(90,50,0,.8); letter-spacing: .04em;
}
.sq-btn.dl { --c: #BFE3FF; --label: "DL"; } .sq-btn.tl { --c: #FAC3DD; --label: "TL"; }
.sq-btn.dw { --c: #FFE08A; --label: "DW"; } .sq-btn.tw { --c: #FF9A9A; --label: "TW"; }
.sq-btn.bump .tile { animation: tile-settle .25s ease-out; }
@keyframes tile-in { from { opacity: 0; translate: 0 -24px; } }
.scorer-result { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 16px 0 6px; border-top: 1.5px dashed var(--border); }
.scorer-face { width: 96px; height: 94px; object-fit: contain; transition: transform .25s cubic-bezier(.3,1.5,.55,1); }
.scorer-face.pop { animation: face-pop .5s cubic-bezier(.3,1.5,.55,1); }
@keyframes face-pop { 40% { transform: scale(1.12) rotate(-4deg); } }
.scorer-total { display: flex; align-items: baseline; gap: 10px; }
.scorer-total b { font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 900; line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.scorer-total span { font-weight: 800; color: var(--ink-2); }
.scorer-math { margin: 6px 0 0; color: var(--ink-2); font-weight: 600; font-size: .95rem; min-height: 1.5em; }
.scorer-math .bingo { color: var(--accent-text); font-weight: 900; }
.scorer-note { margin: 14px 0 0; font-size: .88rem; color: var(--muted-ink); }
@media (max-width: 560px) { .scorer-result { grid-template-columns: 1fr; text-align: center; justify-items: center; } .sq-btn { width: 52px; } .sq-btn .tile { --s: 42px; } }

/* Screens: a row of phones, scrolls sideways on small screens with snap. */
.screens {
  --sw: clamp(160px, 12.5vw, 200px);
  display: flex; gap: clamp(14px, 2vw, 28px); align-items: flex-start; justify-content: flex-start;
  padding: 24px 20px 32px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.screens::-webkit-scrollbar { display: none; }
.screen { margin: 0; scroll-snap-align: center; flex: none; text-align: center; }
.screen:first-child { margin-left: auto; } .screen:last-child { margin-right: auto; } /* centred when it fits, scrollable to both ends when not */
.screen .phone { --w: var(--sw); margin: 0 auto 16px; transition: transform .35s cubic-bezier(.2,.8,.3,1); }
.screen:hover .phone { transform: translateY(-8px); }
.screen:nth-child(odd) .phone { rotate: -2deg; } .screen:nth-child(even) .phone { rotate: 2deg; }
.screen figcaption { font-size: .92rem; color: var(--ink-2); font-weight: 600; max-width: calc(var(--sw) + 12px); margin: 0 auto; }
.screen figcaption b { display: block; color: var(--ink); font-weight: 900; font-size: 1.02rem; margin-bottom: 2px; }
@media (max-width: 1180px) { .screens { --sw: 200px; } }

/* Closing ground under the final call, then a soil-brown footer: the page ends on the ground it started on. */
.final { padding-bottom: 0; }
.final .wrap { padding-bottom: 150px; }
.ground.closing { margin-top: -150px; z-index: 0; }
.ground.closing .bush { bottom: 84px; } /* fallback; site.js seats each bush on the soil curve */
.site-footer { background: var(--soil-deep); border-top: 0; color: #E8C9A4; margin-top: -2px; }
.site-footer nav a { color: #FFF1DC; }
.site-footer .fine { color: #C9A27E; }

/* ---------- Added 2026-11-06 (motion pass): a few deliberate moves, nothing busy ---------- */

/* The hero's S-I-B-B-Y tiles flip up one after another as the page loads. */
.hero .tiles { perspective: 500px; }
.hero .tiles .tile { animation: flip-in .55s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(.25s + var(--i, 0) * 70ms); }
.hero .tiles .tile:nth-child(1) { --i: 0; } .hero .tiles .tile:nth-child(2) { --i: 1; } .hero .tiles .tile:nth-child(3) { --i: 2; }
.hero .tiles .tile:nth-child(4) { --i: 3; } .hero .tiles .tile:nth-child(5) { --i: 4; }
@keyframes flip-in { from { opacity: 0; transform: rotate(var(--rot, 0deg)) rotateX(-95deg) translateY(-8px); } to { opacity: 1; transform: rotate(var(--rot, 0deg)); } }

/* The phone and Sibby lean a few pixels toward the pointer (site.js sets --mx/--my on hover devices). */
.hero-stage .phone { translate: calc(var(--mx, 0) * 10px) calc(var(--my, 0) * 8px); transition: translate .6s cubic-bezier(.2,.8,.3,1); }
.hero-sibby { translate: calc(var(--mx, 0) * -6px) calc(var(--my, 0) * -4px); transition: translate .6s cubic-bezier(.2,.8,.3,1); }

/* Cards lift on hover and their gem tips its hat. */
.card { transition: transform .28s cubic-bezier(.2,.8,.3,1), box-shadow .28s; }
.gem { transition: transform .3s cubic-bezier(.3,1.5,.55,1); }
@media (hover: hover) {
  .features .card:hover, .mini:hover, .sibby:hover, .level:hover, .promise:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 1.2px 0 var(--rim), 0 4px 0 0 var(--card-edge), 0 4px 0 1.5px var(--border), 0 14px 26px rgba(200, 149, 90, .24);
  }
  .card:hover .gem { transform: rotate(-7deg) scale(1.06); }
}

/* Level tiers pop in from small to big once the Level up card scrolls into view. */
.js .reveal:not(.in) .tier b { opacity: 0; }
.js .reveal.in .tier b { animation: pop .55s cubic-bezier(.3,1.5,.55,1) both; animation-delay: calc(.25s + var(--i, 0) * 90ms); }
.tier:nth-child(1) { --i: 0; } .tier:nth-child(2) { --i: 1; } .tier:nth-child(3) { --i: 2; } .tier:nth-child(4) { --i: 3; } .tier:nth-child(5) { --i: 4; }
@keyframes pop { from { opacity: 0; scale: .5; } 70% { scale: 1.08; } to { opacity: 1; scale: 1; } }

/* The score in the playground bumps when it changes. */
.scorer-total b { display: inline-block; }
.scorer-total b.tick { animation: tick .45s cubic-bezier(.3,1.5,.55,1); }
@keyframes tick { 40% { scale: 1.18; color: var(--accent); } }

/* The decorative board drifts up slowly while its section scrolls past (site.js sets --board-shift). */
.board-deco { translate: 0 var(--board-shift, 0px); }

/* Nav links get a tiny lift; buttons already press. */
.nav a { transition: background .2s, box-shadow .2s, transform .2s; }
@media (hover: hover) { .nav a:hover { transform: translateY(-1px); } }

/* ---------- Added 2026-11-06 (sound): header speaker toggle, tappable Sibbies ---------- */
.sound-toggle {
  width: 40px; height: 40px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer;
  display: inline-grid; place-items: center; margin-left: 4px; padding: 0;
  background: transparent; color: var(--ink-2);
  transition: background .2s, box-shadow .2s, color .2s, transform .2s;
}
.sound-toggle svg { width: 22px; height: 22px; }
.sound-toggle:hover { background: var(--surface); color: var(--ink); box-shadow: 0 2px 0 var(--card-edge); }
.sound-toggle:active { transform: translateY(1px); }
.sound-toggle[aria-pressed="true"] .slash { display: none; }
.sound-toggle[aria-pressed="false"] .wave { display: none; }
.sound-toggle[aria-pressed="false"] { color: var(--muted-ink); }
.sibby { cursor: pointer; }
.sibby.wiggling img { animation: wiggle .6s ease-in-out; }

/* ---------- Added 2026-11-07: "and 21 more" strip under the Sibbies shelf ---------- */
/* The shelf shows 8 of 29, so a strip of blacked-out silhouettes and the full count by rarity says there's more. */
.more-sibbies {
  max-width: 860px; margin: 22px auto 0; padding: 20px 24px;
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center;
}
.peek { display: flex; align-items: flex-end; padding-left: 10px; }
.peek img {
  width: 50px; height: 56px; object-fit: contain; margin-left: -12px;
  filter: brightness(0); transform-origin: 50% 100%;
}
/* Opacity on the group, not each figure, so overlapping silhouettes don't darken where they meet. */
.peek-figs { display: flex; align-items: flex-end; opacity: .2; }
.peek img:nth-child(odd) { rotate: -5deg; } .peek img:nth-child(even) { rotate: 4deg; translate: 0 -4px; }
.peek-count {
  margin-left: 6px; align-self: center; flex: none;
  min-width: 52px; height: 52px; padding: 0 10px; border-radius: 16px; display: grid; place-items: center;
  font: 900 1.15rem/1 var(--font); color: var(--on-accent);
  background: linear-gradient(rgba(255,255,255,.4), rgba(255,255,255,0) 55%), var(--accent);
  box-shadow: 0 3px 0 var(--accent-deep), inset 0 0 0 1.2px rgba(255,255,255,.45);
}
.more-copy h3 { margin: 0 0 4px; font-size: 1.25rem; }
.more-copy p { margin: 0 0 12px; color: var(--ink-2); font-size: .97rem; }
.tally { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tally li {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 11px; border-radius: 999px;
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-sunken); color: var(--ink-2);
}
.tally b { font-size: .95rem; letter-spacing: 0; }
.tally .rare { background: var(--blue-soft); color: #2E6FA3; }
.tally .epic { background: var(--purple-soft); color: #6E4DB8; }
.tally .legendary { background: linear-gradient(90deg, #FFE27A, #F0A500); color: #5A3A00; }
.tally .special { background: linear-gradient(90deg, #FFE3EC, #E0F1FF, #EFE5FF); color: #8A3D78; }
/* The silhouettes hop up one after another when the strip scrolls in, then sway a little on hover. */
.js .more-sibbies.reveal.in .peek img { animation: hop .5s cubic-bezier(.3,1.5,.55,1) both; animation-delay: calc(.2s + var(--i, 0) * 60ms); }
.peek img:nth-child(1) { --i: 0; } .peek img:nth-child(2) { --i: 1; } .peek img:nth-child(3) { --i: 2; } .peek img:nth-child(4) { --i: 3; }
.peek img:nth-child(5) { --i: 4; } .peek img:nth-child(6) { --i: 5; } .peek img:nth-child(7) { --i: 6; }
@keyframes hop { from { opacity: 0; transform: translateY(14px) scale(.8); } }
@media (hover: hover) { .more-sibbies:hover .peek img { animation: wiggle .7s ease-in-out; animation-delay: calc(var(--i, 0) * 50ms); } }
@media (max-width: 640px) {
  .more-sibbies { grid-template-columns: 1fr; text-align: center; justify-items: center; margin-top: 16px; padding: 20px 16px; }
  .peek img { width: 40px; height: 46px; margin-left: -10px; }
  .peek-count { min-width: 46px; height: 46px; }
  .tally { justify-content: center; }
}

/* Topic icons on the privacy and support pages (small gems, same as .mini). */
.doc h2.topic { display: flex; align-items: center; gap: 12px; }
.doc h2.topic .gem { margin: 0; flex: none; width: 36px; height: 36px; border-radius: 11px; }
.doc h2.topic .gem svg { width: 20px; height: 20px; }
.faq summary.topic { padding-left: 70px; }
.faq summary.topic .gem { position: absolute; left: 18px; top: calc(50% - 18px); margin: 0; width: 36px; height: 36px; border-radius: 11px; }
.faq summary.topic .gem svg { width: 20px; height: 20px; }

/* Sibby blinks like in the app: eyelids drawn over the eyes (positions from the app's sprite rig),
   one blink, a double blink, then one more every 11 seconds. Reduced motion keeps the eyes open. */
.blink { display: block; }
.blink > img { display: block; width: 100%; height: auto; margin: 0; }
.blink > svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; animation: sibby-blink 11.1s step-end 2.5s infinite; }
.doc-hero .blink { position: relative; width: 120px; margin: 0 auto 6px; }
@keyframes sibby-blink { 0% { opacity: 1; } 1.2% { opacity: 0; } 33.3% { opacity: 1; } 34.5% { opacity: 0; } 35.7% { opacity: 1; } 36.8% { opacity: 0; } 66.7% { opacity: 1; } 67.9% { opacity: 0; } 100% { opacity: 0; } }

/* ---------- Play five turns: the 3D board (public/js/board3d.js, built from src/board3d.js) ---------- */
html:not(.js) #play { display: none; }
.play { max-width: 900px; margin: 0 auto; padding: 20px clamp(14px, 3vw, 28px) 22px; }
.play-hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.play-stat { display: grid; justify-items: center; gap: 2px; padding: 8px 6px; border-radius: var(--r-sm); background: var(--surface-sunken); border: 1.5px solid var(--border); }
.play-stat span { font-size: .78rem; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.play-stat b { font-size: clamp(1.15rem, 3.4vw, 1.5rem); font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.play-stat.move b { color: var(--accent-text); }
.play-stage { position: relative; aspect-ratio: 4 / 3.4; margin: 0 -8px; }
.play-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; outline: none; }
.play-wait, .play-fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; text-align: center; color: var(--ink-2); font-weight: 700; }
.play-fallback { display: none; }
.play.ready .play-wait { display: none; }
.play.no-3d .play-wait, .play.no-3d .play-hud, .play.no-3d .play-actions, .play.no-3d .play-status { display: none; }
.play.no-3d .play-stage { aspect-ratio: auto; min-height: 120px; }
.play.no-3d .play-fallback { display: grid; position: static; gap: 12px; justify-items: center; padding: 28px 20px 8px; }
.play-fallback img { width: 110px; height: auto; filter: drop-shadow(0 10px 10px var(--shadow)); }
.play-fallback p { margin: 0; }
.play-status { min-height: 2.8em; margin: 6px 0 12px; text-align: center; font-weight: 800; color: var(--ink); }
.play-status.nudge { animation: play-nudge .35s ease; }
@keyframes play-nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.play-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.play-actions [hidden] { display: none; }
.play-actions .btn[aria-disabled="true"] { opacity: .55; }
.play-log { list-style: none; margin: 16px auto 0; padding: 0; max-width: 520px; display: grid; gap: 6px; }
.play-log:empty { display: none; }
.play-log li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; padding: 8px 14px; border-radius: 12px; background: var(--surface-sunken); }
.play-log span { font-size: .85rem; font-weight: 800; color: var(--ink-2); }
.play-log b { font-weight: 900; color: var(--ink); overflow-wrap: anywhere; }
.play-log em { font-style: normal; font-weight: 900; color: var(--accent-text); }
.play-float { position: absolute; transform: translate(-50%, -50%); pointer-events: none; font: 900 clamp(1.6rem, 5vw, 2.4rem)/1 var(--font); color: var(--accent); -webkit-text-stroke: 1.5px var(--accent-deep); text-shadow: 0 3px 0 var(--accent-deep); animation: play-float 1.5s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes play-float { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
#play .scorer-note { text-align: center; margin: 14px 0 0; }
@media (max-width: 640px) { .play-stage { aspect-ratio: 1 / 1.06; margin: 0 -10px; } .play-actions .btn { padding: 0 18px; min-height: 50px; } }

/* Headings wrap into even lines (no single word left alone on the last line). */
h1, h2, h3 { text-wrap: balance; }

/* Apple's official "Download on the App Store" badge (public/img/badge/), used unaltered per Apple's marketing guidelines:
   at least 40px tall on screen, clear space around it, no effects on the artwork itself. */
.store-badge { display: inline-flex; border-radius: 12px; line-height: 0; transition: transform .12s; }
.store-badge img { display: block; height: 56px; width: auto; }
.store-badge:hover { transform: translateY(-1px); }
.store-badge:active { transform: translateY(1px); }
.store-badge:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 4px; }
@media (max-width: 640px) { .store-badge img { height: 50px; } }
