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

:root {
  --bg: #0a0b0e;
  --ink: #f2f4f8;
  --ink-2: rgba(242, 244, 248, .72);
  --ink-3: rgba(242, 244, 248, .48);
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .09);
  --stroke: rgba(255, 255, 255, .12);
  --accent: #6ea8fe;
  --accent-ink: #a9c9ff;
  --a: 110, 168, 254;
  --danger: #ff6369;
  --ok: #3dd68c;
  --silver: linear-gradient(180deg, #fbfbfd, #d9dde5);
  --shadow: 0 30px 80px -24px rgba(0, 0, 0, .8), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --display: 'Sora', var(--font);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; }
.muted { color: var(--ink-3); }
.i { width: 20px; height: 20px; flex: none; }

/* ---------- Background ---------- */
.aurora { position: fixed; inset: -25%; z-index: 0; pointer-events: none; opacity: .85; transition: opacity 1s; }
.aurora i {
  position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%;
  mix-blend-mode: screen; animation: drift 28s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { background: radial-gradient(circle, rgba(38, 66, 128, .5), transparent 62%); top: 5%; left: 8%; }
.aurora i:nth-child(2) { background: radial-gradient(circle, rgba(22, 78, 99, .38), transparent 62%); top: 35%; left: 52%; animation-duration: 34s; animation-delay: -9s; }
.aurora i:nth-child(3) { background: radial-gradient(circle, rgba(62, 66, 86, .45), transparent 62%); top: 52%; left: 2%; animation-duration: 40s; animation-delay: -18s; }
.aurora i:nth-child(4) { background: radial-gradient(circle, rgba(46, 58, 112, .42), transparent 62%); top: -8%; left: 58%; animation-duration: 31s; animation-delay: -5s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(7vmax, -6vmax) scale(1.15); }
  100% { transform: translate(-6vmax, 5vmax) scale(.92); }
}
body.in-call .aurora { opacity: .4; }
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Glass surfaces ---------- */
.card {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .035) 42%, rgba(255, 255, 255, .02));
  border: 1px solid var(--stroke);
  border-radius: 28px;
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .04);
}
/* Light that follows your pointer */
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, -30%), rgba(255, 255, 255, .13), transparent 42%);
}
/* A specular reflection that sweeps across the glass */
.card::after {
  content: ""; position: absolute; top: -60%; left: -40%; width: 30%; height: 220%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent);
  transform: rotate(22deg) translateX(-250%);
  animation: sheen 10s ease-in-out infinite;
}
@keyframes sheen {
  0%, 72% { transform: rotate(22deg) translateX(-250%); }
  100% { transform: rotate(22deg) translateX(650%); }
}
/* Rotating light on the card's edge */
.edge {
  position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 60%, rgba(255, 255, 255, .55), rgba(var(--a), .5), transparent 85%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 7s linear infinite;
}
@keyframes spin { to { --ang: 360deg; } }


