/* ═══════════════════════════════════════════════════════════════
   QuizGen – retro 70s game-show design system
   ═══════════════════════════════════════════════════════════════ */
:root {
  --navy: #0b1f5c;
  --navy-2: #12297a;
  --navy-3: #1b3690;
  --cobalt: #1a48c4;
  --cobalt-2: #2a5ee6;
  --gold: #ffc72c;
  --gold-2: #ffdb6b;
  --gold-3: #e9a514;
  --orange: #f2792b;
  --cream: #fff4d8;
  --cream-2: #fbe7b5;
  --paper: #fffbf0;
  --ink: #0b1f5c;
  --ink-2: #33447a;
  --ink-3: #4e5884;
  --line: #efd48c;
  --line-2: #dcb65a;
  --good: #2b9348;
  --good-soft: #dff3e3;
  --bad: #d63a2f;
  --bad-soft: #fde3df;
  --warn: #c76a0a;
  --warn-soft: #ffeccc;
  --navy-rgb: 11, 31, 92;

  --font-display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
  --font-sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --pop: 0 4px 0 var(--navy);
  --pop-lg: 0 6px 0 var(--navy);
  --shadow: 0 12px 30px rgba(var(--navy-rgb), 0.18);
  --shadow-lg: 0 24px 60px rgba(var(--navy-rgb), 0.35);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 16px/1.55 var(--font-sans);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(rgba(var(--navy-rgb), 0.06) 1.2px, transparent 1.7px) 0 0 / 9px 9px,
    var(--cream);
}
main { flex: 1; outline: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; font-weight: 400; }
p { margin: 0; }
a { color: var(--cobalt); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
::selection { background: var(--gold); color: var(--navy); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 1000; background: var(--gold); color: var(--navy); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 800; }
.skip-link:focus { left: 8px; }
.noscript { padding: 40px; text-align: center; }
.container { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* Chunky retro display lettering: cream fill, navy outline, drop shadow. */
.retro-type {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--cream);
  -webkit-text-stroke: 0.09em var(--navy);
  paint-order: stroke fill;
  text-shadow: 0.05em 0.07em 0 var(--navy);
}
.retro-type .gold, .retro-type.gold { color: var(--gold); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 12px; border: 3px solid var(--cream); }

/* ═══ Sunburst & marquee building blocks ═══ */
.sunburst { position: relative; isolation: isolate; overflow: hidden; background: repeating-conic-gradient(from -4.5deg at 50% 55%, var(--cobalt) 0deg 9deg, var(--gold) 9deg 18deg); }
.sunburst::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(rgba(var(--navy-rgb), 0.22) 1.3px, transparent 1.8px) 0 0 / 8px 8px; }
.sunburst::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 55%, rgba(255, 236, 170, 0.55), transparent 55%), linear-gradient(180deg, transparent 70%, rgba(var(--navy-rgb), 0.25)); pointer-events: none; }
.sunburst.dark { background: repeating-conic-gradient(from -4deg at 50% -8%, #1d4fd0 0deg 8deg, #102c86 8deg 16deg); }
.sunburst.dark::after { background: radial-gradient(ellipse at 50% -5%, rgba(255, 210, 90, 0.45), transparent 45%), linear-gradient(180deg, transparent 35%, rgba(6, 17, 56, 0.85)); }

.marquee { position: relative; padding: 20px; border-radius: 30px; background: linear-gradient(180deg, #ffd85c, #f0ae1c 55%, #d9930b); box-shadow: inset 0 0 0 3px #b7790a, inset 0 3px 0 6px rgba(255, 255, 255, 0.25), 0 14px 34px rgba(var(--navy-rgb), 0.35); }
.marquee-inner { position: relative; z-index: 1; background: linear-gradient(180deg, var(--navy-2), var(--navy)); border-radius: 16px; padding: 12px; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25); }
@keyframes twinkle { 50% { opacity: 0.6; } }

/* Marquee bulbs (placed by js/lib/bulbs.js) */
.bulbs { position: absolute; pointer-events: none; z-index: 2; }
.bulb { position: absolute; width: var(--bs); height: var(--bs); margin: calc(var(--bs) / -2) 0 0 calc(var(--bs) / -2); border-radius: 50%; background: radial-gradient(circle at 38% 34%, #fff 0 22%, #fff6c4 42%, #ffd24d 72%, #e9a514 100%); box-shadow: 0 0 calc(var(--bs) * 0.6) calc(var(--bs) * 0.15) rgba(255, 226, 120, 0.9), inset 0 -1px 1px rgba(150, 90, 0, 0.35); animation: chase 1.1s steps(1, end) infinite; }
.bulb.alt { animation-delay: -0.55s; }
@keyframes chase { 0% { filter: none; } 50% { filter: brightness(0.62) saturate(0.85); box-shadow: inset 0 -1px 1px rgba(150, 90, 0, 0.35); } }


/* ═══ Header & footer ═══ */
.site-header { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, var(--cobalt), #1640b0); border-bottom: 4px solid var(--gold); box-shadow: 0 4px 0 var(--navy); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.brand { text-decoration: none; display: flex; align-items: center; }
.brand-name { font-size: 34px; line-height: 1; padding: 4px 6px 0 2px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-link { color: #fff; text-decoration: none; white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 15px; }
.nav-link:hover { background: rgba(255, 255, 255, 0.14); }
.nav-link[aria-current] { background: rgba(var(--navy-rgb), 0.35); }
.nav-sep { width: 2px; height: 20px; background: rgba(255, 255, 255, 0.35); border-radius: 2px; }
.credit-chip { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; background: var(--gold); color: var(--navy); border: 3px solid var(--navy); border-radius: 999px; padding: 5px 14px 5px 8px; font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; box-shadow: 0 3px 0 var(--navy); transition: transform 0.1s; }
.credit-chip:hover { transform: translateY(-1px); background: var(--gold-2); }
.credit-chip.bump { animation: bump 0.45s ease; }
@keyframes bump { 40% { transform: scale(1.14); } }
.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, #f4b41a 60%, #c98a06); border: 2px solid var(--navy); display: inline-grid; place-items: center; font-family: var(--font-display); font-size: 12px; line-height: 1; color: var(--navy); flex-shrink: 0; }
.site-footer { margin-top: 72px; background: var(--navy); color: rgba(255, 255, 255, 0.75); font-size: 14px; border-top: 4px solid var(--gold); }
.footer-inner { display: flex; gap: 16px; align-items: center; padding-top: 24px; padding-bottom: 24px; flex-wrap: wrap; }
.footer-inner .retro-type { font-size: 24px; }
.footer-links { margin-left: auto; display: flex; gap: 20px; }
.footer-links a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

body.playing .site-header, body.playing .site-footer { display: none; }
body.editor-page .site-footer { margin-top: 24px; }

/* ═══ Buttons & form controls ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 20px; border-radius: 999px;
  border: 3px solid var(--navy); background: #fff; color: var(--navy);
  font-weight: 900; font-size: 15px; line-height: 1.15; text-decoration: none; white-space: nowrap;
  box-shadow: var(--pop); transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--navy); background: #fffaf0; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--pop); }
.btn-primary { background: var(--gold); }
.btn-primary:hover { background: var(--gold-2); }
.btn-blue { background: var(--cobalt); color: #fff; }
.btn-blue:hover { background: var(--cobalt-2); }
.btn-ghost { background: transparent; border-color: rgba(var(--navy-rgb), 0.2); box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(var(--navy-rgb), 0.06); box-shadow: none; transform: none; color: var(--navy); }
.btn-ghost:active { transform: none; box-shadow: none; }
.btn-danger { color: var(--bad); border-color: var(--bad); box-shadow: 0 4px 0 var(--bad); }
.btn-danger:hover { background: var(--bad-soft); box-shadow: 0 5px 0 var(--bad); }
.btn-sm { min-height: 34px; padding: 4px 14px; font-size: 13px; border-width: 2px; box-shadow: 0 3px 0 var(--navy); }
.btn-sm:hover { box-shadow: 0 4px 0 var(--navy); }
.btn-lg { min-height: 56px; padding: 12px 30px; font-size: 18px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; min-height: 0; padding: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn .cost { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 900; background: rgba(var(--navy-rgb), 0.12); border-radius: 999px; padding: 2px 8px 2px 4px; }
.btn .cost::before { content: 'C'; width: 15px; height: 15px; border-radius: 50%; background: var(--gold); border: 1.5px solid var(--navy); font-size: 9px; display: grid; place-items: center; color: var(--navy); font-family: var(--font-display); }
.btn-marquee { position: relative; background: var(--navy); color: var(--cream); border: 4px solid var(--gold); box-shadow: 0 0 0 3px var(--navy), 0 7px 0 3px var(--navy); font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 26px; letter-spacing: 0.01em; padding: 14px 40px; min-height: 70px; border-radius: 999px; }
.btn-marquee:hover { background: var(--navy-2); box-shadow: 0 0 0 3px var(--navy), 0 8px 0 3px var(--navy); }
.btn-marquee:active { box-shadow: 0 0 0 3px var(--navy), 0 3px 0 3px var(--navy); }
.btn-marquee > :not(.bulbs) { position: relative; z-index: 1; }
.icon { display: inline-grid; place-items: center; flex-shrink: 0; }
.icon svg { display: block; }

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.hint { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.input, .textarea, .select { width: 100%; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; color: var(--navy); font-weight: 700; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.input::placeholder, .textarea::placeholder { color: #a4a9c2; font-weight: 600; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(26, 72, 196, 0.15); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background: linear-gradient(45deg, transparent 50%, var(--navy) 50%) calc(100% - 18px) 55% / 6px 6px no-repeat, linear-gradient(135deg, var(--navy) 50%, transparent 50%) calc(100% - 12px) 55% / 6px 6px no-repeat, #fff; }

.seg { display: inline-flex; background: var(--cream-2); border: 2px solid var(--line-2); border-radius: 999px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; font-weight: 900; font-size: 14px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.seg button small { font-weight: 700; font-size: 11px; color: var(--ink-3); }
.seg button:hover { color: var(--navy); background: rgba(255, 255, 255, 0.6); }
.seg button[aria-pressed='true'] { background: var(--cobalt); color: #fff; box-shadow: 0 2px 0 var(--navy); }
.seg button[aria-pressed='true'] small { color: rgba(255, 255, 255, 0.8); }
.seg.seg-block { display: flex; border-radius: 16px; }
.seg.seg-block button { flex: 1; border-radius: 12px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; color: var(--ink-2); user-select: none; font-weight: 700; }
.switch input { appearance: none; width: 44px; height: 26px; background: var(--cream-2); border: 2px solid var(--navy); border-radius: 999px; position: relative; transition: background 0.2s; cursor: pointer; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); transition: transform 0.2s; }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { transform: translateX(18px); }

.card, .panel { color: var(--navy); background: var(--paper); border: 3px solid var(--gold); border-radius: var(--r-lg); box-shadow: 0 6px 0 rgba(var(--navy-rgb), 0.08); }
.card { padding: 24px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--navy); color: var(--navy); background: #fff; }
.badge-accent { background: var(--gold); }
.badge-warn { background: var(--warn-soft); color: #8a4500; border-color: var(--warn); }
.badge-good { background: var(--good-soft); color: #1d6b34; border-color: var(--good); }
.kbd { font-family: var(--font-mono); font-size: 11px; background: #fff; border: 2px solid var(--navy); border-bottom-width: 3px; border-radius: 6px; padding: 0 6px; color: var(--navy); font-weight: 700; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(var(--navy-rgb), 0.15); border-top-color: var(--cobalt); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-title { font-size: clamp(40px, 6vw, 62px); }
.page-head { padding: 44px 0 24px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin-top: 8px; font-size: 17px; }
.empty { text-align: center; padding: 56px 20px; border: 3px dashed var(--line-2); border-radius: var(--r-lg); color: var(--ink-2); background: rgba(255, 255, 255, 0.4); }
.empty img { width: 170px; margin-bottom: 8px; }
.empty h2 { font-size: 38px; margin-bottom: 8px; }
.empty p { margin-bottom: 22px; }
.callout { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r); border: 2px solid var(--line-2); background: #fff; font-size: 15px; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); color: #7a3f00; }
.callout.error { border-color: var(--bad); background: var(--bad-soft); color: #7d1d15; }
.callout.info { border-color: var(--cobalt); background: #e5ecff; color: var(--navy); }

/* ═══ Toasts & modals ═══ */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 480px); }
.toast { pointer-events: auto; background: var(--navy); color: var(--cream); border: 3px solid var(--gold); border-radius: 999px; padding: 10px 20px; box-shadow: var(--shadow); font-size: 15px; font-weight: 800; display: flex; gap: 10px; align-items: center; animation: toastIn 0.25s ease; max-width: 100%; text-align: center; }
.toast.success { border-color: #6fd08c; }
.toast.error { background: #7d1d15; border-color: #ff9b8f; }
.toast.leave { opacity: 0; transform: translateY(8px); transition: 0.25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 400; background: rgba(6, 15, 48, 0.62); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade 0.18s ease; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(100%, 540px); background: var(--paper); border: 4px solid var(--navy); border-radius: var(--r-lg); box-shadow: 0 8px 0 var(--navy), var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 40px); overflow: hidden; animation: pop 0.24s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
.modal.modal-lg { width: min(100%, 780px); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.95); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px 22px; background: var(--cobalt); border-bottom: 4px solid var(--gold); }
.modal-head h2 { flex: 1; font-size: 28px; }
.modal-head .btn { background: var(--cream); border-color: var(--navy); box-shadow: 0 3px 0 var(--navy); color: var(--navy); }
.modal-body { padding: 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-body > * { flex-shrink: 0; }
.modal-foot { padding: 14px 22px 18px; border-top: 2px dashed var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.link-box { display: flex; gap: 8px; align-items: center; }
.link-box .input { font-family: var(--font-mono); font-size: 13px; }

/* ═══ Home ═══ */
.hero { border-bottom: 5px solid var(--navy); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(40px, 9vw, 140px); align-items: center; min-height: 560px; padding-top: 40px; padding-bottom: 40px; position: relative; }
.hero-copy { position: relative; z-index: 3; }
.hero h1 { font-size: clamp(52px, 6.3vw, 96px); line-height: 0.95; transform: rotate(-3deg); transform-origin: left bottom; }
.hero h1 span { display: block; }
.hero .lead { font-size: 19px; color: var(--navy); background: rgba(255, 248, 225, 0.92); border: 3px solid var(--navy); border-radius: 18px; padding: 14px 18px; margin: 30px 0 30px; max-width: 470px; box-shadow: 0 5px 0 var(--navy); font-weight: 700; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-note span { background: var(--navy); color: var(--cream); font-weight: 800; font-size: 13px; padding: 5px 12px; border-radius: 999px; }
.hero-note span::before { content: '★ '; color: var(--gold); }
.hero-stage { position: relative; z-index: 2; }
.hero-stage .marquee { transform: rotate(1.5deg); }
.hero-host { position: absolute; height: auto; width: clamp(170px, 15.5vw, 235px); left: calc(clamp(40px, 9vw, 140px) * -1 - 70px); bottom: -48px; z-index: 4; filter: drop-shadow(0 10px 12px rgba(var(--navy-rgb), 0.35)); pointer-events: none; }
.sparkle { position: absolute; color: var(--cream); z-index: 2; filter: drop-shadow(0 2px 0 var(--navy)); animation: twinkle 2.2s ease-in-out infinite; }

.mini-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.plate { background: linear-gradient(180deg, #fff7dc, #f6dfa0); color: var(--navy); border: 2px solid #c9952a; border-radius: 10px; font-family: var(--font-display); font-style: italic; text-align: center; box-shadow: inset 0 -3px 0 rgba(160, 110, 10, 0.25); }
.mini-board .plate { font-size: clamp(11px, 1.05vw, 16px); padding: 8px 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-tile { aspect-ratio: 1.5; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(180deg, var(--navy-3), var(--navy-2)); border: 2px solid var(--gold-3); outline: 2px dotted rgba(255, 220, 120, 0.75); outline-offset: -6px; font-family: var(--font-display); font-style: italic; font-size: clamp(18px, 2.2vw, 32px); color: #fff; text-shadow: 0 2px 0 var(--navy); transition: 0.4s; }
.mini-tile.glow { background: linear-gradient(180deg, #ffd85c, #f0ae1c); color: var(--navy); text-shadow: none; transform: scale(1.06); box-shadow: 0 0 22px rgba(255, 210, 80, 0.8); }
.mini-tile.used { color: transparent; text-shadow: none; background: #0a1a4e; outline-color: rgba(255, 220, 120, 0.2); border-color: #2a3a78; }

.section { padding: 72px 0 8px; }
.section-head { max-width: 680px; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(38px, 5vw, 58px); }
.section-head p { color: var(--ink-2); margin-top: 10px; font-size: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { padding: 26px; position: relative; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: -22px; left: 22px; width: 52px; height: 52px; border-radius: 50%; background: var(--cobalt); color: var(--cream); border: 3px solid var(--navy); display: grid; place-items: center; font-family: var(--font-display); font-size: 28px; box-shadow: 0 4px 0 var(--navy); }
.step h3 { font-family: var(--font-display); font-size: 26px; margin: 22px 0 8px; }
.step p { color: var(--ink-2); font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 22px; display: flex; gap: 16px; align-items: flex-start; }
.feature .ficon { width: 64px; height: 64px; border-radius: 50%; background: var(--gold); border: 3px solid var(--navy); color: var(--navy); display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 4px 0 var(--navy); }
.feature h3 { font-family: var(--font-display); font-size: 22px; margin-bottom: 4px; }
.feature p { color: var(--ink-2); font-size: 15px; font-weight: 600; }
.pricing { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; }
.price-card { padding: 30px; }
.price-big { font-family: var(--font-display); font-style: italic; font-size: 72px; line-height: 0.9; color: var(--cobalt); }
.price-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.price-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-size: 15px; }
.price-list li b { font-weight: 900; font-variant-numeric: tabular-nums; }
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { border: 3px solid var(--navy); border-radius: var(--r); background: #fff; padding: 0 20px; box-shadow: 0 4px 0 var(--navy); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 900; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--font-display); color: var(--cobalt); font-size: 26px; line-height: 0.8; }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding-bottom: 18px; color: var(--ink-2); }
.cta-band { margin-top: 72px; border-radius: 30px; border: 5px solid var(--navy); box-shadow: 0 8px 0 var(--navy); padding: 50px 40px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; text-align: center; }
.cta-band h2 { font-size: clamp(40px, 5.5vw, 70px); width: 100%; }
.cta-host { position: absolute; right: 4%; bottom: 0; width: clamp(130px, 14vw, 200px); height: auto; z-index: 1; filter: drop-shadow(0 6px 8px rgba(var(--navy-rgb), 0.35)); }
.cta-band > :not(.cta-host) { position: relative; z-index: 2; }

/* ═══ Create ═══ */
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 26px; align-items: start; padding-bottom: 40px; }
.panel { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.panel + .panel { margin-top: 20px; }
.panel-title { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 26px; }
.panel-title .btn { font-family: var(--font-sans); }
.panel-title .num { width: 38px; height: 38px; border-radius: 50%; background: var(--cobalt); color: var(--cream); border: 3px solid var(--navy); display: grid; place-items: center; font-size: 20px; box-shadow: 0 3px 0 var(--navy); flex-shrink: 0; }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 180px 40px; gap: 8px; align-items: center; }
.cat-row .idx { font-family: var(--font-display); font-size: 24px; color: var(--cobalt); text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 2px solid var(--navy); background: #fff; color: var(--navy); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; box-shadow: 0 2px 0 var(--navy); }
.chip:hover { background: var(--gold); }
.chip:disabled { opacity: 0.35; cursor: default; background: #fff; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.summary { position: sticky; top: calc(var(--header-h) + 20px); border-color: var(--navy); box-shadow: 0 6px 0 var(--navy); }
.summary .total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.summary .total b { font-family: var(--font-display); font-style: italic; font-size: 56px; font-weight: 400; line-height: 1; color: var(--cobalt); }
.summary-lines { display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.summary-lines div { display: flex; justify-content: space-between; gap: 10px; }
.summary-lines b { color: var(--navy); font-weight: 900; font-variant-numeric: tabular-nums; }
.divider { height: 0; border: 0; border-top: 2px dashed var(--line); margin: 4px 0; width: 100%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; }
.or::before, .or::after { content: ''; flex: 1; border-top: 2px dashed var(--line); }

.gen-host { display: flex; justify-content: center; margin: -6px 0 -4px; }
.gen-host img { width: 120px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
.gen-list { display: flex; flex-direction: column; gap: 8px; }
.gen-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: #fff; border: 2px solid var(--line); }
.gen-item .name { flex: 1; font-weight: 900; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-item .st { font-size: 13px; color: var(--ink-3); font-weight: 800; }
.gen-item.ok { border-color: var(--good); }
.gen-item.ok .st { color: var(--good); }
.gen-item.err { border-color: var(--bad); }
.gen-item.err .st { color: var(--bad); }
.dot-ok, .dot-err { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; flex-shrink: 0; color: #fff; border: 2px solid var(--navy); }
.dot-ok { background: var(--good); }
.dot-err { background: var(--bad); }
.progress { height: 14px; border-radius: 999px; background: var(--cream-2); border: 2px solid var(--navy); overflow: hidden; }
.progress > div { height: 100%; background: repeating-linear-gradient(-45deg, var(--gold) 0 10px, var(--gold-3) 10px 20px); transition: width 0.4s ease; animation: stripes 0.8s linear infinite; background-size: 28px 28px; }
@keyframes stripes { to { background-position: 28px 0; } }

/* ═══ Editor ═══ */
.editor-bar { position: sticky; top: var(--header-h); z-index: 40; background: rgba(255, 244, 216, 0.96); backdrop-filter: blur(8px); border-bottom: 3px solid var(--line-2); }
.editor-bar-inner { display: flex; align-items: center; gap: 10px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.title-input { flex: 1; min-width: 200px; background: transparent; border: 2px dashed transparent; border-radius: 12px; font-family: var(--font-display); font-style: italic; font-size: 36px; line-height: 1.1; padding: 2px 10px; color: var(--navy); outline: none; }
.title-input:hover { border-color: var(--line-2); }
.title-input:focus { border-color: var(--cobalt); border-style: solid; background: #fff; }
.save-state { font-size: 13px; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; font-weight: 800; }
.save-state::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--good); }
.save-state.saving::before { background: var(--warn); }
.editor-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px 0 6px; }
.editor-meta .select { width: auto; padding-top: 7px; padding-bottom: 7px; font-size: 14px; }
.notices { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 4px; }
.board-scroll { overflow-x: auto; padding: 10px 4px 26px; }
.board-frame { min-width: min-content; }
.board-editor { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 10px; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col-head { padding: 8px; display: flex; flex-direction: column; gap: 6px; border-radius: 14px; }
.col-head.double { box-shadow: 0 0 0 3px var(--gold), 0 0 20px rgba(255, 200, 60, 0.6); }
.col-name { width: 100%; background: transparent; border: 2px dashed transparent; border-radius: 8px; padding: 4px 6px; font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--navy); text-align: center; outline: none; }
.col-name:hover { border-color: rgba(var(--navy-rgb), 0.3); }
.col-name:focus { border-color: var(--cobalt); border-style: solid; background: #fff; }
.col-style { text-align: center; font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #8a6510; }
.col-tools { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; }
.col-tools .btn-icon { width: 30px; height: 30px; border: 2px solid transparent; background: transparent; color: var(--navy); box-shadow: none; }
.col-tools .btn-icon:hover { background: rgba(255, 255, 255, 0.7); border-color: var(--navy); transform: none; }
.col-tools .btn-icon.on { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.col-tools .btn-icon.danger:hover { color: var(--bad); border-color: var(--bad); }
.qcard { text-align: left; background: linear-gradient(180deg, var(--navy-3), var(--navy-2)); border: 2px solid var(--gold-3); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; height: 128px; overflow: hidden; transition: transform 0.12s, box-shadow 0.12s; position: relative; color: #fff; width: 100%; font-weight: 700; }
.qcard:hover { transform: translateY(-2px); box-shadow: 0 0 0 3px var(--gold), 0 8px 16px rgba(0, 0, 0, 0.35); }
.qcard .pts { font-family: var(--font-display); font-style: italic; font-size: 24px; line-height: 1; color: var(--gold); display: flex; align-items: center; gap: 6px; }
.qcard .qtext { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qcard .qans { font-size: 12px; color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: auto; }
.qcard .qans::before { content: '→ '; }
.qcard .flags { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.qcard .flag { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; }
.qcard .flag.warn { background: var(--orange); color: #fff; }
.qcard .flag.img { background: rgba(255, 255, 255, 0.2); color: #fff; }
.qcard.empty { background: rgba(var(--navy-rgb), 0.55); border-style: dashed; }
.qcard.empty .qtext { color: rgba(255, 255, 255, 0.65); font-style: italic; }
.qcard.unsure { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.col-error { border: 2px dashed #ff9b8f; border-radius: 12px; padding: 14px; font-size: 14px; color: #ffd8d2; background: rgba(214, 58, 47, 0.25); display: flex; flex-direction: column; gap: 10px; }
.col-add { border: 3px dashed rgba(255, 220, 120, 0.6); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; align-self: start; color: var(--cream); }
.col-add h3, .col-add .col-add-title { font-family: var(--font-display); font-style: italic; font-size: 22px; }
.col-add .input, .col-add .select { border-color: transparent; }
.mc-list { display: flex; flex-direction: column; gap: 8px; }
.mc-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 32px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 14px; border: 2px solid transparent; }
.mc-row.ok { background: var(--good-soft); border-color: var(--good); }
.mc-letter { width: 32px; height: 32px; border-radius: 50%; background: var(--cobalt); color: #fff; border: 2px solid var(--navy); display: grid; place-items: center; font-family: var(--font-display); font-style: italic; font-size: 17px; }
.mc-row.ok .mc-letter { background: var(--good); }
.mc-row .switch { font-size: 13px; }
.qcard .flag.mc { width: auto; padding: 0 5px; background: var(--gold); color: var(--navy); font-size: 9px; font-weight: 900; letter-spacing: 0.04em; }
.sheet-choices { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.sheet-choices .a { color: var(--good); font-weight: 900; }
.img-drop { border: 3px dashed var(--line-2); border-radius: var(--r); min-height: 120px; display: grid; place-items: center; color: var(--ink-3); background: #fff; position: relative; overflow: hidden; cursor: pointer; text-align: center; padding: 12px; font-size: 14px; }
.img-drop:hover, .img-drop.dragover { border-color: var(--cobalt); color: var(--cobalt); background: #f2f5ff; }
.img-drop img { max-height: 220px; border-radius: 8px; }

.sheet { display: flex; flex-direction: column; gap: 18px; }
.sheet h3 { font-family: var(--font-display); font-style: italic; font-size: 26px; color: var(--cobalt); margin-bottom: 6px; }
.sheet ol { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.sheet li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; font-size: 15px; }
.sheet li .p { font-weight: 900; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sheet li .a { color: var(--good); font-weight: 900; }

/* ═══ Library ═══ */
.lib-tools { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.quiz-card { background: var(--paper); border: 3px solid var(--navy); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 6px 0 var(--navy); transition: transform 0.12s; }
.quiz-card:hover { transform: translateY(-3px); }
.quiz-card h3, .quiz-card .quiz-card-title { font-family: var(--font-display); font-style: italic; font-size: 28px; line-height: 1.05; word-break: break-word; }
.quiz-card .cats { display: flex; flex-wrap: wrap; gap: 5px; }
.quiz-card .cats span { font-size: 12px; font-weight: 800; color: var(--navy); background: var(--cream-2); border-radius: 999px; padding: 2px 10px; }
.quiz-card .meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-weight: 700; }
.quiz-card .actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; align-items: center; }
.mini-preview { display: grid; gap: 4px; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, var(--navy-2), var(--navy)); border: 3px solid var(--gold-3); }
.mini-preview i { height: 11px; border-radius: 3px; background: var(--gold); opacity: 0.9; }
.mini-preview i.h { background: var(--cream); opacity: 1; }

/* ═══ Preview ═══ */
.preview-hero { border-bottom: 5px solid var(--navy); }
.preview { max-width: 900px; margin: 0 auto; padding: 60px 0 56px; text-align: center; position: relative; z-index: 1; }
.preview h1 { font-size: clamp(54px, 9vw, 110px); line-height: 0.95; margin: 18px 0 12px; word-break: break-word; transform: rotate(-2deg); }
.preview .meta { display: inline-block; background: var(--navy); color: var(--cream); padding: 6px 16px; border-radius: 999px; font-weight: 800; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 28px 0 34px; }
.cat-chips .plate { font-size: 22px; padding: 8px 18px 6px; }
.preview .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; }
.preview .fine { margin-top: 40px; font-size: 14px; color: var(--ink-2); }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 900; color: var(--navy); background: var(--gold); border: 3px solid var(--navy); padding: 4px 14px; border-radius: 999px; box-shadow: 0 3px 0 var(--navy); }
.linklike { background: none; border: 0; color: var(--ink-2); text-decoration: underline; padding: 0; font-size: inherit; font-weight: 700; }
.linklike:hover { color: var(--navy); }

/* ═══ About ═══ */
.prose { max-width: 780px; padding-bottom: 20px; }
.prose h2 { font-family: var(--font-display); font-style: italic; font-size: 38px; margin: 42px 0 10px; scroll-margin-top: 100px; color: var(--cobalt); }
.prose p, .prose li { color: var(--ink-2); margin-bottom: 10px; font-weight: 600; }
.prose ul { padding-left: 22px; }

/* ═══ Play ═══ */
.play { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: 10; color: #fff; }
.play-top { display: flex; align-items: center; gap: 10px; padding: 10px 18px 4px; }
.play-title { font-size: clamp(30px, 4vw, 56px); flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 10px 8px; line-height: 1.05; }
.play-btn { width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--navy); background: var(--cream); color: var(--navy); display: grid; place-items: center; box-shadow: 0 3px 0 var(--navy); text-decoration: none; transition: transform 0.08s; }
.play-btn:hover { transform: translateY(-1px); background: #fff; }
.play-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy); }
.play-btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.play-top .group { display: flex; gap: 8px; align-items: center; min-width: 0; }
.board-wrap { flex: 1; min-height: 0; padding: 8px 18px 6px; overflow: auto; display: flex; }
.board-wrap .marquee { flex: 1; display: flex; min-width: 600px; padding: 22px; }
.board-wrap .marquee-inner { flex: 1; display: flex; padding: 12px; }
.board { flex: 1; display: grid; gap: 9px; }
.cat-cell { display: grid; place-items: center; text-align: center; padding: 6px 6px 4px; font-size: clamp(13px, min(2.2vw, 3.6vh), 34px); line-height: 1.02; word-break: break-word; }
.cat-cell small { display: block; font-family: var(--font-sans); font-style: normal; font-weight: 900; font-size: 0.42em; letter-spacing: 0.12em; color: var(--cobalt); margin-top: 3px; text-transform: uppercase; }
.tile { display: grid; place-items: center; position: relative; border-radius: 12px; border: 2px solid #b7790a; background: linear-gradient(180deg, #ffe07a 0%, #ffc72c 45%, #eea814 100%); color: var(--navy); font-family: var(--font-display); font-style: italic; font-size: clamp(20px, min(4.6vw, 7.5vh), 74px); text-shadow: 0 2px 0 rgba(255, 255, 255, 0.45); outline: 2.5px dotted rgba(255, 255, 240, 0.95); outline-offset: -8px; box-shadow: inset 0 -5px 0 rgba(150, 95, 5, 0.3), 0 3px 0 rgba(0, 0, 0, 0.3); transition: transform 0.15s, box-shadow 0.15s, filter 0.15s; }
.tile { container-type: size; }
.tile > .v { font-size: clamp(14px, min(64cqh, 32cqw), 80px); line-height: 1; padding-top: 0.06em; }
.tile:hover:not(:disabled) { transform: translateY(-3px) scale(1.02); filter: brightness(1.06); box-shadow: inset 0 -5px 0 rgba(150, 95, 5, 0.3), 0 0 26px rgba(255, 220, 110, 0.85); }
.tile.double { background: linear-gradient(180deg, #fff1b8 0%, #ffd34a 45%, #f39d18 100%); }
.tile.double::before { content: '2×'; position: absolute; top: 8px; right: 12px; font-size: 0.32em; color: var(--cobalt); text-shadow: none; }
.tile:disabled, .tile.used { background: linear-gradient(180deg, #1c3488, #142a72); border-color: #2c4396; outline-color: rgba(255, 220, 120, 0.25); color: transparent; text-shadow: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); cursor: default; }
.tile.used::before { display: none; }
.tile.used .who { position: absolute; bottom: 9px; left: 0; right: 0; display: flex; gap: 5px; justify-content: center; }
.tile.used .who i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--navy); }
.scoreboard { display: flex; gap: clamp(8px, 1.2vw, 16px); padding: 14px 18px clamp(8px, 1.8vh, 16px); justify-content: center; flex-wrap: nowrap; }
.team { --c: var(--gold); position: relative; flex: 0 1 190px; min-width: 0; display: flex; flex-direction: column; align-items: stretch; border-radius: 16px; background: var(--gold); border: 3px solid var(--navy); padding: 6px; box-shadow: 0 5px 0 var(--navy); transition: transform 0.2s; }
.team .tname { font-family: var(--font-display); font-style: italic; font-size: clamp(15px, 2.6vh, 20px); color: var(--navy); text-align: center; background: linear-gradient(180deg, #fff7dc, #f6dfa0); border: 2px solid #c9952a; border-radius: 10px; padding: 4px 10px 2px; display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .tname i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid var(--navy); flex-shrink: 0; }
.team .tscore { font-family: var(--font-display); font-style: italic; font-size: clamp(24px, 5vh, 44px); line-height: 1; text-align: center; color: #fff; background: linear-gradient(180deg, var(--navy-3), var(--navy)); border-radius: 10px; margin-top: 5px; padding: clamp(3px, 0.9vh, 8px) 10px clamp(2px, 0.7vh, 6px); font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.team .tscore.neg { color: #ff9b8f; }
.team .adj { display: flex; gap: 4px; margin-top: 5px; }
@media (max-height: 760px) { .team .adj { display: none; } }
@media (max-height: 820px) { .board-wrap { padding-top: 4px; } .board-wrap .marquee { padding: 14px; } .board-wrap .marquee-inner { padding: 8px; } .board { gap: 6px; } .scoreboard { padding-top: 10px; } .play-title { font-size: clamp(24px, 3.4vw, 44px); padding-bottom: 4px; } }
.team .adj button { flex: 1; background: rgba(255, 255, 255, 0.6); border: 2px solid var(--navy); border-radius: 8px; font-size: 12px; font-weight: 900; color: var(--navy); padding: 2px 6px; }
.team .adj button:hover { background: #fff; }
.team.turn { transform: translateY(-6px) scale(1.04); box-shadow: 0 5px 0 var(--navy), 0 0 30px rgba(255, 215, 90, 0.9); }
.team.turn .tscore { color: var(--gold); }
.team .turn-tag { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--cobalt); color: #fff; border: 2px solid var(--navy); border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: 0.1em; padding: 1px 10px; white-space: nowrap; z-index: 1; }
.team.pop { animation: teamPop 0.5s ease; }
@keyframes teamPop { 30% { transform: scale(1.1); } }

.setup { position: fixed; inset: 0; z-index: 20; overflow-y: auto; padding: 36px 16px; display: flex; justify-content: center; align-items: flex-start; }
.setup-card { width: min(100%, 640px); display: flex; flex-direction: column; gap: 22px; position: relative; z-index: 1; }
.setup-card h1 { font-size: clamp(48px, 8vw, 84px); text-align: center; line-height: 1; transform: rotate(-2deg); }
.setup-card .sub { text-align: center; }
.setup-card .sub span { display: inline-block; background: var(--navy); color: var(--cream); padding: 5px 16px; border-radius: 999px; font-weight: 800; }
.team-edit { display: grid; grid-template-columns: 38px 1fr 40px; gap: 8px; align-items: center; }
.team-color { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy); }

.qview { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; animation: qIn 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.15); color: #fff; }
@keyframes qIn { from { opacity: 0; transform: scale(0.92); } }
.q-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 14px 20px; }
.q-top .left { display: flex; gap: 12px; align-items: center; }
.q-top .right { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.q-head { text-align: center; }
.q-head .cat { font-size: clamp(16px, 2.2vw, 26px); padding: 6px 22px 4px; display: inline-block; }
.q-head .pts { font-family: var(--font-display); font-style: italic; font-size: clamp(26px, 3vw, 40px); color: var(--gold); margin-top: 4px; -webkit-text-stroke: 0.08em var(--navy); paint-order: stroke fill; text-shadow: 0 3px 0 var(--navy); }
.timer { position: relative; width: 88px; height: 88px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--cream); border: 4px solid var(--navy); box-shadow: 0 5px 0 var(--navy); cursor: pointer; }
.timer svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .track { stroke: var(--cream-2); }
.timer .bar { stroke: var(--cobalt); transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer .t { position: relative; font-family: var(--font-sans); font-weight: 900; font-size: 30px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--navy); }
.timer .t.long { font-size: 21px; }
.timer.urgent .bar { stroke: var(--bad); }
.timer.urgent .t { color: var(--bad); animation: pulse 1s infinite; }
.timer.paused .t { color: var(--ink-3); }
@keyframes pulse { 50% { opacity: 0.45; } }
.q-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 30px; padding: 24px 6vw; text-align: center; }
.q-text { line-height: 1.08; max-width: 1300px; word-break: break-word; color: var(--cream); }
.q-text.s1 { font-size: clamp(42px, 7vw, 110px); }
.q-text.s2 { font-size: clamp(36px, 5.6vw, 84px); }
.q-text.s3 { font-size: clamp(30px, 4.5vw, 66px); }
.q-text.s4 { font-size: clamp(26px, 3.5vw, 52px); }
.q-image { max-width: min(80vw, 900px); max-height: 44vh; border-radius: 16px; border: 5px solid var(--cream); box-shadow: 0 8px 0 var(--navy), var(--shadow-lg); }
.q-answer { font-family: var(--font-display); font-style: italic; font-size: clamp(32px, 4.6vw, 70px); color: var(--navy); background: linear-gradient(180deg, #ffe07a, #ffc72c 50%, #eea814); border: 4px solid var(--navy); border-radius: 22px; padding: 16px 44px 12px; box-shadow: 0 7px 0 var(--navy); animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.3); max-width: 1200px; word-break: break-word; position: relative; }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(0.9); } }
.q-reveal { min-width: 260px; }
.q-foot { padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 12px; align-items: center; background: linear-gradient(180deg, transparent, rgba(6, 17, 56, 0.7)); }
.award-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.award-team { --c: var(--gold); display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 16px; border: 3px solid var(--navy); background: var(--cream); color: var(--navy); box-shadow: 0 4px 0 var(--navy); transition: transform 0.12s; }
.award-team.sel { transform: translateY(-3px); box-shadow: 0 4px 0 var(--navy), 0 0 0 4px var(--gold); }
.award-team .n { font-family: var(--font-display); font-style: italic; font-size: 20px; display: flex; align-items: center; gap: 7px; padding-top: 2px; cursor: pointer; background: none; border: 0; color: var(--navy); }
.award-team .n i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid var(--navy); }
.award-team .n .k { font-family: var(--font-mono); font-style: normal; font-size: 11px; color: var(--ink-3); }
.award-btn { width: 42px; height: 42px; border-radius: 11px; border: 2px solid var(--navy); background: #fff; display: grid; place-items: center; color: var(--navy); }
.award-btn.ok:hover, .award-btn.ok.on { background: var(--good); color: #fff; }
.award-btn.no:hover, .award-btn.no.on { background: var(--bad); color: #fff; }
.award-team .res { font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; min-width: 54px; text-align: center; }
.award-team .res.pos { color: var(--good); }
.award-team .res.neg { color: var(--bad); }
.q-hint { font-size: 13px; color: rgba(255, 255, 255, 0.85); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; font-weight: 700; }

/* Played tiles can be reopened */
.tile.used { cursor: pointer; }
.tile.used:hover { transform: none; filter: brightness(1.35); box-shadow: inset 0 0 0 2px rgba(255, 220, 120, 0.55); }
.tile .reopen { display: inline-flex; align-items: center; gap: 6px; font-size: clamp(14px, min(30cqh, 16cqw), 30px); color: var(--gold-2); opacity: 0; transition: opacity 0.15s; text-shadow: none; }
.tile.used:hover .reopen, .tile.used:focus-visible .reopen { opacity: 0.9; }
.replay-tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; background: var(--navy); color: var(--gold-2); border: 2px solid var(--gold); border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 800; }

/* Multiple choice in the game */
.q-text.with-choices.s1 { font-size: clamp(34px, 5.4vw, 84px); }
.q-text.with-choices.s2 { font-size: clamp(30px, 4.4vw, 66px); }
.q-text.with-choices.s3 { font-size: clamp(26px, 3.6vw, 52px); }
.q-text.with-choices.s4 { font-size: clamp(22px, 2.9vw, 42px); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.6vh, 18px) clamp(12px, 1.6vw, 24px); width: min(100%, 1200px); }
.choices.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--cream); color: var(--navy); border: 4px solid var(--navy); border-radius: 18px; padding: clamp(8px, 1.4vh, 14px) 18px; box-shadow: 0 6px 0 var(--navy); font-weight: 900; font-size: clamp(18px, min(2.2vw, 3.4vh), 34px); line-height: 1.15; transition: transform 0.25s, opacity 0.3s, background 0.3s, box-shadow 0.3s; animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; }
.choice:nth-child(2) { animation-delay: 0.08s; }
.choice:nth-child(3) { animation-delay: 0.16s; }
.choice:nth-child(4) { animation-delay: 0.24s; }
.choice:nth-child(5) { animation-delay: 0.32s; }
.choice:nth-child(6) { animation-delay: 0.4s; }
.choice .letter { flex-shrink: 0; width: 1.9em; height: 1.9em; border-radius: 50%; display: grid; place-items: center; background: var(--cobalt); color: #fff; border: 3px solid var(--navy); font-family: var(--font-display); font-style: italic; font-size: 0.95em; }
.choice .ctext { min-width: 0; word-break: break-word; }
.choice.correct { background: linear-gradient(180deg, #ffe07a, #ffc72c 50%, #eea814); transform: scale(1.04); box-shadow: 0 6px 0 var(--navy), 0 0 34px rgba(255, 215, 90, 0.85); }
.choice.correct .letter { background: var(--good); }
.choice.wrong { opacity: 0.38; transform: scale(0.97); }

.winner { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: clamp(10px, 2.5vh, 30px) 16px; overflow-y: auto; text-align: center; animation: fade 0.4s; }
.winner.sunburst { background: repeating-conic-gradient(from 0deg at 50% 50%, var(--cobalt) 0deg 9deg, var(--gold) 9deg 18deg); }
.winner-rays { position: absolute; inset: -50%; z-index: -1; background: inherit; animation: spinRays 40s linear infinite; }
@keyframes spinRays { to { transform: rotate(360deg); } }
.winner > *:not(.winner-rays):not(.confetti) { position: relative; z-index: 1; }
.winner .host { height: auto; width: clamp(90px, min(18vw, 20vh), 230px); margin-bottom: -20px; filter: drop-shadow(0 8px 10px rgba(var(--navy-rgb), 0.4)); animation: bob 1.4s ease-in-out infinite; }
.winner .label { font-family: var(--font-display); font-style: italic; font-size: 26px; color: var(--navy); background: var(--cream); border: 3px solid var(--navy); border-radius: 999px; padding: 4px 22px 2px; box-shadow: 0 4px 0 var(--navy); }
.winner .wname { font-size: clamp(44px, min(11vw, 13vh), 150px); line-height: 0.95; margin: clamp(4px, 1.4vh, 12px) 0 6px; word-break: break-word; transform: rotate(-2deg); }
.winner .wscore { font-family: var(--font-display); font-style: italic; font-size: 32px; color: var(--navy); background: var(--gold); border: 3px solid var(--navy); border-radius: 999px; padding: 2px 22px 0; box-shadow: 0 4px 0 var(--navy); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: clamp(12px, 3vh, 30px) 0; flex-wrap: wrap; }
.place { --c: var(--gold); width: 150px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.place .pn { font-family: var(--font-display); font-style: italic; font-size: 20px; color: var(--navy); background: var(--cream); border: 2px solid var(--navy); border-radius: 999px; padding: 2px 12px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place .ps { font-family: var(--font-display); font-size: 28px; color: #fff; -webkit-text-stroke: 0.08em var(--navy); paint-order: stroke fill; }
.place .block { width: 100%; border-radius: 14px 14px 4px 4px; border: 3px solid var(--navy); background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); display: grid; place-items: center; font-family: var(--font-display); font-size: 54px; color: var(--navy); box-shadow: 0 5px 0 var(--navy); }
.place.p1 .block { height: min(150px, 15vh); }
.place.p2 .block { height: min(110px, 11vh); }
.place.p3 .block { height: min(80px, 8vh); }
.place.p4 .block { height: min(56px, 6vh); font-size: 32px; }
.winner .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 201; }

/* ═══ Responsive ═══ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 40px; }
  .hero-host { left: auto; right: -10px; bottom: -40px; width: 170px; }
  .steps, .features { grid-template-columns: 1fr 1fr; }
  .steps { row-gap: 40px; }
  .pricing { grid-template-columns: 1fr; }
  .create-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .container { padding: 0 16px; }
  .brand-name { font-size: 23px; }
  .header-inner { gap: 8px; }
  .nav { gap: 0; }
  .nav-link { padding: 6px 7px; font-size: 13px; }
  .credit-chip .coin { width: 18px; height: 18px; font-size: 10px; }
  .hero-grid { padding-top: 56px; }
  .nav-sep { display: none; }
  .credit-chip { margin-left: 2px; padding: 4px 10px 4px 6px; font-size: 13px; }
  .credit-chip .label-long { display: none; }
  .hero h1 { font-size: 54px; }
  .hero .lead { font-size: 16px; }
  .hero-host { width: 96px; right: -8px; bottom: -26px; }
  .cta-host { display: none; }
  .steps, .features, .opt-grid { grid-template-columns: 1fr; }
  .cat-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .cat-row .idx { display: none; }
  .cat-row .select { grid-column: 1; }
  .cat-row .btn-icon { grid-row: 1; grid-column: 2; }
  .title-input { font-size: 28px; min-width: 0; width: 100%; flex-basis: 100%; }
  .btn-marquee { font-size: 21px; padding: 12px 28px; min-height: 60px; }
  .cta-band { padding: 34px 20px; }
  .q-top { grid-template-columns: auto 1fr; }
  .q-top .right { grid-column: 1 / -1; justify-content: center; }
  .q-head { text-align: right; }
  .team { min-width: 0; flex: 1 1 140px; }
  .team .tscore { font-size: 32px; }
  .play-top .hide-sm { display: none; }
  .choices, .choices.many { grid-template-columns: 1fr; }
  .mc-row { grid-template-columns: 30px minmax(0, 1fr) 32px; }
  .mc-row .switch { grid-column: 2; grid-row: 2; }
  .footer-links { margin-left: 0; }
}

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

/* ═══ Print (answer sheet) ═══ */
@media print {
  body { background: #fff; color: #000; }
  body > *:not(.modal-backdrop) { display: none !important; }
  .modal-backdrop { position: static; background: none; backdrop-filter: none; padding: 0; display: block; }
  .modal { width: 100%; max-height: none; border: 0; box-shadow: none; background: #fff; }
  .modal-head { background: none; border: 0; }
  .modal-head h2 { color: #000; -webkit-text-stroke: 0; text-shadow: none; }
  .modal-head .btn, .modal-foot { display: none !important; }
  .modal-body { overflow: visible; }
  .sheet h3 { color: #000; }
  .sheet li .a { color: #000; }
  .sheet section { break-inside: avoid; }
}

/* ═══ Added in the launch fixes ═══ */
/* Toasts move to the top while a dialog is open, so they never cover its buttons. */
body:has(.modal-backdrop) .toasts { bottom: auto; top: 18px; }
/* Long question + long answer: smaller text so both fit on screen. */
.qview.compact .q-text { font-size: clamp(20px, 2.4vw, 38px); }
.qview.compact .q-answer { font-size: clamp(20px, 2.6vw, 40px); padding: 10px 30px 8px; }
.qview.compact .q-body { gap: 18px; }
/* Keyboard shortcuts mean nothing on a touch screen. */
@media (hover: none) and (pointer: coarse) { .q-hint, .kbd-tip, .award-team .n .k { display: none; } }
/* The dark "+ New category" column needs light form fields. */
.col-add .input, .col-add .select { background-color: var(--cream); }
.col-add .select { color: var(--navy); }
/* Editor board: hint that the board scrolls sideways. */
.board-scroll-wrap { position: relative; }
.scroll-hint { position: absolute; z-index: 5; right: 8px; top: 18px; display: inline-flex; align-items: center; gap: 4px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 900; padding: 6px 10px 6px 12px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); pointer-events: none; }
.editor-page .col-name { text-overflow: ellipsis; }
/* Shown when the browser blocks localStorage. */
.storage-banner { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px; background: var(--warn-soft); color: #7a3f00; border-bottom: 3px solid var(--warn); font-weight: 800; font-size: 14px; text-align: left; }
.callout.good { border-color: var(--good); background: var(--good-soft); color: #14532d; }
/* Credit packs in the Credits dialog. */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px 12px; border: 3px solid var(--navy); border-radius: 16px; background: #fff; color: var(--navy); box-shadow: 0 4px 0 var(--navy); transition: transform 0.1s; }
.pack:hover:not(:disabled) { transform: translateY(-2px); background: var(--paper); }
.pack:disabled { opacity: 0.6; cursor: progress; }
.pack.best { background: var(--gold-2); }
.pack-tag { position: absolute; top: -12px; background: var(--cobalt); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 2px solid var(--navy); }
.pack-credits { font-family: var(--font-display); font-style: italic; font-size: 34px; line-height: 1; color: var(--cobalt); }
.pack-sub { font-size: 12px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em; }
.pack-price { font-size: 17px; font-weight: 900; margin-top: 4px; }
/* Many teams: one compact scoring row under the question. */
.award-row.many { gap: 8px; }
.award-row.many .award-team { gap: 4px; padding: 4px 4px 4px 10px; border-width: 2px; box-shadow: 0 3px 0 var(--navy); }
.award-row.many .award-team .n { font-size: 16px; gap: 5px; }
.award-row.many .award-team .res { min-width: 34px; font-size: 13px; }
.award-row.many .award-btn { width: 32px; height: 32px; border-radius: 9px; }
/* Narrow phones: the longer brand name needs a tighter header. */
@media (max-width: 480px) {
  .header-inner { gap: 6px; }
  .brand-name { font-size: 20px; padding-right: 2px; }
  .nav-link { padding: 6px 5px; font-size: 12.5px; }
  .credit-chip { margin-left: 0; padding: 3px 8px 3px 5px; font-size: 12.5px; border-width: 2px; }
}
@media (max-width: 359px) {
  .brand-name { font-size: 17px; }
  .nav-link { padding: 5px 3px; font-size: 11.5px; letter-spacing: -0.01em; }
}
/* Grid columns must be allowed to shrink below their content's min-width on phones. */
@media (max-width: 980px) {
  .create-layout, .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .create-layout > *, .hero-grid > * { min-width: 0; }
}
@media (max-width: 360px) {
  .hero h1 { font-size: 44px; }
}
@media (max-width: 480px) {
  .panel-title { flex-wrap: wrap; row-gap: 8px; font-size: 24px; }
  .panel { padding: 18px 16px; }
}
/* Phone editor bar: back + title on one row, all actions on the next. */
@media (max-width: 640px) {
  .editor-bar-inner { gap: 6px; }
  .title-input { flex: 1 1 calc(100% - 60px); flex-basis: calc(100% - 60px); font-size: 26px; }
  .editor-bar-inner .btn-icon { width: 40px; height: 40px; }
  .editor-bar-inner .btn-blue > span:not(.icon) { display: none; }
  .editor-bar-inner .btn-blue { padding-inline: 12px; }
  .save-state { font-size: 0; gap: 0; margin-right: auto; }
  .save-state::before { width: 11px; height: 11px; }
}
/* "Made with FastJeopardy · fastjeopardy.com" on the game board and winner screen. */
.made-with { position: absolute; right: 16px; bottom: 6px; font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.02em; pointer-events: none; white-space: nowrap; }
.made-with b { font-weight: 900; color: rgba(255, 255, 255, 0.75); }
.winner-made-with { margin-top: 14px; font-size: clamp(15px, 1.8vw, 22px); font-weight: 900; color: var(--navy); background: rgba(255, 244, 216, 0.92); border: 3px solid var(--navy); border-radius: 999px; padding: 6px 18px; box-shadow: 0 4px 0 var(--navy); }
.winner-made-with .site { color: var(--cobalt); }
@media (max-width: 640px) { .made-with { display: none; } }
.winner .wname.many { font-size: clamp(36px, min(7vw, 9vh), 96px); }
/* ═══ Fit-to-screen pass ═══ */
/* Editor: long category names wrap (max 2 lines) instead of being cut off. */
.board-editor { grid-auto-columns: minmax(140px, 1fr); }
.editor-page .col-name { resize: none; overflow: hidden; display: block; line-height: 1.12; font-size: 20px; min-height: 0; field-sizing: content; max-height: calc(2 * 1.12em + 12px); text-overflow: clip; word-break: break-word; }
.col-add { padding: 12px; }
.col-add .col-add-title { font-size: 19px; }
/* Game setup: everything on one screen. */
.setup { align-items: safe center; padding: clamp(12px, 3vh, 36px) 16px; }
.setup-card { width: min(100%, 980px); gap: clamp(10px, 1.8vh, 22px); }
.setup-card h1 { font-size: clamp(38px, min(7vw, 8.5vh), 84px); }
.setup-panels { display: grid; grid-template-columns: 1fr; gap: clamp(10px, 1.8vh, 20px); }
.setup-panels .panel { gap: clamp(10px, 1.6vh, 18px); padding: clamp(16px, 2.4vh, 24px); }
.setup-panels .panel + .panel { margin-top: 0; }
.setup .team-edit + .team-edit { margin-top: 0; }
.setup-back { position: fixed; top: 16px; left: 16px; z-index: 2; }
.setup .kbd-tip { margin-top: -4px; }
@media (min-width: 900px) { .setup-panels { grid-template-columns: 1.15fr 1fr; align-items: start; } }
@media (max-width: 640px) { .setup-back { position: static; align-self: flex-start; } }
/* Game board: the quiz title is centred on the screen, not between uneven button groups. */
.play-top { display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; }
.play-top .group:last-child { justify-self: end; }
.play-title { flex: none; min-width: 0; }
/* Winner rays: a fixed square that covers the screen's diagonal at every angle while it spins
   (the old 2×-sized rectangle left the corners bare at ~45°), and never makes the screen scroll. */
.winner-rays { position: fixed; inset: auto; left: 50%; top: 50%; width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; background: repeating-conic-gradient(from 0deg at 50% 50%, var(--cobalt) 0deg 9deg, var(--gold) 9deg 18deg); pointer-events: none; will-change: transform; }
.winner { overflow-x: hidden; }
/* Editor headers: always room for a two-line name and one row of tools, so tile rows line up. */
.editor-page .col-name { min-height: calc(2 * 1.12em + 8px); font-size: 19px; display: flex; }
.col-tools { flex-wrap: nowrap; gap: 0; }
.col-tools .btn-icon { width: 27px; height: 27px; }
/* Setup with many teams: two columns of teams, compact fields. */
.setup .stack.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.setup .team-edit .input { padding-top: 8px; padding-bottom: 8px; }
.setup .team-edit { grid-template-columns: 32px 1fr 34px; gap: 6px; }
.setup .team-edit .team-color { width: 32px; height: 32px; }
@media (max-width: 899px) { .setup .stack.two-col { grid-template-columns: 1fr; } }
