:root {
  --ink: #f4f7ff;
  --muted: #9aa6c4;
  --gold: #ffd23b;
  --pink: #ff2bd6;
  --cyan: #00e5ff;
  --red: #ff3355;
  --green: #7dff6a;
  --glass: rgba(8, 10, 30, 0.72);
  --edge: rgba(120, 200, 255, 0.28);
  --display: 'Russo One', 'Arial Black', Impact, sans-serif;
  --ui: 'Chakra Petch', 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #03040c; color: var(--ink); font-family: var(--ui); -webkit-tap-highlight-color: transparent; }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; touch-action: none; }
html, body { overscroll-behavior: none; touch-action: manipulation; } /* no double-tap zoom */
button, input, select, label, .panel { touch-action: manipulation; }
body.storeopen #toasts { z-index: 40; }
@media (max-width: 640px) { body.storeopen #hud, body.storeopen #weap, body.storeopen #mtabs { display: none !important; } }
.hidden { display: none !important; }
button { font-family: var(--display); letter-spacing: 0.04em; cursor: pointer; border: 0; color: var(--ink); }
input, select { font-family: var(--ui); }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- scoreboard ---------- */
#hud { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 0; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.6)); pointer-events: none; z-index: 5; flex-wrap: nowrap; justify-content: center; white-space: nowrap; }
#hud .bug { background: linear-gradient(180deg, #ff2b4e, #c4002b); font-family: var(--display); font-size: 15px; padding: 0 12px; display: flex; align-items: center; gap: 7px; border-radius: 10px 0 0 10px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
#hud .board { display: flex; background: linear-gradient(180deg, rgba(18,16,54,0.94), rgba(6,8,26,0.94)); border: 1px solid var(--edge); border-left: 0; border-radius: 0 10px 10px 0; overflow: hidden; }
#hud .cell { padding: 6px 16px 7px; border-left: 1px solid rgba(255,255,255,0.08); text-align: center; min-width: 74px; }
#hud .cell:first-child { border-left: 0; }
#hud .lbl { font-size: 10px; letter-spacing: 0.18em; color: var(--muted); font-weight: 700; }
#hud .val { font-family: var(--display); font-size: 24px; line-height: 1.1; white-space: nowrap; }
#hud .who .val { color: var(--gold); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#hud .time .val { color: var(--cyan); min-width: 58px; }
#hud .val .of { display: block; font-family: var(--ui); font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.03em; line-height: 1.1; }
#hud .time.low .val { color: var(--red); animation: pulse 0.5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }
.hearts { color: var(--red); letter-spacing: 2px; }
.hearts .dead { color: rgba(255,255,255,0.15); }
#hKeys { display: flex; gap: 4px; justify-content: center; min-height: 26px; align-items: center; }
#hKeys i { display: inline-block; width: 16px; height: 22px; border-radius: 8px 8px 3px 3px; box-shadow: 0 0 10px currentColor; background: currentColor; }
#hKeys .none { font-size: 14px; color: var(--muted); font-family: var(--ui); }
#hud .sub { position: absolute; top: 100%; margin-top: 6px; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; color: var(--muted); white-space: nowrap; text-shadow: 0 2px 6px #000; }

/* ---------- banners, countdown, popups ---------- */
#banner { position: fixed; top: 25%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; z-index: 6; width: 92vw; }
#banner .b-main { font-family: var(--display); font-size: clamp(34px, 7vw, 92px); line-height: 1; background: linear-gradient(180deg, #fff6c9, var(--gold) 45%, #ff9a1f 55%, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255,43,214,0.55)) drop-shadow(0 6px 0 #1b0b3a); }
#banner .b-sub { margin-top: 12px; font-size: clamp(15px, 2.2vw, 24px); font-weight: 700; letter-spacing: 0.1em; text-shadow: 0 2px 8px #000; }
#banner.show { animation: bannerIn 0.45s cubic-bezier(.2,1.6,.4,1); }
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } }
#banner.danger .b-main { background: linear-gradient(180deg, #fff, #ff6a7d 45%, #ff1030); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 20px rgba(255,20,50,0.7)) drop-shadow(0 6px 0 #2a0008); }
#count { position: fixed; top: 54%; left: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-size: clamp(80px, 14vw, 190px); color: #fff; text-shadow: 0 0 40px var(--cyan), 0 10px 0 #0b1846; pointer-events: none; z-index: 6; }
#count.tick { animation: countIn 0.9s ease-out; }
@keyframes countIn { 0% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.3; } }
#count.go { color: var(--gold); text-shadow: 0 0 50px var(--pink), 0 10px 0 #3a0b2a; }
#popups { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.pop { position: absolute; font-family: var(--display); font-size: 22px; text-shadow: 0 2px 0 #000, 0 0 12px currentColor; transform: translate(-50%, -50%); white-space: nowrap; animation: popUp 1.1s ease-out forwards; }
@keyframes popUp { 0% { transform: translate(-50%, -20%) scale(0.5); opacity: 0; } 15% { transform: translate(-50%, -60%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -190%) scale(1); opacity: 0; } }
.emoji { position: absolute; font-size: 30px; transform: translate(-50%, -50%); animation: emojiUp 1.8s ease-out forwards; }
@keyframes emojiUp { 0% { transform: translate(-50%, 0) scale(0.4); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -30%) scale(1.2); } 100% { transform: translate(-50%, -260%) scale(1); opacity: 0; } }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column-reverse; gap: 8px; align-items: center; z-index: 9; pointer-events: none; }
.toast { background: var(--glass); border: 1px solid var(--edge); padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; backdrop-filter: blur(8px); animation: toastIn 0.3s ease-out; box-shadow: 0 6px 20px rgba(0,0,0,0.5); max-width: 86vw; text-align: center; }
.toast.good { border-color: rgba(125,255,106,0.6); }
.toast.bad { border-color: rgba(255,51,85,0.7); }
.toast.gold { border-color: rgba(255,210,59,0.7); color: var(--gold); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }

