/* ==========================================================================
   Locmind application styles (Liquid Glass UI)
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    overflow: hidden;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: -.005em;
    color: var(--text);
    background: radial-gradient(120% 90% at 50% 0%, var(--bg-1), var(--bg-0));
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
}
input, textarea, select, button { font-family: inherit; }
input, textarea, select { user-select: text; -webkit-user-select: text; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.ic { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
i[data-icon] { display: inline-flex; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }

#gameCanvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#video-layer { position: fixed; width: 2px; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; left: 0; top: 0; }
#audio-layer { display: none; }

.icon-btn {
    appearance: none; border: 0; background: transparent; color: var(--text); width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; font-size: 17px;
    transition: background .2s, transform .25s var(--spring);
    -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--fill); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.danger:hover { background: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; text-align: left; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field em { font-style: normal; font-weight: 400; color: var(--text-3); }

/* ------------------------------------------------------------------ Login */

.screen {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
    padding: calc(20px + var(--safe-t)) 20px calc(20px + var(--safe-b));
    overflow: auto;
    background: radial-gradient(90% 70% at 20% 10%, #1b2250 0%, transparent 60%), radial-gradient(80% 60% at 90% 90%, #3b1d5a 0%, transparent 55%), var(--bg-0);
}
:root[data-theme="light"] .screen {
    background: radial-gradient(90% 70% at 20% 10%, #cfe0ff 0%, transparent 60%), radial-gradient(80% 60% at 90% 90%, #f1d6ff 0%, transparent 55%), var(--bg-1);
}
.orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.orbs i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 22s ease-in-out infinite alternate; }
.orbs i:nth-child(1) { background: #0A84FF; left: -12vmax; top: -10vmax; }
.orbs i:nth-child(2) { background: #BF5AF2; right: -14vmax; top: 8vmax; animation-delay: -6s; animation-duration: 28s; }
.orbs i:nth-child(3) { background: #30D1B8; left: 18vmax; bottom: -22vmax; animation-delay: -11s; opacity: .38; }
.orbs i:nth-child(4) { background: #FF375F; right: 12vmax; bottom: -26vmax; width: 34vmax; height: 34vmax; animation-delay: -3s; opacity: .30; }
:root[data-theme="light"] .orbs i { opacity: .38; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(8vmax, 6vmax) scale(1.18); } }

.login-card {
    position: relative; width: min(420px, 100%); padding: 34px 30px 26px; border-radius: 40px; text-align: center;
    animation: rise .8s var(--ease) both;
}
.login-card.center { display: flex; flex-direction: column; align-items: center; gap: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.brand { margin-bottom: 22px; }
.brand .logo { width: 72px; height: 72px; filter: drop-shadow(0 14px 28px rgba(10, 132, 255, .5)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.brand h1 { font-size: 34px; font-weight: 800; letter-spacing: -.035em; margin-top: 10px; background: linear-gradient(180deg, var(--text), var(--text-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand p { color: var(--text-2); margin-top: 4px; font-size: 15px; }
.avatars { display: flex; justify-content: center; gap: 14px; }
.avatar {
    appearance: none; border: 0; padding: 4px; border-radius: 50%; background: var(--fill-2); cursor: pointer; width: 64px; height: 64px;
    transition: transform .35s var(--spring), box-shadow .25s, background .25s; -webkit-tap-highlight-color: transparent;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; pointer-events: none; }
.avatar:hover { transform: scale(1.08); }
.avatar.is-selected { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 26px color-mix(in srgb, var(--accent) 50%, transparent); transform: scale(1.14); }
.avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.check { display: flex; align-items: center; gap: 12px; text-align: left; font-size: 13px; color: var(--text-2); margin: 4px 0 18px; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
    flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--fill-2); border: 1px solid var(--separator);
    display: grid; place-items: center; color: transparent; transition: all .25s var(--spring);
}
.check input:checked + .box { background: var(--accent); border-color: transparent; color: #fff; transform: scale(1.06); }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 14px; }
.login-error { color: var(--red); font-size: 13px; margin-top: 10px; font-weight: 500; }
.login-foot { margin-top: 18px; display: flex; justify-content: center; }
.login-card.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* -------------------------------------------------------------------- HUD */

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; position: absolute; }
#hud > #toasts, #hud > #goal-banner, #hud > #joystick { pointer-events: none; }

#statusbar, #zone-chip {
    left: calc(14px + var(--safe-l)); height: 40px; padding: 0 16px 0 14px; display: flex; align-items: center; gap: 10px; font-size: 14px;
    max-width: calc(100vw - 150px);
}
#statusbar { top: calc(14px + var(--safe-t)); }
#zone-chip { top: calc(62px + var(--safe-t)); font-size: 13px; font-weight: 500; transition: color .3s; }
#zone-chip i { color: var(--accent); }
#zone-chip.is-room i { color: var(--purple); }
#zone-chip.is-locked i { color: var(--red); }
#statusbar strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#statusbar .sep { width: 1px; height: 16px; background: var(--separator); }
#statusbar .muted { display: inline-flex; gap: 6px; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 28%, transparent); flex: none; }
.dot.off { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 28%, transparent); }
.dot.wait { background: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 28%, transparent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

#top-actions { top: calc(14px + var(--safe-t)); right: calc(14px + var(--safe-r)); display: flex; padding: 2px; gap: 2px; height: 40px; align-items: center; }

#scoreboard { top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); height: 44px; padding: 0 8px 0 14px; display: flex; align-items: center; gap: 12px; animation: drop .5s var(--spring); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -16px) scale(.9); } }
#scoreboard .team b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 1.2ch; display: inline-block; text-align: center; }
#scoreboard .team-blue b { color: var(--blue); }
#scoreboard .team-red b { color: var(--red); }
#scoreboard .vs { font-size: 16px; }
#scoreboard.bump b { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.6); } }

#people { top: calc(112px + var(--safe-t)); left: calc(14px + var(--safe-l)); width: 252px; max-height: calc(100vh - 330px); overflow: auto; padding: 14px; border-radius: 24px; }
#people h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.person img { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--fill); box-shadow: 0 0 0 2px transparent; transition: box-shadow .2s; }
.person.speaking img { box-shadow: 0 0 0 2px var(--green), 0 0 14px color-mix(in srgb, var(--green) 70%, transparent); }
.person .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.person .name small { display: block; font-weight: 400; color: var(--text-3); font-size: 11px; }
.person input.range.vol { width: 72px; flex: none; }
.person .mute { color: var(--red); display: inline-flex; }

#chatlog { left: calc(14px + var(--safe-l)); bottom: calc(100px + var(--safe-b)); width: 330px; max-height: 38vh; display: flex; flex-direction: column; border-radius: 24px; padding: 6px 6px 10px; }
#chatlog header { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; }
#chatlog ol { list-style: none; margin: 0; padding: 0 10px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
#chatlog li { font-size: 13px; line-height: 1.3; word-break: break-word; user-select: text; -webkit-user-select: text; }
#chatlog li b { font-weight: 650; margin-right: 6px; }
#chatlog li .scope { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--purple); margin-left: 8px; }
#chatlog li.sys { color: var(--text-3); font-size: 12px; }

#chatbar { bottom: calc(100px + var(--safe-b)); left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 28px)); height: 52px; display: flex; align-items: center; padding: 0 8px 0 22px; animation: pop .35s var(--spring); }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.94); } }
#chatbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
#chatbar input::placeholder { color: var(--text-3); }
#chatbar .send { background: var(--accent); color: #fff; width: 38px; height: 38px; }
#chatbar .send:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }

#hint { bottom: calc(106px + var(--safe-b)); left: 50%; transform: translateX(-50%); padding: 10px 20px; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; animation: pop .35s var(--spring); max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
#hint kbd, .kbd { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--fill); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .3); margin: 0 2px; }

/* ------------------------------------------------------------------- Dock */

#dock {
    bottom: calc(14px + var(--safe-b)); left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 30px; max-width: calc(100vw - 20px);
}
#dock .group { display: flex; align-items: center; gap: 6px; }
#dock .group.is-hidden { display: none; }
#dock .group.pop { animation: dockin .45s var(--spring); }
@keyframes dockin { from { opacity: 0; transform: scale(.6); } }
#dock .div { width: 1px; height: 30px; background: var(--separator); margin: 0 4px; flex: none; }
.dock-btn {
    appearance: none; border: 0; position: relative; flex: none; width: 52px; height: 52px; border-radius: 18px; cursor: pointer;
    background: var(--fill-2); color: var(--text); font-size: 23px; display: grid; place-items: center;
    transition: transform .3s var(--spring), background .2s, color .2s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}
.dock-btn:hover { transform: translateY(-5px) scale(1.14); background: var(--fill); }
.dock-btn:has(+ .dock-btn:hover), .dock-btn:hover + .dock-btn { transform: translateY(-2px) scale(1.06); }
.dock-btn:active { transform: scale(.92); }
.dock-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dock-btn.is-on { background: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 50%, transparent), inset 0 1px 0 rgba(255, 255, 255, .4); }
.dock-btn.is-green.is-on { background: var(--green); background: linear-gradient(180deg, color-mix(in srgb, var(--green) 85%, #fff), var(--green)); box-shadow: 0 6px 18px color-mix(in srgb, var(--green) 50%, transparent), inset 0 1px 0 rgba(255, 255, 255, .4); }
.dock-btn.is-off { background: var(--red); background: linear-gradient(180deg, color-mix(in srgb, var(--red) 85%, #fff), var(--red)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--red) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.dock-btn.is-warn { background: var(--orange); background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 85%, #fff), var(--orange)); color: #fff; }
.dock-btn .badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--glass-tint-strong); }
.dock-btn[data-tip]::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translate(-50%, 6px) scale(.9);
    padding: 6px 11px; border-radius: 10px; background: var(--glass-tint-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .18s, transform .25s var(--spring);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3), inset 0 0 0 .5px var(--glass-edge);
}
.dock-btn:hover[data-tip]::after { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------------------------------------------------------------- Minimap */

#minimap-wrap { right: calc(14px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); padding: 8px; border-radius: 24px; width: 222px; }
#minimap { display: block; width: 100%; height: auto; border-radius: 16px; background: rgba(0, 0, 0, .18); }
#minimap-wrap .zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .2s; }
#minimap-wrap:hover .zoom { opacity: 1; }
#minimap-wrap .zoom .icon-btn { width: 28px; height: 28px; font-size: 14px; background: var(--glass-tint-strong); }
#minimap-wrap.is-off { display: none; }
:root[data-theme="light"] #minimap { background: rgba(255, 255, 255, .45); }

/* ----------------------------------------------------- Emoji / rooms panel */

#emoji-picker { bottom: calc(100px + var(--safe-b)); left: 50%; transform: translateX(-50%); width: min(336px, calc(100vw - 28px)); padding: 12px; border-radius: 26px; animation: pop .35s var(--spring); }
#emoji-picker .sect { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 4px 6px 6px; }
#emoji-picker .grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 8px; }
#emoji-picker button { appearance: none; border: 0; background: transparent; border-radius: 14px; height: 52px; cursor: pointer; display: grid; place-items: center; font-size: 28px; transition: transform .25s var(--spring), background .2s; }
#emoji-picker button:hover { background: var(--fill); transform: scale(1.18); }
#emoji-picker button img { width: 38px; height: 38px; object-fit: contain; }

#rooms-panel { top: calc(64px + var(--safe-t)); right: calc(14px + var(--safe-r)); width: 316px; max-height: 60vh; overflow: auto; padding: 8px; border-radius: 26px; animation: drop2 .4s var(--spring); }
@keyframes drop2 { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
#rooms-panel h4 { margin: 8px 10px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.room-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 6px 8px 12px; border: 0; background: transparent; color: inherit; border-radius: 18px; text-align: left; font: inherit; transition: background .2s; }
.room-row.is-here { background: var(--accent-soft); }
.room-row .meta em { display: block; font-style: normal; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-row:hover { background: var(--fill-2); }
.room-row .swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; }
.room-row .meta { flex: 1; min-width: 0; }
.room-row .meta b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-row .meta small { color: var(--text-3); font-size: 12px; }
.room-row .icon-btn { color: var(--text-2); flex: none; }
.room-row .icon-btn.go { color: var(--accent); }
.empty-note { padding: 18px 12px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ------------------------------------------------------------- Joystick */

#joystick { display: none; left: calc(22px + var(--safe-l)); bottom: calc(112px + var(--safe-b)); width: 118px; height: 118px; border-radius: 50%; background: var(--glass-tint); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 .5px var(--glass-edge), var(--glass-shadow); touch-action: none; pointer-events: auto !important; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .85), rgba(255, 255, 255, .35)); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); transition: transform .12s; }
@media (hover: none) and (pointer: coarse) { #joystick { display: block; } #minimap-wrap .zoom { opacity: 1; } }

/* ---------------------------------------------------------- Toasts etc. */

#toasts { top: calc(66px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(420px, calc(100vw - 28px)); }
.toast {
    width: 100%; display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 22px;
    animation: toast-in .5s var(--spring); font-size: 14px;
}
.toast.out { animation: toast-out .3s forwards; }
.toast .ti { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; background: var(--accent); }
.toast.success .ti { background: var(--green); } .toast.error .ti { background: var(--red); } .toast.warn .ti { background: var(--orange); }
.toast b { display: block; font-weight: 650; }
.toast span.d { color: var(--text-2); font-size: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-18px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.95); } }

#goal-banner { inset: 0; display: grid; place-items: center; z-index: 5; }
#goal-banner div { text-align: center; animation: goal 2.6s var(--ease) forwards; }
#goal-banner b { display: block; font-size: clamp(56px, 14vw, 140px); font-weight: 900; letter-spacing: -.04em; background: linear-gradient(180deg, #fff, #9ec9ff 60%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 12px 40px rgba(10, 132, 255, .8)); }
#goal-banner span { font-size: clamp(16px, 3vw, 26px); font-weight: 600; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
@keyframes goal { 0% { opacity: 0; transform: scale(.3) rotate(-6deg); } 18% { opacity: 1; transform: scale(1.08) rotate(1deg); } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3) translateY(-30px); } }

#conn-banner { top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); padding: 10px 18px; display: flex; gap: 10px; align-items: center; font-weight: 600; z-index: 6; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--fill); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------- Windows */

.win {
    position: fixed; z-index: 5; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px;
    min-width: 280px; min-height: 200px; resize: both; animation: winin .4s var(--spring);
    background-color: var(--glass-tint-strong);
    max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
}
@keyframes winin { from { opacity: 0; transform: scale(.92) translateY(12px); } }
.win.is-parked { visibility: hidden; pointer-events: none; opacity: 0; left: -9999px !important; }
.win-bar { display: flex; align-items: center; height: 44px; padding: 0 14px; flex: none; cursor: grab; touch-action: none; border-bottom: 1px solid var(--separator); position: relative; }
.win-bar:active { cursor: grabbing; }
.win-bar h2 { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 650; display: flex; justify-content: center; align-items: center; gap: 8px; pointer-events: none; color: var(--text-2); }
.win-bar h2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.traffic { display: flex; gap: 8px; z-index: 2; }
.tl { width: 13px; height: 13px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .25); position: relative; }
.tl-close { background: #ff5f57; } .tl-min { background: #febc2e; } .tl-zoom { background: #28c840; }
.tl::after { content: ""; position: absolute; inset: -6px; }
.traffic:hover .tl-close::before { content: "×"; } .traffic:hover .tl-min::before { content: "–"; } .traffic:hover .tl-zoom::before { content: "+"; }
.tl::before { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; line-height: 1; font-weight: 800; color: rgba(0, 0, 0, .6); }
.win-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--separator); flex: none; font-size: 12px; }

#win-board { top: 84px; right: 24px; width: 640px; height: 460px; }
.wb-tools { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex: none; flex-wrap: wrap; border-bottom: 1px solid var(--separator); }
.wb-tools .range { width: 90px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch-btn { appearance: none; border: 0; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .25); transition: transform .25s var(--spring); }
.swatch-btn:hover { transform: scale(1.18); }
.swatch-btn[aria-checked="true"] { transform: scale(1.22); box-shadow: 0 0 0 2px var(--glass-tint-strong), 0 0 0 4px var(--accent); }
.wb-stage { flex: 1; position: relative; margin: 10px; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), 0 4px 18px rgba(0, 0, 0, .25); min-height: 120px; }
#wb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#wb-eraser.is-active { background: var(--accent); color: #fff; }

#win-notes { top: 130px; right: 64px; width: 420px; height: 360px; }
#notes-text { flex: 1; width: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); padding: 16px 18px; font-size: 15px; line-height: 1.5; font-family: var(--font); }
#notes-text::placeholder { color: var(--text-3); }

#win-music { bottom: 232px; right: 16px; width: 340px; height: min(520px, calc(100vh - 260px)); min-height: 340px; }
.music-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow: auto; flex: 1; min-height: 0; }
.music-now { display: flex; flex-direction: column; gap: 12px; }
.yt-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 8px 26px rgba(0, 0, 0, .4); }
.yt-frame iframe, .yt-frame > div:first-child { position: absolute; inset: 0; width: 100%; height: 100%; }
.yt-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 36px; color: var(--text-3); background: linear-gradient(135deg, #2a2e5a, #3b1d5a); }
.yt-frame.is-playing .yt-empty { display: none; }
.music-title { font-weight: 650; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 6px; }
.music-controls { display: flex; align-items: center; gap: 8px; }
.music-add { display: flex; gap: 8px; }
.music-add .input { padding: 10px 14px; border-radius: 999px; }
.music-add .btn { padding: 10px 14px; }
.music-results { list-style: none; margin: -4px 0 0; padding: 4px; border-radius: 16px; background: var(--fill-2); display: flex; flex-direction: column; gap: 2px; }
.music-results li { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 12px; cursor: pointer; }
.music-results li:hover { background: var(--fill); }
.music-results img { width: 64px; height: 36px; object-fit: cover; border-radius: 8px; flex: none; background: var(--fill); }
.music-results .t { font-size: 13px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.music-results .a { font-size: 11px; color: var(--text-3); }
.music-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.music-queue li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--fill-2); font-size: 13px; }
.music-queue li .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.music-queue li small { color: var(--text-3); }
.music-queue .empty { color: var(--text-3); background: transparent; justify-content: center; }

.screen-win { width: 520px; height: 360px; }
.screen-win video { flex: 1; width: 100%; min-height: 0; background: #000; object-fit: contain; }

/* --------------------------------------------------------------- Modals */

.modal-layer { position: fixed; inset: 0; z-index: 60; background: rgba(5, 8, 16, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .3s; }
:root[data-theme="light"] .modal-layer { background: rgba(120, 140, 180, .3); }
@keyframes fade { from { opacity: 0; } }
.modal {
    position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 28px)); max-height: calc(100vh - 28px);
    overflow: auto; padding: 26px 24px 20px; border-radius: 32px; animation: modal-in .45s var(--spring);
}
.modal-wide { width: min(460px, calc(100vw - 28px)); }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.9); } }
.modal h3 { font-size: 20px; font-weight: 750; letter-spacing: -.02em; margin-bottom: 16px; text-align: center; }
.modal p { text-align: center; margin-bottom: 14px; }
.modal-icon { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 12px; display: grid; place-items: center; font-size: 26px; color: #fff; background: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent); }
.modal-icon.warn { background: var(--orange); background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 80%, #fff), var(--orange)); box-shadow: 0 10px 26px color-mix(in srgb, var(--orange) 45%, transparent); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.prose { text-align: left; font-size: 14px; color: var(--text-2); line-height: 1.5; max-height: 50vh; overflow: auto; }
.prose p { text-align: left; margin-bottom: 10px; } .prose b { color: var(--text); }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
.settings-list { display: flex; flex-direction: column; border-radius: 18px; background: var(--fill-2); padding: 4px 16px; }
.settings-list .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--separator); font-weight: 500; }
.settings-list .row:last-child { border-bottom: 0; }
.settings-list .row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.settings-list select.input { padding: 9px 12px; font-size: 14px; }

/* ----------------------------------------------------------- Responsive */

@media (max-width: 820px) {
    #people { top: auto; bottom: calc(100px + var(--safe-b)); left: calc(12px + var(--safe-l)); width: min(260px, calc(100vw - 150px)); max-height: 28vh; }
    #chatlog { width: calc(100vw - 24px); bottom: calc(96px + var(--safe-b)); max-height: 34vh; }
    #minimap-wrap { width: 128px; padding: 5px; border-radius: 18px; bottom: calc(96px + var(--safe-b)); }
    #minimap { border-radius: 13px; }
    #dock { padding: 6px 8px; gap: 4px; border-radius: 26px; overflow-x: auto; scrollbar-width: none; }
    #dock::-webkit-scrollbar { display: none; }
    .dock-btn { width: 46px; height: 46px; font-size: 21px; border-radius: 16px; }
    .dock-btn[data-tip]::after { display: none; }
    .win, .win.screen-win { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(92px + var(--safe-b)); width: auto !important; height: 58vh !important; resize: none; border-radius: 24px; }
    .win-bar { cursor: default; }
    #joystick { bottom: calc(100px + var(--safe-b)); }
    #statusbar { max-width: calc(100vw - 110px); }
    #toasts { top: calc(112px + var(--safe-t)); }
    #hint { bottom: calc(150px + var(--safe-b)); }
    #rooms-panel { right: 12px; width: calc(100vw - 24px); }
}
@media (max-width: 820px) and (hover: none) and (pointer: coarse) {
    #people { bottom: calc(232px + var(--safe-b)); }
    #chatlog { bottom: calc(232px + var(--safe-b)); }
}
@media (max-width: 820px) {
    body.win-open #joystick, body.win-open #minimap-wrap, body.win-open #people, body.win-open #chatlog { display: none; }
}
@media (max-height: 520px) {
    #people { display: none; }
}

/* =================================================================== v3 */

/* avatars */
.av { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--fill); line-height: 1; overflow: visible; user-select: none; }
.av img { width: 100%; height: 100%; border-radius: 50%; display: block; pointer-events: none; }
.av-status { position: absolute; right: -1px; bottom: -1px; width: 32%; height: 32%; min-width: 8px; min-height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--glass-tint-strong); }
.avatar-custom { display: grid; place-items: center; }
.avatar-custom .av { width: 100% !important; height: 100% !important; }
.avatar-maker { margin-top: 12px; padding: 10px; border-radius: 18px; background: var(--fill-2); display: flex; flex-direction: column; gap: 10px; animation: pop2 .35s var(--spring); }
@keyframes pop2 { from { opacity: 0; transform: scale(.96); } }
.maker-faces { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.maker-faces button { appearance: none; border: 0; background: transparent; font-size: 22px; height: 36px; border-radius: 10px; cursor: pointer; transition: transform .2s var(--spring), background .2s; }
.maker-faces button:hover { transform: scale(1.18); background: var(--fill); }
.maker-faces button.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.maker-colors { justify-content: center; }
#avatars .avatars { flex-wrap: wrap; gap: 10px; }
#avatars .avatar { width: 60px; height: 60px; }

/* sign in: server name and message of the day */
.server-info { margin: -6px 0 18px; padding: 12px 14px; border-radius: 18px; background: var(--fill-2); text-align: left; }
.server-info b { display: block; font-size: 15px; }
.server-info p { margin-top: 4px; color: var(--text-2); font-size: 13px; white-space: pre-line; }

/* status bar is a button that opens the profile */
#statusbar { appearance: none; border: 0; font: inherit; color: var(--text); cursor: pointer; padding-left: 7px; }
#statusbar:hover { filter: brightness(1.08); }
#statusbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#status-avatar { display: inline-flex; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dot.slow { background: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 28%, transparent); }

/* popovers */
.popover { position: absolute; z-index: 12; padding: 14px; border-radius: 24px; width: 300px; animation: drop2 .35s var(--spring); }
#profile-pop { top: calc(62px + var(--safe-t)); left: calc(14px + var(--safe-l)); display: flex; flex-direction: column; gap: 12px; }
.pp-head { display: flex; align-items: center; gap: 12px; }
.pp-head b { display: block; font-size: 16px; }
.pp-head small { color: var(--text-2); }
.pp-status { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pp-status button { appearance: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: var(--fill-2); border-radius: 12px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: background .2s; }
.pp-status button:hover { background: var(--fill); }
.pp-status button.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.pp-status i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pp-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: -4px; }
.pp-maker .avatars { gap: 8px; justify-content: flex-start; }
.pp-maker .avatar { width: 46px; height: 46px; padding: 3px; }
.pp-maker .maker-faces { grid-template-columns: repeat(6, 1fr); }

#player-card { width: 280px; display: flex; flex-direction: column; gap: 12px; }
.card-x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; }
.card-head { display: flex; gap: 12px; align-items: center; padding-right: 22px; }
.card-head b { display: block; font-size: 17px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.card-head small { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.card-status i { width: 8px; height: 8px; border-radius: 50%; }
.card-note { display: block; font-size: 13px; color: var(--text); margin: 2px 0; font-style: italic; }
.card-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.card-act { appearance: none; border: 0; background: var(--fill-2); color: var(--text); border-radius: 14px; padding: 9px 2px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; transition: background .2s, transform .25s var(--spring); }
.card-act:hover { background: var(--fill); transform: translateY(-2px); }
.card-act span { font-size: 19px; color: var(--accent); display: inline-flex; }
.card-act small { font-size: 11px; font-weight: 600; color: var(--text-2); }
.card-act.is-on { background: var(--accent-soft); }
.card-row { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.card-extra { display: flex; flex-wrap: wrap; gap: 6px; }
.card-extra .btn span { display: inline-flex; }

/* timer chip + announcement banner */
#timer-chip { top: calc(110px + var(--safe-t)); left: calc(14px + var(--safe-l)); height: 36px; padding: 0 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
#timer-chip b { font-size: 15px; font-variant-numeric: tabular-nums; }
#timer-chip.is-soon b { color: var(--orange); }
#timer-chip.is-done { animation: pulse 1s infinite; }
#timer-chip.is-done b { color: var(--red); }
#timer-chip:not([hidden]) ~ #people { top: calc(156px + var(--safe-t)); }
#announce { top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 28px)); display: flex; gap: 14px; align-items: center; padding: 14px 10px 14px 16px; border-radius: 24px; z-index: 7; }
#announce.in { animation: drop .5s var(--spring); }
#announce .ann-icon { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; font-size: 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 80%, #fff), var(--orange)); }
#announce b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
#announce p { font-size: 15px; font-weight: 600; margin-top: 2px; word-break: break-word; }
#announce > div { flex: 1; min-width: 0; }

/* people list rows open the player card */
.person .who { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 0; cursor: pointer; text-align: left; border-radius: 10px; }
.person .who:hover .name { color: var(--accent); }
.person .av { box-shadow: 0 0 0 2px transparent; transition: box-shadow .2s; }
.person.speaking .av { box-shadow: 0 0 0 2px var(--green), 0 0 14px color-mix(in srgb, var(--green) 70%, transparent); }
.person.is-blocked { opacity: .45; }

/* chat */
#chatlog li.mention { background: color-mix(in srgb, var(--orange) 18%, transparent); border-radius: 8px; padding: 3px 6px; margin: 0 -6px; }
.toast.clickable { pointer-events: auto; cursor: pointer; }
.toast.clickable:hover { filter: brightness(1.08); }

/* dock extras */
#dock-mic::before { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--green); transform: scaleX(var(--lvl, 0)); transform-origin: left; transition: transform .1s linear; opacity: .9; }
.dock-btn.is-ptt { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--green) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, .16); }
.dock-btn.is-amber.is-on { background: linear-gradient(180deg, color-mix(in srgb, var(--yellow) 80%, #fff), var(--orange)); color: #1c1c1e; box-shadow: 0 6px 18px color-mix(in srgb, var(--orange) 50%, transparent), inset 0 1px 0 rgba(255, 255, 255, .4); }

/* room tools window */
#win-room { top: 84px; right: 24px; width: 380px; height: min(560px, calc(100vh - 330px)); min-height: 300px; }
.room-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.rt-empty { text-align: center; padding: 30px 0; }
.rt-head { display: flex; gap: 12px; align-items: flex-start; }
.rt-swatch { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; flex: none; box-shadow: 0 0 12px currentColor; }
.rt-head b { font-size: 17px; }
.rt-head small { display: block; color: var(--text-3); font-size: 12px; }
.rt-topic { margin-top: 6px !important; font-size: 13px; color: var(--text-2); }
.rt-sec { background: var(--fill-2); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.rt-sec h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.rt-sec h4 { margin: 4px 0 0; font-size: 12px; color: var(--text-2); }
.rt-sec > .btn { align-self: flex-start; }
.rt-sec .btn span { display: inline-flex; }
.rt-hands, .rt-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rt-hands li, .rt-members li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rt-n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--yellow); color: #1c1c1e; flex: none; }
.rt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rt-hands .icon-btn { width: 28px; height: 28px; }
.rt-poll { display: flex; flex-direction: column; gap: 6px; }
.rt-q { font-size: 15px; }
.rt-opt { position: relative; overflow: hidden; appearance: none; border: 0; text-align: left; font: inherit; color: var(--text); background: var(--fill); border-radius: 12px; padding: 9px 12px; display: flex; justify-content: space-between; gap: 8px; cursor: pointer; }
.rt-opt i { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width .5s var(--ease); }
.rt-opt.is-lead i { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.rt-opt span, .rt-opt small { position: relative; }
.rt-opt span { font-weight: 600; font-size: 13px; }
.rt-opt small { color: var(--text-2); font-variant-numeric: tabular-nums; }
.rt-opt:disabled { cursor: default; }
.rt-poll > .btn { align-self: flex-start; }
.rt-form { display: flex; flex-direction: column; gap: 8px; }
.rt-form .input { padding: 9px 12px; font-size: 14px; }
.rt-opts { display: flex; flex-direction: column; gap: 6px; }
.rt-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rt-row .btn span { display: inline-flex; }
.rt-min { width: 80px !important; }
.rt-timer { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; }
.rt-timer b { font-size: 40px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rt-form .field { margin-bottom: 0; }

/* direct messages */
#win-dm { bottom: 120px; right: 260px; width: 360px; height: min(460px, calc(100vh - 220px)); }
.dm-threads { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; border-bottom: 1px solid var(--separator); flex: none; scrollbar-width: none; }
.dm-chip { appearance: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: var(--fill-2); border-radius: 999px; padding: 4px 10px 4px 4px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; flex: none; }
.dm-chip.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dm-chip.is-away { opacity: .55; }
.dot-badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
.dm-list { list-style: none; margin: 0; padding: 12px; flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.dm-list li { max-width: 80%; align-self: flex-start; background: var(--fill); padding: 8px 12px; border-radius: 16px 16px 16px 6px; font-size: 14px; word-break: break-word; user-select: text; -webkit-user-select: text; }
.dm-list li.mine { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 16px 16px 6px 16px; }
.dm-list li time { display: block; font-size: 10px; opacity: .6; margin-top: 2px; text-align: right; }
.dm-list li.dm-empty { align-self: center; background: transparent; color: var(--text-3); text-align: center; font-size: 13px; max-width: 100%; }
.dm-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--separator); flex: none; }
.dm-form .input { padding: 10px 14px; border-radius: 999px; font-size: 14px; }
.dm-form .btn { padding: 10px 14px; }

/* camera gallery */
#win-gallery { top: 90px; left: max(20px, calc(50vw - 380px)); width: min(760px, calc(100vw - 40px)); height: min(520px, calc(100vh - 220px)); }
.gallery { flex: 1; min-height: 0; padding: 10px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-auto-rows: minmax(140px, 1fr); overflow: auto; }
.g-tile { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.g-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-tile.is-me video { transform: scaleX(-1); }
.g-tile figcaption { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.g-empty { grid-column: 1 / -1; align-self: center; text-align: center; }

/* music: tabs, library, upload */
.music-tabs { align-self: flex-start; }
.music-library { display: flex; flex-direction: column; gap: 8px; }
.music-library .music-add .btn { padding: 10px 14px; cursor: pointer; }
.library-list { max-height: 220px; overflow: auto; margin: 0; }
.library-list .lib-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--indigo), var(--purple)); color: #fff; }
.library-list li > div { flex: 1; min-width: 0; }
.library-list .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.library-list .lib-add { color: var(--accent); display: inline-flex; flex: none; }
.upload-progress { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.yt-frame.is-library .yt-empty { background: linear-gradient(135deg, #24306b, #4a2370); }
.eq { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); display: flex; gap: 5px; align-items: flex-end; height: 34%; }
.eq i { width: 8px; border-radius: 4px; background: rgba(255, 255, 255, .85); animation: eq 1s ease-in-out infinite; height: 30%; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; } .eq i:nth-child(5) { animation-delay: -.45s; }
@keyframes eq { 50% { height: 100%; } }

@media (max-width: 820px) {
    .popover, #player-card { left: 8px !important; right: 8px; top: auto !important; bottom: calc(92px + var(--safe-b)); width: auto; }
    #profile-pop { max-height: 70vh; overflow: auto; }
    #timer-chip { top: calc(104px + var(--safe-t)); }
    #announce { top: calc(110px + var(--safe-t)); }
    .net span#net-rtt { display: none; }
}
