/* Layout: stage on the left (the wheel is the product), control desk on the right, guide and FAQ below. Single dark look by choice: it matches streaming software. */
:root {
  --bg: #0f0d16;
  --panel: #18151f;
  --panel-2: #211d2b;
  --line: #2e293b;
  --fg: #eeeaf6;
  --muted: #a39cb6;
  --accent: #ffb627;      /* prize gold */
  --accent-ink: #1c1405;
  --live: #4ade80;
  --warn: #f87171;
  --font-display: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 var(--font-body);
  padding-inline: 16px;
  padding-block: 0 48px;
}
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1180px; margin: 0 auto; }

/* Top bar */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.02em; }
.brand-mark { width: 28px; height: 28px; }
.top nav { display: flex; gap: 18px; font-size: 14px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--fg); }

/* Intro */
.intro { padding-block: 4px 18px; }
.intro h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; margin: 0 0 6px; text-wrap: balance; }
.intro p { margin: 0; color: var(--muted); max-width: 65ch; }
.intro p b { color: var(--fg); }

/* Main grid */
.app {
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 860px) { .app { grid-template-columns: minmax(0, 1fr); } }

.stage {
  background: radial-gradient(120% 80% at 50% 0%, #241e33 0%, var(--panel) 60%);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; display: grid; gap: 10px; justify-items: center;
}
.wheel-box { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; }
#wheel { width: 100%; height: 100%; display: block; cursor: pointer; }
.pointer {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 44px; pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.5));
}
.spin-btn {
  font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 8px 30px; cursor: pointer; box-shadow: 0 4px 0 #b77d0e;
  transition: transform .08s, box-shadow .08s;
}
.spin-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b77d0e; }
.spin-btn:disabled { opacity: .55; cursor: default; }
.stage-meta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: 13px; }
.stage-meta b { color: var(--fg); font-variant-numeric: tabular-nums; }

/* Draw style switch */
.modes { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.mode {
  background: none; border: 0; border-radius: 999px; padding: 6px 16px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.mode[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.mode:disabled { cursor: default; }

/* Win effect helpers */
.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(4px, -2px); }
  30%, 50%, 70% { transform: translate(-7px, 3px); }
  40%, 60% { transform: translate(7px, -3px); }
}

/* Winner card */
.winner {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.winner-card {
  pointer-events: auto;
  background: rgba(15, 13, 22, .92); border: 2px solid var(--accent); border-radius: 14px;
  padding: 18px 28px; text-align: center; max-width: 86%;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  animation: pop .35s cubic-bezier(.2,1.4,.4,1);
}
.winner-card small { display: block; font-family: var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-size: 12px; }
.winner-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 5vw, 40px); line-height: 1.1; margin: 4px 0 12px; overflow-wrap: anywhere; }
.winner-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Desk (controls) */
.desk { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  flex: 1; background: none; border: 0; padding: 12px 10px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 13px;
  color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.pane { padding: 16px; display: grid; gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
label.lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: block; margin-bottom: 4px; }
textarea, input[type="text"], input[type="number"], select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
}
textarea { min-height: 230px; resize: vertical; font-size: 14px; line-height: 1.5; }
.btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5b556b; }
.status.on .dot { background: var(--live); box-shadow: 0 0 0 4px rgba(74,222,128,.15); }
.status.err .dot { background: var(--warn); }
.feed { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; height: 120px; overflow-y: auto; font-size: 13px; color: var(--muted); }
.feed div { overflow-wrap: anywhere; }
.feed b { color: var(--fg); font-weight: 600; }
.copybox { display: flex; gap: 8px; }
.copybox input { font-size: 12px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.history li { display: flex; justify-content: space-between; gap: 10px; background: var(--panel-2); border-radius: 8px; padding: 7px 10px; font-size: 14px; }
.history li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.empty { color: var(--muted); font-size: 14px; }
.pill { font-size: 11px; font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--muted); }

/* Website-only ad slot placeholder (never shown in overlay mode) */
.ad-slot {
  margin-top: 20px; border: 1px dashed var(--line); border-radius: 12px; min-height: 90px;
  display: grid; place-items: center; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}

/* Guide / FAQ */
.guide { margin-top: 44px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .guide { grid-template-columns: minmax(0, 1fr); } }
.guide h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 10px; text-wrap: balance; }
.guide h3 { font-size: 16px; margin: 0 0 4px; }
.guide p, .guide li { color: #cfc9dc; max-width: 65ch; }
.steps { padding-left: 20px; display: grid; gap: 6px; margin: 0; }
.faq-wide { grid-column: 1 / -1; }
.guide h3 { margin-top: 14px; }
details { border-bottom: 1px solid var(--line); padding-block: 10px; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
footer { margin-top: 40px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 16px; }

/* Confetti layer */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; width: 100%; height: 100%; }

/* OBS overlay mode: only the wheel and the winner, on a transparent background */
body.overlay { background: transparent; padding: 0; }
body.overlay .top, body.overlay .desk, body.overlay .guide, body.overlay footer,
body.overlay .intro, body.overlay .ad-slot, body.overlay .spin-btn, body.overlay .stage-meta, body.overlay .winner-actions, body.overlay .modes { display: none !important; }
body.overlay .app { display: block; }
body.overlay .stage { background: none; border: 0; padding: 8px; }
body.overlay .wrap { max-width: none; }

@media (prefers-reduced-motion: reduce) {
  .winner-card { animation: none; }
}

/* Site nav: wraps under the brand on phones */
.top nav { flex-wrap: wrap; row-gap: 6px; }
.top nav a[aria-current="page"] { color: var(--accent); }
.brand { color: var(--fg); text-decoration: none; }

/* Footer page list */
.foot-pages { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.foot-pages a { color: var(--muted); }

/* Text pages (about, privacy, guides) */
.article { max-width: 720px; margin: 8px auto 0; font-size: 16px; line-height: 1.65; }
.article h1 { font-family: var(--font-display); font-size: clamp(28px, 5vw, 38px); line-height: 1.15; margin: 12px 0 8px; text-wrap: balance; }
.article h2 { font-family: var(--font-display); font-size: 22px; margin: 32px 0 6px; }
.article p, .article li { color: #d6d0e2; }
.article .updated { color: var(--muted); margin: 0 0 20px; }
.article .lead { font-size: 18px; color: var(--fg); }
.cta { display: inline-block; margin-top: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; border-radius: 999px; padding: 8px 20px; }

/* Team generator */
.teams-tool { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
@media (max-width: 860px) { .teams-tool { grid-template-columns: minmax(0, 1fr); } }
.teams-tool .desk .pane { gap: 14px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.team-board { background: radial-gradient(120% 80% at 50% 0%, #241e33 0%, var(--panel) 60%); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-height: 320px; display: grid; gap: 14px; align-content: start; }
.team-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.team { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; animation: pop .3s cubic-bezier(.2,1.4,.4,1) both; }
.team h3 { margin: 0; padding: 8px 12px; font-family: var(--font-display); font-size: 15px; letter-spacing: .04em; color: #15111c; display: flex; justify-content: space-between; }
.team h3 span { font-weight: 500; opacity: .75; }
.team ol { margin: 0; padding: 8px 12px 10px 32px; display: grid; gap: 2px; font-size: 14px; }
.team li { overflow-wrap: anywhere; }
.team li.captain::after { content: " ★ captain"; color: var(--accent); font-size: 12px; }
.board-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.board-empty { color: var(--muted); text-align: center; padding: 60px 10px; }
@media (prefers-reduced-motion: reduce) { .team { animation: none; } }
