/* OpenStudio — guest app theme (dark + lime, matches the host studio). */
:root {
  --bg: #0B0C0E; --card: #15171C; --c2: #1B1E25; --c3: #23272F;
  --ln: rgba(255,255,255,.07); --ln2: rgba(255,255,255,.13);
  --tx: #F4F5F7; --dim: #A1A7B2; --mute: #697079;
  --lime: #C8F24E; --lime-rgb: 200,242,78; --limd: #141a04; --live: #FF4D5E;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--tx);
  font-family: 'Inter', system-ui, sans-serif; overflow: hidden;
}
button { font-family: inherit; cursor: pointer; color: inherit; border: none; background: none; }
.gk { font-family: 'Space Grotesk', 'Inter', sans-serif; }
[hidden] { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--lime); display: flex; align-items: center; justify-content: center; color: var(--limd); font-size: 18px; }
.brand .wm { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 18px; letter-spacing: -.3px; }
.brand .wm b { color: var(--lime); font-weight: 600; }
.brand.small .mark { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.brand.small .wm { font-size: 15px; }

/* ---------- pre-join ---------- */
.pj-screen { align-items: center; justify-content: center; background: radial-gradient(120% 130% at 50% -10%, #15171c, #0b0c0e); padding: 20px; }
.pj-card { width: 380px; max-width: 100%; background: var(--card); border: 1px solid var(--ln); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.5); padding: 26px; }
.pj-card .tagline { color: var(--dim); font-size: 13px; margin: 8px 0 20px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 11px; color: var(--mute); letter-spacing: .3px; margin-bottom: 6px; }
.field input, .sel { width: 100%; height: 42px; background: var(--c2); border: 1px solid var(--ln2); border-radius: 11px; color: var(--tx); font-size: 14px; padding: 0 13px; font-family: inherit; }
.field input:focus, .sel:focus { outline: none; border-color: var(--lime); }
.field input:disabled, .sel:disabled { opacity: .65; cursor: default; }
/* Invite link (?room=…) → the room is already decided, so the field is replaced by
   this read-only chip: it confirms which room without reading as "fill me in". */
.roomchip { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 0 13px; height: 42px; border-radius: 11px; background: rgba(var(--lime-rgb),.10); border: 1px solid rgba(var(--lime-rgb),.35); color: var(--dim); font-size: 13px; }
.roomchip i { font-size: 16px; color: var(--lime); }
.roomchip b { color: var(--tx); font-weight: 600; }
/* Shown under a name/title field the host has taken over (see plock in app.js). */
.lockhint { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--mute); font-size: 11.5px; }
.lockhint i { font-size: 13px; }
/* Speaker picker: device list + its Test button on one line. */
.outrow { display: flex; gap: 8px; align-items: flex-start; }
.outrow .sel { flex: 1; min-width: 0; }
.outrow .upbtn { flex: none; white-space: nowrap; }
/* Disabled = this browser can't route audio at all (see OSOut) — read-only, not broken. */
.outrow .sel:disabled, .outrow .upbtn:disabled { opacity: .5; cursor: not-allowed; }
.outhint { margin: 6px 0 0; color: var(--mute); font-size: 11.5px; line-height: 1.4; }
.toggles { display: flex; gap: 8px; margin: 4px 0 18px; }
.toggle { flex: 1; height: 40px; border-radius: 11px; background: var(--c2); border: 1px solid var(--ln2); color: var(--dim); font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.toggle i { font-size: 16px; }
.toggle.on { background: rgba(var(--lime-rgb),.13); border-color: rgba(var(--lime-rgb),.45); color: var(--lime); }
.primary { width: 100%; height: 46px; border-radius: 12px; background: var(--lime); color: var(--limd); font-size: 14.5px; font-weight: 600; }
.primary:disabled { opacity: .6; cursor: default; }
.error { color: var(--live); font-size: 12.5px; margin: 12px 0 0; min-height: 1px; }

/* ---------- shared header / controls ---------- */
.bar { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--ln); background: var(--card); }
.bar .sp { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 9px; background: var(--c2); font-size: 12px; color: var(--dim); }
.pill i { font-size: 14px; }
.onair { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px; border-radius: 9px; font-size: 12px; font-weight: 600; }
.onair .dot { width: 7px; height: 7px; border-radius: 50%; }
.onair.live { background: rgba(255,77,94,.14); color: var(--live); }
.onair.live .dot { background: var(--live); animation: pulse 1.2s infinite; }
.onair.off { background: var(--c2); color: var(--dim); }
.onair.off .dot { background: var(--mute); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.controls { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--ln); background: var(--card); }
.ctl { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px; background: var(--c2); color: var(--tx); font-size: 13px; font-weight: 500; transition: color .18s ease, background .18s ease; }
.ctl i { font-size: 19px; }
.ctl:hover { background: var(--c3); }
.ctl.off { color: var(--live); background: rgba(255,77,94,.1); }
.ctl.locked { cursor: not-allowed; box-shadow: inset 0 0 0 1.5px rgba(255,77,94,.5); }
.ctl.locked:hover { background: rgba(255,77,94,.1); }
.ctl.camlocked { cursor: not-allowed; }
/* Backstage: the button still shows the guest's own mic choice (it's what happens the
   moment they're staged), dimmed with a dashed edge so it never reads as "you're live". */
.ctl.backstage { opacity: .7; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.ctl.active { color: var(--lime); background: rgba(var(--lime-rgb),.12); }
.ctl.round { padding: 0; width: 44px; justify-content: center; }
.ctl.leave { margin-left: auto; color: var(--live); background: transparent; border: 1px solid rgba(255,77,94,.3); }
/* camera acquiring: hide the icon, spin a loader in its place */
.ctl.busy > i { visibility: hidden; position: relative; }
.ctl.busy > i::after { content: ""; visibility: visible; position: absolute; left: 50%; top: 50%; width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; border-radius: 50%; border: 2px solid rgba(255,255,255,.22); border-top-color: var(--lime); animation: spin .7s linear infinite; }

/* "Starting camera…" spinner shown over an avatar while the camera warms up */
.cam-starting-ov { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--dim); font-size: 11px; font-weight: 500; letter-spacing: .2px; pointer-events: none; background: rgba(10,11,13,.32); backdrop-filter: blur(2px); animation: csfade .2s ease; }
.cam-starting-ov .cs-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--lime); animation: spin .8s linear infinite; }
@keyframes csfade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- green room ---------- */
.gr-body { flex: 1; display: flex; gap: 16px; padding: 16px; min-height: 0; align-items: stretch; }
.gr-preview { flex: 1; position: relative; border-radius: 16px; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; min-width: 0; }
.gr-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.gr-preview .avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--c3); display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 600; color: var(--tx); }
.gr-preview .avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gr-preview .np { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 7px; background: rgba(10,11,13,.55); backdrop-filter: blur(8px); padding: 6px 11px; border-radius: 9px; font-size: 12.5px; }
.gr-side { width: 320px; max-width: 38%; display: flex; flex-direction: column; gap: 14px; }
.gr-status { background: var(--card); border: 1px solid var(--ln); border-radius: 14px; padding: 18px; text-align: center; }
.gr-status .spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--c3); border-top-color: var(--lime); margin: 2px auto 12px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gr-status .gk { font-size: 15px; font-weight: 600; }
.gr-status p { color: var(--dim); font-size: 12.5px; margin: 8px 0 0; line-height: 1.5; }
.gr-setup { background: var(--card); border: 1px solid var(--ln); border-radius: 14px; padding: 16px; }
.gr-setup h3 { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 600; margin: 0 0 12px; }
.gr-setup label:not(.upbtn) { font-size: 10.5px; color: var(--mute); letter-spacing: .3px; display: block; margin: 0 0 6px; }
.gr-setup .sel { height: 38px; font-size: 12.5px; margin-bottom: 12px; }
.gr-setup .sel:last-child { margin-bottom: 0; }

