/* PuzzleSheet. BingoSheet's loud sibling: chunky outlines, offset "sticker" shadows, highlighter colors.
   Self-hosted Bricolage Grotesque (OFL, see /fonts/OFL.txt). No external requests. */

@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-grotesque.woff2') format('woff2-variations'), url('/fonts/bricolage-grotesque.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --lime: #b6f03c;
  --pink: #ff4f9a;
  --sky: #38bdf8;
  --sun: #ffd23f;
  --grape: #7c4dff;
  --tang: #ff8a1f;
  --mint: #3ee0b0;
  --deep: #16123d; /* fixed ink for outlines and paper */

  --bg: #fbfaf2;
  --bg-alt: #f0f6da;
  --surface: #ffffff;
  --surface-2: #f6f7ec;
  --ink: #16123d;
  --ink-soft: #4a4570;
  --line: #16123d;
  --shadow: #16123d;
  --hero-bg: #c6f24e;
  --hero-ink: #16123d;
  --hero-line: rgba(22, 18, 61, 0.09);
  --mark-bg: #ff4f9a;
  --mark-ink: #16123d;
  --pop: #5b2be0;
  --pop-btn: #5b2be0; /* white text: 7.9:1 */
  --pop-ink: #ffffff;
  --chip-bg: #ffffff;
  --ok-bg: #dcf7b0;
  --ok-ink: #2c4a00;
  --bad-bg: #ffd9e8;
  --bad-ink: #8a0c43;
  --warn-bg: #fff1c2;
  --warn-ink: #5c3d00;
  --band: #5b2be0;
  --band-ink: #ffffff;
  --focus: #5b2be0;

  --font: 'Bricolage', ui-rounded, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 22px;
  --bw: 3px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f0c29;
    --bg-alt: #151137;
    --surface: #1d1846;
    --surface-2: #262057;
    --ink: #f3f0ff;
    --ink-soft: #c9c2ee;
    --line: #f3f0ff;
    --shadow: #b6f03c;
    --hero-bg: #1b1550;
    --hero-ink: #f3f0ff;
    --hero-line: rgba(182, 240, 60, 0.1);
    --mark-bg: #b6f03c;
    --mark-ink: #16123d;
    --pop: #b6f03c;
    --pop-btn: #6d3cf5;
    --chip-bg: #262057;
    --ok-bg: #2c4a00;
    --ok-ink: #d9f99d;
    --bad-bg: #5a1235;
    --bad-ink: #ffc2db;
    --warn-bg: #4a3500;
    --warn-ink: #ffe49a;
    --band: #b6f03c;
    --band-ink: #16123d;
    --focus: #b6f03c;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f0c29;
  --bg-alt: #151137;
  --surface: #1d1846;
  --surface-2: #262057;
  --ink: #f3f0ff;
  --ink-soft: #c9c2ee;
  --line: #f3f0ff;
  --shadow: #b6f03c;
  --hero-bg: #1b1550;
  --hero-ink: #f3f0ff;
  --hero-line: rgba(182, 240, 60, 0.1);
  --mark-bg: #b6f03c;
  --mark-ink: #16123d;
  --pop: #b6f03c;
  --pop-btn: #6d3cf5;
  --chip-bg: #262057;
  --ok-bg: #2c4a00;
  --ok-ink: #d9f99d;
  --bad-bg: #5a1235;
  --bad-ink: #ffc2db;
  --warn-bg: #4a3500;
  --warn-ink: #ffe49a;
  --band: #b6f03c;
  --band-ink: #16123d;
  --focus: #b6f03c;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font); overflow-x: hidden; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 0.4em; font-weight: 800; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1.5px solid color-mix(in srgb, var(--line) 25%, transparent); padding: 0.05em 0.35em; border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.fine { font-size: 0.86rem; color: var(--ink-soft); margin: 0.6em 0 0; }