/* ---------- Buttons & inputs ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px; border-radius: 14px; border: 1px solid var(--stroke); background: var(--glass-2);
  font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .3s, background .3s, opacity .2s;
}
.btn:hover { background: rgba(255, 255, 255, .13); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary {
  background: var(--silver); border-color: transparent; color: #0b0d12;
  box-shadow: 0 12px 30px -12px rgba(255, 255, 255, .35), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.btn.primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .9) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--ease);
}
.btn.primary:hover::after { transform: translateX(120%); }
.btn.big { width: 100%; padding: 16px; font-size: 1.05rem; border-radius: 16px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--glass-2); }
.btn.sm { padding: 9px 14px; font-size: .9rem; }
.btn.full { width: 100%; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--stroke); background: var(--glass);
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
  transition: background .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.icon-btn:active { transform: scale(.92); }

.field { display: block; text-align: left; margin-bottom: 14px; }
.field span { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px 4px; }
.field input, .input {
  width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .28); color: var(--ink); font: inherit; font-size: 16px; outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .input:focus {
  border-color: rgba(var(--a), .7); background: rgba(0, 0, 0, .36);
  box-shadow: 0 0 0 4px rgba(var(--a), .16), inset 0 1px 2px rgba(0, 0, 0, .4);
}

.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 12px 0; border-radius: 99px; outline: none; cursor: pointer;
  background: linear-gradient(var(--accent), var(--accent)) 0 / var(--p, 50%) 100% no-repeat, rgba(255, 255, 255, .13);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px rgba(var(--a), .3), 0 4px 12px rgba(0, 0, 0, .5); transition: transform .15s;
}
.range::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(var(--a), .3), 0 4px 12px rgba(0, 0, 0, .5); }
.range:active::-webkit-slider-thumb { transform: scale(1.2); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(var(--a), .5); }
@media (pointer: coarse) { .range::-webkit-slider-thumb { width: 24px; height: 24px; } }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Views ---------- */
.view { position: fixed; inset: 0; z-index: 1; overflow-x: hidden; overflow-y: auto; }
.view:not([hidden]) { animation: viewIn .7s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.center { display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }

.boot { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; }
.spin-ring { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--ink); animation: turn .9s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.spin-ring.sm { width: 18px; height: 18px; border-width: 2px; }

/* ---------- Sign in ---------- */
.auth-card {
  width: min(420px, 100%); padding: 40px 28px 28px; text-align: center;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
}
.auth-title { margin: 6px 0 8px; font-size: clamp(1.8rem, 6vw, 2.2rem); font-weight: 700; }
.sub { color: var(--ink-2); margin: 0 0 28px; line-height: 1.5; }
.form-error { min-height: 1.3em; color: var(--danger); font-size: .9rem; font-weight: 600; margin: 2px 0 12px; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }

/* ---------- Lobby ---------- */
.lobby {
  width: min(1000px, 100%); min-height: 100%; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; align-content: center;
}
.lobby > .card { animation: rise .8s var(--ease) both; }
.lobby > .card:nth-of-type(2) { animation-delay: .08s; }
.lobby > .card:nth-of-type(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.lobby-top { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; padding: 4px 2px; }
.profile-card { padding: 38px 24px 30px; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; }
.join-card, .admin-card { padding: 26px 24px; }
.admin-card { grid-column: 1 / -1; }
@media (max-width: 760px) { .lobby { grid-template-columns: 1fr; align-content: start; } }

.avatar-upload {
  position: relative; padding: 5px; border-radius: 50%; cursor: pointer;
  background: conic-gradient(from var(--ang), #3a3f4b, #f4f6fa, #6b7282, rgba(var(--a), .9), #3a3f4b);
  animation: spin 9s linear infinite;
  box-shadow: 0 0 60px -14px rgba(var(--a), .55);
  -webkit-box-reflect: below 12px linear-gradient(transparent 62%, rgba(255, 255, 255, .22));
  transition: transform .4s var(--ease);
}
.avatar-upload:hover { transform: scale(1.04); }
.avatar-upload > .avatar { border: 4px solid var(--bg); }
.avatar-cam {
  position: absolute; right: 2px; bottom: 6px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(14, 16, 22, .8); border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hello { margin: 52px 0 6px; font-size: clamp(1.7rem, 5vw, 2.2rem); }
.profile-card p { margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px;
  font-size: .78rem; font-weight: 800; background: var(--glass-2); border: 1px solid var(--stroke); color: var(--ink-2);
}
.chip.admin { background: rgba(var(--a), .12); color: var(--accent-ink); border-color: rgba(var(--a), .35); margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { margin: 0; font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }

.presence { margin: 18px 0 4px; min-height: 92px; }
.live-row { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ok); font-size: .9rem; margin-bottom: 12px; }
.faces { display: flex; flex-wrap: wrap; gap: 16px; }
.face { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; animation: pop .5s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
.quiet { display: flex; gap: 12px; align-items: center; color: var(--ink-3); line-height: 1.45; padding: 14px 16px; border-radius: 16px; border: 1px dashed rgba(255, 255, 255, .14); }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 14px; }
.toggle {
  display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; cursor: pointer; font-weight: 700;
  border: 1px solid var(--stroke); background: var(--glass); color: var(--ink-3); transition: all .3s var(--ease);
}
.toggle.on {
  color: var(--ink); border-color: rgba(var(--a), .45);
  background: rgba(var(--a), .12);
  box-shadow: 0 0 24px -10px rgba(var(--a), .7);
}
.join-card .btn.ghost { width: 100%; margin-top: 10px; }

.ns-list { margin-top: 10px; }
.ns-row { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 14px 0 6px; border-top: 1px solid rgba(255, 255, 255, .07); }
.ns-top { display: flex; justify-content: space-between; font-weight: 700; }
.val { font-variant-numeric: tabular-nums; color: var(--accent-ink); font-weight: 800; }

/* ---------- Avatars ---------- */
.avatar {
  --s: 40px; position: relative; flex: none; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 700; font-size: calc(var(--s) * .42);
  background: radial-gradient(circle at 30% 25%, hsl(var(--h) 32% 66%), hsl(var(--h) 26% 42%) 55%, hsl(var(--h) 24% 24%));
  text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px -6px rgba(0, 0, 0, .6);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(160deg, rgba(255, 255, 255, .3), transparent 42%); }
.avatar.md { --s: 52px; }
.avatar.lg { --s: 60px; }
.avatar.hero { --s: 128px; }
.avatar.xl { --s: clamp(56px, calc(var(--th, 200px) * .36), 150px); }

/* ---------- Call ---------- */
.call { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left));
}
.room-pill, .np-pill {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; white-space: nowrap;
  background: var(--glass); border: 1px solid var(--stroke); font-size: .86rem; font-weight: 700; color: var(--ink-2);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.room-pill b { color: var(--ink); }
.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.timer { font-variant-numeric: tabular-nums; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(61, 214, 140, .7); } 70%, 100% { box-shadow: 0 0 0 9px rgba(61, 214, 140, 0); } }
.np-pill { cursor: pointer; max-width: min(34vw, 320px); color: var(--ink); animation: pop .5s var(--ease); }
.np-pill span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .np-pill { display: none; }
  .room-pill { font-size: .8rem; }
}

.stage {
  flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  transition: margin-right .55s var(--ease);
}
.tile {
  position: relative; isolation: isolate; overflow: hidden; flex: none;
  width: var(--tw, 320px); height: var(--th, 180px); border-radius: 24px;
  background: #0e1015; border: 1px solid var(--stroke);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9);
  animation: tileIn .7s var(--ease) both;
  transition: width .5s var(--ease), height .5s var(--ease);
}
@keyframes tileIn { from { opacity: 0; transform: scale(.86) translateY(12px); } }
.tile.leaving { animation: tileOut .28s forwards; }
@keyframes tileOut { to { opacity: 0; transform: scale(.9); } }
.tile-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 80% at 50% 115%, hsl(var(--h) 30% 45% / .3), transparent 62%),
    radial-gradient(70% 60% at 50% -5%, rgba(255, 255, 255, .06), transparent 70%);
}
.tile-avatar { position: absolute; inset: 0; display: grid; place-items: center; }
.tile-avatar .avatar {
  transform: scale(calc(1 + var(--lvl, 0) * .08)); transition: transform .08s linear;
  box-shadow: 0 0 0 calc(var(--lvl, 0) * 16px) rgba(var(--a), .16), 0 0 calc(24px + var(--lvl, 0) * 60px) rgba(var(--a), .35);
}
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; transition: opacity .45s; }
.tile.self video { transform: scaleX(-1); }
.tile.cam-off video { opacity: 0; }
/* Glass reflection over every tile */
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1), transparent 20%),
    radial-gradient(520px circle at var(--mx, 50%) var(--my, -20%), rgba(255, 255, 255, .08), transparent 42%);
}
.ring {
  position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
  box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 40px rgba(var(--a), .35);
}
.tile.speaking .ring { opacity: 1; }
.tag {
  position: absolute; left: 10px; bottom: 10px; z-index: 4; max-width: calc(100% - 20px);
  display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px;
  background: rgba(10, 11, 15, .55); border: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; font-weight: 700;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tag-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag em { font-style: normal; color: var(--ink-3); font-weight: 600; }
.tag-mic { display: none; color: #ff9a9e; }
.tag-mic .i { width: 15px; height: 15px; }
.tile.mic-off .tag-mic { display: inline-flex; }
.tile-btn {
  position: absolute; top: 10px; right: 10px; z-index: 4; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .16); background: rgba(10, 11, 15, .5);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: opacity .25s, transform .25s var(--ease), background .2s;
}
.tile-btn:hover { background: rgba(255, 255, 255, .2); }
.tile-btn .i { width: 18px; height: 18px; }
@media (hover: hover) {
  .tile .tile-btn { opacity: 0; transform: translateY(-4px); }
  .tile:hover .tile-btn, .tile-btn:focus-visible { opacity: 1; transform: none; }
}
.tile-status {
  display: none; position: absolute; top: 12px; left: 50%; translate: -50% 0; z-index: 4; gap: 8px; align-items: center;
  padding: 6px 12px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: rgba(10, 11, 15, .6); color: var(--ink-2);
}
.tile.connecting .tile-status { display: flex; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.dock {
  position: relative; z-index: 6; align-self: center; display: flex; gap: 8px; padding: 10px; border-radius: 26px;
  margin: 4px 12px max(14px, env(safe-area-inset-bottom));
  -webkit-box-reflect: below 3px linear-gradient(transparent 62%, rgba(255, 255, 255, .13));
  animation: rise .8s .15s var(--ease) both;
}
.dock-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-width: 70px; height: 62px; padding: 0 8px; border-radius: 18px; cursor: pointer;
  border: 1px solid transparent; background: rgba(255, 255, 255, .06); color: var(--ink-2);
  font-size: .7rem; font-weight: 800; letter-spacing: .01em;
  transition: background .25s, transform .25s var(--ease), color .25s, box-shadow .25s, border-color .25s;
}
.dock-btn .i { width: 22px; height: 22px; }
.dock-btn:hover { background: rgba(255, 255, 255, .13); color: var(--ink); transform: translateY(-3px); }
.dock-btn:active { transform: scale(.94); }
.dock-btn.off { background: rgba(255, 99, 105, .13); color: #ff9a9e; border-color: rgba(255, 99, 105, .28); }
.dock-btn.active { background: rgba(var(--a), .16); color: #fff; border-color: rgba(var(--a), .45); }
.dock-btn.leave { background: linear-gradient(180deg, #ef5b60, #d4383e); color: #fff; box-shadow: 0 10px 26px -10px rgba(229, 72, 77, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
.dock-btn .eq { display: none; }
.dock-btn.playing .eq { display: inline-flex; position: absolute; top: 8px; right: 10px; color: var(--accent); }
.dock-btn { position: relative; }
.dock-sep { width: 1px; background: var(--stroke); margin: 8px 2px; }
@media (max-width: 560px) {
  .dock { align-self: stretch; gap: 5px; padding: 8px; margin-inline: 10px; border-radius: 24px; -webkit-box-reflect: unset; }
  .dock-btn { flex: 1; min-width: 0; height: 54px; font-size: 0; gap: 0; border-radius: 16px; }
  .dock-btn span { display: none; }
  .dock-sep { display: none; }
  .dock-btn.playing .eq { top: 6px; right: 6px; }
}

/* ---------- Music ---------- */
.music-panel {
  position: absolute; z-index: 5; right: 16px; width: 380px;
  top: calc(max(12px, env(safe-area-inset-top)) + 54px); bottom: 110px;
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 40px)); opacity: 0; pointer-events: none;
  transition: transform .6s var(--ease), opacity .4s;
}
.call.music-open .music-panel { transform: none; opacity: 1; pointer-events: auto; }
@media (min-width: 1000px) { .call.music-open .stage { margin-right: 396px; } }
@media (max-width: 999px) {
  .music-panel {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; height: min(84dvh, 740px); z-index: 7;
    border-radius: 28px 28px 0 0; border-bottom: 0; transform: translateY(104%);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .music-panel .mp-head::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 9px; background: rgba(255, 255, 255, .25);
  }
}
.mp-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 20px 6px; }
.mp-head h2 { margin: 0; font-size: 1.2rem; }
.mp-head p { margin: 4px 0 0; color: var(--ink-3); font-size: .85rem; }
.mp-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 20px 20px; }
.mp-now { position: relative; text-align: center; }
.mp-glow {
  position: absolute; inset: -30px -40px 35%; z-index: -1; opacity: .5; pointer-events: none;
  background: var(--art, none) center / cover; filter: blur(46px) saturate(1.7); transition: opacity .6s;
}
.mp-frame {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; background: rgba(0, 0, 0, .35);
  box-shadow: 0 22px 50px -20px #000, inset 0 0 0 1px rgba(255, 255, 255, .08);
  -webkit-box-reflect: below 6px linear-gradient(transparent 72%, rgba(255, 255, 255, .16));
}
.mp-yt { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.mp-yt.on { opacity: 1; z-index: 1; }
.mp-yt iframe { width: 100% !important; height: 100% !important; border: 0; display: block; }
.music-panel:not([data-playing]) .mp-yt { visibility: hidden; pointer-events: none; }
.mp-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-3); font-weight: 700; font-size: .9rem; }
.music-panel[data-playing] .mp-empty { display: none; }
.vinyl {
  width: 92px; height: 92px; border-radius: 50%; animation: vinyl 6s linear infinite;
  background:
    radial-gradient(circle, #0a0b0e 0 5%, #d9dde5 6% 13%, #3a4150 14% 24%, transparent 25%),
    repeating-radial-gradient(circle, #111 0 2px, #1c1f28 3px 4px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 18px 40px -12px #000, inset 0 0 0 3px #000;
}
@keyframes vinyl { to { transform: rotate(360deg); } }
.mp-meta { margin-top: 46px; }
.mp-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-sub { color: var(--ink-3); font-size: .84rem; margin-top: 4px; }
.mp-progress { display: grid; grid-template-columns: 40px 1fr 40px; gap: 10px; align-items: center; margin-top: 10px; font-size: .75rem; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mp-progress span:last-child { text-align: right; }
.mp-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 4px 0 10px; }
.play-btn {
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--silver); color: #0b0d12; box-shadow: 0 14px 30px -12px rgba(255, 255, 255, .4), inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0, 0, 0, .12);
  transition: transform .25s var(--ease);
}
.play-btn:hover { transform: scale(1.07); }
.play-btn:active { transform: scale(.94); }
.play-btn .i, .icon-btn .fill { fill: currentColor; }
.play-btn .i { width: 26px; height: 26px; }
.mp-vol { text-align: left; margin-top: 8px; padding: 14px 14px 4px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.mp-vol .setting-label { font-size: .88rem; }
.mp-vol-row { display: flex; align-items: center; gap: 12px; }
.mp-vol-row .icon-btn { width: 36px; height: 36px; }
.mp-vol-row .icon-btn .i { width: 18px; height: 18px; }
.mp-choice { display: grid; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(var(--a), .08); border: 1px solid rgba(var(--a), .25); font-size: .88rem; font-weight: 600; animation: rise .4s var(--ease); }
.mp-choice div { display: flex; gap: 8px; }
.mp-choice .btn { flex: 1; }
.link-btn { background: none; border: 0; padding: 4px 6px; cursor: pointer; color: var(--ink-3); font-weight: 800; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; border-radius: 8px; }
.link-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.mp-unlock { width: 100%; margin-top: 8px; }
.mp-add { display: flex; gap: 8px; margin-top: 18px; }
.mp-add .input { padding: 13px 14px; }
.mp-add .btn { padding: 0 16px; flex: none; }
.mp-note { color: var(--ink-3); font-size: .76rem; line-height: 1.5; margin: 10px 2px 0; }
.mp-queue-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 8px; font-weight: 800; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.mp-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.q-item {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 7px; border-radius: 14px; cursor: pointer;
  transition: background .2s; animation: rise .45s var(--ease) both;
}
.q-item:hover { background: rgba(255, 255, 255, .06); }
.q-item.current { background: rgba(var(--a), .1); box-shadow: inset 0 0 0 1px rgba(var(--a), .3); }
.q-item.done { opacity: .5; }
.q-more { list-style: none; text-align: center; padding: 10px; font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.q-thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #1a1d26; display: grid; place-items: center; }
.q-text { min-width: 0; }
.q-title { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.q-title span { overflow: hidden; text-overflow: ellipsis; }
.q-sub { font-size: .75rem; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .icon-btn { width: 34px; height: 34px; background: transparent; border-color: transparent; opacity: .6; }
.q-item .icon-btn:hover { opacity: 1; background: rgba(251, 113, 133, .2); }
.q-item .icon-btn .i { width: 16px; height: 16px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; color: var(--accent); flex: none; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; animation: eq .8s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.55s; }
@keyframes eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
.eq i { transform-origin: bottom; }
.paused .eq i { animation-play-state: paused; }

/* ---------- Sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(4, 5, 8, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .25s;
}
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 22px; animation: sheetIn .5s var(--ease); }
@keyframes sheetIn { from { opacity: 0; transform: scale(.94) translateY(10px); } }
@media (max-width: 600px) {
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 28px 28px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); animation-name: sheetUp; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
}
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.sheet-head .icon-btn { margin-left: auto; }
.sheet-head h3 { margin: 0; font-size: 1.25rem; }
.sheet-head h3 em { font-style: normal; color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.sheet-head p { margin: 2px 0 0; color: var(--ink-3); font-size: .85rem; }
.setting { padding: 16px 0 4px; border-top: 1px solid rgba(255, 255, 255, .07); margin-top: 10px; }
.setting-label { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.setting-label .val { margin-left: auto; }
.hint { color: var(--ink-3); font-size: .8rem; margin: 0 0 6px; line-height: 1.45; }
.meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .12); margin: 14px 0; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s var(--ease); }
.sheet .btn.full { margin-top: 14px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 60; top: max(14px, env(safe-area-inset-top)); left: 50%; translate: -50% 0; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast {
  padding: 11px 18px; border-radius: 16px; font-weight: 700; font-size: .9rem; text-align: center;
  background: rgba(18, 20, 26, .85); border: 1px solid var(--stroke); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: toastIn .5s var(--ease);
}
.toast.ok { border-color: rgba(61, 214, 140, .4); }
.toast.warn { border-color: rgba(255, 99, 105, .45); }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.95); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
