/* ==========================================================================
   VibeRoom — "spotlight deck"
   One wide conversation lit in the middle of a dark glass room: a floating
   command bar above it, room tabs along its top edge, a dock of server drops
   below. Electric blue is the light and only shows where you can act or where
   something is live. Loaded after app.css: re-tokens the themes, reshapes the
   shell (see renderShell in js/app.js) and carries the motion from js/deck.js.
   ========================================================================== */

@property --sw { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --ink: #05070d;
  --accent: #2f7bff; --cyan: #5ad1ff; --green: #3ddc84; --red: #ff4d6d; --yellow: #f5b83d; --blue: #7cbcff;
  --radius: 12px; --radius-lg: 20px; --slab-r: 18px; --deck-gap: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --edge: rgba(130, 170, 255, .13);
  --shadow: 0 30px 60px -28px rgba(0, 0, 0, .9), 0 8px 20px -10px rgba(0, 0, 0, .6);
  --lift: inset 0 1px 0 rgba(255, 255, 255, .06);
  --glass-a: 74%;
}
[data-theme="dark"] {
  --bg-0: #060a13; --bg-1: #0c1322; --bg-2: #0a101d; --bg-3: #131c30; --bg-4: #1d2943;
  --hover: rgba(140, 175, 255, .06); --hover-2: rgba(140, 175, 255, .1);
  --text: #e6edf7; --text-2: #b4c0d6; --muted: #8592ad; --border: rgba(130, 170, 255, .12);
  --code-bg: #050810; --mention-bg: rgba(47, 123, 255, .12); --mention-bar: #2f7bff;
}
[data-theme="midnight"] {
  --bg-0: #000; --bg-1: #05070c; --bg-2: #03050a; --bg-3: #0b1120; --bg-4: #141d33;
  --hover: rgba(140, 175, 255, .06); --hover-2: rgba(140, 175, 255, .1);
  --text: #e6edf7; --text-2: #aab6cc; --muted: #7f8ba3; --border: rgba(130, 170, 255, .1);
  --code-bg: #02040a; --mention-bg: rgba(47, 123, 255, .11); --mention-bar: #2f7bff;
  --glass-a: 88%;
}
[data-theme="light"] {
  --bg-0: #dfe6f2; --bg-1: #eef2f8; --bg-2: #f7f9fc; --bg-3: #e8edf6; --bg-4: #d5deed;
  --hover: rgba(20, 40, 90, .05); --hover-2: rgba(20, 40, 90, .09);
  --text: #0b1220; --text-2: #2c3a55; --muted: #5d6b86; --border: rgba(20, 40, 90, .12);
  --code-bg: #eef2f8; --mention-bg: rgba(47, 123, 255, .1); --mention-bar: #2f7bff;
  --blue: #1d5fd8; --cyan: #0b8ed1;
  --edge: rgba(20, 40, 90, .12);
  --shadow: 0 26px 50px -26px rgba(20, 40, 90, .35), 0 6px 16px -10px rgba(20, 40, 90, .25);
  --lift: inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-a: 70%;
}

