:root {
  --bg: #f5f3ff;
  --surface: #ffffff;
  --surface-2: #ede9fe;
  --text: #1e1b4b;
  --muted: #585e6b;
  --border: #ddd6fe;
  --accent: #6d28d9;
  --accent-text: #ffffff;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(76, 29, 149, .12);
}
:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273449;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --accent: #8b5cf6;
  --danger: #f87171;
  --shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #273449;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #8b5cf6;
    --danger: #f87171;
    --shadow: 0 10px 30px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 12px;
  transition: background .15s, transform .1s;
}
button:hover { background: var(--surface-2); }
button:active { transform: scale(.97); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--danger); }
button.wide { width: 100%; margin-top: 12px; }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; font-size: .85em; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.top-actions { display: flex; gap: 6px; }
.icon-btn { padding: 6px 10px; }

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px;
  max-width: 1200px; margin: 0 auto; padding: 20px 16px;
}
.wheel-area { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.wheel-title {
  width: 100%; max-width: 560px; text-align: center; font-size: 1.6rem; font-weight: 800;
  background: transparent; border: 1px dashed transparent; border-radius: 10px; padding: 4px 8px;
}
.wheel-title:hover, .wheel-title:focus { border-color: var(--border); outline: none; }
.wheel-grid { width: min(100%, 600px); display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 8px; }
.wheel-grid[data-count="2"], .wheel-grid[data-count="3"], .wheel-grid[data-count="4"] { width: min(100%, 780px); grid-template-columns: 1fr 1fr; }
.wheel-wrap { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; cursor: pointer; filter: drop-shadow(var(--shadow)); }
.wheel-label { display: none; position: absolute; top: -2px; inset-inline-start: 0; font-weight: 700; font-size: .8rem; color: var(--muted); }
body.multi .wheel-label { display: block; }
body.multi .wheel-wrap { margin-top: 14px; }
.wheel-wrap.active { outline: 3px solid var(--accent); outline-offset: 4px; }
body.multi .pointer { border-left-width: 12px; border-right-width: 12px; border-top-width: 24px; }
body.multi .spin-center { font-size: clamp(.6rem, 1.6vw, .9rem); border-width: 3px; width: 22%; }
.pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent;
  border-top: 36px solid var(--text); filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
}
.spin-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 18%; aspect-ratio: 1; border-radius: 50%; border: 4px solid #fff;
  background: var(--accent); color: #fff; font-weight: 900; font-size: clamp(.8rem, 2.4vw, 1.2rem);
  box-shadow: 0 4px 14px rgba(0,0,0,.3); padding: 0;
}
.spin-center:hover { background: var(--accent); filter: brightness(1.1); }
.spin-center:active { transform: translate(-50%, -50%) scale(.95); }
.spin-center:disabled { cursor: wait; filter: grayscale(.4); }
.hint { color: var(--muted); font-size: .9rem; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 14px; align-self: start; min-width: 0;
}
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab { flex: 1; border: none; background: transparent; font-weight: 600; padding: 8px 4px; border-radius: 8px; }
.tab.active { background: var(--surface-2); color: var(--accent); }
.badge { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; }
.hidden { display: none !important; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.toolbar button { font-size: .85rem; padding: 5px 9px; }
textarea {
  width: 100%; height: 340px; resize: vertical; padding: 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); font-size: 1rem;
}
textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.small { color: var(--muted); font-size: .85rem; margin: 6px 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.presets button { font-size: .8rem; padding: 3px 9px; border-radius: 999px; }
.results { margin: 0; padding-inline-start: 26px; max-height: 380px; overflow: auto; }
.results li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.results li small { color: var(--muted); margin-left: 6px; }
.field { display: block; margin-bottom: 14px; font-weight: 600; }
.field select, .field input[type=range] { display: block; width: 100%; margin-top: 6px; }
select { padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); }
input[type=range] { accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }

