/* ===========================================================
   BIAS ROULETTE — BEGINNER'S STYLE GUIDE
   Change these colour variables to personalise the entire site.
   "Dark" is the default theme; light-mode values are below.
   =========================================================== */
:root {
  --bg: #0e0e1b;
  --panel: #181827;
  --panel-2: #202033;
  --field-bg: #131322;
  --text: #f8f5ff;
  --muted: #a6a1b8;
  --muted-2: #77748d;
  --line: #343148;
  --accent: #f77baa;
  --accent-2: #aa92ff;
  --accent-text: #21121f;
  --glow: rgba(248, 108, 164, .2);
  --shadow: 0 26px 90px rgba(0, 0, 0, .24);
  --radius: 26px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Light mode is activated via the moon/sun button. */
body[data-theme="light"] {
  --bg: #f7f3fb;
  --panel: #ffffff;
  --panel-2: #f7f3fc;
  --field-bg: #f9f7fd;
  --text: #262038;
  --muted: #777088;
  --muted-2: #8c859a;
  --line: #e6e0ed;
  --accent: #e95492;
  --accent-2: #9271ec;
  --accent-text: #ffffff;
  --glow: rgba(233, 84, 146, .12);
  --shadow: 0 25px 55px rgba(75, 49, 110, .09);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; position: relative; color: var(--text); background: var(--bg); font: 15px/1.55 var(--font); transition: background-color .25s, color .25s; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
a { color: inherit; }
.container { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.ambient { position: fixed; pointer-events: none; z-index: -1; border-radius: 50%; filter: blur(65px); }
.ambient-one { width: 400px; height: 400px; background: rgba(149, 89, 238, .12); top: 90px; left: -150px; }
.ambient-two { width: 350px; height: 350px; background: rgba(252, 76, 144, .10); bottom: 0; right: -140px; }

.topbar { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 16px; letter-spacing: .055em; font-weight: 950; line-height: 1.03; }
.brand-symbol { width: 43px; height: 43px; border-radius: 15px; background: linear-gradient(135deg, #ff87ba, #b08bff); display: grid; place-items: center; color: #2c1538; font-size: 28px; box-shadow: 0 4px 24px var(--glow); }
.brand-accent { color: var(--accent); }
.brand small { display: block; color: var(--muted-2); font-size: 8px; letter-spacing: .22em; margin-top: 7px; font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot span { background: #63d7a0; box-shadow: 0 0 15px #63d7a077; border-radius: 50%; width: 7px; height: 7px; }
.icon-button { border: 1px solid var(--line); background: var(--panel); color: var(--text); width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; }
.icon-button:hover { border-color: var(--accent-2); }
.main-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, 1fr); align-items: start; gap: 22px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage { min-width: 0; padding: 38px 36px 30px; text-align: center; }
.heading-group { text-align: center; }
.eyebrow { display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: .18em; color: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(34px, 3.75vw, 55px); letter-spacing: -.058em; line-height: 1.05; margin: 13px 0 10px; font-weight: 900; }
h1 em { color: var(--accent); font-style: normal; }
.intro { color: var(--muted); font-size: 14px; margin-bottom: 0; }
.setup-notice { margin: 22px 0 4px; padding: 15px; text-align: left; border-radius: 13px; border: 1px solid var(--accent); background: var(--panel-2); font-size: 12px; }
.setup-notice strong { color: var(--accent); font-size: 13px; }
.setup-notice p { color: var(--muted); margin: 5px 0 0; }
.setup-notice code { font-size: 11px; overflow-wrap: anywhere; }
.wheel-area { padding: 27px 0 24px; display: flex; justify-content: center; }
.wheel-wrap { position: relative; isolation: isolate; width: min(100%, 455px); aspect-ratio: 1 / 1; }
.wheel-wrap::before { content: ""; position: absolute; inset: -12px; border: 1px solid var(--line); border-radius: 50%; }
.wheel-wrap::after { content: ""; position: absolute; inset: 2px; border: 9px solid var(--panel); border-radius: 50%; pointer-events: none; box-shadow: inset 0 0 18px rgba(17, 11, 42, .14); }
.wheel-disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; box-shadow: 0 12px 40px #0003; will-change: transform; }
.wheel-disc canvas { display: block; width: 100%; height: 100%; }
.pointer { position: absolute; z-index: 5; top: -17px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 17px solid transparent; border-right: 17px solid transparent; border-top: 32px solid var(--text); filter: drop-shadow(0 3px 3px #0005); }
.spin-center { position: absolute; z-index: 6; width: 105px; height: 105px; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 7px solid var(--panel); background: #fff; color: #292238; font-weight: 950; font-size: 22px; line-height: 1; letter-spacing: .03em; box-shadow: 0 8px 22px #21162952; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; transition: scale .2s; }
.spin-center small { color: #f168a2; font-size: 17px; }
.spin-center:hover { scale: 1.07; }
.spin-center:disabled { scale: 1; }
.wheel-controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; padding: 11px 17px; font-size: 13px; font-weight: 800; line-height: 1.35; transition: transform .15s, background-color .15s, border-color .15s; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button-primary { background: linear-gradient(110deg, #f67fb1, #ee88c9); color: #261222; border-color: transparent; box-shadow: 0 8px 25px var(--glow); }
.button-subtle { background: var(--panel-2); color: var(--text); }
.button-subtle:hover:not(:disabled) { border-color: var(--accent-2); }
.wheel-footnote { margin: 14px auto 22px; color: var(--muted-2); font-size: 11px; }
.last-result { background: var(--panel-2); border: 1px solid var(--line); border-radius: 17px; display: flex; align-items: center; padding: 16px; gap: 13px; text-align: left; }
.last-result-icon { flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); font-size: 23px; }
.last-result-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.micro-heading { font-size: 10px; font-weight: 950; letter-spacing: .14em; color: var(--accent); }
.last-result-body strong { font-size: 14px; line-height: 1.35; }
.last-result-body > span:last-child { color: var(--muted); font-size: 11px; }
.button-small { font-size: 11px; padding: 8px 11px; background: var(--panel); color: var(--text); }
.editor { padding: 30px 25px 22px; }
.editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.editor-heading h2 { font-size: 27px; letter-spacing: -.04em; margin: 2px 0 0; }
.editor-star { color: var(--accent); }
.count-badge { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 22px; padding: 6px 9px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.editor-intro { margin: 14px 0 21px; color: var(--muted); font-size: 12px; }
.editor-form { background: var(--panel-2); padding: 17px; border: 1px solid var(--line); border-radius: 15px; }
.two-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { color: var(--text); display: flex; flex-direction: column; gap: 7px; font-size: 11px; font-weight: 850; margin-bottom: 12px; }
.optional { display: inline; color: var(--muted-2); font-weight: 500; }
.field input, .field textarea { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: var(--field-bg); color: var(--text); font-size: 12px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.field textarea { resize: vertical; min-height: 77px; }
.field textarea::placeholder, .field input::placeholder { color: var(--muted-2); opacity: .8; }
.form-tip { font-size: 10px; color: var(--muted-2); margin: -2px 0 11px; }
.form-error { font-size: 11px; color: #ff8798; margin: 3px 0 12px; }
.form-actions { display: flex; gap: 8px; }
.button-wide { flex: 1; }
.roster-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 0 11px; }
.roster-heading h3 { font-size: 14px; margin: 0; }
.muted-small { color: var(--muted-2); font-size: 11px; }
.roster-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; max-height: 368px; overflow-y: auto; padding-right: 3px; scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
.roster-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 9px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; }
.roster-item.is-winner { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 15px var(--glow); }
.entry-avatar { flex: 0 0 auto; width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; color: #20162b; font-size: 14px; }
.entry-detail { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.entry-name { font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-meta { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-actions { display: flex; gap: 3px; }
.entry-actions button { background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 7px; padding: 6px; font-size: 11px; }
.entry-actions button:hover { background: var(--panel); color: var(--accent); border-color: var(--line); }
.empty-roster { color: var(--muted); font-size: 12px; padding: 16px; text-align: center; }
.data-actions { border-top: 1px solid var(--line); margin-top: 19px; padding-top: 13px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.text-button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 11px; padding: 6px 0; }
.text-button:hover { color: var(--accent); }
.reset-button { color: var(--muted-2); }
.footer { padding: 28px 0 35px; text-align: center; color: var(--muted-2); font-size: 9px; letter-spacing: .11em; }
.footer span { color: var(--accent); }

/* Automatically displayed result popup */
.result-dialog { width: min(570px, calc(100% - 32px)); max-height: min(88vh, 880px); overflow-y: auto; border: 1px solid var(--line); border-radius: 24px; padding: 23px; color: var(--text); background: var(--panel); box-shadow: 0 35px 110px #000a; }
.result-dialog::backdrop { background: rgba(7, 5, 22, .78); backdrop-filter: blur(9px); }
.result-dialog[open] { animation: popIn .35s cubic-bezier(.2, .8, .2, 1) both; }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.close-button { font-size: 26px; width: 36px; height: 36px; }
.modal-title { text-align: center; padding: 4px 0 23px; }
.winner-crown { color: #ffd18f; font-size: 30px; }
.modal-title .micro-heading { margin: 2px 0 3px; }
.modal-title h2 { font-size: clamp(39px, 6vw, 65px); line-height: 1.03; letter-spacing: -.065em; margin: 4px 0 4px; color: var(--accent); }
.modal-title > p:last-child { margin: 0; color: var(--muted); font-weight: 750; }
.video-label { display: flex; gap: 10px; justify-content: space-between; align-items: center; font-size: 10px; margin-bottom: 10px; }
.video-label strong { letter-spacing: .12em; }
.video-label span { color: var(--muted); }
.player-frame { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 13px; background: #111018; display: grid; place-items: center; }
.video-mount { width: 100%; height: 100%; }
.video-mount iframe, .video-mount > div { display: block; width: 100%; height: 100%; border: 0; }
.video-mount[hidden], .video-placeholder[hidden] { display: none; }
.video-placeholder { text-align: center; padding: 16px; color: #fff; }
.video-placeholder span { display: block; color: var(--accent); font-size: 28px; margin-bottom: 7px; }
.video-placeholder strong { font-size: 14px; }
.video-placeholder p { font-size: 11px; color: #c2bbd0; max-width: 270px; margin: 5px auto 0; }
.video-note { color: var(--muted-2); margin: 9px 0 0; font-size: 10px; }
.modal-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 17px; }
.modal-actions .button { flex: 1 1 140px; text-align: center; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); z-index: 40; pointer-events: none; color: #20142c; background: #f9d5e8; border-radius: 20px; box-shadow: 0 12px 35px #0003; padding: 10px 17px; font-size: 12px; font-weight: 750; opacity: 0; transition: transform .2s, opacity .2s; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
#confettiLayer { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -30px; width: 9px; height: 17px; border-radius: 2px; animation: confettiFall var(--duration, 2.6s) cubic-bezier(.16, .56, .42, 1) forwards; transform: rotate(var(--spin, 0deg)); }
@keyframes confettiFall { 0% { transform: translateY(-20px) rotate(0); opacity: 1; } 100% { transform: translateY(110vh) translateX(var(--drift, 0px)) rotate(var(--spin, 800deg)); opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 1000px) { .main-grid { grid-template-columns: 1fr; } .editor { max-width: 100%; } .roster-list { max-height: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .container { width: min(100% - 26px, 460px); } .topbar { min-height: 82px; } .status-dot { display: none; } .brand { font-size: 14px; } .brand-symbol { width: 39px; height: 39px; } .stage { padding: 31px 15px 19px; } h1 { font-size: 39px; } .wheel-area { padding: 32px 5px 27px; } .wheel-wrap { width: min(100%, 385px); } .spin-center { width: 82px; height: 82px; font-size: 19px; border-width: 5px; } .spin-center small { font-size: 13px; } .wheel-footnote { max-width: 230px; } .editor { padding: 25px 16px 19px; } .roster-list { grid-template-columns: 1fr; } .two-inputs { grid-template-columns: 1fr; gap: 0; } .modal-actions { flex-direction: column; } .modal-actions .button { flex: 0 0 auto; } .result-dialog { padding: 17px; } .last-result { gap: 8px; padding: 12px; } .last-result-icon { width: 34px; height: 34px; } .last-result-body strong { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