.test-banner { background: var(--sun); color: var(--deep); text-align: center; font-weight: 700; padding: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  --sh: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  padding: 0.62em 1.25em; border: var(--bw) solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-weight: 750; text-decoration: none; cursor: pointer;
  box-shadow: var(--sh) var(--sh) 0 var(--shadow); transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s;
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: calc(var(--sh) + 2px) calc(var(--sh) + 2px) 0 var(--shadow); }
.btn:active { transform: translate(var(--sh), var(--sh)); box-shadow: 0 0 0 var(--shadow); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-pop { background: var(--pop-btn); color: var(--pop-ink); border-color: var(--deep); box-shadow: var(--sh) var(--sh) 0 var(--deep); }
.btn-pop:hover { box-shadow: calc(var(--sh) + 2px) calc(var(--sh) + 2px) 0 var(--deep); }
.btn-ghost { background: var(--surface); }
.btn-ink { background: var(--deep); color: #f3f0ff; border-color: var(--deep); }
.btn-sm { --sh: 3px; padding: 0.42em 0.95em; font-size: 0.92rem; }
.btn-xl { --sh: 6px; font-size: clamp(1.15rem, 2.4vw, 1.45rem); padding: 0.7em 1.4em; }
.btn-block { width: 100%; }
.btn .arrow { display: inline-block; transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(5px); }
.linkish { background: none; border: 0; padding: 0; color: inherit; font-weight: 750; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--hero-bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: var(--bw) solid var(--line); color: var(--hero-ink); }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.45rem; letter-spacing: -0.03em; text-decoration: none; }
.brand b { color: var(--pop); font-weight: 800; }
.logo-mark { width: 34px; height: 34px; transition: transform 0.4s cubic-bezier(.3, 1.6, .5, 1); }
:root[data-theme='dark'] .logo-mark rect, .site-footer .logo-mark rect { stroke: #f3f0ff; stroke-width: 1.6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .logo-mark rect { stroke: #f3f0ff; stroke-width: 1.6; } }
.brand:hover .logo-mark { transform: rotate(-12deg) scale(1.08); }
.nav { margin-left: auto; display: flex; gap: 22px; font-weight: 700; }
.nav a { text-decoration: none; position: relative; white-space: nowrap; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: var(--pop); transform: scaleX(0); transform-origin: left; transition: transform 0.2s; border-radius: 3px; }
.nav a:hover::after { transform: scaleX(1); }
.theme-toggle { width: 42px; height: 42px; border-radius: 50%; border: var(--bw) solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: transform 0.3s; flex: none; }
.theme-toggle:hover { transform: rotate(-20deg) scale(1.06); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.theme-toggle .i-moon { fill: var(--ink); stroke: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .i-sun { display: block; }
:root[data-theme='dark'] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .i-moon { display: none; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .brand { font-size: 1.25rem; }
  .header-inner { gap: 10px; min-height: 60px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; background-color: var(--hero-bg); color: var(--hero-ink); padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 80px); overflow: hidden; isolation: isolate;
  background-image: linear-gradient(var(--hero-line) 2px, transparent 2px), linear-gradient(90deg, var(--hero-line) 2px, transparent 2px);
  background-size: 36px 36px; background-position: -1px -1px;
}
:root[data-theme='dark'] .hero { background-image: linear-gradient(var(--hero-line) 2px, transparent 2px), linear-gradient(90deg, var(--hero-line) 2px, transparent 2px), radial-gradient(1100px 520px at 85% 0%, rgba(124, 77, 255, 0.45), transparent 62%), linear-gradient(160deg, #1b1550, #0f0b2e); background-size: 36px 36px, 36px 36px, auto, auto; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .hero { background-image: linear-gradient(var(--hero-line) 2px, transparent 2px), linear-gradient(90deg, var(--hero-line) 2px, transparent 2px), radial-gradient(1100px 520px at 85% 0%, rgba(124, 77, 255, 0.45), transparent 62%), linear-gradient(160deg, #1b1550, #0f0b2e); background-size: 36px 36px, 36px 36px, auto, auto; }
}
.hero-deco i { position: absolute; z-index: -1; display: grid; place-items: center; font-style: normal; font-weight: 800; color: var(--deep); border: var(--bw) solid var(--deep); border-radius: 12px; width: 58px; height: 58px; font-size: 1.9rem; box-shadow: 4px 4px 0 var(--deep); animation: float 7s ease-in-out infinite; }
.hero-deco i:nth-child(1) { background: var(--pink); top: 8%; right: 5%; transform: rotate(10deg); }
.hero-deco i:nth-child(2) { background: var(--sky); top: 48%; left: -14px; width: 46px; height: 46px; font-size: 1.4rem; animation-delay: -2s; }
.hero-deco i:nth-child(3) { background: var(--sun); bottom: 5%; right: 40%; width: 40px; height: 40px; font-size: 1.2rem; animation-delay: -4s; }
.hero-deco i:nth-child(4) { background: #fff; top: 3%; left: 43%; width: 36px; height: 36px; font-size: 1.1rem; animation-delay: -1s; }
.hero-deco i:nth-child(5) { background: var(--tang); top: 26%; right: 36%; width: 30px; height: 30px; font-size: 0.95rem; animation-delay: -3s; }
.hero-deco i:nth-child(6) { background: var(--grape); color: #fff; bottom: 10%; left: 3%; width: 40px; height: 40px; font-size: 1.2rem; animation-delay: -5s; }
@media (max-width: 760px) { .hero-deco i:nth-child(1), .hero-deco i:nth-child(4), .hero-deco i:nth-child(5) { display: none; } }
@keyframes float { 0%, 100% { translate: 0 0; rotate: -6deg; } 50% { translate: 0 -16px; rotate: 8deg; } }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 0.95rem; padding: 6px 14px 6px 10px; border: var(--bw) solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: 3px 3px 0 var(--shadow); margin-bottom: 18px; }
.eyebrow .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--grape); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(124, 77, 255, 0.7); } 80%, 100% { box-shadow: 0 0 0 10px rgba(124, 77, 255, 0); } }
.hero-title { font-size: clamp(2.6rem, 6.2vw, 4.7rem); line-height: 0.95; letter-spacing: -0.045em; margin-bottom: 0.3em; max-width: 13ch; }
.hero-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: -6px 0 clamp(22px, 3vw, 34px); }
.hero-cta-note { font-weight: 700; font-size: 0.95rem; }
.hero-title-theme { font-size: clamp(2.2rem, 5vw, 4rem); max-width: 15ch; }
.hero-emoji { display: inline-block; animation: wiggle 2.6s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) scale(1.04); } }
/* The highlighter swipe: same marker as a found word. */
.hero-title mark {
  color: var(--mark-ink); padding: 0 0.16em 0.04em; margin: 0 -0.04em; border-radius: 0.5em; display: inline-block; transform: rotate(-2.5deg);
  background: linear-gradient(var(--mark-bg), var(--mark-bg)) no-repeat left center / 100% 100%; box-shadow: 0 0 0 var(--bw) var(--deep), 5px 5px 0 var(--bw) var(--deep);
  animation: swipe 0.8s cubic-bezier(.6, 0, .3, 1) 0.25s both;
}
@keyframes swipe { from { background-size: 0% 100%; color: var(--hero-ink); box-shadow: 0 0 0 0 var(--deep), 0 0 0 0 var(--deep); } 70% { box-shadow: 0 0 0 0 var(--deep), 0 0 0 0 var(--deep); } }
.hero-lede { font-size: clamp(1.1rem, 2vw, 1.3rem); max-width: 44ch; margin-bottom: clamp(22px, 3vw, 32px); }
.hero-lede b { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--pink) 55%, transparent) 58%); }
.crumbs { font-size: 0.9rem; font-weight: 650; margin-bottom: 14px; opacity: 0.85; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- Generator ---------- */
.gen { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); grid-template-areas: 'intro preview' 'form preview'; column-gap: clamp(28px, 4.5vw, 64px); row-gap: 8px; align-items: start; }
.gen-intro { grid-area: intro; }
.gen-form { grid-area: form; scroll-margin-top: 90px; }
.preview { grid-area: preview; position: sticky; top: 88px; }
@media (max-width: 920px) {
  .gen { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'preview' 'form'; row-gap: 22px; }
  .preview { position: relative; top: 0; }
}
.panel { background: var(--surface); color: var(--ink); border: var(--bw) solid var(--line); border-radius: var(--r); box-shadow: 8px 8px 0 var(--shadow); }
.gen-form { padding: clamp(18px, 2.6vw, 30px); display: grid; gap: 18px; animation: rise 0.6s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.field { display: grid; gap: 8px; min-width: 0; align-content: start; }
.lbl { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.lbl-note { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: 0.85; }
.lbl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.input { width: 100%; border: var(--bw) solid color-mix(in srgb, var(--line) 30%, transparent); background: var(--surface-2); border-radius: 14px; padding: 0.6em 0.85em; transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus { outline: none; border-color: var(--grape); box-shadow: 0 0 0 4px color-mix(in srgb, var(--grape) 28%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--ink-soft) 80%, transparent); }
.input-title { font-size: 1.25rem; font-weight: 750; }
.input-sm { padding: 0.4em 0.65em; border-radius: 10px; font-size: 0.95rem; width: auto; }
.words { min-height: 150px; resize: vertical; line-height: 1.5; font-size: 1rem; }
.hint { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
.badge { font-size: 0.82rem; font-weight: 800; padding: 3px 11px; border-radius: 999px; transition: background-color 0.2s, color 0.2s; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad-ink); animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.gen-row { display: flex; gap: 18px 26px; flex-wrap: wrap; }
.gen-row > .field { flex: 1 1 200px; }
.field-size { flex: 1 1 220px; }
.size-out { display: inline-block; margin-left: 6px; color: var(--ink); background: var(--sun); color: var(--deep); padding: 1px 9px; border-radius: 8px; letter-spacing: 0; font-size: 0.9rem; }
.range { width: 100%; height: 36px; margin: 0; accent-color: var(--grape); cursor: pointer; background: transparent; -webkit-appearance: none; appearance: none; }
.range::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--line) 18%, transparent); border: 2px solid color-mix(in srgb, var(--line) 35%, transparent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 9px; background: var(--lime); border: var(--bw) solid var(--deep); box-shadow: 2px 2px 0 var(--deep); transition: transform 0.15s; }
.range:hover::-webkit-slider-thumb { transform: rotate(-10deg) scale(1.08); }
.range::-moz-range-track { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--line) 18%, transparent); border: 2px solid color-mix(in srgb, var(--line) 35%, transparent); }
.range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 9px; background: var(--lime); border: var(--bw) solid var(--deep); box-shadow: 2px 2px 0 var(--deep); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--focus); outline-offset: 3px; }
.range:focus-visible::-moz-range-thumb { outline: 3px solid var(--focus); outline-offset: 3px; }
.pro-link { justify-self: start; font-size: 0.85rem; color: var(--ink-soft); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-block; padding: 0.45em 1em; border: var(--bw) solid color-mix(in srgb, var(--line) 28%, transparent); border-radius: 999px; font-weight: 750; background: var(--surface); transition: all 0.15s; cursor: pointer; white-space: nowrap; }
.pill span small { font-weight: 650; opacity: 0.7; font-size: 0.78em; margin-left: 3px; }
.pill:hover span { border-color: var(--line); transform: translateY(-2px); }
.pill input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: 3px 3px 0 var(--grape); }
.pill input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.pills-diff .pill span { padding-inline: 0.85em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chips-dolch { padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--sun) 22%, transparent); border: 2px dashed color-mix(in srgb, var(--line) 30%, transparent); }
.chip { --c: var(--sun); display: inline-flex; align-items: center; gap: 6px; border: 2px solid color-mix(in srgb, var(--line) 25%, transparent); background: var(--chip-bg); border-radius: 999px; padding: 0.3em 0.85em; font-weight: 700; font-size: 0.9rem; cursor: pointer; text-decoration: none; transition: transform 0.15s, border-color 0.15s, background-color 0.15s; }
.chip:hover { transform: translateY(-2px) rotate(-1.5deg); border-color: var(--c); }
.chip.on { background: var(--c); color: var(--deep); border-color: var(--deep); box-shadow: 2px 2px 0 var(--deep); }
.chip-more { border-style: dashed; }
.c-pink { --c: var(--pink); } .c-orange, .c-tang { --c: var(--tang); } .c-yellow, .c-sun { --c: var(--sun); }
.c-teal, .c-mint { --c: var(--mint); } .c-blue, .c-sky { --c: var(--sky); } .c-violet, .c-grape { --c: var(--grape); } .c-lime { --c: var(--lime); }
.chip.on.c-violet, .chip.on.c-grape { color: #fff; }
details.more { border: 2px dashed color-mix(in srgb, var(--line) 28%, transparent); border-radius: 16px; padding: 0 14px; }
details.more summary { cursor: pointer; font-weight: 800; padding: 10px 0; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '+'; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--ink); color: var(--bg); font-size: 1rem; line-height: 1; transition: transform 0.2s; }
details.more[open] summary::before { transform: rotate(45deg); }
.more-body { display: grid; gap: 16px; padding: 4px 0 16px; }
.toggles { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; background: none; border: 0; padding: 0; color: inherit; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { width: 46px; height: 26px; border-radius: 999px; background: color-mix(in srgb, var(--line) 22%, transparent); position: relative; transition: background-color 0.2s; flex: none; }
.track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1); }
.switch input:checked + .track { background: var(--grape); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch-pro .switch-text { opacity: 0.85; }
.switch-pro:hover .track::after { transform: translateX(6px); }
.pro-tag, .upsell-btn i { font-style: normal; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; background: var(--grape); color: #fff; padding: 2px 7px; border-radius: 6px; }
.form-error { margin: 0; font-weight: 700; color: var(--bad-ink); background: var(--bad-bg); padding: 10px 14px; border-radius: 12px; }
.report { font-size: 0.92rem; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; border: 2px solid color-mix(in srgb, var(--line) 18%, transparent); }
.report.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn-ink) 40%, transparent); }
.report p { margin: 0 0 6px; }
.report p:last-child { margin: 0; }
.report ul { margin: 0 0 8px; padding-left: 20px; }
.report-title { font-weight: 800; }
.report-fixes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.fine-row { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; align-items: center; }
.bingo-inline { font-weight: 750; color: var(--ink); white-space: nowrap; }