/* ---------- panels ---------- */
.panel { position: fixed; top: 92px; width: 272px; background: var(--glass); border: 1px solid var(--edge); border-radius: 14px; padding: 12px; backdrop-filter: blur(10px); z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
#queue { left: 14px; }
#side { right: 14px; bottom: 14px; display: flex; flex-direction: column; }
.p-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 14px; letter-spacing: 0.12em; color: var(--cyan); margin-bottom: 10px; }
.online { font-family: var(--ui); font-size: 12px; color: var(--muted); letter-spacing: 0; }
button.big { width: 100%; padding: 13px 14px; font-size: 17px; border-radius: 10px; background: linear-gradient(180deg, #ff4fe0, #b8009a); box-shadow: 0 4px 0 #5c004d, 0 0 24px rgba(255,43,214,0.4); transition: transform 0.08s; }
button.big:hover { filter: brightness(1.12); }
button.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #5c004d; }
button.big:disabled { opacity: 0.4; filter: grayscale(0.85); cursor: default; transform: none; box-shadow: none; }
button.big.wear { background: linear-gradient(180deg, #3fd2ff, #0a7fb8); box-shadow: 0 4px 0 #04405e, 0 0 24px rgba(63,210,255,0.35); }
.st-btns { display: flex; gap: 8px; }
.st-btns button.big { flex: 1; font-size: 15px; padding: 11px 8px; }
.st-colors { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 10px; }
.st-colors .pc { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); position: relative; padding: 0; cursor: pointer; flex: none; }
.st-colors .pc.orig { background: conic-gradient(#ff3355, #ffd23b, #7dff6a, #00e5ff, #a55cff, #ff3355); }
.st-colors .pc.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); transform: scale(1.15); }
.st-colors .pc .lk { position: absolute; right: -5px; bottom: -5px; background: rgba(0,0,0,0.8); color: var(--gold); font: 700 9px/12px var(--ui); border-radius: 6px; padding: 0 3px; }
button.big.queued { background: linear-gradient(180deg, #2a3560, #161d3c); box-shadow: 0 4px 0 #0b0f22; }
#qMine { margin: 8px 2px; min-height: 16px; }
#qList { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: auto; }
#qList li { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,0.06); font-weight: 600; font-size: 14px; }
#qList li .n { color: var(--muted); width: 18px; font-family: var(--display); font-size: 12px; }
#qList li .dot { width: 10px; height: 10px; border-radius: 50%; }
#qList li.me { color: var(--gold); }
#qList li.now { color: var(--cyan); }
.cams { display: flex; gap: 6px; margin-top: 12px; }
.cams button, .row-btns button { flex: 1; padding: 8px 4px; font-size: 12px; border-radius: 8px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); }
.cams button.on { background: rgba(0,229,255,0.18); border-color: var(--cyan); color: var(--cyan); }
.row-btns { display: flex; gap: 6px; margin-top: 6px; }
button.tiny { background: rgba(255,255,255,0.08); width: 24px; height: 22px; border-radius: 6px; font-size: 12px; }
#side { height: min(440px, calc(100vh - 120px)); top: auto; }
#side.collapsed { height: auto; }
#queue .p-head .online { margin-left: auto; margin-right: 8px; }
#queue.collapsed #qList, #queue.collapsed .cams, #queue.collapsed .row-btns, #queue.collapsed #qMine { display: none; }
#queue.collapsed #qBtn { padding: 9px 10px; font-size: 14px; }
#side.collapsed #chatLog, #side.collapsed #chatForm { display: none; }
#chatLog { flex: 1; overflow-y: auto; font-size: 14px; line-height: 1.35; padding-right: 4px; min-height: 60px; }
#chatLog .ln { margin: 3px 0; word-wrap: break-word; }
#chatLog .ln b { font-weight: 700; }
#chatLog .sys { color: var(--muted); font-style: italic; }
#chatLog .party { color: var(--gold); font-weight: 700; }
#chatLog .turn { color: var(--cyan); }
#chatForm { display: flex; gap: 6px; margin-top: 8px; }
#chatForm input { flex: 1; min-width: 0; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.14); color: var(--ink); border-radius: 8px; padding: 8px; font-size: 14px; }
#chatForm button { padding: 0 10px; border-radius: 8px; background: rgba(0,229,255,0.2); font-size: 12px; }
#emotes { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 8px; }
#emotes button { background: rgba(255,255,255,0.06); border-radius: 8px; padding: 5px 0; font-size: 18px; font-family: system-ui, sans-serif; }
#emotes button:hover { background: rgba(255,255,255,0.16); }
button.gift { margin-top: 8px; padding: 10px; border-radius: 10px; font-size: 14px; background: linear-gradient(180deg, #19c2ff, #0062c4); box-shadow: 0 3px 0 #002a5c, 0 0 18px rgba(0,180,255,0.35); }
button.gift:disabled { filter: grayscale(0.8) brightness(0.6); cursor: default; }

#minimap { position: fixed; right: 300px; bottom: 14px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(4,6,18,0.75); z-index: 5; width: 210px; height: 168px; }
#pip { position: fixed; left: 16px; bottom: 16px; border: 2px solid rgba(255,255,255,0.75); border-radius: 4px; z-index: 4; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 8px 24px rgba(0,0,0,0.6); }
#pip .pip-tag { position: absolute; top: 6px; left: 6px; background: linear-gradient(180deg, #ff2b4e, #c4002b); font-family: var(--display); font-size: 11px; padding: 3px 7px; border-radius: 4px; display: flex; align-items: center; gap: 5px; }
#help { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; color: var(--muted); background: rgba(4,6,18,0.6); padding: 7px 14px; border-radius: 20px; z-index: 4; white-space: nowrap; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; background: radial-gradient(ellipse at center, rgba(10,6,40,0.35), rgba(0,0,0,0.65)); }
#title { background: radial-gradient(ellipse at center, rgba(10,6,40,0.15), rgba(0,0,0,0.55)); }
.title-card { text-align: center; width: min(600px, 94vw); padding: 28px; }
.logo { display: inline-block; padding: 0 0.08em; font-family: var(--display); white-space: nowrap; font-size: clamp(30px, 7.6vw, 68px); line-height: 1; background: linear-gradient(180deg, #fff6c9, var(--gold) 45%, #ff9a1f 52%, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 26px rgba(255,43,214,0.6)) drop-shadow(0 7px 0 #1b0b3a); }
.tag { font-family: var(--display); color: var(--cyan); letter-spacing: 0.3em; font-size: clamp(12px, 2.4vw, 17px); margin-top: 10px; text-shadow: 0 0 14px var(--cyan); }
.pitch { color: #cfd8f2; font-size: 15px; line-height: 1.5; margin: 18px 0 20px; text-shadow: 0 2px 6px #000; }
.field { display: block; text-align: left; font-family: var(--display); font-size: 12px; letter-spacing: 0.16em; color: var(--muted); margin-bottom: 10px; }
.field input { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 18px; font-weight: 700; background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; outline: none; }
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,0.2); }
.field .count { float: right; letter-spacing: 0.04em; color: var(--muted); font-family: var(--ui); font-size: 13px; }
.field .count.full { color: var(--red); }
.field input.bad { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,51,85,0.25); }
.name-err { margin: -4px 0 10px; text-align: left; color: var(--red); font-size: 14px; font-weight: 700; }
.swatches { display: flex; gap: 8px; justify-content: center; margin: 4px 0 18px; flex-wrap: wrap; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; box-shadow: 0 0 10px rgba(0,0,0,0.6); }
.swatches button.on { border-color: #fff; transform: scale(1.12); }
#connMsg { margin-top: 12px; min-height: 18px; }
.yt-card, .res-card, .modal { background: linear-gradient(180deg, rgba(22,16,64,0.96), rgba(6,8,28,0.96)); border: 1px solid var(--edge); border-radius: 18px; padding: 26px; width: min(440px, 92vw); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 60px rgba(255,43,214,0.2); }
.yt-big { font-family: var(--display); font-size: 58px; color: var(--gold); text-shadow: 0 0 30px rgba(255,210,59,0.6), 0 5px 0 #3a2400; animation: pulse 0.6s infinite alternate; }
.yt-sub { margin: 8px 0 16px; color: #cfd8f2; }
.yt-how { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 13px; color: #cfd8f2; margin: -4px 0 16px; }
.yt-how b { color: var(--gold); font-family: var(--display); font-weight: 400; }
.yt-bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
#ytFill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); width: 100%; }
button.link { background: none; color: var(--muted); font-family: var(--ui); text-decoration: underline; margin: 10px 0 4px; font-size: 14px; }
.res-card h2 { font-family: var(--display); margin: 0 0 4px; font-size: 18px; letter-spacing: 0.2em; color: var(--cyan); }
.res-card .res-name { font-family: var(--display); font-size: 34px; color: var(--gold); }
.res-card .res-score { font-family: var(--display); font-size: 64px; line-height: 1.1; text-shadow: 0 0 24px rgba(255,43,214,0.6); }
.res-card .res-why { color: var(--muted); margin-bottom: 14px; }
.res-card .res-row { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,0.07); font-weight: 600; }
.res-card .badge { display: inline-block; margin-top: 12px; padding: 6px 14px; border-radius: 20px; background: linear-gradient(90deg, var(--pink), var(--gold)); color: #1a0830; font-family: var(--display); font-size: 14px; }
#results { background: transparent; pointer-events: none; }
#results .res-again { pointer-events: auto; margin-top: 16px; }
#results .res-card { animation: toastIn 0.35s ease-out; }
.m-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); color: var(--cyan); letter-spacing: 0.14em; margin-bottom: 12px; }
.m-head .close { background: none; font-size: 26px; color: var(--muted); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1; padding: 8px; font-size: 12px; border-radius: 8px; background: rgba(255,255,255,0.07); }
.tabs button.on { background: rgba(0,229,255,0.2); color: var(--cyan); }
#lbList { list-style: none; padding: 0; margin: 0; text-align: left; max-height: 50vh; overflow: auto; }
#lbList li { display: flex; gap: 10px; padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,0.06); font-weight: 600; }
#lbList li .r { width: 28px; color: var(--muted); font-family: var(--display); }
#lbList li .s { margin-left: auto; font-family: var(--display); color: var(--gold); }
#lbList li:nth-child(1) .r { color: var(--gold); }
.modal label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; font-weight: 700; text-align: left; }
.modal label.check { justify-content: flex-start; }
.modal input[type=range] { width: 60%; accent-color: var(--pink); }
.modal select { background: #0b0f26; color: #fff; border: 1px solid var(--edge); border-radius: 8px; padding: 6px; }
#conn { position: fixed; top: 0; left: 0; right: 0; background: #b8002b; text-align: center; padding: 6px; font-weight: 700; z-index: 30; }

/* ---------- loading ---------- */
#loading { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 40%, #1a0f4a 0%, #07061a 55%, #020208 100%); transition: opacity 0.6s ease; }
#loading.soft { background: rgba(3, 4, 14, 0.72); backdrop-filter: blur(4px); }
#loading.gone { opacity: 0; pointer-events: none; }
.ld-card { text-align: center; width: min(560px, 90vw); }
.ld-bar { position: relative; height: 10px; margin: 30px auto 14px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; border: 1px solid rgba(120,200,255,0.25); }
#ldFill { height: 100%; width: 0%; border-radius: 6px; background: linear-gradient(90deg, var(--pink), var(--gold)); box-shadow: 0 0 18px rgba(255,43,214,0.7); transition: width 0.35s ease; }
/* a shimmer that runs on the compositor, so it keeps moving even while a step is busy */
.ld-bar::after { content: ""; position: absolute; inset: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent); animation: ldShine 1.1s linear infinite; will-change: transform; }
@keyframes ldShine { from { transform: translateX(-120%); } to { transform: translateX(380%); } }
#ldMsg { font-family: var(--display); letter-spacing: 0.14em; font-size: 14px; color: var(--cyan); min-height: 20px; }
.ld-tip { margin-top: 26px; color: var(--muted); font-size: 14px; min-height: 40px; }

/* ---------- the contestant's gun ---------- */
#weap { position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 5; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 5px; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.6)); }
#weap .w-main { display: flex; align-items: baseline; gap: 14px; background: linear-gradient(180deg, rgba(18,16,54,0.92), rgba(6,8,26,0.92)); border: 1px solid var(--edge); border-radius: 10px; padding: 5px 16px 6px; }
#weap .w-name { font-family: var(--display); font-size: 15px; letter-spacing: 0.12em; }
#weap .w-ammo b { font-family: var(--display); font-size: 30px; font-weight: 400; line-height: 1; }
#weap .w-ammo span { font-family: var(--display); font-size: 15px; color: var(--muted); margin-left: 4px; }
#weap .w-ammo.empty b { color: var(--red); animation: pulse 0.4s infinite alternate; }
#weap .w-reload { width: 180px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1); overflow: hidden; visibility: hidden; }
#weap.reloading .w-reload { visibility: visible; }
#wReload { height: 100%; width: 0%; background: var(--gold); }
#weap .w-slots { display: flex; gap: 4px; }
.vote { margin: 0 0 8px; padding: 8px; border: 1px solid rgba(255,210,59,0.45); border-radius: 10px; background: rgba(40,30,0,0.35); }
.vote .v-head { font-family: var(--display); font-size: 11px; letter-spacing: 0.12em; color: #ffd23b; margin-bottom: 6px; }
.vote button { position: relative; display: block; width: 100%; text-align: left; margin-top: 5px; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.16); background: rgba(0,0,0,0.35); color: #fff; overflow: hidden; cursor: pointer; }
.vote button i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,210,59,0.18); transition: width 0.3s; }
.vote button b { position: relative; font-family: var(--display); font-size: 13px; letter-spacing: 0.06em; }
.vote button em { position: relative; float: right; font-style: normal; font-family: var(--display); color: #ffd23b; }
.vote button span { position: relative; display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.vote button.on { border-color: #ffd23b; box-shadow: 0 0 10px rgba(255,210,59,0.4); }
#bossBar { position: fixed; left: 50%; top: 122px; transform: translateX(-50%); width: min(560px, 86vw); z-index: 5; pointer-events: none; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.6)); }
#bossBar .bb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--display); letter-spacing: 0.1em; margin-bottom: 4px; }
#bossBar .bb-name { font-size: 16px; text-shadow: 0 0 12px currentColor; }
#bossBar .bb-num { font-size: 13px; color: var(--muted); }
#bossBar .bb-track { position: relative; height: 14px; border-radius: 7px; background: rgba(6,8,26,0.88); border: 1px solid rgba(255,255,255,0.18); overflow: hidden; }
#bossBar .bb-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff2a6a, #ff7a2a); box-shadow: 0 0 14px #ff2a6a; transition: width 0.25s; }
#bossBar .bb-track i { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,0.55); }
#bossBar.down .bb-num { color: #ffd23b; }
@media (max-width: 640px) { #bossBar { top: 96px; } #bossBar .bb-name { font-size: 13px; } }
#weap .w-powers { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 92vw; }
#weap .w-powers .pw { font-family: var(--display); font-size: 11px; letter-spacing: 0.08em; padding: 2px 7px; border: 1px solid; border-radius: 999px; background: rgba(6,8,26,0.85); text-shadow: 0 0 8px currentColor; }
#weap .w-slots span { font-family: var(--display); font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,0.5); color: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.06); }
#weap .w-slots span.own { color: var(--ink); border-color: rgba(255,255,255,0.2); }
#weap .w-slots span.on { box-shadow: 0 0 10px currentColor; border-color: currentColor; }
body.aimmouse #view { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Ccircle cx='16' cy='16' r='9'/%3E%3Cpath d='M16 2v8M16 22v8M2 16h8M22 16h8'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='2' fill='%23ff2bd6'/%3E%3C/svg%3E") 16 16, crosshair; }

/* ---------- made with Multiplayer Agent ---------- */
a.made-with { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; padding: 7px 14px 7px 9px; border-radius: 22px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: #cfd8f2; text-decoration: none; font-size: 14px; transition: background 0.15s, border-color 0.15s; pointer-events: auto; }
a.made-with img { width: 28px; height: 28px; display: block; }
a.made-with b { color: #fff; font-weight: 700; }
a.made-with:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,154,31,0.6); }

/* ---------- money ---------- */
#wallet { position: fixed; top: 14px; right: 14px; z-index: 6; display: flex; flex-direction: column; align-items: flex-end; padding: 6px 14px 7px; border-radius: 10px; background: linear-gradient(180deg, rgba(18,16,54,0.94), rgba(6,8,26,0.94)); border: 1px solid rgba(255,210,59,0.45); box-shadow: 0 6px 18px rgba(0,0,0,0.5); pointer-events: none; }
#wallet .w-lbl { font-size: 10px; letter-spacing: 0.18em; color: var(--muted); font-weight: 700; }
#wallet b { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.1; color: var(--gold); }
#wallet.pulse b { animation: walletPulse 0.7s ease-out; }
@keyframes walletPulse { 30% { transform: scale(1.25); color: #fff6c9; text-shadow: 0 0 18px var(--gold); } }
#wallet .w-gain { position: absolute; right: 12px; top: 100%; margin-top: 4px; font-family: var(--display); color: var(--green); font-size: 16px; text-shadow: 0 2px 6px #000; animation: popUp 1.5s ease-out forwards; }

/* ---------- store ---------- */
button.store-btn { width: 100%; margin-top: 6px; padding: 9px 4px; font-size: 13px; border-radius: 8px; background: linear-gradient(180deg, #ffd23b, #ff9a1f); color: #2a1300; box-shadow: 0 3px 0 #7a4300; }
button.store-btn span { margin-left: 6px; }
#store { background: transparent; align-items: center; }
.store-modal { width: min(960px, 96vw); height: min(640px, 92vh); display: flex; flex-direction: column; gap: 8px; }
.st-head, .st-sel, .st-right, .st-foot { background: linear-gradient(180deg, rgba(22,16,64,0.97), rgba(6,8,28,0.97)); border: 1px solid var(--edge); border-radius: 14px; }
.st-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-family: var(--display); color: var(--cyan); letter-spacing: 0.14em; }
.st-money { margin-left: auto; color: var(--gold); letter-spacing: 0.04em; font-size: 20px; }
.st-head .close { background: none; font-size: 26px; color: var(--muted); }
.st-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 38% 1fr; gap: 8px; }
.st-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
#stPreview { flex: 1; min-height: 160px; border-radius: 14px; border: 1px solid var(--edge); box-shadow: inset 0 0 40px rgba(0,0,0,0.5); touch-action: none; cursor: grab; }
.st-sel { padding: 12px; text-align: center; }
#stSelName { font-family: var(--display); font-size: 18px; color: var(--gold); }
#stSelInfo { margin: 4px 0 8px; }
.st-right { padding: 10px; display: flex; flex-direction: column; min-height: 0; }
.st-right .tabs { flex-wrap: wrap; }
.st-right .tabs button { flex: 1 0 auto; padding: 7px 8px; }
.st-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; align-content: start; padding: 2px; }
.st-item { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 8px 6px; text-align: center; font-family: var(--ui); color: var(--ink); }
.st-item .ic { font-size: 30px; line-height: 1.2; font-family: system-ui, sans-serif; }
.st-item .sw { width: 34px; height: 34px; border-radius: 50%; margin: 2px auto 4px; border: 2px solid rgba(255,255,255,0.3); }
.st-item .nm { font-weight: 700; font-size: 13px; }
.st-item .pr { font-family: var(--display); font-size: 12px; color: var(--gold); margin-top: 2px; }
.st-item.owned .pr { color: var(--green); }
.st-item.worn { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0,229,255,0.35); }
.st-item.worn .pr { color: var(--cyan); }
.st-item.sel { outline: 2px solid var(--gold); }
.st-item.cant .pr { color: var(--muted); }
.st-foot { padding: 8px 12px; text-align: center; }
@media (max-width: 640px) {
  .store-modal { width: 100vw; height: 100%; padding: 6px; gap: 6px; }
  .st-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .st-left { flex-direction: row; height: 34vh; }
  #stPreview { flex: 1.1; }
  .st-sel { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .st-grid { grid-template-columns: repeat(3, 1fr); }
  .st-foot { font-size: 11px; }
  #store { z-index: 30; }
}

/* ---------- confirm ---------- */
.cf-text { color: #cfd8f2; line-height: 1.5; text-align: left; margin: 0 0 18px; }
.cf-btns { display: flex; gap: 10px; align-items: stretch; }
.cf-btns button.big { flex: 1.4; }
button.cf-no { flex: 1; border-radius: 10px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); font-size: 15px; }
#confirm { z-index: 35; }

/* ---------- touch ---------- */
#touch { position: fixed; inset: auto 0 0 0; height: 200px; z-index: 6; pointer-events: none; }
#stick { position: absolute; left: 30px; bottom: 30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.2); pointer-events: auto; touch-action: none; }
#stick .knob { position: absolute; left: 40px; top: 40px; width: 50px; height: 50px; border-radius: 50%; background: rgba(0,229,255,0.5); box-shadow: 0 0 20px rgba(0,229,255,0.6); }
#dashBtn { position: absolute; right: 150px; bottom: 30px; width: 76px; height: 76px; border-radius: 50%; background: rgba(0,229,255,0.35); font-size: 14px; pointer-events: auto; touch-action: none; }
#fireBtn { position: absolute; right: 30px; bottom: 50px; width: 104px; height: 104px; border-radius: 50%; background: rgba(255,43,214,0.5); font-size: 18px; pointer-events: auto; touch-action: none; box-shadow: 0 0 24px rgba(255,43,214,0.5); }
#swapBtn { position: absolute; right: 44px; bottom: 166px; width: 64px; height: 44px; border-radius: 12px; background: rgba(255,210,59,0.35); font-size: 13px; pointer-events: auto; touch-action: none; }
body.playing #weap { bottom: 52px; }
#toasts { transition: bottom 0.3s; }
body.playing #toasts { bottom: 150px; }
@media (pointer: coarse) { #weap { bottom: auto; top: 86px; transform: translateX(-50%) scale(0.85); } }

@media (max-width: 900px) {
  .panel { width: 230px; }
  #minimap { display: none; }
  #hud .cell { padding: 4px 9px; min-width: 52px; }
  #hud .val { font-size: 18px; }
}
#mtabs { display: none; }
body.studio > *:not(canvas) { display: none !important; }
/* phones play in portrait only */
#rotate { display: none; position: fixed; inset: 0; z-index: 60; background: #07061a; color: var(--ink); align-items: center; justify-content: center; text-align: center; font-family: var(--display); }
#rotate > div { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#rotate b { font-weight: 400; letter-spacing: 0.1em; color: var(--gold); font-size: 20px; }
#rotate span { font-family: var(--ui); color: var(--muted); font-size: 14px; }
.rot-phone { width: 46px; height: 80px; border: 4px solid var(--cyan); border-radius: 10px; animation: rotPhone 1.6s ease-in-out infinite; box-shadow: 0 0 18px rgba(0,229,255,0.5); }
@keyframes rotPhone { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) { #rotate { display: flex; } }
@media (max-width: 640px) {
  /* phones: a tab bar at the bottom; the queue and the chat each get the full width */
  #mtabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(48px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); z-index: 8; background: rgba(6,8,26,0.94); border-top: 1px solid var(--edge); backdrop-filter: blur(8px); }
  #mtabs button { flex: 1; background: none; font-size: 14px; letter-spacing: 0.12em; color: var(--muted); position: relative; }
  #mtabs button.on { color: var(--cyan); box-shadow: inset 0 3px 0 var(--cyan); }
  #mtabs { padding-right: 104px; }
  #wallet { top: auto; right: 0; bottom: env(safe-area-inset-bottom); height: 48px; width: 104px; border-radius: 0; border: 0; border-left: 1px solid var(--edge); background: transparent; box-shadow: none; justify-content: center; padding: 4px 12px; z-index: 9; }
  #wallet .w-lbl { font-size: 9px; letter-spacing: 0.1em; }
  #wallet b { font-size: 18px; }
  #wallet .w-gain { top: auto; bottom: 100%; margin: 0 0 6px; }
  body.playing #wallet, body.storeopen #wallet { display: none !important; }
  #mtabs .badge { position: absolute; top: 8px; margin-left: 6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--pink); color: #fff; font-family: var(--ui); font-size: 11px; line-height: 18px; padding: 0 5px; }
  #queue, #side { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(56px + env(safe-area-inset-bottom)); padding: 10px; }
  #side { height: min(52vh, 430px); }
  body.mtab-queue #side, body.mtab-chat #queue, body.mtab-none #queue, body.mtab-none #side { display: none !important; }
  #side.collapsed { height: min(52vh, 430px); }
  #side.collapsed #chatLog, #side.collapsed #chatForm { display: flex; }
  #chatToggle { display: none; }
  #qList { max-height: 18vh; }
  #emotes { grid-template-columns: repeat(8, 1fr); }
  #chatForm input { font-size: 16px; } /* no zoom-in on focus (iOS) */
  #toasts { top: calc(124px + env(safe-area-inset-top)); bottom: auto; flex-direction: column; width: 92vw; }
  .toast { font-size: 13px; padding: 7px 12px; }
  #hud .sub { font-size: 10px; letter-spacing: 0.06em; white-space: normal; width: 94vw; text-align: center; }
  #queueToggle { width: 40px; height: 32px; font-size: 16px; }
  #hud { top: calc(6px + env(safe-area-inset-top)); }
  #hud .bug { display: none; }
  #hud .board { border-radius: 10px; border-left: 1px solid var(--edge); }
  #hud .keys, #hud .who { display: none; }
  #help { display: none; }
  body.playing #queue, body.playing #side, body.playing #mtabs { display: none !important; }
}
body.playing #queue, body.playing #side { opacity: 0.35; }
body.playing #queue:hover, body.playing #side:hover { opacity: 1; }
