:root { --text: #0b2c50; --muted: #4c6f92; --accent: #1b9cf0; --font: "Segoe UI", "Segoe UI Variable", system-ui, -apple-system, Roboto, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.4 var(--font); color: var(--text); -webkit-text-size-adjust: 100%; background: #06336b; overflow: hidden; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }

.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(120% 70% at 50% 120%, #c8f0ff, transparent 60%), linear-gradient(#06336b, #1874c9 45%, #74c9f5); }
.aurora { position: absolute; width: 140%; height: 60%; left: -20%; border-radius: 50%; filter: blur(50px); opacity: .45; mix-blend-mode: screen; animation: drift 40s ease-in-out infinite alternate; }
.aurora.a1 { top: 35%; background: radial-gradient(closest-side, #57f2c4, transparent); }
.aurora.a2 { top: 5%; background: radial-gradient(closest-side, #7bd2ff, transparent); animation-duration: 55s; }
@keyframes drift { from { transform: translateX(-8%) rotate(-4deg); } to { transform: translateX(8%) rotate(5deg); } }
.bubbles span { position: absolute; bottom: -80px; border-radius: 50%; animation: rise linear infinite;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.85) 0 8%, rgba(255,255,255,.12) 30%, rgba(255,255,255,.05) 60%, rgba(255,255,255,.35) 100%); }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translate(20px, -115vh); opacity: 0; } }

.screen { position: relative; z-index: 1; height: 100%; }
.glass-window { border-radius: 10px; border: 1px solid rgba(0,30,70,.55); background: linear-gradient(rgba(190,225,250,.85), rgba(150,200,240,.8) 36px, rgba(150,200,240,.8));
  box-shadow: 0 18px 50px rgba(0,20,50,.55), inset 0 0 0 1px rgba(255,255,255,.7); backdrop-filter: blur(18px) saturate(160%); }
.glass { border-radius: 12px; border: 1px solid rgba(255,255,255,.8); background: linear-gradient(rgba(255,255,255,.66), rgba(226,242,255,.5)); box-shadow: 0 4px 16px rgba(0,30,70,.25), inset 0 1px 0 #fff; backdrop-filter: blur(16px); }
.win-title { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #fff; font-weight: 600; text-shadow: 0 0 6px rgba(0,50,120,.9); }
.win-body { margin: 0 8px 8px; padding: 22px; border-radius: 5px; background: #fff; border: 1px solid rgba(0,40,90,.35); text-align: center; }
.logo-sm { width: 20px; height: 20px; }
.logo-big { width: 84px; height: 84px; filter: drop-shadow(0 6px 12px rgba(0,40,100,.35)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }

#join { display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); padding: 16px; overflow: auto; }
.join-card { width: 420px; max-width: 100%; }
h1 { margin: 6px 0 2px; font-size: 22px; }
.room-now { color: var(--muted); font-size: 13px; min-height: 18px; margin-bottom: 12px; }
form label { display: block; text-align: left; font-weight: 600; font-size: 12.5px; margin: 10px 0 0; }
form input:not([type=radio]) { display: block; width: 100%; margin-top: 4px; height: 34px; padding: 4px 10px; border-radius: 4px; border: 1px solid #8db2d4; box-shadow: inset 0 1px 2px rgba(0,30,70,.15); outline: none; }
form input:focus { border-color: #3d9be9; box-shadow: 0 0 0 3px rgba(80,170,255,.3); }
.mode-pick { display: flex; gap: 8px; margin: 14px 0; }
.mode { flex: 1; margin: 0 !important; cursor: pointer; }
.mode input { position: absolute; opacity: 0; }
.mode span { display: block; padding: 10px; border-radius: 8px; border: 1px solid #a9c6e0; background: linear-gradient(#fff, #edf5fc); text-align: center; transition: all .15s; }
.mode small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.mode input:checked + span { border-color: #2f8fd8; background: linear-gradient(#e2f5ff, #c3e7fc 48%, #a9dbfb 50%, #c7eafd); box-shadow: 0 0 10px rgba(60,170,255,.5); }
.gel { cursor: pointer; border-radius: 6px; border: 1px solid #1468a8; color: #fff; font-weight: 700; text-shadow: 0 1px 1px rgba(0,40,90,.7); padding: 6px 14px;
  background: linear-gradient(#c9f2ff 0%, #6fcbff 46%, #1e95e6 50%, #3fb3ff 85%, #8fe0ff 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 1px 3px rgba(0,40,90,.35); }
.gel:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 0 12px rgba(60,190,255,.9); }
.gel.big { width: 100%; padding: 11px; font-size: 16px; border-radius: 8px; }
.gel.small { padding: 4px 10px; font-size: 13px; }
.err { color: #c62b0f; margin-top: 10px; font-size: 13px; }

#player { display: grid; grid-template-columns: minmax(0, 1fr) var(--chatW, 320px); grid-template-areas: "top top" "main chat"; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
#player .topbar { grid-area: top; }
#player .stage-wrap { grid-area: main; }
#player .chat { grid-area: chat; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: #fff; text-shadow: 0 1px 3px rgba(0,30,70,.8);
  background: linear-gradient(rgba(255,255,255,.3), rgba(255,255,255,.06) 50%, rgba(0,20,50,.15) 51%, rgba(255,255,255,.08)); border-bottom: 1px solid rgba(255,255,255,.4); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.live-badge { font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 2px 10px; border-radius: 10px; background: linear-gradient(#ffb0a2, #ef4b35 50%, #c8200b); box-shadow: 0 0 10px rgba(255,60,40,.6); }
.live-badge.off { background: linear-gradient(#ccc, #888 50%, #666); box-shadow: none; }
.spacer { flex: 1; }
.count { font-weight: 700; }
.stage-wrap { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.stage { position: relative; flex: 1; min-height: 0; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid rgba(255,255,255,.7); box-shadow: 0 10px 30px rgba(0,20,60,.5); }
.stage video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.stage.audio-mode video { opacity: 0; }
.audio-art { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #39a7f0, #0b3a75 70%); }
.orb { width: 160px; height: 160px; border-radius: 50%; position: relative; background: radial-gradient(circle at 38% 30%, #fff 0 8%, #a6f1ff 28%, #1ea3f5 65%, #06508f); box-shadow: 0 0 60px rgba(120,220,255,.7); animation: breathe 2.4s ease-in-out infinite; }
.orb-shine { position: absolute; left: 25px; right: 25px; top: 10px; height: 60px; border-radius: 50%; background: linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,0)); }
@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 0 90px rgba(140,240,255,.9); } }
.eq { position: absolute; bottom: 22%; display: flex; gap: 6px; align-items: flex-end; height: 40px; }
.eq span { width: 8px; background: linear-gradient(#e9fff2, #7ff06a); border-radius: 3px; animation: eq 0.9s ease-in-out infinite alternate; }
.eq span:nth-child(2) { animation-delay: -.3s; } .eq span:nth-child(3) { animation-delay: -.6s; } .eq span:nth-child(4) { animation-delay: -.15s; } .eq span:nth-child(5) { animation-delay: -.45s; }
@keyframes eq { from { height: 8px; } to { height: 40px; } }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; background: rgba(0,20,50,.55); text-shadow: 0 1px 3px #000; transition: opacity .3s; }
.overlay.hide { opacity: 0; pointer-events: none; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #7fe1ff; animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.tap-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 14px 28px; font-size: 18px; border-radius: 30px; cursor: pointer; color: #fff; font-weight: 700;
  border: 1px solid #1f5c10; background: radial-gradient(circle at 50% 120%, #d2ffc0, #45b923 50%, #12520a); box-shadow: 0 0 20px rgba(120,255,80,.8); }
.controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; opacity: 0; transition: opacity .25s;
  background: linear-gradient(transparent, rgba(0,10,30,.85)); color: #fff; }
.stage:hover .controls, .stage.show-controls .controls { opacity: 1; }
.ctl { min-width: 34px; height: 30px; border-radius: 15px; cursor: pointer; border: 1px solid rgba(255,255,255,.5); color: #fff; background: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.08) 50%, rgba(0,0,0,.2) 51%, rgba(255,255,255,.12)); }
.ctl:hover { box-shadow: 0 0 10px rgba(120,220,255,.8); }
.ctl.live { font-size: 11px; font-weight: 800; padding: 0 10px; }
.ctl.live.behind { background: linear-gradient(#ffd27a, #e38a00 50%, #b86200); }
.controls input[type=range] { width: 100px; accent-color: #7fe1ff; }
.controls select { background: rgba(0,0,0,.4); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 12px; padding: 3px 8px; }
.lat { font-size: 11px; opacity: .75; }
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floaters span { position: absolute; bottom: 10%; font-size: 34px; animation: up 3s ease-out forwards; }
@keyframes up { 0% { transform: translateY(0) scale(.5); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.1); } 100% { transform: translateY(-60vh) scale(1); opacity: 0; } }
.now { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex: none; }
.now-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: radial-gradient(circle at 38% 30%, #fff 0 10%, #a6f1ff 30%, #1ea3f5 70%, #06508f); box-shadow: 0 2px 6px rgba(0,30,70,.35); flex: none; }
.now-text { flex: 1; min-width: 0; }
.now-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reacts { display: flex; gap: 4px; }
.reacts button { font-size: 20px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 1px solid #9cbbd8; background: linear-gradient(#fff, #e3f0fa); transition: transform .1s; }
.reacts button:hover { transform: translateY(-2px) scale(1.08); box-shadow: 0 0 10px rgba(70,170,255,.7); }
.reacts button:active { transform: scale(.9); }
.chat { margin: 12px 12px 12px 0; display: flex; flex-direction: column; min-height: 0; }
.chat-head { padding: 8px 12px; font-weight: 700; border-bottom: 1px solid rgba(110,160,210,.35); }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 12px; }
.chat-log .m { padding: 3px 0; word-wrap: break-word; }
.chat-log .m b { color: #0c64ad; }
.chat-log .m.host b { color: #c2410c; }
.chat-log .m.host b::after { content: ' 🎧'; }
.chat-log .sys { color: var(--muted); font-size: 12px; font-style: italic; text-align: center; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(110,160,210,.35); }
.chat-form input { flex: 1; height: 32px; padding: 4px 10px; border-radius: 16px; border: 1px solid #8db2d4; outline: none; }

.stage canvas#liveCanvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.transport-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; color: #fff; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.4); }
.transport-badge.live { background: linear-gradient(#ffe39a, #e8a100 50%, #c47c00); color: #3a2400; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.mode-hint { font-size: 12.5px; color: var(--muted); margin: -4px 0 10px; text-align: left; }
.mode-hint.live { color: #8a5a00; }
.compat { display: flex !important; align-items: center; gap: 6px; font-weight: 400 !important; font-size: 12px !important; color: var(--muted); margin: 0 0 12px !important; }
.compat input { width: auto !important; height: auto !important; display: inline !important; margin: 0 !important; }

/* ---------------------------------------------------------------- Glass Hill: custom sign-in page */
.join-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#join .join-card { position: relative; z-index: 1; }
#join .join-card.placed { position: fixed; margin: 0; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); max-height: 96vh; overflow: auto; }
.join-card.gone { visibility: hidden; }
.join-card.themed .gel.big { border-color: color-mix(in srgb, var(--accent) 70%, #000);
  background: linear-gradient(color-mix(in srgb, var(--accent) 25%, #fff) 0%, color-mix(in srgb, var(--accent) 65%, #fff) 46%, var(--accent) 50%, color-mix(in srgb, var(--accent) 80%, #fff) 85%, color-mix(in srgb, var(--accent) 45%, #fff) 100%); }
.join-card.themed .mode input:checked + span { border-color: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
.join-card.theme-dark, .join-card.theme-neon { border-color: rgba(140,210,255,.45); background: linear-gradient(rgba(30,60,100,.85), rgba(8,22,44,.88)); color: #e6f4ff; }
.join-card.theme-dark .win-body, .join-card.theme-neon .win-body { background: rgba(4,14,30,.75); border-color: rgba(140,210,255,.3); color: #e6f4ff; }
.join-card.theme-dark .room-now, .join-card.theme-neon .room-now, .join-card.theme-dark .mode small, .join-card.theme-neon .mode small, .join-card.theme-dark .mode-hint, .join-card.theme-neon .mode-hint { color: #9ab9d6; }
.join-card.theme-dark form input:not([type=radio]), .join-card.theme-neon form input:not([type=radio]) { background: rgba(0,0,0,.35); color: #fff; border-color: #3c6390; }
.join-card.theme-dark .mode span, .join-card.theme-neon .mode span { background: rgba(255,255,255,.06); border-color: #3c6390; color: #e6f4ff; }
.join-card.theme-dark .mode input:checked + span, .join-card.theme-neon .mode input:checked + span { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.join-card.theme-neon { box-shadow: 0 0 0 1px var(--accent), 0 0 30px color-mix(in srgb, var(--accent) 70%, transparent), 0 18px 50px rgba(0,0,0,.6); background: rgba(5,5,20,.9); }
.join-card.theme-neon .win-body { background: rgba(0,0,10,.6); }
.join-card.theme-neon h1 { text-shadow: 0 0 12px var(--accent); }
/* Glass Ocean: the sign-in card as designed in the Studio */
.join-msg { margin: 2px 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.join-card.custom { border-color: var(--card-line); border-radius: var(--card-radius); color: var(--card-text); font-family: var(--card-font, var(--font));
  background: linear-gradient(var(--card-top), var(--card-bottom) 36px, var(--card-bottom));
  backdrop-filter: blur(var(--card-blur)) saturate(160%); -webkit-backdrop-filter: blur(var(--card-blur)) saturate(160%);
  box-shadow: 0 18px 50px rgba(0,20,50,calc(.55 * var(--card-shadow))), inset 0 0 0 1px rgba(255,255,255,calc(.7 * var(--card-shadow))); }
.join-card.custom.theme-neon { box-shadow: 0 0 0 1px var(--accent), 0 0 30px color-mix(in srgb, var(--accent) calc(70% * var(--card-shadow)), transparent), 0 18px 50px rgba(0,0,0,calc(.6 * var(--card-shadow))); }
.join-card.custom .win-body { background: var(--card-body); border-color: color-mix(in srgb, var(--card-line) 60%, transparent); border-radius: max(0px, calc(var(--card-radius) - 5px)); color: var(--card-text); }
.join-card.custom.no-bar .win-body { margin-top: 8px; }
.join-card.custom h1, .join-card.custom form label { color: var(--card-text); }
.join-card.custom .room-now, .join-card.custom .mode small, .join-card.custom .mode-hint, .join-card.custom .compat { color: var(--card-muted); }
.join-card.custom.see-through { box-shadow: none; }
.join-card.custom.see-through .win-body { border-color: transparent; }
.join-card.custom.see-through h1, .join-card.custom.see-through .join-msg, .join-card.custom.see-through .room-now,
.join-card.custom.see-through form label, .join-card.custom.see-through .mode-hint, .join-card.custom.see-through .compat { text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 10px rgba(0,0,0,.35); }
@keyframes j-fade { from { opacity: 0; } }
@keyframes j-pop { from { opacity: 0; scale: .3; } }
@keyframes j-zoom { from { opacity: 0; scale: .5; } }
@keyframes j-slideL { from { opacity: 0; translate: -40vw 0; } }
@keyframes j-slideR { from { opacity: 0; translate: 40vw 0; } }
@keyframes j-slideU { from { opacity: 0; translate: 0 30vh; } }
@keyframes j-slideD { from { opacity: 0; translate: 0 -30vh; } }
@keyframes j-drop { 0% { translate: 0 -60vh; } 60% { translate: 0 2vh; } 80% { translate: 0 -1vh; } }
@keyframes j-blur { from { opacity: 0; filter: blur(20px); } }
@keyframes j-spin { from { opacity: 0; rotate: -180deg; scale: .2; } }
@keyframes j-flip { from { scale: 0 1; } }
@keyframes j-typewriter { from { opacity: 0; } }

/* ---------------------------------------------------------------- live polls */
.poll { padding: 10px 14px; flex: none; animation: j-pop .4s cubic-bezier(.2,.8,.3,1.2); }
.poll-q { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.poll-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.poll-opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; cursor: pointer; text-align: left;
  border: 1px solid #9cbbd8; background: linear-gradient(#fff, #e3f0fa); color: var(--text); font-weight: 600; }
.poll-opt:hover:not(:disabled) { box-shadow: 0 0 10px rgba(70,170,255,.7); }
.poll-opt.mine { border-color: #2f8fd8; box-shadow: 0 0 0 2px rgba(47,143,216,.5); }
.poll-opt:disabled { cursor: default; }
.poll-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(127,216,255,.55), rgba(27,156,240,.55)); transition: width .4s; }
.poll-t, .poll-p { position: relative; }
.poll-t { flex: 1; }
.poll-foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.poll.closed { opacity: .85; }

/* ================================================================ Glass Cloud: guest layouts */
.page-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.sky[hidden] { display: none !important; }
.stage { border-radius: var(--r, 12px); }
.glass { border-radius: var(--r, 12px); }
.stage, .now, .poll { width: min(100%, var(--stageMax, 100%)); align-self: center; }
.preview-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.brand { min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .logo-sm { object-fit: contain; flex: none; }
.icon { position: relative; }
.unread { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; font: 700 10px/17px var(--font);
  background: #ef4b35; color: #fff; text-shadow: none; box-shadow: 0 0 0 2px #fff; }
.chat-head { display: flex; align-items: center; }
.chat-head span { flex: 1; }
.chat-close { display: none; border: none; background: none; font-size: 16px; cursor: pointer; color: inherit; padding: 0 4px; }
.t-nocount .count, .t-nolat .lat, .t-nobadge .transport-badge { display: none; }

.reacts button.more { font-size: 18px; font-weight: 700; color: #0c64ad; }
.stage-reacts { display: none; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); flex-direction: column; gap: 6px; z-index: 3; }
.stage-reacts button { font-size: 20px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 1px solid rgba(255,255,255,.6); background: rgba(0,20,50,.45); backdrop-filter: blur(6px); color: #fff; }
.stage-reacts button:hover { box-shadow: 0 0 10px rgba(120,220,255,.8); }
.floaters span.stk { bottom: 12%; animation-duration: 3.3s; }
.floaters span.stk img, .floaters span.stk video { width: 96px; height: 96px; object-fit: contain; display: block; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }

/* desktop arrangements */
body:not(.mobile).d-chat-left #player { grid-template-columns: var(--chatW, 320px) minmax(0, 1fr); grid-template-areas: "top top" "chat main"; }
body:not(.mobile).d-chat-left .chat { margin: 12px 0 12px 12px; }
body:not(.mobile).chat-off #player { grid-template-columns: minmax(0, 1fr) 0; grid-template-areas: "top top" "main chat"; }
body:not(.mobile).chat-off .chat { display: none; }
body:not(.mobile).d-now-above .now { order: -1; }
body:not(.mobile).d-now-hidden .now { display: none; }
body:not(.mobile).d-react-stage .stage-reacts { display: flex; }
body:not(.mobile).d-react-stage .now .reacts { display: none; }
body:not(.mobile).d-chat-hidden .chat-close { display: block; }
body.d-top-dark:not(.mobile) .topbar, body.m-top-dark.mobile .topbar { background: rgba(0,12,32,.78); border-bottom-color: rgba(140,200,255,.25); }
body.d-top-minimal:not(.mobile) .topbar, body.m-top-minimal.mobile .topbar { background: none; border-bottom: none; }
body.d-top-hidden:not(.mobile) .topbar, body.m-top-hidden.mobile .topbar { display: none; }
.fab-col { display: none; }

/* custom accent */
body.t-accent .gel { border-color: color-mix(in srgb, var(--accent) 70%, #000);
  background: linear-gradient(color-mix(in srgb, var(--accent) 25%, #fff) 0%, color-mix(in srgb, var(--accent) 65%, #fff) 46%, var(--accent) 50%, color-mix(in srgb, var(--accent) 80%, #fff) 85%, color-mix(in srgb, var(--accent) 45%, #fff) 100%); }
body.t-accent .chat-log .m b, body.t-accent .reacts button.more { color: color-mix(in srgb, var(--accent) 75%, #000); }
body.t-accent .poll-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 35%, transparent), color-mix(in srgb, var(--accent) 65%, transparent)); }
body.t-accent .poll-opt.mine { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent); }

/* panel themes */
body.t-dark .glass, body.t-neon .glass { background: linear-gradient(rgba(24,44,74,.82), rgba(8,20,40,.86)); border-color: rgba(140,200,255,.3); color: #e6f4ff; box-shadow: 0 6px 20px rgba(0,0,0,.45); }
body.t-dark .now-sub, body.t-neon .now-sub, body.t-dark .poll-foot, body.t-neon .poll-foot, body.t-dark .chat-log .sys, body.t-neon .chat-log .sys { color: #9ab9d6; }
body.t-dark .chat-log .m b, body.t-neon .chat-log .m b { color: #8fd8ff; }
body.t-dark .chat-form input, body.t-neon .chat-form input, body.t-dark .picker-foot input, body.t-neon .picker-foot input { background: rgba(0,0,0,.35); color: #fff; border-color: #3c6390; }
body.t-dark .reacts button, body.t-neon .reacts button, body.t-dark .poll-opt, body.t-neon .poll-opt { background: rgba(255,255,255,.08); border-color: rgba(140,200,255,.35); color: #e6f4ff; }
body.t-dark .reacts button.more, body.t-neon .reacts button.more { color: #8fd8ff; }
body.t-dark .chat-head, body.t-neon .chat-head, body.t-dark .chat-form, body.t-neon .chat-form { border-color: rgba(140,200,255,.2); }
body.t-neon .glass { background: rgba(4,4,18,.88); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); }
body.t-neon .stage { border-color: var(--accent); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 60%, transparent); }
body.t-neon .now-title, body.t-neon .poll-q { text-shadow: 0 0 10px var(--accent); }
body.t-bubble .glass { background: linear-gradient(color-mix(in srgb, var(--accent) 45%, #fff), color-mix(in srgb, var(--accent) 80%, #fff) 50%, var(--accent) 51%, color-mix(in srgb, var(--accent) 70%, #fff));
  border: 1px solid rgba(255,255,255,.9); color: #fff; text-shadow: 0 1px 2px rgba(0,30,80,.45); border-radius: max(18px, var(--r, 12px)); }
body.t-bubble .now-sub, body.t-bubble .poll-foot, body.t-bubble .chat-log .sys, body.t-bubble .chat-log .m b { color: #fff; }
body.t-bubble .chat-log { background: rgba(255,255,255,.88); color: var(--text); text-shadow: none; margin: 0 8px; border-radius: 10px; }
body.t-bubble .chat-log .m b { color: color-mix(in srgb, var(--accent) 75%, #000); }
body.t-bubble .chat-log .sys { color: var(--muted); }
body.t-bubble .poll-opt { text-shadow: none; }
body.t-minimal .glass { background: rgba(255,255,255,.96); border: 1px solid rgba(0,0,0,.08); box-shadow: 0 2px 10px rgba(0,0,0,.15); backdrop-filter: none; }
body.t-minimal .stage { border: none; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
body.t-minimal .topbar { background: rgba(0,0,0,.35); border-bottom: none; }

/* ---------------------------------------------------------------- picker */
.picker { position: fixed; z-index: 40; width: 340px; height: 330px; display: flex; flex-direction: column; overflow: hidden; }
.picker-tabs { display: flex; gap: 2px; padding: 6px 6px 0; overflow-x: auto; scrollbar-width: none; flex: none; }
.picker-tabs::-webkit-scrollbar { display: none; }
.ptab { flex: none; width: 34px; height: 32px; font-size: 17px; border: none; border-radius: 8px 8px 0 0; background: none; cursor: pointer; opacity: .6; }
.ptab.on { opacity: 1; background: rgba(255,255,255,.7); box-shadow: inset 0 -2px 0 var(--accent); }
.picker-body { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); align-content: start; gap: 2px; padding: 6px; background: rgba(255,255,255,.55); }
.pemo { height: 38px; font-size: 22px; border: none; background: none; border-radius: 8px; cursor: pointer; padding: 0; line-height: 38px; }
.pemo:hover, .pemo:focus-visible { background: rgba(27,156,240,.18); }
.picker-body.stickers { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.pstk { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 10px; border: 1px solid rgba(110,160,210,.4); background: rgba(255,255,255,.75); cursor: pointer; min-width: 0; color: var(--text); }
.pstk img, .pstk video { width: 64px; height: 64px; object-fit: contain; }
.pstk span { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstk:hover { box-shadow: 0 0 10px rgba(70,170,255,.6); }
.picker-foot { display: flex; gap: 6px; padding: 6px; flex: none; }
.picker-foot input { flex: 1; min-width: 0; height: 32px; padding: 4px 10px; border-radius: 16px; border: 1px solid #8db2d4; outline: none; font-size: 15px; }
.picker-close { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #9cbbd8; background: linear-gradient(#fff, #e3f0fa); cursor: pointer; }
.picker.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: min(52vh, 420px); border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
body.t-dark .picker-body, body.t-neon .picker-body { background: rgba(0,0,0,.25); }
body.t-dark .ptab.on, body.t-neon .ptab.on { background: rgba(255,255,255,.12); }
body.t-dark .pstk, body.t-neon .pstk { background: rgba(255,255,255,.08); color: #e6f4ff; }

/* ================================================================ phones & tablets */
body.mobile { font-size: 15px; }
body.mobile .topbar { gap: 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); flex: none; }
body.mobile .brand { font-size: 15px; flex: 0 1 auto; }
body.mobile .live-badge { font-size: 10px; padding: 2px 7px; flex: none; }
body.mobile .transport-badge { font-size: 10px; padding: 2px 7px; flex: none; white-space: nowrap; }
body.mobile .count { flex: none; font-size: 13px; }
body.mobile .gel.small { padding: 4px 9px; }
body.mobile .controls { opacity: 1; gap: 6px; padding: 18px 8px 6px; }
body.mobile .ctl { min-width: 32px; height: 30px; padding: 0 6px; flex: none; }
body.mobile .ctl.live { padding: 0 8px; }
body.mobile #vol { display: none; }
body.mobile .lat { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.mobile .controls select { max-width: 104px; padding: 3px 6px; font-size: 13px; flex: none; }
body.mobile .floaters span { font-size: 28px; }
body.mobile .floaters span.stk img, body.mobile .floaters span.stk video { width: 72px; height: 72px; }
body.mobile .tap-play { font-size: 16px; padding: 12px 22px; white-space: nowrap; }
body.mobile .fab { width: 48px; height: 48px; border-radius: 50%; font-size: 22px; cursor: pointer; position: relative; color: #fff;
  border: 1px solid rgba(255,255,255,.75); background: radial-gradient(circle at 40% 30%, color-mix(in srgb, var(--accent, #1b9cf0) 40%, #fff), var(--accent, #1b9cf0) 70%); box-shadow: 0 4px 14px rgba(0,30,70,.45); }
body.mobile .fab-col { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 15; flex-direction: column; gap: 10px; }
body.mobile .fab { display: none; }
body.mobile.m-react-button .fab-col, body.mobile.m-now-hidden .fab-col, body.mobile.portrait.m-chat-drawer .fab-col { display: flex; }
body.mobile.m-react-button #fabReact, body.mobile.m-now-hidden #fabReact, body.mobile.portrait.m-chat-drawer #fabChat { display: block; }
body.mobile.m-react-button .now .reacts { display: none; }
body.mobile .chat-log { font-size: 15px; }
body.mobile .chat-form input { height: 38px; font-size: 16px; }

/* join page */
body.mobile #join { padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); align-items: start; }
body.mobile .join-card { width: 100%; max-width: 460px; justify-self: center; margin-top: 2vh; }
body.mobile .win-body { padding: 16px 14px; }
body.mobile .logo-big { width: 64px; height: 64px; }
body.mobile h1 { font-size: 20px; overflow-wrap: anywhere; }
body.mobile .mode-pick { gap: 6px; }
body.mobile .mode span { padding: 9px 6px; }
body.mobile .mode b { font-size: 13.5px; white-space: nowrap; }
body.mobile .mode small { font-size: 11px; }
body.mobile form input:not([type=radio]) { height: 40px; font-size: 16px; }
@media (max-width: 359px) { body.mobile .mode-pick { flex-direction: column; } }

/* portrait: one scrolling column; sections in the host's order */
body.mobile.portrait #player, body.mobile.landscape.m-land-split #player { display: flex; flex-direction: column; height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
body.mobile.portrait .stage-wrap { display: contents; }
body.mobile.portrait .stage, body.mobile.portrait .poll, body.mobile.portrait .now, body.mobile.landscape.m-land-split .now, body.mobile.landscape.m-land-split .poll { align-self: stretch; min-width: 0; }
body.mobile.portrait .stage { order: var(--o-stage, 0); flex: none; width: 100%; aspect-ratio: 16 / 9; border-radius: 0; border-left: none; border-right: none; box-shadow: 0 6px 18px rgba(0,20,60,.45); }
body.mobile.portrait.m-sticky .stage { position: sticky; top: 0; z-index: 4; }
body.mobile.portrait .poll { order: var(--o-poll, 1); margin: 10px 10px 0; width: auto; }
body.mobile.portrait .now { order: var(--o-now, 2); margin: 10px 10px 0; width: auto; flex-wrap: wrap; gap: 8px 10px; padding: 10px; }
body.mobile.portrait .now-text { flex: 1 1 0; min-width: 0; }
body.mobile.portrait .now .reacts { flex: 1 0 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 4px; }
body.mobile.portrait .now .reacts::-webkit-scrollbar { display: none; }
body.mobile .reacts button { flex: none; width: 40px; height: 40px; font-size: 20px; }
body.mobile.portrait .chat { order: var(--o-chat, 3); margin: 10px; min-height: max(320px, 50vh); flex: 1 0 auto; }
body.mobile.portrait.m-now-hidden .now { display: none; }
body.mobile.portrait .poll-opts { grid-template-columns: 1fr; }

/* chat as a pull-up sheet */
body.mobile.portrait.m-chat-drawer .chat, body.mobile.landscape.m-land-fullscreen .chat {
  position: fixed; z-index: 20; margin: 0; min-height: 0; transition: transform .28s cubic-bezier(.2,.8,.3,1); }
body.mobile.portrait.m-chat-drawer .chat { left: 0; right: 0; bottom: 0; height: 68vh; border-radius: 18px 18px 0 0; transform: translateY(105%); padding-bottom: env(safe-area-inset-bottom); }
body.mobile.portrait.m-chat-drawer .chat-close, body.mobile.landscape.m-land-fullscreen .chat-close { display: block; }
body.mobile.chat-open .chat { transform: none !important; box-shadow: 0 -10px 40px rgba(0,20,60,.5); }

/* landscape phone: full-screen stage */
body.mobile.landscape.m-land-fullscreen #player { display: block; height: 100%; }
body.mobile.landscape.m-land-fullscreen .topbar { display: none; }
body.mobile.landscape.m-land-fullscreen .stage-wrap { padding: 0; height: 100%; }
body.mobile.landscape.m-land-fullscreen .stage { position: fixed; inset: 0; width: 100%; height: 100%; border: none; border-radius: 0; }
body.mobile.landscape.m-land-fullscreen .now { display: none; }
body.mobile.landscape.m-land-fullscreen .poll { position: fixed; left: max(8px, env(safe-area-inset-left)); top: 8px; z-index: 6; width: min(44vw, 340px); padding: 8px 10px; max-height: calc(100% - 70px); overflow-y: auto; }
body.mobile.landscape.m-land-fullscreen .poll-opts { grid-template-columns: 1fr; gap: 4px; }
body.mobile.landscape.m-land-fullscreen .poll-opt { padding: 5px 10px; }
body.mobile.landscape.m-land-fullscreen .chat { top: 0; right: 0; bottom: 0; width: min(46vw, 360px); border-radius: 16px 0 0 16px; transform: translateX(105%); padding-right: env(safe-area-inset-right); }
body.mobile.landscape.m-land-fullscreen .fab-col { display: flex; bottom: 64px; }
body.mobile.landscape.m-land-fullscreen .fab { display: block; width: 44px; height: 44px; font-size: 20px; }
body.mobile.landscape.m-land-fullscreen .stage-reacts { display: none; }

/* landscape phone: stage + side column */
body.mobile.landscape.m-land-split #player { display: grid; grid-template-columns: minmax(0, 1fr) min(40vw, 340px); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "stage now" "stage poll" "stage chat"; overflow: hidden; }
body.mobile.landscape.m-land-split .topbar { display: none; }
body.mobile.landscape.m-land-split .stage-wrap { display: contents; }
body.mobile.landscape.m-land-split .stage { grid-area: stage; width: 100%; height: 100%; border-radius: 0; border: none; align-self: stretch; }
body.mobile.landscape.m-land-split .now { grid-area: now; margin: 6px 6px 0; width: auto; flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
body.mobile.landscape.m-land-split .now-icon { width: 34px; height: 34px; font-size: 17px; }
body.mobile.landscape.m-land-split .now-text { flex: 1 1 0; min-width: 0; }
body.mobile.landscape.m-land-split .now .reacts { flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; }
body.mobile.landscape.m-land-split .reacts button { width: 34px; height: 34px; font-size: 17px; }
body.mobile.landscape.m-land-split .poll { grid-area: poll; margin: 6px 6px 0; width: auto; padding: 6px 8px; }
body.mobile.landscape.m-land-split .poll-opts { grid-template-columns: 1fr; gap: 4px; }
body.mobile.landscape.m-land-split .chat { grid-area: chat; margin: 6px; min-height: 0; }
body.mobile.landscape.m-land-split.m-now-hidden .now { display: none; }
body.mobile.landscape .picker.sheet { left: auto; width: min(100%, 460px); height: 78vh; border-radius: 18px 0 0 0; }
body.mobile.landscape .controls { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
body.mobile.landscape .lat { display: none; }

/* Glass Reef: parts you hid, blocks you added, the audio-only screen and the be-right-back screen */
.gp-off { display: none !important; }
.gp-zone { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gp-zone[hidden] { display: none; }
.z-top { flex-direction: row; align-items: center; flex-wrap: wrap; }
.z-above, .z-below, .z-footer { width: min(100%, var(--stageMax, 100%)); align-self: center; }
.z-chat { padding: 8px 10px 0; }
.z-join { margin-top: 12px; }
.gp-block { overflow-wrap: anywhere; }
.gp-text { white-space: pre-line; }
.gp-link { display: inline-block; align-self: center; padding: 8px 16px; border-radius: var(--r, 10px); color: #fff; font-weight: 600; text-decoration: none;
  background: linear-gradient(color-mix(in srgb, var(--accent) 55%, #fff), var(--accent) 50%, color-mix(in srgb, var(--accent) 85%, #000)); box-shadow: 0 2px 8px rgba(0,20,60,.3); }
.gp-link:hover { filter: brightness(1.08); }
.gp-img { max-width: 100%; height: 48px; object-fit: contain; align-self: center; }
.z-top .gp-text, .z-top .gp-link { padding: 4px 10px; font-size: 13px; }
.z-top .gp-img { height: 26px; }
body.mobile.portrait .z-above { order: -1; margin: 10px 10px 0; width: auto; }
body.mobile.portrait .z-below, body.mobile.portrait .z-footer { order: 50; margin: 10px; width: auto; }
body.mobile.landscape .z-above, body.mobile.landscape .z-below, body.mobile.landscape .z-footer { display: none; }
.audio-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.away { position: absolute; inset: 0; z-index: 4; background: #031a38; }
.away canvas { width: 100%; height: 100%; display: block; }
.away-banner { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  color: #fff; font-weight: 600; background: rgba(0,12,32,.72); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(8px); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.spinner.small { width: 16px; height: 16px; border-width: 2px; margin: 0; flex: none; }
#qualSel { margin-left: 4px; }
/* the quality picker shares the phone control bar: both pickers give up some width */
body.mobile .controls select { max-width: 86px; text-overflow: ellipsis; }
body.mobile #qualSel { max-width: 72px; margin-left: 0; }
