:root {
  /* Vice-city sunset palette: #EB9998 #5D649C #6F70A2 #7E3A63 #A373C0 */
  --coral: #eb9998; --indigo: #5d649c; --slate: #6f70a2; --plum: #7e3a63; --lav: #a373c0;
  --ink: #fff7f4; --muted: #e8d6ea; --lime: #ffd27a; --pink: #ff7ab6; --cyan: #a373c0; --amber: #ffb98a;
  --glass: rgba(14, 8, 22, 0.86); --glass-2: rgba(255, 255, 255, 0.08); --line: rgba(255, 220, 230, 0.22);
  --font: "Inter", "SF Pro Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #0c0716; color: var(--ink); font-family: var(--font); font-size: 14px; overflow-x: hidden; }
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #d9878a 0%, #a86a90 16%, #6f4f96 36%, #3f3572 56%, #1f1a3e 78%, #0c0716 100%); }
.blob { position: absolute; width: 60vw; height: 60vw; border-radius: 50%; filter: blur(90px); opacity: 0.45; mix-blend-mode: screen; animation: drift 22s ease-in-out infinite alternate; }
.b1 { background: #ffb08c; left: -20vw; top: -12vw; opacity: 0.55; }
.b2 { background: #7e3a63; right: -25vw; top: 14vw; animation-delay: -7s; opacity: 0.6; }
.b3 { background: #5d649c; left: 20vw; bottom: -35vw; animation-delay: -14s; opacity: 0.5; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vw, 6vw) scale(1.15); } }
.noise { position: absolute; inset: 0; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.08'/></svg>"); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; gap: 16px; flex-wrap: wrap; background: linear-gradient(180deg, rgba(8, 4, 16, 0.9), rgba(8, 4, 16, 0.6)); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(255, 244, 241, 0.15); }
.brand { display: flex; align-items: baseline; gap: 14px; }
.logo { font-weight: 900; font-size: 30px; letter-spacing: -0.02em; color: #fff4f1; text-shadow: 0 2px 0 rgba(58, 30, 78, 0.6), 0 0 24px rgba(126, 58, 99, 0.9); }
.logo b { color: #ffd27a; text-shadow: 0 0 24px rgba(255, 210, 122, 0.8); }
.sub { color: #fff4f1; opacity: 0.85; font-size: 13px; text-shadow: 0 1px 2px rgba(58, 30, 78, 0.6); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; padding: 6px 12px; border-radius: 999px; background: rgba(6, 3, 12, 0.85); border: 1px solid rgba(255, 244, 241, 0.25); color: #fff4f1; backdrop-filter: blur(8px); }
.chip.ok { color: #ffd27a; border-color: rgba(255, 210, 122, 0.5); }
.chip.warn { color: var(--amber); border-color: rgba(255, 184, 79, 0.4); }
.party { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.95fr); gap: 18px; padding: 0 28px 28px; max-width: 1500px; margin: 0 auto; align-items: start; }
.left { display: grid; gap: 14px; }
.under { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 980px) { .under { grid-template-columns: 1fr; } }
@media (max-width: 980px) { .party { grid-template-columns: 1fr; } }
.stage-card { background: #05030a; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
#stage3d { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0a0614; }
#stage3d canvas { display: block; width: 100% !important; height: 100% !important; }
.score { position: absolute; left: 16px; top: 16px; display: flex; gap: 10px; }
.stat { background: rgba(10, 5, 18, 0.9); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; min-width: 78px; backdrop-filter: blur(10px); }
.stat .k { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: #f0dff0; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.lime { color: var(--lime); } .pink { color: var(--pink); } .amber { color: var(--amber); } .cyan { color: var(--cyan); }
.beers { display: block; font-size: 12px; letter-spacing: 2px; min-height: 16px; }
.state { position: absolute; right: 16px; top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); background: rgba(10, 5, 18, 0.9); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.bubble { position: absolute; transform: translate(-50%, -100%); background: #fff4f1; color: #3a1a3e; padding: 6px 12px; border-radius: 14px; font-weight: 800; white-space: nowrap; display: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.bubble:after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff4f1; border-bottom: 0; }
.flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(60% 60% at 50% 50%, rgba(255, 122, 182, 0.55), transparent 70%); transition: opacity .15s; }
.flash.on { opacity: 1; }
.banner { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%) scale(0.9); padding: 12px 22px; border-radius: 999px; font-weight: 900; font-size: 20px; letter-spacing: -0.01em; background: rgba(6, 3, 12, 0.95); border: 1px solid var(--line); backdrop-filter: blur(10px); opacity: 0; transition: opacity .2s, transform .2s; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.banner.on { opacity: 1; transform: translateX(-50%) scale(1); }
.controls { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pill { font-family: var(--font); font-weight: 700; font-size: 13px; color: var(--ink); background: var(--glass-2); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; cursor: pointer; transition: transform .1s, background .2s; }
.pill:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.pill.primary { background: linear-gradient(90deg, #eb9998, #a373c0); border: 0; color: #2a1230; box-shadow: 0 10px 30px rgba(235, 153, 152, 0.4); }
.pill.sm { padding: 6px 10px; font-size: 12px; }
.pill.sm.on { background: rgba(255, 210, 122, 0.18); border-color: rgba(255, 210, 122, 0.5); color: var(--lime); }
.speed { display: flex; align-items: center; gap: 6px; margin-left: 6px; color: var(--muted); font-size: 12px; }
.progress { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.side { display: grid; gap: 14px; align-content: start; }
.card { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); position: relative; overflow: hidden; }
.card .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); margin-bottom: 8px; }
.card .big { font-size: 44px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.card .big small { font-size: 16px; color: var(--muted); font-weight: 600; }
.card .big.small { font-size: 30px; }
.card .meta { font-size: 12px; color: #efe0ee; margin-top: 8px; line-height: 1.4; }
.card.dopa { border-color: rgba(255, 122, 182, 0.45); }
.card.dopa .big { color: var(--pink); text-shadow: 0 0 22px rgba(255, 122, 182, 0.5); }
.card.dopa.hot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 79, 216, 0.0); } 50% { box-shadow: 0 0 0 10px rgba(255, 79, 216, 0.18); } }
.ring { position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; border: 12px solid rgba(255, 79, 216, 0.15); border-top-color: var(--pink); opacity: 0.6; transition: transform .6s; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 18px 1fr 70px; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; }
.bar em { font-style: normal; color: var(--ink); text-align: right; }
.track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 999px; transition: width .35s; }
.fill.l { background: linear-gradient(90deg, #a373c0, #5d649c); } .fill.r { background: linear-gradient(90deg, #eb9998, #ff7ab6); }
.card.cam canvas { display: block; width: 100%; border-radius: 10px; image-rendering: pixelated; background: #000; }
.card.cns { background: rgba(0, 0, 0, 0.72); padding: 12px 14px 10px; }
.cns-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cns-head .k { margin-bottom: 6px; }
.cns-view { position: relative; margin-bottom: 8px; }
.cns-view canvas { display: block; width: 100%; aspect-ratio: 2 / 1; background: #000; border-radius: 10px; }
.cns-view .cap { position: absolute; left: 10px; bottom: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); }
.card.meter .big { color: var(--lime); text-shadow: 0 0 22px rgba(200, 255, 90, 0.4); }
.track.tall { height: 14px; margin-top: 10px; }
.fill.lime { background: linear-gradient(90deg, #ffd27a, #eb9998); }
.feedlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 160px; overflow: auto; }
.feedlist li { font-size: 12px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.feedlist li.hit { border-color: rgba(200, 255, 90, 0.45); } .feedlist li.miss { border-color: rgba(255, 184, 79, 0.4); } .feedlist li.dopa { border-color: rgba(255, 79, 216, 0.5); }
.feed ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.feed li { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.feed li.hit { border-color: rgba(200, 255, 90, 0.45); } .feed li.miss { border-color: rgba(255, 184, 79, 0.4); } .feed li.dopa { border-color: rgba(255, 79, 216, 0.5); }
.disclosure { max-width: 1500px; margin: 0 auto; padding: 8px 28px 28px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---- single-screen layout ---- */
.top.compact { padding: 12px 22px; }
.party.one { display: block; padding: 0 22px 16px; max-width: none; }
.party.one .stage-card { height: calc(100vh - 88px); min-height: 520px; }
.party.one #stage3d { aspect-ratio: auto; height: 100%; }
.ov { position: absolute; background: rgba(10, 5, 18, 0.9); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(10px); padding: 10px 12px; }
.ov .k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: #f0dff0; margin-bottom: 6px; }
.brainbox { right: 16px; top: 16px; width: min(34%, 380px); background: rgba(4, 2, 8, 0.94); }
.brainbox .cns-view { margin-bottom: 6px; }
.brainbox .cns-view canvas { aspect-ratio: 2.2 / 1; border-radius: 10px; }
.brainbox .cns-view .cap { font-size: 9px; bottom: 6px; }
.meterrow { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin-top: 4px; }
.meterrow .big.small { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.meterrow .big small { font-size: 10px; color: var(--muted); }
.meterrow .track { height: 8px; margin-top: 6px; }
.meterrow .meta { font-size: 10px; margin-top: 4px; }
.meterrow .dopa .big { color: var(--pink); text-shadow: 0 0 18px rgba(255, 122, 182, 0.5); }
.meterrow .dopa.hot .big { animation: glow 1s ease-in-out infinite; }
@keyframes glow { 0%, 100% { text-shadow: 0 0 10px rgba(255, 122, 182, 0.4); } 50% { text-shadow: 0 0 30px rgba(255, 122, 182, 1); } }
.cambox { left: 16px; bottom: 52px; width: 220px; }
.cambox canvas { display: block; width: 100%; border-radius: 8px; image-rendering: pixelated; background: #000; }
.bars.mini { margin-top: 8px; gap: 5px; }
.bars.mini .bar { grid-template-columns: 14px 1fr 56px; font-size: 10px; }
.bars.mini .track { height: 7px; }
.cambox .meta { font-size: 10px; margin-top: 4px; }
.onebtn { right: 16px; bottom: 52px; display: flex; align-items: center; gap: 12px; background: transparent; border: 0; padding: 0; backdrop-filter: none; }
.onebtn .pill.primary { font-size: 15px; padding: 12px 22px; }
.party.one .banner { bottom: 86px; }
.foot { left: 0; right: 0; bottom: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; font-size: 10px; color: #f3e6f2; line-height: 1.35; padding: 7px 16px; background: rgba(6, 3, 12, 0.94); text-align: center; }
@media (max-width: 900px) { .brainbox { width: 44%; } .foot { display: none; } }

/* ---- record mode (?record): edge-to-edge stage, no chrome, no radius ---- */
body.record { overflow: hidden; }
body.record .top { display: none; }
body.record .party.one { padding: 0; }
body.record .party.one .stage-card { height: 100vh; min-height: 0; border-radius: 0; border: 0; box-shadow: none; }
body.record .bg { display: none; }
body.record .onebtn { opacity: 0; transition: opacity .25s; }
body.record #stage3d:hover .onebtn { opacity: 1; }
