/* Trivia Dice — leaderboard (no inline styles; CSP style-src 'self') */
.lb-top{box-sizing:border-box;width:100%;max-width:1100px;margin:6px auto 0;padding:0 12px}
.lb-top-inner{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#1f2a44;color:#fff;border-radius:12px;padding:8px 12px;font:600 14px/1.3 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.lb-top-title{white-space:nowrap;letter-spacing:.02em}
.lb-top-list{display:flex;gap:8px;flex-wrap:wrap;list-style:none;margin:0;padding:0;flex:1 1 auto}
.lb-chip{display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.12);border-radius:999px;padding:4px 10px;min-width:0;max-width:100%}
.lb-chip .lb-place{opacity:.8;font-weight:500}
.lb-chip .lb-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:14ch}
.lb-chip .lb-score{opacity:.85;font-weight:500}
.lb-open .lb-name{font-style:italic;opacity:.7}
.lb-bottom{margin-top:18px}
.lb-bottom h2{margin:0 0 8px;font-size:1.15rem}
.lb-bottom-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.lb-row{display:grid;grid-template-columns:2em 6.5em 1fr auto;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;background:rgba(0,0,0,.04)}
.lb-row .lb-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.lb-row .lb-score{font-variant-numeric:tabular-nums}
.lb-note{font-size:.85rem;opacity:.75;margin:8px 0 0}
.lb-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:16px}
.lb-modal[hidden]{display:none}
.lb-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(10,14,30,.55)}
.lb-box{position:relative;background:#fff;color:#111;border-radius:16px;padding:20px;width:100%;max-width:380px;box-shadow:0 12px 40px rgba(0,0,0,.35)}
.lb-title{margin:0 0 6px;font-size:1.3rem}
.lb-sub{margin:0 0 12px;word-break:break-word}
.lb-label{display:block;font-weight:600;margin-bottom:6px}
.lb-input{box-sizing:border-box;width:100%;font-size:16px;padding:10px;border:2px solid #1f2a44;border-radius:10px}
.lb-msg{min-height:1.3em;margin:8px 0}
.lb-btns{display:flex;gap:8px;flex-wrap:wrap}
body.lb-locked{overflow:hidden}
@media (max-width:480px){.lb-top-inner{font-size:13px;padding:6px 8px;gap:6px}.lb-chip{padding:3px 8px}.lb-chip .lb-name{max-width:8ch}.lb-row{grid-template-columns:1.6em 5.5em 1fr auto}}
.lb-extra .lb-label{margin-top:10px;font-weight:500}
.lb-check{display:flex;gap:8px;align-items:flex-start;margin-top:8px}
.lb-google{margin-top:10px}
.lb-privacy{font-size:.8rem;opacity:.8;margin:12px 0 0}

/* Trivia Dice v3 */
.howto summary { cursor: pointer; font-weight: 700; }
.howto ol { margin: .5rem 0 0; padding-left: 1.2rem; line-height: 1.45; }
#dice { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
#dice .die { display: flex; flex-direction: column; align-items: center; min-width: 3rem; padding: .25rem .35rem; border-radius: .6rem; border: 2px solid transparent; background: rgba(255,255,255,.08); color: inherit; }
#dice .die-face { font-size: 2.2rem; line-height: 1; }
#dice .die-name { font-size: .65rem; min-height: .8rem; opacity: .8; }
#dice .die-cat { border-color: #f5c84c; }
#dice .held { background: rgba(245,200,76,.28); border-color: #fff; }
.dice-info { text-align: center; font-weight: 600; }
.dice-actions, .risk-row { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .5rem; }
@media (max-width: 480px) { #dice .die { min-width: 2.6rem; } #dice .die-face { font-size: 1.8rem; } }

/* ---- Core v4 loop (GAMIFY-FINAL §1) ---- */
#dice { grid-template-columns: 1.4fr 1fr 1fr; }
#dice .die { min-height: 88px; min-width: 44px; border: 3px solid transparent; font: inherit; color: #2a2148; background: #fff8e7; cursor: pointer; }
#dice .die:disabled { opacity: 1; cursor: default; }
#dice .die-cat { background: #e8f7ff; box-shadow: 0 4px 0 #3aa0d8; }
#dice .die .die-name { font-size: .8rem; font-weight: 700; display: block; margin-top: 4px; }
#dice .die.held { border-color: #2dd4a8; transform: translateY(-3px); }
#dice .die.held::after { content: 'HELD'; display: block; font-size: .7rem; font-weight: 800; color: #0b6b52; }
#dice .die.rolling { animation: td-throw .38s ease-out; }
#dice .die.streak-flame { box-shadow: 0 4px 0 #d4a017, 0 0 14px #ff8a00; }
@keyframes td-throw { 0% { transform: translateY(-14px) rotate(-18deg); } 60% { transform: translateY(3px) rotate(8deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { #dice .die.rolling, body.jackpot .wrap { animation: none !important; } #dice .die { transition: none; } }
.rule-line { margin: 10px 0 0; font-weight: 700; font-size: 1.05rem; }
.rule-twist { color: var(--accent); }
.mult-line { margin: 4px 0 0; color: var(--good); font-weight: 600; min-height: 1.3em; }
.wild-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.wild-row .chosen { outline: 3px solid var(--accent); }
.dice-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dice-actions button { flex: 1 1 140px; }
.q-card #choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.q-card .choice { min-height: 52px; }
.choice.was-answer { background: #1f9e7c; }
.choice.picked-bad { background: #b83a52; }
.timer { margin: 0 0 6px; font-weight: 800; color: var(--accent); font-size: 1.2rem; }
.fact { margin: 6px 0 0; color: #9be7ff; min-height: 1.3em; }
#btn-next { margin-top: 8px; width: 100%; }
.opts { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.opt { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; cursor: pointer; }
.opt input { width: 24px; height: 24px; accent-color: var(--accent); }
button.small { min-height: 44px; padding: 6px 12px; margin-left: auto; }
.tut-dots { text-align: center; letter-spacing: .3em; color: var(--accent); }
body.jackpot .wrap { animation: td-jackpot 1s ease; }
@keyframes td-jackpot { 0%,100% { filter: none; } 30% { filter: brightness(1.35) saturate(1.4); } }
button:focus-visible, .die:focus-visible, input:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
/* High contrast */
body.hc { background: #000; --ink: #fff; --muted: #fff; --card: #111; --btn: #0040ff; --accent: #ffd400; --good: #00ff9c; }
body.hc .card { border: 2px solid #fff; }
body.hc button.secondary { background: #222; border: 2px solid #fff; }
body.hc .fact { color: #fff; }
[hidden] { display: none !important; }

/* GAMIFY r1 #5: small 'twist' tag on the higher number die */
#dice .die .twist-tag { display: block; margin-top: 3px; padding: 0 .35rem; border-radius: .4rem; font-size: .65rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: #2a2148; color: #ffe08a; }
/* GAMIFY r1 #9: seed row = Roll · Daily · Dare a friend (seed text box hidden) */
.seed-row { flex-wrap: wrap; }
.seed-row #share-out { flex-basis: 100%; margin: .25rem 0 0; min-height: 0; }
.seed-row #share-out:empty { display: none; }
/* GAMIFY r1 #7: tip link light on the purple (contrast ≥4.5:1 vs #3d2e6b and #2a2148, checked in test/ui-copy.test.js) */
footer .tip-link, .tip-link { color: #ffe08a; }
footer .tip-link:hover, footer .tip-link:focus-visible { color: #fff3c4; }

/* ---- DesignerBot Batch 1 (how-to + critical layout) ---- */
/* #36: 3 dice → 3 columns (replaces the old 6-dice grid); centered, capped width */
#dice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 560px; margin: 0 auto; }
@media (min-width: 480px) { #dice { grid-template-columns: repeat(3, minmax(120px, 1fr)); } }
/* how-to chip (#6) + panel (#1/#3/#9/#10) */
.howto { padding: 0; }
.howto > .howto-chip { display: flex; align-items: center; gap: .4rem; min-height: 44px; padding: .6rem 1rem; cursor: pointer; font-weight: 600; list-style: none; }
.howto > .howto-chip::-webkit-details-marker { display: none; }
.howto > .howto-chip::before { content: '▸'; color: #ffe08a; }
.howto[open] > .howto-chip::before { content: '▾'; }
.howto-one { margin: 0 1rem .6rem; font-weight: 600; }
.howto-steps { list-style: none; margin: 0; padding: 0 1rem; }
.howto-steps > li { display: flex; gap: .7rem; margin: 0 0 .8rem; }
.howto-steps h3 { margin: 0 0 .15rem; font-size: 1rem; }
.howto-steps p { margin: 0; line-height: 1.45; }
.howto-num { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; background: #ffe08a; color: #2a2148; }
.howto-example { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .45rem; }
.mini-die { padding: .25rem .5rem; border-radius: .45rem; background: #fff8e7; color: #2a2148; font-weight: 700; font-size: .85rem; }
.rule-ex { flex-basis: 100%; font-weight: 700; color: #ffe08a; }
.howto-twist { margin: .2rem 1rem .6rem; }
.howto-twist h3 { margin: 0 0 .4rem; font-size: 1rem; }
.twist-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: .4rem; }
@media (min-width: 600px) { .twist-grid { grid-template-columns: 1fr 1fr; } }
.twist-grid li { display: flex; flex-direction: column; padding: .45rem .6rem; border-radius: .5rem; background: rgba(255,255,255,.07); }
.twist-grid span { font-size: .85rem; opacity: .85; }
.howto-note { margin: 0 1rem .4rem; font-size: .85rem; opacity: .85; }
.howto-cta { position: static; padding: .6rem 1rem .9rem; background: #1a1430; border-radius: 0 0 16px 16px; border-top: 1px solid #ffffff14; }
.howto-cta button { width: 100%; min-height: 48px; }
/* first-run spotlight: bottom sheet, no dimming, dice stay visible */
.tut-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex; justify-content: center; padding: 0 12px 12px; pointer-events: none; }
.tut-sheet .tut-box { pointer-events: auto; max-width: 420px; padding: 14px 16px; }
.tut-sheet .lb-title { margin: 0 0 .25rem; font-size: 1.05rem; }
.tut-sheet .lb-sub { margin: 0 0 .3rem; }
/* .wrap is display:contents on the one-page layout, so padding there does nothing and the tip sheet covers #btn-roll. */
body.tut-on .shell { padding-bottom: 190px; }
.spotlight { position: relative; z-index: 5; outline: 3px solid #ffe08a; outline-offset: 4px; border-radius: 12px; box-shadow: 0 0 0 6px rgba(255,224,138,.25); }