/* ------------------------------------------------------------------ the room */
body {
  background:
    radial-gradient(45% 40% at 14% 6%, rgba(47, 123, 255, .22), transparent 70%),
    radial-gradient(40% 35% at 90% 96%, rgba(90, 209, 255, .12), transparent 70%),
    radial-gradient(30% 30% at 66% 12%, rgba(61, 220, 132, .05), transparent 70%),
    var(--ink);
  caret-color: var(--cyan);
}
[data-theme="midnight"] body { background: radial-gradient(40% 35% at 14% 6%, rgba(47, 123, 255, .12), transparent 70%), #000; }
[data-theme="light"] body {
  background: radial-gradient(45% 40% at 14% 6%, rgba(47, 123, 255, .16), transparent 70%),
              radial-gradient(40% 35% at 90% 96%, rgba(11, 142, 209, .1), transparent 70%), #e9eef6;
}
::selection { background: rgba(47, 123, 255, .42); color: #fff; }
::-webkit-scrollbar-thumb { background: rgba(130, 170, 255, .18); }
::-webkit-scrollbar-thumb:hover { background-color: rgba(130, 170, 255, .32); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
a { text-underline-offset: 3px; }
h1, h2, h3, .modal-head h2, .settings-pane h2, .intro h1, .home-head h2 { letter-spacing: -.02em; }

/* smoked glass: one material for every floating piece */
.deck-bar, .deck-stage, .deck-dock, .deck .right-panel, .auth-card, .modal, .menu {
  background: color-mix(in srgb, var(--bg-1) var(--glass-a), transparent);
  backdrop-filter: blur(20px) saturate(1.25);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow), var(--lift);
}

/* ------------------------------------------------------------------ deck layout */
.shell.deck {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--deck-gap); padding: 18px 22px; height: 100vh; height: 100dvh; background: none;
}

/* command bar */
.deck-bar { position: relative; display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 12px 0 10px; border-radius: var(--slab-r); min-width: 0; }
.deck .side-head { height: auto; padding: 0; border: 0; box-shadow: none; flex: 0 1 auto; min-width: 0; max-width: 280px; }
.deck .side-head .find-btn { display: none; }
.deck .server-head { height: 42px; padding: 0 12px; border-radius: 12px; font-weight: 650; gap: 8px; }
.deck .server-head:hover { background-color: var(--hover-2); }
.deck .server-head.has-banner { height: 42px; margin: 0; border-radius: 12px; padding: 0 14px; }
.deck-find {
  flex: 0 1 360px; min-width: 0; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px;
  border-radius: 12px; background: color-mix(in srgb, var(--bg-0) 70%, transparent); border: 1px solid var(--edge); color: var(--muted); font-size: .88em;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.deck-find span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-find kbd { margin-left: auto; flex: none; }
.deck-find:hover { border-color: rgba(90, 209, 255, .35); box-shadow: 0 0 0 3px rgba(47, 123, 255, .12); }
.deck .chan-head { flex: 1; height: auto; padding: 0 4px; border: 0; box-shadow: none; min-width: 0; gap: 10px; }
.deck .chan-head h1 { font-size: 1.14em; font-weight: 700; letter-spacing: -.015em; }
.deck .chan-head .head-ic { color: var(--cyan); }
.deck .chan-head .mobile-only { display: none !important; }
.deck .head-tools { padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--bg-0) 60%, transparent); border: 1px solid var(--edge); }
.deck .head-search { width: 34px; padding-right: 0; background: transparent; cursor: pointer; }
.deck .head-search::placeholder { color: transparent; }
.deck .head-search:focus { width: 210px; cursor: text; }
.deck .head-search:focus::placeholder { color: var(--muted); }
.deck .icon-btn { border-radius: 10px; }
.deck .icon-btn.active { color: var(--cyan); background: rgba(47, 123, 255, .14); }
.deck-new { flex: none; display: flex; gap: 8px; }
.deck-new:empty { display: none; }

/* stage: room tabs + conversation, members as a separate drawer */
.deck .main { background: none; box-shadow: none; overflow: visible; min-height: 0; border-radius: 0; }
.deck .chan-body { gap: var(--deck-gap); min-height: 0; }
.deck-stage { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: var(--slab-r); }
.deck .content-area { min-height: 0; }
.deck .right-panel { position: relative; border-left: 0; border-radius: var(--slab-r); overflow: hidden; }
.deck .right-panel[data-mode] { background: color-mix(in srgb, var(--bg-1) var(--glass-a), transparent); }
.deck .rp-head { height: 56px; }
.deck .right-panel .member-list { padding-top: 10px; }

