/* XenoRogue Wheel — viewer page + host panel */
body.wheel-page {
  --bg: #07060f;
  --panel: #120e24;
  --panel-2: #1a1433;
  --line: #2c2450;
  --text: #e9e7f5;
  --muted: #9a94b8;
  --purple: #7c3aed;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --green: #22c55e;
  --red: #ef4444;
}
* { box-sizing: border-box; }
body.wheel-page {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, #2a145a 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #0b3b4a 0%, transparent 55%), var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wheel-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.wheel-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.wheel-top a { color: var(--muted); text-decoration: none; font-weight: 600; }
.wheel-top a:hover { color: var(--cyan); }
.wheel-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: .02em; margin: 0; }
.wheel-title span { background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); background: var(--panel); }
.badge.open { color: var(--green); border-color: #14532d; }
.badge.closed { color: var(--red); border-color: #5b1d1d; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.open .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.wheel-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 820px) { .wheel-grid { grid-template-columns: 1fr; } }
.wheel-grid > .card { align-self: start; }
.row input { min-width: 0; }
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.card h2 { margin: 0 0 12px; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.wheel-stage { position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; margin: 0 auto; }
.wheel-stage canvas { width: 100%; height: 100%; display: block; }

body.wheel-page label { display: block; font-weight: 700; font-size: .85rem; color: var(--muted); margin: 10px 0 6px; }
body.wheel-page :is(input[type=text], input[type=password], select, textarea) {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #0b0918; color: var(--text); font: inherit; font-size: 1rem;
}
body.wheel-page :is(input, select, textarea):focus { outline: 2px solid var(--purple); border-color: transparent; }
body.wheel-page textarea { min-height: 140px; resize: vertical; }
.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 800; letter-spacing: .03em; padding: 12px 18px; border-radius: 12px; color: #fff; background: linear-gradient(90deg, var(--purple), #9333ea); transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.cyan { background: linear-gradient(90deg, #0891b2, var(--cyan)); color: #04151b; }
.btn.pink { background: linear-gradient(90deg, #db2777, var(--pink)); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: transparent; border: 1px solid #5b1d1d; color: #fca5a5; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.msg { min-height: 1.4em; margin-top: 10px; font-weight: 700; }
.msg.ok { color: var(--green); }
.msg.err { color: #fca5a5; }
.muted { color: var(--muted); font-size: .9rem; }

.entry-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; display: grid; gap: 6px; }
.entry-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #0b0918; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; }
.entry-list li.me { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.plat { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; }
.plat.twitch { background: #3b1f6e; color: #c4b5fd; }
.plat.youtube { background: #5b1d1d; color: #fca5a5; }
.plat.other { background: #1f2937; color: #cbd5e1; }
.x { background: none; border: 0; color: #fca5a5; cursor: pointer; font-size: 1.1rem; padding: 0 4px; }

.winner-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; text-align: center; padding: 18px 26px; border-radius: 18px; background: rgba(10, 8, 25, .92); border: 2px solid var(--cyan); box-shadow: 0 0 40px rgba(34, 211, 238, .45); transition: all .35s cubic-bezier(.2, 1.4, .4, 1); min-width: 60%; }
.winner-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.winner-banner small { display: block; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); font-size: .8rem; }
.winner-banner strong { display: block; font-size: clamp(1.4rem, 4vw, 2.4rem); font-weight: 900; margin-top: 4px; word-break: break-word; }

.wheel-confetti { position: absolute; top: 40%; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; animation: confetti 2.4s cubic-bezier(.2, .7, .4, 1) forwards; z-index: 5; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; }
}

.winners { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.winners li { padding: 8px 12px; border-radius: 10px; background: #0b0918; border: 1px solid var(--line); font-weight: 600; }
.winners li em { color: var(--cyan); font-style: normal; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-weight: 600; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--purple); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { background: #0b0918; color: var(--muted); border: 0; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--purple); color: #fff; }
.copy { display: flex; gap: 8px; }
.copy input { font-size: .85rem; }
.hidden { display: none !important; }


/* ============================================================
   Themed viewer page (wheel.html) — uses the site's styles.css
   variables so it follows X / XR / R mode.
   ============================================================ */
.wheel-site {
  --cyan: var(--rogue, #ffb7c5);
  --green: #4ade80;
  --red: #ff5a6a;
}
.wx-hero-status { margin-top: 22px; }
.wx-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px;
  font-family: "Orbitron", sans-serif; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  background: var(--panel-strong, rgba(13,10,19,.92)); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.wx-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.wx-pill.open { color: var(--green); border-color: rgba(74,222,128,.35); }
.wx-pill.open .dot { animation: wx-pulse 1.4s infinite; }
.wx-pill.closed { color: var(--red); border-color: rgba(255,90,106,.3); }
@keyframes wx-pulse { 50% { opacity: .3; } }

.wx-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: 22px; align-items: start; }
.wx-side { display: grid; gap: 22px; }
@media (max-width: 900px) { .wx-layout { grid-template-columns: 1fr; } }

.wx-stage-card { position: relative; overflow: hidden; }
.wx-stage-card::before {
  content: ""; position: absolute; inset: -30% -10% auto; height: 70%; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--glow, rgba(106,13,173,.45)), transparent 60%);
  opacity: .55;
}
.wx-stage-head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.wx-stage-head h2 { margin: 6px 0 0; font-family: "Orbitron", sans-serif; text-transform: uppercase; font-size: clamp(22px, 3vw, 34px); line-height: 1.1; }
.wx-count { text-align: right; }
.wx-count strong { display: block; font-family: "Orbitron", sans-serif; font-size: clamp(28px, 4vw, 44px); line-height: 1; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wx-count small { color: var(--muted); font-family: "Rajdhani", sans-serif; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.wheel-site .wheel-stage { max-width: 600px; }
.wx-purpose { position: relative; text-align: center; margin: 14px 0 0; }

.wx-join h3, .wx-side h3 { margin: 6px 0 16px; }
.wx-form { display: grid; gap: 14px; }
.wx-form label { display: grid; gap: 8px; font-family: "Rajdhani", sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .04em; color: var(--muted); }
.wx-form input, .wx-form select {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(9,7,13,.7); color: var(--text);
  font-family: "Rajdhani", sans-serif; font-size: 18px; font-weight: 600;
}
.wx-form input:focus, .wx-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.wx-form .cta-primary { width: 100%; justify-content: center; border: 0; cursor: pointer; }
.wx-form .cta-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.wheel-site .msg { margin: 0; min-height: 1.3em; font-family: "Rajdhani", sans-serif; font-weight: 700; font-size: 16px; }
.wheel-site .msg.ok { color: var(--green); }
.wheel-site .msg.err { color: var(--red); }
.wheel-site .muted { color: var(--muted); }

.wx-entries { max-height: none; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.wheel-site .entry-list li {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  font-family: "Rajdhani", sans-serif; font-size: 18px; font-weight: 700;
}
.wheel-site .entry-list li.me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 24px var(--glow); }
.wheel-site .entry-list li.wx-empty { grid-column: 1 / -1; justify-content: center; font-weight: 500; }
.wheel-site .plat { font-family: "Orbitron", sans-serif; font-size: 10px; letter-spacing: .1em; }
.wheel-site .plat.twitch { background: rgba(145,70,255,.18); color: #c9a7ff; }
.wheel-site .plat.youtube { background: rgba(229,9,20,.18); color: #ff8a8f; }
.wheel-site .plat.other { background: rgba(255,255,255,.08); color: var(--muted); }

.wheel-site .winners li {
  background: rgba(9,7,13,.55); border: 1px solid var(--line); border-radius: 12px;
  font-family: "Rajdhani", sans-serif; font-size: 18px; font-weight: 700;
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.wheel-site .winners li em { font-style: normal; color: var(--rogue); font-size: 15px; }

.wheel-site .winner-banner {
  background: rgba(9,7,13,.94); border: 1px solid var(--accent);
  box-shadow: 0 0 50px var(--glow), inset 0 0 30px rgba(255,255,255,.03);
}
.wheel-site .winner-banner small { font-family: "Cinzel", serif; color: var(--rogue); letter-spacing: .2em; }
.wheel-site .winner-banner strong { font-family: "Orbitron", sans-serif; text-transform: uppercase; background: linear-gradient(90deg, #fff, var(--rogue)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.wx-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.wx-steps li { position: relative; }
.wx-steps b {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  font-family: "Orbitron", sans-serif; font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 0 22px var(--glow);
}
.wx-steps h3 { margin: 16px 0 8px; }
@media (max-width: 820px) { .wx-steps { grid-template-columns: 1fr; } }