/* profile photo + title controls (green room + settings) */
.prow { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.upbtn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 10px; background: var(--c3); border: 1px solid var(--ln2); color: var(--tx); font-size: 12px; font-family: inherit; cursor: pointer; }
.upbtn:hover { border-color: var(--lime); }
.upbtn i { font-size: 15px; }
.upbtn.ghost { background: transparent; color: var(--dim); }
.upbtn.ghost:hover { color: var(--live); border-color: rgba(255,77,94,.4); }
.phint { font-size: 10.5px; color: var(--mute); }

/* ---------- studio gallery ---------- */
.st-main { flex: 1; display: flex; min-height: 0; }
#program { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 14px; min-width: 0; }

/* ---------- chat panel ---------- */
/* The panel collapses to zero width (sliding its inner content out) and hands its
   space to a slim rail the guest can click to re-expand. Width + transform animate
   together so #program smoothly reclaims the space. */
.chatpanel { width: 320px; flex: none; position: relative; border-left: 1px solid var(--ln); background: var(--card); overflow: hidden; transition: width .42s cubic-bezier(.22,.61,.36,1); }
.chatpanel .chatinner { position: relative; width: 320px; height: 100%; display: flex; flex-direction: column; transition: transform .42s cubic-bezier(.22,.61,.36,1), opacity .3s ease; }
.chatpanel.collapsed { width: 0; border-left: none; }
.chatpanel.collapsed .chatinner { transform: translateX(30px); opacity: 0; }
/* close (X) button lives in the header now (moved from the top bar) */
.chatpanel .chatx { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--c2); border: 1px solid var(--ln2); color: var(--dim); display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; margin-left: 8px; transition: color .15s, background .15s, border-color .15s; }
.chatpanel .chatx:hover { color: var(--tx); background: var(--c3); border-color: var(--ln); }
/* collapsed rail — click to re-open the chat */
.chatrail { flex: none; width: 0; overflow: hidden; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--card); border: none; color: var(--dim); cursor: pointer; padding: 0; transition: width .42s cubic-bezier(.22,.61,.36,1), color .18s ease, background .18s ease; }
.chatrail.show { width: 48px; border-left: 1px solid var(--ln); }
.chatrail:hover { color: var(--tx); background: var(--c2); }
.chatrail i { font-size: 20px; }
.chatrail .railtxt { writing-mode: vertical-rl; transform: rotate(180deg); font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .8px; }
.chatrail .railbadge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--lime); color: #10210a; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chatrail.pulse i { animation: railPulse 1.6s ease-in-out infinite; }
@keyframes railPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); color: var(--lime); } }
.chatpanel .chd { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--ln); }
.chatpanel .chd .ct { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.chatpanel .chd .ct i { color: var(--mute); font-size: 14px; }
.chatpanel .seg2 { display: flex; gap: 2px; background: var(--c2); padding: 3px; border-radius: 9px; margin-left: auto; }
.chatpanel .seg2 button { height: 24px; padding: 0 9px; border-radius: 7px; font-size: 10px; color: var(--dim); background: transparent; border: none; cursor: pointer; font-family: inherit; }
.chatpanel .seg2 button.act { background: var(--card); color: var(--tx); }
.cmsgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.cmsg { display: flex; gap: 7px; align-items: center; }
@keyframes msgIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.cmsg:last-child { animation: msgIn .28s cubic-bezier(.22,.61,.36,1); }
.cmsg .ava { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; color: #fff; }
.cmsg .mb { font-size: 11px; color: var(--dim); line-height: 1.4; }
.cmsg .mb b { color: var(--tx); font-weight: 600; }
.cempty { font-size: 11.5px; color: var(--mute); text-align: center; padding: 16px 8px; line-height: 1.5; }
.cinrow { display: flex; gap: 8px; padding: 12px 14px; }
.cinput { flex: 1; min-width: 0; height: 38px; background: var(--c2); border: 1px solid var(--ln2); border-radius: 10px; color: var(--tx); font-size: 12.5px; padding: 0 12px; font-family: inherit; }
.cinput:focus { outline: none; border-color: var(--lime); }
.cinput:disabled { opacity: .5; cursor: not-allowed; }
.cinbtn { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--lime); color: #0a0b0d; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; border: none; transition: filter .15s, box-shadow .15s, opacity .15s; }
.cinbtn:hover { box-shadow: 0 0 12px rgba(var(--lime-rgb),.55); }
.cinbtn:disabled { background: var(--c3); color: var(--mute); cursor: not-allowed; box-shadow: none; }
/* a private note from the host, highlighted in the chat */
.cmsg.priv { background: linear-gradient(135deg, rgba(var(--lime-rgb),.12), rgba(var(--lime-rgb),.03)); border: 1px solid rgba(var(--lime-rgb),.38); border-radius: 11px; padding: 8px 10px; }
.cmsg.priv .mb { color: #e9f6c8; }
.cmsg .pmtag { display: flex; align-items: center; gap: 4px; font-size: 9px; letter-spacing: .3px; text-transform: uppercase; color: var(--lime); font-weight: 700; margin-bottom: 3px; }
.cmsg .pmtag i { font-size: 11px; }
/* jump-to-latest button (mirrors the host studio) */
.chatpanel .scrolldn { position: absolute; right: 16px; bottom: 74px; z-index: 6; display: none; align-items: center; gap: 3px; height: 27px; padding: 0 10px 0 8px; border-radius: 14px; background: var(--lime); color: #10210a; font-size: 10px; font-weight: 600; font-family: 'Space Grotesk', sans-serif; line-height: 1; box-shadow: 0 5px 16px rgba(0,0,0,.45); border: none; cursor: pointer; transition: transform .12s ease; }
.chatpanel .scrolldn.show { display: inline-flex; }
.chatpanel .scrolldn:hover { transform: translateY(-1px); }
.chatpanel .scrolldn i { font-size: 15px; }
.chatpanel .scrolldn:not(.hasct) { padding: 0; width: 30px; height: 30px; border-radius: 50%; justify-content: center; gap: 0; }
.chatpanel .scrolldn:not(.hasct) span { display: none; }
/* clickable links inside chat messages */
.cmsg .mb a.chatlink { color: var(--lime); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.cmsg .mb a.chatlink:hover { filter: brightness(1.15); }
/* Widget tab — read-only shared preview for guests */
.widgetpane { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 14px; }
/* Off-tab, the pane is parked instead of unmounted: it keeps a layout box (so the
   iframe stays loaded, sized and ticking) but is unpainted and untouchable. JS pins
   the exact geometry inline; these values are the fallback before it's ever shown. */
.widgetpane.stash { position: absolute; top: 0; left: 0; width: 100%; height: 100%; visibility: hidden; pointer-events: none; z-index: -1; }
.widgetpane .wgtview { flex: 1; min-height: 140px; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--ln); position: relative; }
.widgetpane .wgtframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.widgetpane .wgtempty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 22px; color: var(--mute); font-size: 12px; line-height: 1.55; background: var(--c2); }
.widgetpane .wgtempty i { font-size: 30px; color: var(--dim); }

/* on-screen popup for a host's private message (slides in, holds 7s, slides out) */
.pmbanner { position: absolute; top: 22px; left: 50%; z-index: 30; display: flex; align-items: center; gap: 12px; max-width: min(460px, 86%); padding: 13px 18px 13px 14px; border-radius: 15px; background: linear-gradient(135deg, rgba(var(--lime-rgb),.18), rgba(18,24,4,.92)); border: 1px solid rgba(var(--lime-rgb),.5); box-shadow: 0 16px 44px rgba(0,0,0,.55), 0 0 0 1px rgba(var(--lime-rgb),.22), 0 0 28px rgba(var(--lime-rgb),.35); backdrop-filter: blur(10px); opacity: 0; transform: translateX(-50%) translateY(-26px) scale(.9); pointer-events: none; }
.pmbanner .pmb-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; background: var(--lime); color: var(--limd); display: flex; align-items: center; justify-content: center; font-size: 21px; box-shadow: 0 0 16px rgba(var(--lime-rgb),.65); animation: pmpulse 1.8s ease-in-out infinite; }
.pmbanner .pmb-from { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: var(--lime); font-weight: 700; margin-bottom: 2px; }
.pmbanner .pmb-msg { font-size: 14.5px; color: #fff; line-height: 1.35; font-weight: 500; word-break: break-word; }
.pmbanner.in { animation: pmIn .55s cubic-bezier(.22,1.3,.36,1) forwards; }
.pmbanner.out { animation: pmOut .45s ease forwards; }
@keyframes pmIn { 0% { opacity: 0; transform: translateX(-50%) translateY(-26px) scale(.9); } 60% { opacity: 1; } 100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes pmOut { 0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-22px) scale(.94); } }
@keyframes pmpulse { 0%, 100% { box-shadow: 0 0 12px rgba(var(--lime-rgb),.5); } 50% { box-shadow: 0 0 22px rgba(var(--lime-rgb),.85); } }

/* ---------- settings modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(6,7,9,.6); backdrop-filter: blur(3px); padding: 20px; }
.modal .box { width: 380px; max-width: 100%; background: var(--card); border: 1px solid var(--ln2); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.55); padding: 20px; }
.modal h3 { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; margin: 0 0 16px; display: flex; align-items: center; justify-content: space-between; }
.modal .x { width: 28px; height: 28px; border-radius: 8px; background: var(--c2); color: var(--dim); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.modal label { font-size: 10.5px; color: var(--mute); letter-spacing: .3px; display: block; margin: 0 0 6px; }
.modal .sel { height: 40px; font-size: 13px; margin-bottom: 14px; }
/* button-style labels keep their flex look inside the modal — the generic .modal label
   rule above would otherwise force them to display:block, small + gray + left-aligned */
.modal .upbtn { display: inline-flex; justify-content: center; font-size: 12px; color: var(--tx); margin: 0; }
.modal .upbtn.ghost { color: var(--dim); }
.modal .upbtn.primary { width: auto; background: var(--lime); color: var(--limd); border-color: var(--lime); font-weight: 600; }
.modal .upbtn.primary:hover { filter: brightness(1.05); border-color: var(--lime); }
/* round preview of the guest's current profile photo (initials fallback) */
.savatar-sm { width: 52px; height: 52px; border-radius: 50%; flex: none; object-fit: cover; background: var(--c3); color: var(--tx); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; font-family: 'Space Grotesk', sans-serif; border: 1px solid var(--ln2); }
/* modal footer (Cancel / Save) */
.mfoot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- blocked / toast ---------- */
.blocked { align-items: center; justify-content: center; text-align: center; padding: 24px; }
.blocked .gk { font-size: 20px; font-weight: 600; }
.blocked p { color: var(--dim); margin: 10px 0 20px; }
.gtoast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 120; background: var(--c3); border: 1px solid var(--ln2); color: var(--tx); font-size: 13px; padding: 11px 16px; border-radius: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 440px; display: none; }
.gtoast.show { display: block; }

/* ---------- reconnecting ---------- */
/* Covers whatever screen they were on rather than replacing it: a dropped guest is
   still a guest, and the host is holding their stage slot. Bouncing them back to the
   join form (the old reload) is what made a 5-second blip cost a re-admit. */
.reconn { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(11,12,14,.82); backdrop-filter: blur(8px); animation: csfade .2s ease; }
.reconn[hidden] { display: none; }
.reconn-card { text-align: center; max-width: 380px; }
.reconn-spin { width: 34px; height: 34px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid rgba(255,255,255,.16); border-top-color: var(--lime); animation: spin .8s linear infinite; }
.reconn-title { font-size: 18px; font-weight: 600; color: var(--tx); }
.reconn-text { color: var(--dim); font-size: 13px; line-height: 1.55; margin: 9px 0 18px; }
/* Given up — the spinner would be a lie, so it stops and turns red. */
.reconn.failed .reconn-spin { animation: none; border-color: rgba(255,77,94,.35); border-top-color: var(--live); }
@media (prefers-reduced-motion: reduce) { .reconn-spin { animation: none; } .reconn { animation: none; } }

/* ---------- unstable-connection warning ---------- */
.netwarn { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 130; display: flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(240,180,41,.14); border: 1px solid rgba(240,180,41,.32); color: #f0b429; font-size: 12px; font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: csfade .25s ease; }
.netwarn[hidden] { display: none; }
.netwarn i { font-size: 15px; }

@media (max-width: 720px) {
  .gr-body { flex-direction: column; }
  .gr-side { width: 100%; max-width: 100%; }
  .chatpanel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 60; }
}