/* room tabs: the old channel list laid out as one row of glowing pills */
.deck .sidebar { background: none; flex: none; min-width: 0; border-bottom: 1px solid var(--edge); }
.deck .side-body { display: flex; align-items: center; gap: 6px; padding: 12px 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex: none; }
.deck .side-body::-webkit-scrollbar { display: none; }
.deck .chan-group { display: contents; }
.deck .side-body .side-label { display: none !important; }
.deck .chan-row, .deck .nav-item, .deck .dm-row {
  flex: none; width: auto; height: 34px; margin: 0; padding: 0 12px; border-radius: 11px; gap: 6px; white-space: nowrap; font-weight: 550; color: var(--text-2);
  transition: background .2s var(--ease), box-shadow .2s var(--ease), color .2s;
}
.deck .chan-row .chan-name { flex: none; overflow: visible; }
.deck .chan-row:hover, .deck .nav-item:hover, .deck .dm-row:hover { background: var(--hover-2); color: var(--text); }
.deck .chan-row.active, .deck .nav-item.active, .deck .dm-row.active {
  color: var(--text); background: rgba(47, 123, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(90, 209, 255, .38), 0 0 20px -6px rgba(47, 123, 255, .85);
}
[data-theme="light"] .deck .chan-row.active, [data-theme="light"] .deck .nav-item.active, [data-theme="light"] .deck .dm-row.active {
  background: rgba(47, 123, 255, .12); box-shadow: inset 0 0 0 1px rgba(47, 123, 255, .35);
}
.deck .chan-row.unread { color: var(--text); font-weight: 650; }
.deck .chan-row.unread::before { left: auto; right: 5px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.deck .chan-row.connected { color: var(--green); }
.deck .chan-row.nested { padding-left: 10px; height: 30px; font-size: .9em; }
.deck .chan-row .thread-spine { display: none; }
.deck .chan-row .lock-ic { position: static; }
.deck .chan-row.drop-before::after { top: 6px; bottom: 6px; left: -4px; right: auto; width: 2px; height: auto; }
.deck .voice-users { display: flex; align-items: center; padding: 0 6px 0 0; flex: none; }
.deck .voice-user { padding: 0; margin-left: -8px; border-radius: 50%; background: none; }
.deck .voice-user .vu-name, .deck .voice-user .vu-ic { display: none; }
.deck .voice-user .avatar { box-shadow: 0 0 0 2px var(--bg-1); }
.deck .voice-user.speaking .avatar { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--cyan); }
.deck .dm-row .dm-sub, .deck .dm-row .close-dm { display: none; }
.deck .empty-side { flex: none; white-space: nowrap; padding: 0 6px; }
.deck .badge.inline { margin-left: 2px; }

/* dock: server drops + voice status + you */
.deck-dock {
  position: relative; justify-self: center; display: flex; align-items: center; gap: 10px; height: 72px; max-width: 100%;
  padding: 0 10px 0 12px; border-radius: 22px; min-width: 0;
}
.deck .rail { flex-direction: row; background: none; padding: 0; gap: 10px; overflow-x: auto; overflow-y: visible; height: 100%; align-items: center; min-width: 0; }
.deck .rail-servers { flex-direction: row; gap: 10px; }
.deck .rail-sep { width: 1px; height: 34px; margin: 0 2px; background: var(--edge); }
.deck .rail-item { width: auto; }
.deck .rail-item .pill { display: none; }
.deck .rail-btn, .deck .rail-item:hover .rail-btn, .deck .rail-item.active .rail-btn, .deck .rail-item.home-item .rail-btn { border-radius: 15px; overflow: visible; }
.deck .srv-icon {
  border-radius: 15px; background: linear-gradient(160deg, var(--bg-4), var(--bg-3)); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 16px -8px rgba(0, 0, 0, .8);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .2s;
}
.deck .rail-item:hover .srv-icon { transform: translateY(-3px); }
.deck .rail-item:hover .srv-icon:not(.action), .deck .rail-item.active .srv-icon:not(.action) { background: var(--c, linear-gradient(135deg, #2f7bff, #5ad1ff)); color: #fff; }
.deck .rail-item.active .srv-icon { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--cyan), 0 0 26px -4px var(--accent); }
[data-theme="light"] .deck .rail-item.active .srv-icon { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.deck .srv-icon.action { background: transparent; border: 1px dashed var(--edge); color: var(--text-2); box-shadow: none; }
.deck .rail-item:hover .srv-icon.action, .deck .rail-item.active .srv-icon.action { background: rgba(47, 123, 255, .16); color: var(--cyan); border-color: rgba(90, 209, 255, .4); }
.deck .rail-item .badge { right: -5px; top: -5px; bottom: auto; height: 18px; min-width: 18px; border: 2px solid var(--ink); }
.deck .rail-item.in-voice .rail-btn::after { right: -3px; top: auto; bottom: -3px; width: 12px; height: 12px; border: 2px solid var(--ink); background: var(--green); }
.deck .rail-item.drop-before::before { top: 8px; bottom: 8px; left: -6px; right: auto; width: 3px; height: auto; }
.deck .user-panel { height: auto; background: none; border: 0; border-left: 1px solid var(--edge); padding: 0 0 0 10px; gap: 2px; flex: none; }
.deck .me-btn { max-width: 190px; border-radius: 12px; }
.deck .voice-panel { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 14px; background: rgba(61, 220, 132, .08); border: 1px solid rgba(61, 220, 132, .3); }
.deck .voice-panel.hidden { display: none; }
.deck .vp-top { margin: 0; }
.deck .vp-btns { gap: 4px; }
.deck .vbtn { flex: none; width: 34px; border-radius: 10px; background: color-mix(in srgb, var(--bg-0) 60%, transparent); }
.deck .vbtn.on { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ conversation */
.avatar, .avatar > img { border-radius: 32%; }
.status-dot { border-radius: 50%; }
.msg { padding-right: 32px; }
.msg:hover { background: var(--hover); }
.msg.mentioned { background: var(--mention-bg); box-shadow: none; }
.day-divider { font-size: .76em; color: var(--muted); }
.new-divider { border-top-color: var(--cyan); }
.new-divider span { background: var(--cyan); color: #04121c; }
.intro-icon { border-radius: 30%; background: linear-gradient(160deg, rgba(47, 123, 255, .3), var(--bg-3)); color: var(--cyan); box-shadow: var(--lift); }
.intro h1 { font-weight: 750; }
.composer-wrap { padding: 0 18px 14px; }
.composer {
  background: color-mix(in srgb, var(--bg-0) 75%, transparent); border: 1px solid var(--edge); border-radius: 14px; padding: 7px 8px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.composer:focus-within { border-color: rgba(90, 209, 255, .5); box-shadow: 0 0 0 3px rgba(47, 123, 255, .14); }
.cbtn.send {
  border-radius: 10px; color: #fff; background: linear-gradient(135deg, #1d63e8, #2f7bff 55%, #3a9bff); background-size: 200% 100%;
  box-shadow: 0 8px 20px -8px rgba(47, 123, 255, .9); transition: background-position .5s var(--ease), box-shadow .3s var(--ease);
}
.cbtn.send:hover { background-position: 100% 50%; }
.typing .dots i { background: var(--cyan); }
.reaction { border-radius: 10px; }
.reaction.mine { background: rgba(47, 123, 255, .14); border-color: rgba(90, 209, 255, .5); }
.reaction.mine .r-count { color: var(--text); }
.embed { border-left: 0; border-radius: 12px; box-shadow: inset 0 2px 0 var(--ec), var(--lift); }
.poll { border-radius: 14px; }
.poll-q .ic { color: var(--cyan); }
.tag-bot { background: rgba(47, 123, 255, .2); color: var(--cyan); }
.badge { background: var(--red); border-radius: 7px; }
.sys-ic.join { color: var(--green); }

/* calls */
.call-host { background: var(--ink); }
.tile { border-radius: 16px; background: color-mix(in srgb, var(--c, #2f7bff) 30%, #0a101d); }
.tile.speaking { box-shadow: 0 0 0 2px var(--cyan), 0 14px 30px -10px rgba(47, 123, 255, .7); }
.stage-avatars .avatar { box-shadow: 0 0 0 3px var(--ink); }
.avatar.ringing { animation: ringPulse 1.2s infinite; }
@keyframes ringPulse { 0%, 100% { box-shadow: 0 6px 14px -4px rgba(61, 220, 132, .7); } 50% { box-shadow: 0 10px 26px -2px rgba(61, 220, 132, .25); } }

/* ------------------------------------------------------------------ controls (B: glowing buttons) */
.btn { border-radius: 11px; transition: background-position .6s var(--ease), box-shadow .3s var(--ease), transform .15s var(--ease), filter .2s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary {
  color: #fff; background: linear-gradient(100deg, #1d63e8, #2f7bff 45%, #3a9bff 75%, #5ad1ff); background-size: 220% 100%; background-position: 0% 50%;
  box-shadow: 0 10px 24px -12px rgba(47, 123, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn.primary:hover { background-position: 45% 50%; filter: none; }
.btn.glow {
  color: #03141c; font-weight: 650; background: linear-gradient(100deg, #3ddc84, #5ad1ff 45%, #2f7bff 75%, #1d63e8); background-size: 150% 100%; background-position: 0% 50%;
  box-shadow: 0 10px 26px -10px rgba(61, 220, 132, .8), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn.glow:hover { background-position: 40% 50%; }
.btn.pressed, .cbtn.send.pressed { animation: glowShift .9s var(--ease); }
.btn.glow.pressed { animation-name: glowShiftNew; }
@keyframes glowShift {
  0% { background-position: 0% 50%; }
  45% { background-position: 100% 50%; box-shadow: 0 12px 32px -8px rgba(90, 209, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .3); }
  100% { background-position: 0% 50%; }
}
@keyframes glowShiftNew {
  0% { background-position: 0% 50%; }
  45% { background-position: 100% 50%; box-shadow: 0 12px 32px -8px rgba(47, 123, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .4); }
  100% { background-position: 0% 50%; }
}
.btn.danger { background: var(--red); }
.btn.ghost { box-shadow: inset 0 0 0 1px var(--edge); }
.input { border-radius: 11px; background: color-mix(in srgb, var(--bg-0) 80%, transparent); }
.input:focus { border-color: rgba(90, 209, 255, .55); box-shadow: 0 0 0 3px rgba(47, 123, 255, .16); }
.spinner { border-color: var(--bg-4); border-top-color: var(--cyan); }
.range { accent-color: var(--accent); }
kbd { background: color-mix(in srgb, var(--bg-0) 60%, transparent); border: 1px solid var(--edge); border-bottom-width: 1px; border-radius: 7px; font-family: var(--font); font-weight: 600; }

/* ------------------------------------------------------------------ overlays */
.overlay { background: rgba(3, 5, 10, .62); backdrop-filter: blur(3px); }
[data-theme="light"] .overlay { background: rgba(20, 40, 90, .25); }
.modal { border-radius: var(--radius-lg); }
.modal-foot { background: color-mix(in srgb, var(--bg-0) 45%, transparent); border-top: 1px solid var(--edge); }
.menu { border-radius: 14px; }
.menu-item { border-radius: 9px; }
.menu-item:hover { background: rgba(47, 123, 255, .2); color: var(--text); }
.settings-nav { background: color-mix(in srgb, var(--bg-0) 40%, transparent); }
.settings-tab { border-radius: 10px; }
.settings-tab.active { background: rgba(47, 123, 255, .16); box-shadow: inset 0 0 0 1px rgba(90, 209, 255, .3); }
.theme-swatch.active i { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(47, 123, 255, .25); }
.toast { border-radius: 14px; border: 1px solid var(--edge); }

/* ------------------------------------------------------------------ A: light sweep along an edge on live events */
.deck-bar::after, .deck-stage::after, .deck-dock::after, .deck .right-panel::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0;
  background: conic-gradient(from var(--sw), transparent 0 68%, rgba(90, 209, 255, 0) 70%, var(--cyan) 80%, #fff 82.5%, var(--accent) 86%, transparent 91% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  filter: drop-shadow(0 0 6px rgba(90, 209, 255, .85));
}
.sweep-run::after { animation: edgeSweep 1.5s var(--ease) forwards; }
@keyframes edgeSweep {
  0% { --sw: -60deg; opacity: 0; }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { --sw: 300deg; opacity: 0; }
}

/* ------------------------------------------------------------------ C: one-time 3D fly-in */
.deck-intro .deck-bar, .deck-intro .chan-body, .deck-intro .deck-dock, .auth-intro .auth-side, .auth-intro .auth-card {
  animation: flyIn 1.2s var(--ease) both;
}
.deck-intro .chan-body { animation-delay: .1s; }
.deck-intro .deck-dock { animation-delay: .22s; }
.auth-intro .auth-card { animation-delay: .12s; }
@keyframes flyIn {
  from { opacity: 0; transform: perspective(1400px) rotateX(26deg) rotateZ(-3deg) translateY(90px) scale(.9); filter: blur(10px); }
  60% { filter: blur(0); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ------------------------------------------------------------------ welcome (auth) */
.auth-page { background: none; padding: 32px; overflow-x: hidden; }
.auth-bg { display: none; }
.auth-wrap { max-width: 1060px; gap: 64px; align-items: center; }
.auth-card { flex: 0 0 420px; order: 2; border-radius: 22px; padding: 34px; }
.auth-card h1 { font-weight: 750; }
.auth-side { order: 1; background: none; padding: 0; color: var(--text); overflow: visible; }
.auth-side h2 { font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 1; font-weight: 750; letter-spacing: -.04em; max-width: 9em; margin-bottom: 34px; text-wrap: balance; }
.splash { background: none; }

/* ------------------------------------------------------------------ OS reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .deck .right-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 30; }
  .deck-find { flex-basis: 220px; }
}
@media (max-width: 860px) {
  .deck-find span { display: none; }
  .deck-find { flex: none; width: 40px; padding: 0; justify-content: center; }
  .deck-find kbd { display: none; }
}
@media (max-width: 760px) {
  .shell.deck { padding: 8px; gap: 8px; }
  .deck .rail, .deck .sidebar { position: static; transform: none; width: auto; z-index: auto; transition: none; }
  .deck-bar { height: 54px; gap: 6px; padding: 0 6px; }
  .deck .side-head { max-width: 40%; }
  .deck .head-tools { padding: 2px; }
  .deck-new .btn { padding: 0 10px; font-size: 0; gap: 0; }
  .deck-find { display: none; }
  .deck .chan-head { gap: 6px; }
  .deck .chan-head h1 { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .deck .head-tools { flex-shrink: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .deck .head-tools::-webkit-scrollbar { display: none; }
  .deck .side-head { max-width: 34%; }
  .deck .server-head { padding: 0 6px; }
  .deck-dock { height: 62px; justify-self: stretch; padding: 0 8px; border-radius: 18px; }
  .deck .me-meta { display: none; }
  .deck .srv-icon { width: 42px !important; height: 42px !important; }
  .deck .right-panel { position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(400px, calc(100vw - 16px)) !important; }
  .auth-wrap { flex-direction: column; gap: 22px; }
  .auth-side { display: block; order: 0; }
  .auth-side h2 { font-size: 2.4rem; margin: 0; }
  .auth-page { padding: 16px; }
  .auth-card { flex: none; padding: 26px; }
}

/* ------------------------------------------------------------------ fix round: tabs, chips, presence, depth */
.deck .chan-row .hover-only { display: none !important; }
.deck .chan-row:hover .hover-only { display: inline-flex !important; }
.deck .side-body > .chan-group:has(> .chan-row.voice) > .chan-row.voice:first-child { margin-left: auto; }
.deck .chan-row.voice { border: 1px solid var(--edge); }
.deck .chan-row.voice.occupied {
  color: var(--text); background: rgba(61, 220, 132, .08); border-color: rgba(61, 220, 132, .38);
  box-shadow: 0 8px 22px -12px rgba(61, 220, 132, .75);
}
.deck .chan-row.voice.occupied .chan-ic { color: var(--green); }
.deck .vc-count { color: var(--green); font-size: .82em; font-weight: 600; }
.deck .tab-add { flex: none; width: 34px; height: 34px; border-radius: 11px; border: 1px dashed var(--edge); color: var(--text-2); }
.deck .tab-add:hover { color: var(--cyan); border-color: rgba(90, 209, 255, .45); }
.deck .status-dot { width: 26%; height: 26%; min-width: 8px; min-height: 8px; border-width: 2px; right: -3px; bottom: -3px; }
/* in voice: the dock keeps a standing green edge until you leave */
.deck-dock:has(#voice-panel:not(.hidden)) { border-color: rgba(61, 220, 132, .45); box-shadow: var(--shadow), var(--lift), 0 14px 34px -16px rgba(61, 220, 132, .7); }
/* depth: the drawer sits a plane behind the stage */
.deck .right-panel { box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .8), var(--lift); }
.deck-stage { box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .95), 0 10px 24px -12px rgba(0, 0, 0, .7), var(--lift); }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; filter: blur(40px); opacity: .9;
  background:
    radial-gradient(18% 22% at 30% 40%, rgba(47, 123, 255, .16), transparent 70%),
    radial-gradient(14% 18% at 72% 30%, rgba(90, 209, 255, .1), transparent 70%),
    radial-gradient(16% 20% at 55% 78%, rgba(61, 220, 132, .06), transparent 70%);
}
[data-theme="light"] body::before { opacity: .6; }
@media (max-width: 1360px) { .deck .head-topic, .deck .head-sep { display: none; } }

/* ------------------------------------------------------------------ welcome: the deck, tilted and out of focus */
.auth-wrap { flex-direction: column; align-items: stretch; max-width: 440px; gap: 26px; position: relative; z-index: 1; }
.auth-side { order: 0; text-align: left; }
.auth-side h2 { font-size: clamp(2.4rem, 4.2vw, 3.4rem); max-width: 10em; margin: 0 0 12px; line-height: 1.02; }
.auth-pitch { color: var(--text-2); font-size: 1.05em; max-width: 32em; }
.auth-card { order: 1; flex: none; border-radius: 20px; padding: 28px 30px; }
.auth-ghost {
  position: fixed; left: 50%; top: 50%; width: 1180px; height: 720px; pointer-events: none; opacity: .8; filter: blur(1.5px); /* fixed: never makes the page scroll */
  transform: translate(-50%, -50%) perspective(1700px) rotateX(30deg) rotateZ(-9deg) scale(1.08);
  -webkit-mask: radial-gradient(70% 70% at 50% 50%, #000 55%, transparent 90%); mask: radial-gradient(70% 70% at 50% 50%, #000 55%, transparent 90%);
  display: grid; grid-template-rows: 60px 1fr 70px; gap: 16px; justify-items: stretch;
}
.auth-ghost > div { background: color-mix(in srgb, var(--bg-1) 80%, transparent); border: 1px solid var(--edge); border-radius: 18px; box-shadow: var(--shadow); }
.g-bar { display: flex; align-items: center; gap: 16px; padding: 0 18px; }
.g-find { flex: 0 0 340px; height: 36px; border-radius: 11px; background: var(--bg-0); border: 1px solid var(--edge); }
.g-new { margin-left: auto; width: 120px; height: 36px; border-radius: 11px; background: linear-gradient(100deg, #3ddc84, #5ad1ff); box-shadow: 0 10px 26px -10px rgba(61, 220, 132, .8); }
.g-stage { padding: 18px 26px; display: flex; flex-direction: column; gap: 18px; }
.g-tabs { display: flex; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--edge); font-weight: 600; color: var(--text-2); }
.g-tabs span { padding: 7px 14px; border-radius: 11px; }
.g-tabs .on { color: var(--text); background: rgba(47, 123, 255, .18); box-shadow: inset 0 0 0 1px rgba(90, 209, 255, .4), 0 0 20px -6px rgba(47, 123, 255, .9); }
.g-tabs .live { margin-left: auto; color: var(--text); border: 1px solid rgba(61, 220, 132, .4); background: rgba(61, 220, 132, .1); }
.gm { display: flex; gap: 14px; align-items: center; font-size: 1.05em; }
.gm b { display: block; } .gm span { color: var(--text-2); }
.gav { width: 40px; height: 40px; border-radius: 13px; flex: none; }
.gav.a2 { background: linear-gradient(135deg, #12b3a8, #2f7bff); } .gav.a3 { background: linear-gradient(135deg, #e0569b, #6a5cff); } .gav.a4 { background: linear-gradient(135deg, #f5a524, #ff6b5c); }
.g-dock { justify-self: center; width: 300px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.g-dock i { width: 46px; height: 46px; border-radius: 15px; background: var(--bg-4); }
.g-dock i.on { background: linear-gradient(135deg, #2f7bff, #5ad1ff); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--cyan); }
.auth-intro .auth-ghost { animation: ghostIn 1.6s var(--ease) both; }
@keyframes ghostIn {
  from { opacity: 0; transform: translate(-50%, -40%) perspective(1700px) rotateX(48deg) rotateZ(-14deg) scale(.9); filter: blur(12px); }
  to { opacity: .8; transform: translate(-50%, -50%) perspective(1700px) rotateX(30deg) rotateZ(-9deg) scale(1.08); filter: blur(1.5px); }
}

@media (max-width: 760px) {
  .deck .chan-head h1, .deck .chan-head .head-ic { display: none; }
  .deck .side-head { max-width: 58%; }
  .deck .rail-item.action { display: none; }
  .auth-ghost { width: 760px; height: 560px; opacity: .45; }
  .auth-side h2 { font-size: 2.3rem; }
}

/* member drawer group labels: sentence case, quiet */
.deck .right-panel .side-label { text-transform: none; letter-spacing: 0; font-size: .8em; font-weight: 650; color: var(--text-2); }

/* ------------------------------------------------------------------ desktop app: own title bar
   Drawn by the page (desktop.js) inside the borderless VibeRoom window. It is transparent, so the
   room's own background runs straight through it: no separate grey strip like a browser window. */
html.desktop { --tb: 36px; }
html.desktop, html.desktop body { overflow: hidden; }
html.desktop body { margin-top: var(--tb); height: calc(100% - var(--tb)); }
html.desktop .shell, html.desktop .shell.deck { height: calc(100vh - var(--tb)); }
html.desktop .auth-page { top: var(--tb); padding: 14px 32px; }
html.desktop .auth-wrap { gap: 18px; }
html.desktop .modal-overlay, html.desktop .overlay { top: var(--tb); }
.titlebar {
  position: fixed; inset: 0 0 auto 0; height: var(--tb, 36px); z-index: 10000;
  display: flex; align-items: center; gap: 12px; padding-left: 14px;
  app-region: drag; -webkit-app-region: drag; user-select: none;
  font: 500 12.5px/1 var(--font); color: var(--muted);
}
.tb-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.tb-brand img { width: 18px; height: 18px; filter: drop-shadow(0 0 6px rgba(62, 230, 255, .45)); }
.tb-brand span {
  font-weight: 650; font-size: 13px; letter-spacing: -.01em;
  background: linear-gradient(90deg, #3ee6ff, #8f6bff 70%, #b45cff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tb-title { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); opacity: .8; }
.tb-status { flex: none; font: 600 11.5px/1 var(--mono); padding: 5px 9px; border-radius: 999px; color: var(--cyan); background: rgba(90, 209, 255, .08); border: 1px solid rgba(90, 209, 255, .22); app-region: no-drag; -webkit-app-region: no-drag; cursor: default; }
.tb-status:empty { display: none; }
.tb-status.lightning { color: #3ee07f; background: rgba(35, 165, 90, .1); border-color: rgba(35, 165, 90, .35); }
.tb-ctl { display: flex; height: 100%; flex: none; app-region: no-drag; -webkit-app-region: no-drag; }
.tb-btn {
  width: 46px; height: 100%; display: grid; place-items: center; border: 0; padding: 0; background: transparent; cursor: pointer;
  color: #23a55a; /* Discord's "update ready" green */
  transition: background .12s, color .12s;
}
.tb-btn:hover { background: rgba(35, 165, 90, .16); color: #3ee07f; }
.tb-btn:active { background: rgba(35, 165, 90, .26); }
.tb-btn.close:hover { background: #e5484d; color: #fff; }
.tb-btn:focus-visible { outline: 2px solid #3ee07f; outline-offset: -2px; }
html.win-max .titlebar { padding-left: 12px; }
[data-theme="light"] .tb-btn { color: #1a8a4a; }
[data-theme="light"] .tb-title { color: var(--text-2); }

/* ------------------------------------------------------------------ voice panel: speed + mode */
.vp-ping { margin-left: 8px; font: 600 11px/1 var(--mono); color: var(--cyan); }
.vp-ping.lightning { color: #3ee07f; }
.vp-mode { display: block; margin-top: 2px; padding: 0; border: 0; background: none; font-size: 11.5px; color: var(--muted); cursor: pointer; text-align: left; }
.vp-mode:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.deck .user-panel.transmitting .avatar { box-shadow: 0 0 0 2px var(--green), 0 0 12px rgba(61, 220, 132, .55); border-radius: 50%; }

/* ------------------------------------------------------------------ settings: voice */
.settings-pane .section h3 { margin: 0 0 10px; font-size: 1.02em; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.seg-btn {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  padding: 12px 14px; border-radius: 12px; cursor: pointer; color: var(--text);
  background: var(--hover); border: 1px solid var(--border); transition: border-color .15s, background .15s, box-shadow .15s;
}
.seg-btn b { font-weight: 650; }
.seg-btn small { color: var(--muted); font-size: .82em; }
.seg-btn:hover { background: var(--hover-2); }
.seg-btn.active { border-color: color-mix(in srgb, var(--cyan) 70%, transparent); background: rgba(90, 209, 255, .08); box-shadow: 0 0 0 3px rgba(90, 209, 255, .12); }
.mode-box { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 10px; }
.slider-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.slider-row.disabled { opacity: .45; }
.slider-ctl { display: flex; align-items: center; gap: 10px; flex: 0 1 320px; }
.slider-ctl .range { flex: 1; }
.slider-val { min-width: 64px; text-align: right; font: 500 12px var(--mono); color: var(--text-2); }
.keybind-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.kb-ctl { display: flex; align-items: center; gap: 6px; flex: none; }
.keybind {
  min-width: 150px; padding: 9px 14px; border-radius: 10px; cursor: pointer;
  font: 600 13px var(--mono); color: var(--text); background: var(--bg-3); border: 1px solid var(--border); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25);
}
.keybind.empty { color: var(--muted); font-family: var(--font); font-weight: 500; }
.keybind.listening { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(90, 209, 255, .18); animation: kbPulse 1.2s ease-in-out infinite; }
@keyframes kbPulse { 50% { box-shadow: 0 0 0 6px rgba(90, 209, 255, .06); } }
.kb-clear { opacity: .6; }
.kb-clear:hover { opacity: 1; }
.vmeter { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.vm-track { position: relative; flex: 1; height: 12px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--border); overflow: hidden; }
.vm-level { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #2f7bff, #5ad1ff); transition: width .05s linear; }
.vmeter.open .vm-level { background: linear-gradient(90deg, #23a55a, #3ee07f); }
.vm-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, .8); left: 37%; }
.vm-badge { flex: none; min-width: 70px; text-align: center; font: 600 11px/1 var(--mono); padding: 6px 8px; border-radius: 999px; color: var(--muted); background: var(--hover); }
.vmeter.open .vm-badge { color: #3ee07f; background: rgba(35, 165, 90, .14); }
.section.speed .toggle-label { font-weight: 650; }
.invite-share { display: grid; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line, rgba(140,170,255,.14)); background: rgba(62, 230, 255, .05); }
.invite-share .btn { justify-content: center; }
.auth-download { display: flex; align-items: center; justify-content: center; margin-top: 14px; text-decoration: none; }
@media (max-width: 760px) { .seg { grid-template-columns: 1fr; } .slider-row, .keybind-row { flex-direction: column; align-items: stretch; } .slider-ctl { flex-basis: auto; } }
@media (prefers-reduced-motion: reduce) { .keybind.listening { animation: none; } .vm-level { transition: none; } }