/* ---------- Preview (playable) ---------- */
.preview { padding: 26px 14px 0 10px; max-width: 560px; width: 100%; justify-self: center; }
.stack span { position: absolute; inset: 40px 10px 70px 22px; border-radius: var(--r); border: var(--bw) solid var(--deep); }
.stack span:nth-child(1) { background: var(--pink); transform: rotate(5deg); }
.stack span:nth-child(2) { background: var(--sky); transform: rotate(2.5deg); }
.preview-card { position: relative; transform: rotate(-1.2deg); transition: transform 0.3s; }
.preview-card:hover, .preview-card:focus-within { transform: rotate(0deg); }
.sticker { position: absolute; z-index: 3; font-weight: 800; padding: 6px 14px; border-radius: 12px; border: var(--bw) solid var(--deep); box-shadow: 3px 3px 0 var(--deep); font-size: 0.95rem; white-space: nowrap; pointer-events: none; }
.sticker-top { top: 2px; right: -6px; background: var(--sun); color: var(--deep); transform: rotate(6deg); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.found-meter { position: absolute; z-index: 3; left: -6px; top: 6px; background: var(--deep); color: #fff; font-weight: 800; padding: 5px 12px; border-radius: 12px; border: var(--bw) solid var(--deep); box-shadow: 3px 3px 0 var(--lime); transform: rotate(-5deg); font-size: 0.95rem; }
.found-meter b { color: var(--lime); font-size: 1.1em; }
.found-meter.bump { animation: bump 0.45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 40% { transform: rotate(-5deg) scale(1.25); } }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.preview-hint { margin: 0; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--pink); animation: ping-pink 1.6s infinite; flex: none; }
@keyframes ping-pink { 0% { box-shadow: 0 0 0 0 rgba(255, 79, 154, 0.7); } 80%, 100% { box-shadow: 0 0 0 10px rgba(255, 79, 154, 0); } }
.stamp { position: absolute; z-index: 5; left: 50%; top: 45%; font-weight: 800; font-size: clamp(2.2rem, 8vw, 4rem); color: var(--deep); background: var(--lime); border: 5px solid var(--deep); padding: 0.05em 0.35em; border-radius: 16px; letter-spacing: -0.02em; pointer-events: none; transform: translate(-50%, -50%) rotate(-10deg) scale(0); opacity: 0; transition: transform 0.35s cubic-bezier(.3, 1.8, .5, 1), opacity 0.2s; box-shadow: 6px 6px 0 var(--deep); white-space: nowrap; }
.stamp.show { transform: translate(-50%, -50%) rotate(-10deg) scale(1); opacity: 1; }

/* ---------- Word search sheet (screen + print) ---------- */
.ws-sheet { container-type: inline-size; background: #fff; color: var(--deep); border: var(--bw) solid var(--deep); border-radius: 20px; box-shadow: 6px 6px 0 var(--deep); padding: 5% 5.5% 3.5%; position: relative; }
.ws-head { text-align: center; margin-bottom: 3cqi; }
.ws-org { font-size: 2.7cqi; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #4a4570; margin: 0 0 1.2cqi; }
.ws-titlebar { display: flex; justify-content: center; align-items: center; gap: 1.6cqi 2.4cqi; flex-wrap: wrap; }
.ws-title { font-size: 6.6cqi; font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.05; overflow-wrap: anywhere; }
.ws-badge, .ws-ver { font-size: 2.4cqi; font-weight: 800; padding: 0.35em 0.9em; border-radius: 999px; border: 0.4cqi solid var(--deep); line-height: 1.2; white-space: nowrap; }
.ws-badge { background: var(--lime); }
.ws-ver { background: #fff; }
.ws-name { display: flex; gap: 5cqi; font-size: 2.7cqi; font-weight: 700; margin: 3cqi 0 0; }
.ws-name span { flex: 1; display: flex; gap: 1.4cqi; align-items: flex-end; }
.ws-name span:last-child { flex: 0.6; }
.ws-name span::after { content: ''; flex: 1; border-bottom: 0.35cqi solid var(--deep); margin-bottom: 0.5cqi; }
.ws-instr { font-size: 2.8cqi; margin: 2.2cqi 0 0; color: #3d3866; font-weight: 600; }
.ws-board { container-type: inline-size; width: 100%; aspect-ratio: 1; margin: 0 auto; border: 0.55cqi solid var(--deep); border-radius: 2.6cqi; padding: 1.6%; background: #fff; }
.ws-board.shaped { border-color: transparent; }
.ws-area { position: relative; width: 100%; height: 100%; }
.ws-hl { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ws-hl line { stroke-linecap: round; fill: none; }
.ws-hl .ols line { stroke: var(--deep); stroke-width: 0.8; }
.ws-hl .fills line { stroke-width: 0.64; }
.ws-hl .sel line { stroke: var(--grape); stroke-width: 0.72; opacity: 0.35; }
.h0 { stroke: #c4f25c; } .h1 { stroke: #ff9cc6; } .h2 { stroke: #8fd9ff; } .h3 { stroke: #ffe066; }
.h4 { stroke: #c9b0ff; } .h5 { stroke: #ffb877; } .h6 { stroke: #7ff0cf; } .h7 { stroke: #ffa99a; }
.ws-grid { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); width: 100%; height: 100%; }
.ws-row { display: contents; }
/* Grid letters use a plain sans with an unmistakable Q (Bricolage's Q reads like an underlined O). */
.c { display: grid; place-items: center; font-family: Arial, Helvetica, 'Liberation Sans', 'Nimbus Sans', sans-serif; font-size: calc(62cqi / var(--n)); font-weight: 700; line-height: 1; color: var(--deep); user-select: none; -webkit-user-select: none; position: relative; }
.c.x { visibility: hidden; }
.n10 { --n: 10; } .n11 { --n: 11; } .n12 { --n: 12; } .n13 { --n: 13; } .n14 { --n: 14; } .n15 { --n: 15; }
.n16 { --n: 16; } .n17 { --n: 17; } .n18 { --n: 18; } .n19 { --n: 19; } .n20 { --n: 20; } .n21 { --n: 21; }
.n22 { --n: 22; } .n23 { --n: 23; } .n24 { --n: 24; } .n25 { --n: 25; } .n26 { --n: 26; } .n27 { --n: 27; }
.n28 { --n: 28; } .n29 { --n: 29; } .n30 { --n: 30; }
.ws-bank { list-style: none; padding: 0; margin: 3.4cqi 0 0; columns: 4; column-gap: 3cqi; font-size: 2.5cqi; font-weight: 700; }
.ws-bank.cols-3 { columns: 3; } .ws-bank.cols-2 { columns: 2; }
.ws-bank li { break-inside: avoid; padding: 0.35cqi 0 0.35cqi 3.6cqi; position: relative; line-height: 1.35; overflow-wrap: break-word; }
.ws-bank li::before { content: ''; position: absolute; left: 0; top: 0.75cqi; width: 2cqi; height: 2cqi; border: 0.35cqi solid var(--deep); border-radius: 0.5cqi; }
.ws-key .ws-bank li::before { display: none; }
.ws-bank .sw { position: absolute; left: 0; top: 0.65cqi; width: 2.4cqi; height: 2.4cqi; border-radius: 50%; border: 0.35cqi solid var(--deep); }
.sw.h0 { background: #c4f25c; } .sw.h1 { background: #ff9cc6; } .sw.h2 { background: #8fd9ff; } .sw.h3 { background: #ffe066; }
.sw.h4 { background: #c9b0ff; } .sw.h5 { background: #ffb877; } .sw.h6 { background: #7ff0cf; } .sw.h7 { background: #ffa99a; }
.ws-foot { text-align: center; font-size: 2.1cqi; margin-top: 2.6cqi; color: #6b6690; font-weight: 600; }
.ws-empty { padding: 12% 8%; text-align: center; min-height: 320px; display: grid; place-content: center; }

/* Playable preview */
.ws-compact .ws-head { margin-bottom: 2.4cqi; }
.ws-compact .ws-title { font-size: 6cqi; }
.ws-compact .ws-bank { columns: 4; font-size: max(12px, 2.6cqi); }
.ws-compact .ws-bank.cols-2 { columns: 2; } .ws-compact .ws-bank.cols-3 { columns: 3; }
.play .c { cursor: pointer; border-radius: 22%; transition: background-color 0.12s, transform 0.12s; touch-action: manipulation; }
.play .c:hover { background: color-mix(in srgb, var(--grape) 16%, transparent); transform: scale(1.12); z-index: 1; }
.play .c:focus-visible { outline: none; box-shadow: inset 0 0 0 0.45cqi var(--grape); background: color-mix(in srgb, var(--grape) 14%, transparent); }
.play .c.anchor { background: var(--grape); color: #fff; transform: scale(1.12); }
.play .ws-bank li { transition: opacity 0.3s; }
.play .ws-bank li.found, .ws-bank li.found { text-decoration: line-through; text-decoration-thickness: 0.4cqi; opacity: 0.55; }
.ws-bank li.found::before { background: var(--lime); }
.ws-board.miss { animation: shake 0.35s; }
.pop-in .c { animation: popin 0.42s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--r, 0) * 28ms); }
@keyframes popin { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ws-hl .fills line:last-child { animation: draw 0.4s ease-out; }
@keyframes draw { from { stroke-width: 0; } }

/* ---------- Marquee ---------- */
.marquee { background: var(--deep); color: #f3f0ff; border-block: var(--bw) solid var(--deep); overflow: hidden; padding: 14px 0; }
.marquee-track { display: flex; width: max-content; animation: scroll 50s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee a, .marquee-dup { display: inline-flex; }
.marquee a { padding: 0 22px; font-weight: 750; font-size: 1.1rem; text-decoration: none; white-space: nowrap; gap: 8px; }
.marquee a:hover { color: var(--lime); }
.marquee a + a::before, .marquee-dup a::before { content: '✦'; color: var(--lime); margin-right: 22px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Results ---------- */
.results { background: var(--bg-alt); padding: clamp(36px, 5vw, 64px) 0; border-bottom: var(--bw) solid var(--line); scroll-margin-top: 70px; }
.results-title { font-size: clamp(2.3rem, 6vw, 4.2rem); letter-spacing: -0.04em; outline: none; }
.results-title span { display: inline-block; background: var(--mark-bg); color: var(--mark-ink); padding: 0 0.15em; border-radius: 0.4em; transform: rotate(-2deg); animation: countpop 0.5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes countpop { from { transform: scale(0.4) rotate(-10deg); } }
.results-sub { color: var(--ink-soft); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin: 8px 0 14px; }
.toolbar-2 { margin-bottom: 30px; gap: 10px; }
.btn-print { margin-left: auto; }
@media (max-width: 700px) { .btn-print { margin-left: 0; width: 100%; } }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 26px; align-items: start; }
.page { animation: rise 0.45s cubic-bezier(.2, .9, .3, 1.2) both; }
.page-half { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 14px; border: 2px dashed color-mix(in srgb, var(--line) 35%, transparent); border-radius: 18px; }
@media (max-width: 700px) { .page-half { grid-template-columns: 1fr; } }
.upsell { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 30px; }
.upsell-lbl { font-weight: 800; }
.upsell-btn { border: 2px dashed color-mix(in srgb, var(--line) 50%, transparent); background: var(--surface); border-radius: 999px; padding: 0.45em 1em; font-weight: 700; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; transition: transform 0.15s, border-color 0.15s; }
.upsell-btn:hover { transform: translateY(-2px); border-color: var(--grape); border-style: solid; }

/* Large print (Pro) */
.ws-lp .c { font-weight: 800; font-size: calc(66cqi / var(--n)); }
.ws-lp .ws-board { border-width: 0.8cqi; }
.ws-lp .ws-bank { font-size: 3.4cqi; font-weight: 800; columns: 3; }
.ws-lp .ws-bank.cols-2 { columns: 2; }
.ws-lp .ws-instr { font-size: 3.4cqi; color: var(--deep); }
.ws-lp .ws-title { font-size: 7.4cqi; }

/* ---------- Sections ---------- */
section.how, section.features, section.themes, section.pricing, section.faq, section.related, section.dolch, .guide { padding: clamp(48px, 7vw, 96px) 0; }
.section-title { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -0.035em; }
.section-title-sm { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: 1.2em; }
.section-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step-card { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r); padding: 26px; box-shadow: 6px 6px 0 var(--c); transition: transform 0.2s; }
.step-card:hover { transform: translateY(-4px) rotate(-0.6deg); }
.step-n { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--c); color: var(--deep); font-weight: 800; font-size: 1.6rem; border: var(--bw) solid var(--deep); margin-bottom: 14px; transform: rotate(-6deg); }
.step-card h3 { font-size: 1.5rem; }
.step-card p { margin: 0; color: var(--ink-soft); }
.features { background: var(--bg-alt); border-block: var(--bw) solid var(--line); }
.feat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 26px; }
.feat { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: 6px 6px 0 var(--c, var(--shadow)); transition: transform 0.2s; }
.feat:hover { transform: translateY(-4px); }
.feat-wide { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; }
.feat h3 { font-size: 1.35rem; }
.feat p { margin: 0; color: var(--ink-soft); }
.feat-wide h3 { font-size: 2rem; }
.feat-wide p { font-size: 1.1rem; }
@media (max-width: 960px) { .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .feat-grid { grid-template-columns: minmax(0, 1fr); } .feat-wide { grid-column: auto; grid-row: auto; } .feat-wide h3 { font-size: 1.6rem; } }
.feat-demo { height: 90px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.demo-find { height: auto; flex: 1; min-height: 170px; flex-direction: column; justify-content: center; gap: 6px; }
.df-row { display: flex; gap: 6px; }
.df-row i { font-style: normal; display: grid; place-items: center; width: clamp(32px, 5vw, 46px); aspect-ratio: 1; border-radius: 10px; font-weight: 800; font-size: clamp(1.1rem, 2.4vw, 1.5rem); background: #fff; color: var(--deep); border: 2px solid color-mix(in srgb, var(--deep) 25%, transparent); }
.df-row i.hit { background: var(--lime); border-color: var(--deep); animation: hit 3.2s ease-in-out infinite; }
.df-row i.hit:nth-child(3) { animation-delay: 0.12s; } .df-row i.hit:nth-child(4) { animation-delay: 0.24s; } .df-row i.hit:nth-child(5) { animation-delay: 0.36s; } .df-row i.hit:nth-child(6) { animation-delay: 0.48s; }
@keyframes hit { 0%, 12% { background: #fff; transform: none; } 22%, 85% { background: var(--lime); transform: translateY(-3px); } 100% { background: #fff; } }
.demo-key span { width: 58px; height: 74px; background: #fff; border: 2px solid var(--deep); border-radius: 8px; box-shadow: 3px 3px 0 var(--c); position: relative; background-image: repeating-linear-gradient(90deg, transparent 0 9px, #e8e6f2 9px 11px), repeating-linear-gradient(0deg, transparent 0 9px, #e8e6f2 9px 11px); }
.demo-key .sheet-a { transform: rotate(-5deg); }
.demo-key .sheet-b { transform: rotate(4deg) translateY(-4px); }
.demo-key .sheet-b i { position: absolute; height: 9px; border-radius: 9px; border: 1.5px solid var(--deep); }
.demo-key .sheet-b i:nth-child(1) { background: #c4f25c; left: 6px; top: 12px; width: 40px; }
.demo-key .sheet-b i:nth-child(2) { background: #ff9cc6; left: 10px; top: 32px; width: 30px; transform: rotate(35deg); }
.demo-key .sheet-b i:nth-child(3) { background: #8fd9ff; left: 8px; top: 54px; width: 38px; }
.demo-report { flex-direction: column; align-items: flex-start; gap: 4px; font-weight: 800; }
.demo-report s { font-size: 1.15rem; text-decoration-thickness: 3px; text-decoration-color: var(--pink); }
.demo-report b { background: var(--sun); color: var(--deep); padding: 2px 10px; border-radius: 8px; border: 2px solid var(--deep); }
.demo-link { font-size: 3.2rem; animation: wiggle 2.6s infinite; }
.demo-bingo { display: grid; grid-template-columns: repeat(3, 26px); gap: 5px; height: auto; padding: 10px; border: var(--bw) solid var(--line); border-radius: 16px; width: max-content; }
.demo-bingo span { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--line); }
.demo-bingo span.on { background: var(--pink); border-color: var(--deep); animation: dab 2.4s infinite; }
.demo-bingo span.on:nth-child(4) { animation-delay: 0.3s; } .demo-bingo span.on:nth-child(5) { animation-delay: 0.6s; } .demo-bingo span.on:nth-child(8) { animation-delay: 0.9s; }
@keyframes dab { 0%, 10% { transform: scale(0.2); } 25%, 100% { transform: scale(1); } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.tiles-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile { --c: var(--sun); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-decoration: none; background: var(--surface); border: var(--bw) solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: 5px 5px 0 var(--c); transition: transform 0.16s, box-shadow 0.16s; }
.tile:hover { transform: translate(-3px, -3px) rotate(-0.8deg); box-shadow: 8px 8px 0 var(--c); }
.tile-emoji { grid-row: span 2; font-size: 2rem; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--c) 32%, transparent); transition: transform 0.3s cubic-bezier(.3, 1.8, .5, 1); }
.tile:hover .tile-emoji { transform: scale(1.15) rotate(-8deg); }
.tile-name { font-weight: 800; font-size: 1.12rem; line-height: 1.15; }
.tile-meta { font-size: 0.85rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pro { background: var(--band); color: var(--band-ink); padding: clamp(48px, 7vw, 96px) 0; border-block: var(--bw) solid var(--line); position: relative; overflow: hidden; }
.pro::before { content: 'PRO PRO PRO PRO PRO PRO'; position: absolute; right: -40px; top: 10px; font-weight: 800; font-size: 9rem; opacity: 0.08; white-space: nowrap; letter-spacing: -0.04em; pointer-events: none; }
.tag { display: inline-block; font-weight: 800; font-size: 0.85rem; padding: 5px 12px; border-radius: 999px; border: 2px solid var(--deep); margin-bottom: 14px; }
.tag-lime { background: var(--lime); color: var(--deep); }
.tag-ink { background: var(--deep); color: #f3f0ff; }
.pro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
@media (max-width: 900px) { .pro-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pro-grid { grid-template-columns: 1fr; } }
.pro-card { background: #fff; color: var(--deep); border: var(--bw) solid var(--deep); border-radius: 18px; padding: 20px; box-shadow: 5px 5px 0 var(--deep); display: flex; flex-direction: column; align-items: flex-start; transition: transform 0.18s; }
.pro-card:hover { transform: translateY(-4px) rotate(0.5deg); }
.pro-card h3 { font-size: 1.3rem; margin-top: 8px; }
.pro-card p { color: #4a4570; flex: 1; }
.pro-emoji { font-size: 2rem; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 34px 0 18px; align-items: start; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }
.plan { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r); padding: 26px; box-shadow: 6px 6px 0 var(--shadow); position: relative; }
.plan h3 { font-size: 1.2rem; }
.plan .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 6px; }
.plan ul { padding: 0; list-style: none; margin: 14px 0 22px; display: grid; gap: 8px; }
.plan li { padding-left: 28px; position: relative; }
.plan li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: var(--deep); font-weight: 800; font-size: 0.75rem; display: grid; place-items: center; margin-top: 3px; }
.plan-hot { border-color: var(--grape); box-shadow: 8px 8px 0 var(--grape); transform: translateY(-10px); }
.plan-flag { position: absolute; top: -16px; right: 20px; background: var(--pop-btn); color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--deep); transform: rotate(4deg); }
.plan-note { background: var(--lime); color: var(--deep); border-radius: 10px; padding: 6px 10px; font-size: 0.92rem; font-weight: 600; }

.faq details { background: var(--surface); border: var(--bw) solid var(--line); border-radius: 16px; margin-bottom: 12px; box-shadow: 4px 4px 0 var(--shadow); }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 800; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.5rem; line-height: 1; color: var(--grape); transition: transform 0.2s; }
:root[data-theme='dark'] .faq summary::after { color: var(--lime); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 20px 16px; margin: 0; color: var(--ink-soft); }

.license { padding: 0 0 64px; }
.license-panel { padding: 22px 26px; box-shadow: 5px 5px 0 var(--shadow); }
.license-panel h2 { font-size: 1.3rem; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 220px; }
.form-msg { min-height: 1.4em; margin: 8px 0 0; font-weight: 600; }
.pro-status { font-weight: 800; color: var(--ok-ink); }

/* ---------- Landing pages ---------- */
.guide-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-intro { font-size: 1.18rem; line-height: 1.6; }
.guide-steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; margin: 22px 0 10px; }
.guide-steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 62px; background: var(--surface); border: var(--bw) solid var(--line); border-radius: 16px; box-shadow: 4px 4px 0 var(--shadow); }
.guide-steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--lime); color: var(--deep); border: 2px solid var(--deep); font-weight: 800; transform: rotate(-6deg); }
.guide-steps li:nth-child(2)::before { background: var(--sky); } .guide-steps li:nth-child(3)::before { background: var(--pink); } .guide-steps li:nth-child(4)::before { background: var(--sun); }
.guide-tips { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.guide-tips li { padding-left: 34px; position: relative; }
.guide-tips li::before { content: '✦'; position: absolute; left: 4px; top: -1px; color: var(--grape); font-size: 1.2rem; }
:root[data-theme='dark'] .guide-tips li::before { color: var(--lime); }
.guide-side { position: sticky; top: 90px; display: grid; gap: 24px; }
@media (max-width: 900px) { .guide-side { position: static; } }
.words-panel { padding: 22px; }
.words-title { font-size: 1.3rem; }
.wordlist { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.wordlist li { background: var(--surface-2); border: 2px solid color-mix(in srgb, var(--line) 22%, transparent); border-radius: 999px; padding: 2px 10px; font-weight: 650; font-size: 0.92rem; }
.bingo-panel { background: var(--deep); color: #f3f0ff; border: var(--bw) solid var(--deep); border-radius: var(--r); padding: 22px; box-shadow: 6px 6px 0 var(--pink); }
.bingo-panel p { color: #d6d0f5; }
.bingo-panel .btn-ink { background: var(--pink); color: var(--deep); border-color: #f3f0ff; box-shadow: 4px 4px 0 #f3f0ff; }
.bingo-panel .chips { margin-top: 16px; }
.bingo-panel .chip { background: transparent; color: #f3f0ff; border-color: rgba(243, 240, 255, 0.4); }
.bingo-panel .chip:hover { border-color: var(--pink); }
.bingo-panel-wide { margin-top: 40px; }
.bingo-kicker { font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pink) !important; margin-bottom: 6px; }
.bingo-title { font-size: 1.6rem; }
.related { background: var(--bg-alt); border-top: var(--bw) solid var(--line); }
.related-more { margin-top: 22px; font-weight: 700; }
.dolch { border-top: var(--bw) solid var(--line); }
.dolch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; margin-top: 22px; }
.dolch-level { padding: 20px; box-shadow: 5px 5px 0 var(--shadow); }
.dolch-level h3 { font-size: 1.3rem; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dolch-level h3 small { font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }
.dolch-level .wordlist { margin: 0; }
.prose { padding-block: 48px 72px; font-size: 1.08rem; }
.prose h1 { font-size: 3rem; } .prose h2 { font-size: 1.5rem; margin-top: 1.4em; }
.success-box { padding: 22px; margin: 18px 0; }
.license-key { font-size: 1.05rem; word-break: break-all; }
.hero-hub { padding-bottom: 56px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); color: #f3f0ff; padding: 48px 0 40px; }
.site-footer .brand b { color: var(--lime); }
.footer-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.footer-top p { margin: 0; opacity: 0.85; }
.footer-themes { display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 600; font-size: 0.95rem; margin-bottom: 22px; }
.footer-themes a { opacity: 0.85; text-decoration: none; }
.footer-themes a:hover { opacity: 1; color: var(--lime); }
.site-footer .fine { color: #c9c2ee; }

/* ---------- Dialogs ---------- */
.dlg { border: var(--bw) solid var(--line); border-radius: 26px; background: var(--surface); color: var(--ink); padding: 0; box-shadow: 10px 10px 0 var(--grape); max-width: min(96vw, 560px); width: 100%; max-height: 94vh; }
.dlg[open] { animation: dlgin 0.35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes dlgin { from { transform: translateY(30px) scale(0.94); opacity: 0; } }
.dlg::backdrop { background: rgba(15, 12, 41, 0.6); backdrop-filter: blur(6px); }
.dlg-waitlist form { padding: 26px; display: grid; gap: 10px; }
.dlg-waitlist h2 { font-size: 2rem; margin: 0; }
.dlg-waitlist .tag { justify-self: start; margin: 0; }
.wl-feature { margin: 0; font-weight: 700; color: var(--grape); }
:root[data-theme='dark'] .wl-feature { color: var(--lime); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--grape); flex: none; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--deep); color: #f3f0ff; font-weight: 750; padding: 12px 20px; border-radius: 999px; border: 2px solid #f3f0ff; box-shadow: 4px 4px 0 var(--lime); animation: dlgin 0.3s; max-width: calc(100vw - 32px); text-align: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2000; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall var(--t, 2s) cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x, 0), 105vh) rotate(var(--r, 720deg)); opacity: 0.9; } }

/* ---------- Pro panel (rendered by puzzle.js only with a verified license) ---------- */
html.is-pro .site-header .brand span::after { content: 'PRO'; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; background: var(--grape); color: #fff; padding: 2px 7px; border-radius: 6px; margin-left: 8px; vertical-align: 0.35em; }
html.is-pro .pro-card [data-plan], html.is-pro .plan [data-plan], html.is-pro .upsell { display: none; }
.pro-panel { display: grid; gap: 16px; border: 2px dashed color-mix(in srgb, var(--grape) 70%, transparent); border-radius: 18px; padding: 16px; background: color-mix(in srgb, var(--grape) 7%, var(--surface)); animation: rise 0.45s cubic-bezier(.2, .9, .3, 1.2) both; }
.pro-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.95rem; margin: 0; font-weight: 800; }
.pro-row-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pro-row-ctl select { flex: 1 1 180px; min-width: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .preview { padding-inline: 2px; }
  .sticker { font-size: 0.8rem; }
  .sticker-top { right: -2px; }
  .found-meter { font-size: 0.82rem; left: -2px; }
  .gen-row { gap: 16px; }
  .toolbar-2 .btn { flex: 1 1 calc(50% - 10px); }
  .preview-bar { flex-wrap: wrap; }
  .bingo-inline { white-space: normal; }
  .ws-compact .ws-bank, .ws-compact .ws-bank.cols-3 { columns: 2; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee-dup { display: none; }
}

/* ---------- Print: only the sheets ---------- */
@page { size: auto; margin: 0.35in; }
@page landscape { size: landscape; margin: 0.35in; }
@media print {
  html, body { background: #fff !important; color: #000; }
  html.has-puzzle .np, html.has-puzzle .hero, html.has-puzzle .marquee, html.has-puzzle .site-header, html.has-puzzle dialog, html.has-puzzle .toast, html.has-puzzle .confetti, html.has-puzzle .skip, html.has-puzzle .test-banner, html.has-puzzle .qw-strip, html.has-puzzle .site-footer { display: none !important; }
  html.has-puzzle main > :not(#results) { display: none !important; }
  .results { padding: 0; background: #fff; border: 0; }
  .results .wrap { max-width: none; padding: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; animation: none !important; transition: none !important; }
  .sheets { display: block; }
  .page { display: flex; justify-content: center; break-after: page; page-break-after: always; break-inside: avoid; }
  .page:last-child { break-after: auto; page-break-after: auto; }
  /* Each sheet fills exactly one page: the grid takes whatever height the title and word bank leave
     (up to 5.9 in), so long titles and 30-word banks never push the footer onto a second page. */
  .page { height: 10.2in; }
  .ws-sheet { width: 100%; height: 100%; display: flex; flex-direction: column; border: 0; border-radius: 0; box-shadow: none; padding: 0; overflow: hidden; }
  .ws-title { font-size: 4.8cqi; }
  .ws-lp .ws-title { font-size: 5.6cqi; }
  .ws-board { flex: 1 1 0; min-height: 0; width: auto; height: auto; max-width: 5.9in; max-height: 5.9in; aspect-ratio: 1; align-self: center; margin: 0; }
  .ws-bank { font-size: 2.2cqi; margin-top: 3cqi; flex: none; }
  .ws-lp .ws-bank { font-size: 2.9cqi; }
  .ws-foot { margin-top: auto; padding-top: 2cqi; flex: none; }
  .ws-head { flex: none; }
  .page-half { page: landscape; height: 7.7in; display: flex; flex-direction: row; justify-content: space-between; gap: 0.45in; padding: 0; border: 0; }
  .page-half .ws-sheet { width: 4.9in; }
  .page-half .ws-board { max-width: 4.5in; max-height: 4.5in; }
  .page-half .ws-bank { font-size: 2.3cqi; }
}

/* Pro owners don't need the sales pitch: hide the Pro/pricing sections, their nav links and upsells
   once Pro is active (pro.js sets html.is-pro after the license verifies). */
html.is-pro #pro,
html.is-pro #pricing,
html.is-pro .upsell,
html.is-pro .site-header a[href="/#pro"],
html.is-pro .site-header a[href="/#pricing"] { display: none !important; }
