:root {
  --bg: #140a1f;
  --panel: #1e1030;
  --panel2: #29173f;
  --line: #3e245c;
  --ink: #f8f0ff;
  --muted: #aa94c4;
  --accent: #ff5fa8;
  --hot: #ffb347;
  --cool: #6ef0d0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: radial-gradient(1100px 520px at 75% -10%, #5a1a6e 0%, rgba(255,95,168,0.10) 35%, var(--bg) 65%) fixed, var(--bg);
  color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
small { display: block; font-size: 10px; letter-spacing: 0.1em; color: var(--muted); }
.muted { color: var(--muted); }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }

/* header */
.top { display: flex; align-items: center; gap: 28px; max-width: 1440px; margin: 0 auto; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 26px; letter-spacing: -0.02em; font-style: italic; font-family: "Arial Black", Impact, Helvetica, sans-serif; text-shadow: 2px 2px 0 #000; }
.logo b { background: linear-gradient(180deg, #ffb347, #ff5fa8 55%, #a45cff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; padding-right: 0.14em; }
.logo-word { white-space: nowrap; }
.logo-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(180deg, #ffb347, #ff5fa8 60%, #a45cff); border-radius: 50%; box-shadow: 0 0 14px rgba(255,95,168,0.6); }
.top nav { display: flex; gap: 20px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.top nav a.on, .top nav a:hover { color: var(--ink); }
.top nav a.on { border-bottom: 2px solid var(--accent); padding-bottom: 3px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 0.1em; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; color: var(--muted); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.live { color: var(--cool); border-color: #24574c; }
.pill.live i { background: var(--cool); box-shadow: 0 0 8px var(--cool); }
.profile { display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 12px 5px 6px; text-align: left; }
.profile small { letter-spacing: 0; font-size: 11px; color: var(--accent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; flex: none; }

.tagline { font-size: 16px; font-weight: 900; font-style: italic; letter-spacing: 0.02em; text-transform: uppercase; margin: 16px 0 12px; }
.age { font-size: 10px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; color: var(--muted); vertical-align: middle; margin-left: 6px; }

/* main layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.stage { overflow: hidden; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #000; }
/* The player is enlarged and shifted so the top and left edges of the video, and the player's badge along the bottom, fall outside the frame. */
.screen { overflow: hidden; }
.screen { container-type: inline-size; }
/* Shows the picture from 26% across to the right edge and from 17% down, so the
   whole controller panel is in view and the streamer's logo and chat are not. */
.screen iframe { position: absolute; left: -35%; top: -23%; width: 135%; height: 135%; border: 0; }
/* Our own labels drawn over the streamer's panel (positions follow his layout). */
.cover { position: absolute; background: #080a0e; color: #fff; display: flex; align-items: center; font-family: inherit; line-height: 1; white-space: nowrap; overflow: hidden; }
.cover-id { left: 64.85%; top: 3.2%; width: 15.45%; height: 13.6%; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.9cqw; padding-left: 0.9cqw; }
.cover-id small { font-size: 0.85cqw; letter-spacing: 0.12em; color: #b6f36a; font-weight: 700; }
.cover-id b { font-size: 2.1cqw; font-weight: 800; letter-spacing: 0.02em; }
.cover-time { left: 64.9%; top: 17.15%; width: 6%; height: 2.2%; font-size: 0.72cqw; letter-spacing: 0.1em; color: #8d93a3; font-weight: 700; padding-left: 0.75cqw; }
.cover-act { left: 72.1%; top: 19.3%; width: 8.1%; height: 4.1%; }
.cover-extra { left: 64.75%; top: 23.8%; width: 8.1%; height: 3.9%; }
.cover-below { left: 80.5%; top: 25.15%; width: 19.5%; height: 1.65%; }
.cover-pad { left: 80.5%; top: 3.7%; width: 8.5%; height: 2.4%; font-size: 0.72cqw; letter-spacing: 0.1em; color: #8d93a3; font-weight: 700; padding-left: 0.4cqw; }
/* Sits over the player so clicks do not reach it. */
.shield { position: absolute; inset: 0; }
.sound { position: absolute; left: 14px; bottom: 14px; width: auto; background: rgba(20, 10, 31, 0.8); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; }
.offline { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; color: var(--muted);
  background: linear-gradient(180deg, #2a0f45 0%, #7a2a6b 55%, #ff7a59 100%); }
.offline b { color: var(--ink); font-size: 20px; }
.offline-mark { width: 54px; height: 54px; border-radius: 14px; border: 2px dashed var(--line); margin-bottom: 8px; }
.pad-overlay { position: absolute; bottom: 3%; right: 2%; width: clamp(110px, 26%, 220px); background: rgba(20, 10, 31, 0.8); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px 6px; pointer-events: none; backdrop-filter: blur(4px); }
.pad-title { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.pad-title b { color: var(--cool); font-family: ui-monospace, Menlo, monospace; }
.turn-banner { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--accent); color: #23061a; font-weight: 800; padding: 9px 18px; border-radius: 999px; }

.bar { display: flex; align-items: center; gap: 16px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sources { display: flex; gap: 4px; }
.sources button { background: none; border: 1px solid transparent; border-radius: 7px; padding: 5px 10px; color: var(--muted); }
.sources button.on { background: var(--panel2); border-color: var(--line); color: var(--ink); }
.incontrol { display: flex; align-items: center; gap: 9px; padding-left: 16px; border-left: 1px solid var(--line); }
.incontrol small { color: var(--hot); }
.incontrol .ico { font-size: 18px; }
.mini { margin-left: auto; display: flex; gap: 18px; text-align: left; }
.mini b { font-size: 14px; }
.clock b { font-family: ui-monospace, Menlo, monospace; font-size: 17px; color: var(--cool); }


/* sidebar */
.side { display: flex; flex-direction: column; padding: 12px; gap: 10px; max-height: calc(100vh - 110px); min-height: 520px; position: sticky; top: 12px; }
.side-head b { color: var(--accent); font-size: 13px; }
.side-head small { letter-spacing: 0; font-size: 12px; margin-top: 2px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tab { background: none; border: 1px solid transparent; border-radius: 8px; padding: 8px; color: var(--muted); }
.tab.on { background: var(--accent); color: #23061a; font-weight: 700; }
.tab-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.note { margin: 0; color: var(--muted); font-size: 12px; }
.note.small { font-size: 11.5px; }
.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 9px; padding: 10px 14px; width: 100%; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #23061a; font-weight: 800; }
.btn.primary.leave { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn.ghost { background: transparent; }
.btn:hover { filter: brightness(1.1); }
.next-head { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; font-size: 12px; letter-spacing: 0.04em; }
.count { font-family: ui-monospace, Menlo, monospace; background: var(--panel2); border-radius: 6px; padding: 2px 8px; color: var(--cool); }
.next { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; overflow-y: auto; }
.next li { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 9px; padding: 8px 10px; }
.next li.me { outline: 1px solid var(--accent); }
.next .n { width: 16px; color: var(--muted); font-size: 12px; text-align: right; }
.next .who { flex: 1; min-width: 0; }
.next .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next .who span, .next .t { font-size: 11px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 18px 0; font-size: 12.5px; }

.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; min-height: 200px; }
.chat p { margin: 0; overflow-wrap: anywhere; }
.chat p b { color: var(--accent); margin-right: 6px; }
.chat-form { display: flex; gap: 6px; }
.chat-form input, .modal input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px; color: var(--ink); font: inherit; }
.chat-form .btn { width: auto; }

/* numbers */
.numbers { margin-top: 14px; padding: 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 0.12em; color: var(--hot); }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--hot); }
.numbers h2 { margin: 6px 0 2px; font-size: 22px; text-transform: uppercase; letter-spacing: 0.01em; }
.numbers > p { margin: 0 0 16px; }
.num-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 10px; }
.num { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.num b { display: block; font-size: 30px; font-weight: 800; margin-top: 10px; font-variant-numeric: tabular-nums; }
.num.big { grid-row: span 2; background: linear-gradient(150deg, #4a1d63, var(--panel2)); }
.num.big b { font-size: 64px; line-height: 1.05; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chip { font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

.how { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; align-items: start; }
.how details { padding: 12px 16px; }
.how summary { cursor: pointer; font-weight: 600; }
.how ol { color: var(--muted); padding-left: 20px; margin: 10px 0 4px; }
.how li { margin: 4px 0; }

.foot { margin-top: 18px; padding-top: 16px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.foot p { max-width: 560px; }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(5, 7, 12, 0.75); display: grid; place-items: center; z-index: 10; padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: 100%; max-width: 360px; display: grid; gap: 12px; }
.modal-card.wide { max-width: 520px; }
.modal-card h3 { margin: 0; font-size: 19px; }
.modal-card p { margin: 0; }
.keys { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--muted); }
.keys td { padding: 4px 6px 4px 0; }
kbd { font: 11px ui-monospace, Menlo, monospace; background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; margin-right: 3px; color: var(--ink); }

/* controls guide */
.modal-card.guide { max-width: 860px; gap: 14px; max-height: calc(100vh - 32px); overflow-y: auto; }
.guide-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.guide-head h3 { margin-bottom: 4px; }
.x { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--muted); }
.guide-tabs { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
.steps, .devices { display: flex; gap: 6px; flex-wrap: wrap; }
.steps button, .devices button { background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 11px; color: var(--muted); }
.steps button.on { background: rgba(255, 95, 168, 0.16); border-color: var(--accent); color: var(--ink); }
.devices { background: var(--panel2); border-radius: 10px; padding: 3px; }
.devices button.on { background: var(--line); color: var(--ink); }
.guide h4 { margin: 0 0 2px; font-size: 20px; }
.guide-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions button { text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.actions button b { display: block; font-size: 15px; }
.actions button span { color: var(--muted); font-size: 12.5px; }
.actions button.on { border-color: var(--accent); background: rgba(255, 95, 168, 0.12); }
.guide-pad { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 6px; }
.guide-pad > b { font-size: 18px; }
.caps { display: flex; gap: 6px; flex-wrap: wrap; min-height: 34px; }
.caps kbd { font-size: 14px; padding: 5px 10px; margin: 0; }
.guide-pad p { margin: 0; font-size: 13px; }
.guide-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.guide-foot .btn { width: auto; }
.muted.small { font-size: 12px; }
@media (max-width: 720px) { .guide-body { grid-template-columns: 1fr; } .guide-foot span { display: none; } }

/* controller drawing */
.pad { position: relative; width: 100%; aspect-ratio: 2 / 1; }
.pad .body { position: absolute; inset: 14% 4% 6%; border-radius: 40% 40% 46% 46% / 46% 46% 54% 54%; background: #2c1a44; border: 1px solid #4b2d6e; }
.pad .p { position: absolute; background: #4b2f6c; border-radius: 50%; transform: translate(-50%, -50%); width: 8%; aspect-ratio: 1; display: grid; place-items: center; font-size: 8px; font-weight: 700; color: #d9c7ef; transition: background 0.05s; }
.pad.large .p { font-size: 13px; }
.pad .p.on { background: var(--accent); color: #23061a; }
.pad .bump { border-radius: 5px; width: 17%; aspect-ratio: auto; height: 7%; }
.pad .trig { border-radius: 5px 5px 2px 2px; width: 11%; aspect-ratio: auto; height: 9%; overflow: hidden; background: #3a2356; }
.pad .trig i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); height: 0; }
.pad .small { width: 5%; }
.pad .well { position: absolute; width: 17%; aspect-ratio: 1; border-radius: 50%; background: #170b24; border: 1px solid #4b2d6e; transform: translate(-50%, -50%); }
.pad .stick { position: absolute; left: 50%; top: 50%; width: 58%; aspect-ratio: 1; border-radius: 50%; background: #7a559f; transform: translate(-50%, -50%); }
.pad .stick.on { background: var(--accent); }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .next { max-height: 320px; }
  .num-grid { grid-template-columns: 1fr 1fr; }
  .num.big { grid-column: span 2; grid-row: auto; }
  .how { grid-template-columns: 1fr; }
  .top nav { display: none; }
  .mini { margin-left: 0; width: 100%; justify-content: space-between; }
  .incontrol { border-left: 0; padding-left: 0; }
  .profile small { display: none; }
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Our own controller box is switched off: the stream already shows the live controller. */
.pad-overlay { display: none !important; }