.seo { max-width: 1000px; margin: 20px auto; padding: 0 16px; }
.seo h1 { font-size: 1.6rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.card h2 { font-size: 1.05rem; margin: 0 0 4px; }
.card p { margin: 0; color: var(--muted); }
.footer { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; padding: 24px 16px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 30px; }
.footer a { color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .2s; }
.modal-box { background: var(--surface); border-radius: 20px; padding: 28px; text-align: center; width: min(100%, 440px); box-shadow: var(--shadow); animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
.modal-label { margin: 0; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.modal-box h2 { font-size: clamp(1.6rem, 6vw, 2.6rem); margin: 10px 0 22px; word-break: break-word; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions button { padding: 10px 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 60; font-weight: 600; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 55; }

.page { max-width: 760px; margin: 0 auto; padding: 24px 16px; }

body.fs .panel, body.fs .seo, body.fs .footer, body.fs .hint { display: none; }
body.fs .layout { grid-template-columns: 1fr; }
body.fs .wheel-grid { width: min(100%, 86vh); }
body.fs .wheel-grid:not([data-count="1"]) { width: min(100%, 120vh); }
body.fs .subnav, body.fs .breadcrumb, body.fs .count-picker { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .top-actions span { display: none; }
  textarea { height: 220px; }
}

/* ---- v2 additions ---- */
.row { display: flex; gap: 6px; margin-top: 6px; }
.row select { flex: 1; min-width: 0; margin: 0; }
.row button { white-space: nowrap; }
code { background: var(--surface-2); padding: 0 4px; border-radius: 4px; font-size: .9em; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 2px; color: var(--muted); }
.wide-box { width: min(100%, 560px); text-align: start; }
.fair-title { font-size: 1.4rem !important; margin: 0 0 4px !important; }
.fair-scroll { max-height: 50vh; overflow: auto; margin: 10px 0 16px; }
.fair { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fair th, .fair td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: end; }
.fair th:first-child, .fair td:first-child { text-align: start; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fair td.ok { color: #16a34a; }
.fair td.warn { color: #d97706; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.stream, body.stream .layout { background: transparent !important; }
body.stream .topbar, body.stream .subnav, body.stream .breadcrumb, body.stream .count-picker, body.stream .wheel-title, body.stream .panel, body.stream .seo, body.stream .footer, body.stream .hint, body.stream .wheel-label { display: none !important; }
body.stream .layout { grid-template-columns: 1fr; padding: 8px; }
body.stream .wheel-grid { width: min(100%, 96vh); }
body.stream .wheel-grid:not([data-count="1"]) { width: min(100%, 130vh); }
body.stream .wheel-wrap.active { outline: none; }

/* ---- languages ---- */
.top-actions { align-items: center; }
.lang-select { padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); max-width: 150px; }
.lang-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.lang-links a { color: var(--accent); }
[dir="rtl"] body, [dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] button, [dir="rtl"] select {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Nastaliq Urdu", system-ui, sans-serif;
}
:lang(ur) body { line-height: 1.9; }
@media (max-width: 520px) {
  .lang-select { max-width: 96px; }
  .brand { font-size: 1.05rem; }
}
/* monospace fonts can't join Arabic/Urdu letters */
[dir="rtl"] code { font-family: inherit; }

/* ---- multi-wheel controls ---- */
.count-picker { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; font-size: .9rem; color: var(--muted); }
.count-picker button { min-width: 36px; padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.count-picker button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.spin-all { margin-top: 16px; padding: 12px 28px; font-size: 1.1rem; font-weight: 800; border-radius: 999px; box-shadow: var(--shadow); }
.spin-all:disabled { opacity: .6; cursor: wait; }
.wheel-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wheel-tabs button { font-size: .85rem; padding: 5px 10px; border-radius: 999px; }
.wheel-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.winner-list { list-style: none; padding: 0; margin: 12px 0 22px; text-align: start; }
.winner-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.winner-list span { color: var(--muted); font-weight: 600; }
.winner-list b { font-size: 1.3rem; word-break: break-word; }

/* ---- navigation & SEO content ---- */
.skip { position: absolute; top: 8px; inset-inline-start: 16px; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; z-index: 100; background: var(--surface); padding: 6px 12px; border-radius: 8px; }
.subnav { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); justify-content: safe center; }
.subnav a { white-space: nowrap; padding: 5px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; border: 1px solid var(--border); }
.subnav a[aria-current="page"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.breadcrumb ol { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 4px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.breadcrumb li + li::before { content: "›"; margin-inline-end: 6px; }
[dir="rtl"] .breadcrumb li + li::before { content: "‹"; }
.breadcrumb a { color: var(--accent); }
.seo .lead { font-size: 1.08rem; }
.seo h3 { font-size: 1.05rem; margin: 0 0 4px; }
.link-card { text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; display: block; }
.link-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.link-card[aria-current="page"] { border-color: var(--accent); }
.btn-link { display: inline-block; margin: 6px; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; }
.noscript { padding: 16px; text-align: center; }

/* ---- page tools: number range + team maker ---- */
.page-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 10px; margin-bottom: 10px; border-radius: 12px; background: var(--surface-2); }
.page-tools label { display: flex; flex-direction: column; gap: 2px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.page-tools input { width: 84px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 1rem; }
.page-tools input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.page-tools button { padding: 8px 14px; font-weight: 700; }
.teams-box { width: min(100%, 760px); text-align: start; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; margin: 12px 0 18px; }
.team-card { border: 1px solid var(--border); border-top: 5px solid var(--team); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.team-card h3 { margin: 0 0 6px; font-size: 1rem; }
.team-card ol { margin: 0; padding-inline-start: 20px; }
.team-card li { padding: 2px 0; }
.modal-actions { flex-wrap: wrap; }

/* ---- truth or dare prompt ---- */
.winner-prompt { margin: -8px 0 22px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); font-size: 1.15rem; font-weight: 600; line-height: 1.4; }
.page-tools .check { flex-direction: row; font-size: .9rem; color: var(--text); margin: 0; }

/* ---------- merged additions: articles, lucky wheel table, name picker, ads, cookie consent ---------- */
.seo .meta { color: var(--muted); font-size: .9rem; }
.seo h2 { margin-top: 1.6em; }
.seo h3 { font-size: 1.15rem; margin: 1.5em 0 .4em; }
.seo .card h3, .seo .cards h3 { margin: 0 0 4px; font-size: 1.05rem; }
.seo p, .seo li { line-height: 1.65; }
.seo a { color: var(--accent); }
.seo figure { margin: 16px 0; }
.seo figure img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin: 18px 0; }
.toc ol { margin: 6px 0; padding-inline-start: 20px; }
.table-wrap { overflow-x: auto; }
.seo table, .page table, .chance-table table, #cc-modal table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: .95rem; }
.seo th, .seo td, .page th, .page td, .chance-table th, .chance-table td, #cc-modal th, #cc-modal td { border: 1px solid var(--border); padding: 7px 10px; text-align: start; vertical-align: top; }
.seo th, .page th, .chance-table th, #cc-modal th { background: var(--surface-2); }
.disclaimer { border-inline-start: 4px solid #f59e0b; background: var(--surface); padding: 10px 14px; border-radius: 8px; margin: 18px 0; font-size: .95rem; }
.author { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin: 20px 0; background: var(--surface); }
.author .av { width: 46px; height: 46px; border-radius: 50%; background: #6d28d9; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.chance-tools { display: block; }
.chance-table table { margin: 0; background: var(--surface); }
.chance-table caption { text-align: start; color: var(--muted); font-size: .8rem; font-weight: 600; padding-bottom: 4px; }
.pick-list { text-align: start; font-size: 1.25rem; font-weight: 700; max-height: 55vh; overflow: auto; margin: 12px 0 18px; padding-inline-start: 2em; }
.pick-list li { padding: 3px 0; }
#pickTools input { width: 96px; }
.ad-slot { display: none; }
.has-ads .ad-slot { display: block; min-height: 280px; max-width: 1000px; margin: 18px auto; background: var(--surface-2); border-radius: 10px; }
body.fs .ad-slot, body.stream .ad-slot, body.stream #cc-banner, body.stream #cc-revisit { display: none !important; }
.page h1 { font-size: 1.8rem; line-height: 1.25; } .page h2 { font-size: 1.3rem; margin-top: 1.6em; } .page p, .page li { line-height: 1.65; } .page a { color: var(--accent); }
.page.wide { max-width: 1000px; }
.page form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.page form input, .page form textarea { width: 100%; padding: 10px; border: 1px solid #6b7280; border-radius: 10px; background: var(--surface); }
.page form textarea { min-height: 150px; }
.page .card h2 { margin-top: 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 8px; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-inline-end: 6px; }
.topbar .back { color: var(--accent); font-weight: 600; text-decoration: none; }
#cc-banner { position: fixed; inset-inline-start: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 16px; z-index: 60; font-size: .93rem; }
#cc-banner p { margin: 0 0 8px; } #cc-banner a { color: var(--accent); }
.cc-title { font-weight: 800; font-size: 1.05rem; }
.cc-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cc-btns button { flex: 1 1 30%; min-height: 44px; font-weight: 700; border-radius: 10px; padding: 8px 10px; }
button.cc-fill, button.cc-fill:hover { background: #6d28d9; color: #fff; border: 2px solid #6d28d9; }
button.cc-out { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
button.cc-link { background: transparent; border: 2px solid transparent; color: var(--text); text-decoration: underline; }
@media (max-width: 640px) { #cc-banner { inset-inline: 0; bottom: 0; width: 100%; border-radius: 14px 14px 0 0; padding: 8px 12px; font-size: .8rem; line-height: 1.4; max-height: 46vh; overflow: auto; } #cc-banner p { margin-bottom: 4px; } .cc-btns { margin-top: 6px; } }
#cc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70; display: grid; place-items: center; padding: 12px; }
#cc-modal { background: var(--surface); color: var(--text); border-radius: 14px; max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; padding: 20px; position: relative; text-align: start; }
#cc-modal h2 { margin: 0 34px 8px 0; font-size: 1.25rem; }
#cc-x { position: absolute; top: 8px; inset-inline-end: 10px; background: none; border: 0; font-size: 1.8rem; line-height: 1; min-width: 44px; min-height: 44px; }
.cc-row { border-top: 1px solid var(--border); padding: 10px 0; }
.cc-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cc-row p { margin: 4px 0; font-size: .92rem; color: var(--muted); }
.cc-always { color: #047857; font-weight: 700; font-size: .9rem; } :root[data-theme="dark"] .cc-always { color: #34d399; }
.cc-none { font-style: italic; }
.cc-switch { position: relative; width: 48px; height: 28px; margin: 0; flex: none; display: block; }
.cc-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-switch span { position: absolute; inset: 0; background: #6b7280; border-radius: 99px; pointer-events: none; }
.cc-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.cc-switch input:checked + span { background: #6d28d9; } .cc-switch input:checked + span::after { transform: translateX(20px); }
.cc-switch input:focus-visible + span { outline: 3px solid #f59e0b; outline-offset: 2px; }
#cc-revisit { position: fixed; inset-inline-start: 14px; bottom: 14px; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 0; background: #6d28d9; color: #fff; z-index: 50; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.wheel-grid:empty { aspect-ratio: 1; }
.chance-table { min-height: 196px; }

/* v3: H1 above the wheel, card titles that are not headings */
.page-h1 { font-size: .95rem; font-weight: 600; color: var(--muted); margin: 0 0 2px; text-align: center; line-height: 1.3; }
body.fs .page-h1, body.stream .page-h1 { display: none; }
.card .card-t { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.seo > h2:first-of-type { margin-top: .6em; }
