:root {
  --bg: #0b0912;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f2fb;
  --muted: #9d95b3;
  --pink: #ff6b9d;
  --violet: #8b7bff;
  --blue: #7c9cff;
  --tg: #2aabee;
  --ya: #ffcc00;
  --grad: linear-gradient(120deg, var(--pink), var(--violet) 55%, var(--blue));
  --radius: 22px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --display: Unbounded, Manrope, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Manrope, system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 19px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
input {
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
}
input:focus { border-color: var(--violet); background: var(--surface-2); }
input::placeholder { color: #6f6886; }

/* ---------- фон ---------- */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; animation: drift 22s ease-in-out infinite alternate; }
.o1 { width: 46vmax; height: 46vmax; background: #ff4f8b; top: -18vmax; left: -12vmax; opacity: 0.32; }
.o2 { width: 40vmax; height: 40vmax; background: #6b5cff; top: 10vmax; right: -16vmax; opacity: 0.32; animation-delay: -7s; }
.o3 { width: 34vmax; height: 34vmax; background: #2fd3b0; bottom: -20vmax; left: 20vmax; opacity: 0.14; animation-delay: -13s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }
#bg-cover { position: absolute; inset: -10%; background-size: cover; background-position: center; filter: blur(70px) saturate(1.5) brightness(0.4); opacity: 0; transition: opacity 0.8s, background-image 0.8s; }
#bg-cover.on { opacity: 1; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 18px;
  white-space: nowrap;
  transition: transform 0.12s, background 0.2s, opacity 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.13); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 10px 30px -10px rgba(255, 107, 157, 0.6); }
.btn.tg { background: var(--tg); border: 0; color: #fff; box-shadow: 0 12px 34px -12px rgba(42, 171, 238, 0.8); }
.btn.tg svg { width: 22px; height: 22px; }
.btn.ghost { background: transparent; }
.btn.small { padding: 8px 13px; font-size: 13px; border-radius: 12px; }
.btn.big { padding: 16px 26px; font-size: 16px; border-radius: 18px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }

.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; cursor: pointer; }
.logo-mark { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 200deg, var(--pink), var(--violet), var(--blue), var(--pink)); box-shadow: 0 0 22px rgba(255, 107, 157, 0.55); position: relative; }
.logo-mark::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--bg); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- лендинг ---------- */
#landing { max-width: 1120px; margin: 0 auto; padding: calc(20px + var(--safe-t)) 20px calc(40px + var(--safe-b)); }
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; min-height: 72vh; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 6vw, 66px); line-height: 1.04; letter-spacing: -0.035em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: #c9c1dd; font-size: 17px; margin: 22px 0 30px; max-width: 520px; }
.fine { color: var(--muted); font-size: 13px; margin-top: 14px; }
#dev-login { margin-left: 8px; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 460px; justify-self: center; width: 100%; }
.vinyl { position: absolute; inset: 8%; border-radius: 50%; background: repeating-radial-gradient(circle, #15121d 0 2px, #1c1826 2px 4px); box-shadow: 0 40px 100px -30px rgba(139, 123, 255, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.06); animation: spin 14s linear infinite; }
.vinyl::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 20%, rgba(255, 255, 255, 0.08) 25%, transparent 30% 70%, rgba(255, 255, 255, 0.06) 75%, transparent 80%); }
.vinyl-label { position: absolute; inset: 34%; border-radius: 50%; background: var(--grad); box-shadow: inset 0 0 0 10px rgba(0, 0, 0, 0.15); }
.vinyl-label::after { content: ''; position: absolute; inset: 44%; border-radius: 50%; background: var(--bg); }
@keyframes spin { to { transform: rotate(360deg); } }
.float-card { position: absolute; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px 12px 30px; border-radius: 16px; background: rgba(24, 20, 34, 0.75); border: 1px solid var(--border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 12px; color: var(--muted); animation: bob 5s ease-in-out infinite; }
.float-card b { color: var(--text); font-size: 15px; }
.float-card .dot { position: absolute; left: 13px; top: 17px; width: 9px; height: 9px; border-radius: 50%; }
.fc1 { top: 12%; left: -4%; }
.fc2 { bottom: 10%; right: -2%; animation-delay: -2.5s; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature b { display: block; font-size: 16px; margin: 12px 0 6px; }
.feature p { color: var(--muted); font-size: 14px; }
.f-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 10px; padding-top: 10px; }
  .hero-art { order: -1; max-width: 300px; }
  .features { grid-template-columns: 1fr; }
  #tg-login { width: 100%; }
  #dev-login { margin: 10px 0 0; width: 100%; }
}

/* ---------- оболочка приложения ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(12px + var(--safe-t)) 20px 12px;
  background: linear-gradient(var(--bg) 40%, rgba(11, 9, 18, 0));
}
.side-nav { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 999px; }
.side-nav a { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s; }
.side-nav a.on { background: var(--surface-2); color: var(--text); }
.avatar-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; color: #14111c; background-size: cover; background-position: center; flex: none; }
.avatar.xl { width: 76px; height: 76px; font-size: 28px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }

#main { max-width: 1080px; margin: 0 auto; padding: 8px 20px calc(var(--tabbar-h) + 100px + var(--safe-b)); }
.page { animation: page-in 0.3s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
.page-title { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 5vw, 34px); }
.sub { color: var(--muted); margin: 6px 0 22px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: none;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(14, 11, 22, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--text); }
@media (max-width: 760px) {
  .tabbar { display: flex; }
  .side-nav { display: none; }
}

/* ---------- главная ---------- */
.connect-card { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; border-color: rgba(255, 204, 0, 0.25); background: linear-gradient(120deg, rgba(255, 204, 0, 0.08), rgba(255, 255, 255, 0.04)); }
.cc-text { flex: 1; min-width: 0; }
.cc-text p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.cc-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.cc-ico.ya { background: var(--ya); color: #111; }
.cc-ico.small { width: 36px; height: 36px; font-size: 17px; border-radius: 11px; }
@media (max-width: 520px) { .connect-card { flex-wrap: wrap; } .connect-card .btn { width: 100%; } }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.action {
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px;
  min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  transition: transform 0.15s;
}
.action:active { transform: scale(0.98); }
.action b { font-size: 18px; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.action span:not(.a-ico) { color: rgba(255, 255, 255, 0.75); font-size: 13px; }
.a-ico { position: absolute; top: 18px; left: 18px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: rgba(255, 255, 255, 0.18); }
.a-create { background: linear-gradient(140deg, #ff6b9d, #c04bff); }
.a-match { background: linear-gradient(140deg, #6b7cff, #2fc4d6); }
.action::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -60px; top: -60px; background: rgba(255, 255, 255, 0.12); }
@media (max-width: 520px) { .actions { grid-template-columns: 1fr; } .action { min-height: 150px; } }

.join-card { display: flex; gap: 10px; margin-top: 14px; padding: 10px; }
.join-card input { border: 0; background: transparent; text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700; }
.join-card input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 12px; }
.section-head a { color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }

.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.room-card { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: background 0.2s, transform 0.12s; text-align: left; }
.room-card:hover { background: var(--surface-2); }
.room-card:active { transform: scale(0.98); }
.room-card .rc-cover { width: 64px; height: 64px; border-radius: 14px; background: var(--grad); background-size: cover; background-position: center; flex: none; position: relative; }
.room-card .rc-cover::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #ff4f6d; border: 2px solid var(--bg); animation: pulse 1.6s infinite; }
.rc-body { min-width: 0; flex: 1; }
.rc-body b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-now { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.stack-av { display: flex; }
.stack-av .avatar { width: 22px; height: 22px; font-size: 10px; border: 2px solid var(--bg); margin-left: -6px; }
.stack-av .avatar:first-child { margin-left: 0; }
.mood-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: #d8d0ee; }
.empty { text-align: center; padding: 34px 20px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); grid-column: 1 / -1; }
.empty b { display: block; color: var(--text); font-size: 16px; margin: 8px 0 4px; }
.empty .btn { margin-top: 14px; }

/* ---------- профиль ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; margin: 6px 0 22px; }
.profile-head h1 { font-family: var(--display); font-weight: 600; font-size: 24px; }
#main .card + .card, #main .card + form, #main form + .card, #main .card + .btn { margin-top: 14px; }
.svc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.svc > div { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.15s; }
.chips button.on { background: var(--text); color: #14111c; border-color: transparent; }
.chips.big button { padding: 11px 16px; font-size: 15px; }
.ok { color: #5ee6b0; }

/* ---------- комната ---------- */
.room-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.room-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-title b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-title span { color: var(--muted); font-size: 13px; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .room-grid { grid-template-columns: 1fr; } }
.player { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cover-wrap { width: min(380px, 82vw); aspect-ratio: 1; border-radius: 26px; overflow: hidden; position: relative; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06); margin-bottom: 22px; background: var(--surface); }
.cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; animation: cover-in 0.6s ease; }
@keyframes cover-in { from { opacity: 0; transform: scale(1.04); } }
.cover-ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(124, 156, 255, 0.3)); }
.eq { display: flex; gap: 6px; align-items: flex-end; height: 52px; }
.eq i { width: 8px; background: rgba(255, 255, 255, 0.85); border-radius: 4px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; } .eq i:nth-child(3) { animation-delay: -0.6s; } .eq i:nth-child(4) { animation-delay: -0.15s; }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }
.pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 5px 12px 5px 5px; border-radius: 999px; margin-bottom: 12px; min-height: 30px; background: var(--surface-2); }
.pick:empty { visibility: hidden; }
.track-title { font-family: var(--display); font-weight: 600; font-size: clamp(20px, 4.6vw, 26px); max-width: 440px; }
.track-artist { color: var(--muted); margin-top: 6px; font-weight: 600; }
.progress { width: 100%; max-width: 440px; margin-top: 22px; }
.bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: var(--grad); border-radius: 3px; transition: width 0.5s linear; }
.times { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-top: 7px; font-variant-numeric: tabular-nums; }
.live { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; color: #ff5c7a; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.controls { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.ctrl { width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--text); transition: transform 0.12s; box-shadow: 0 14px 40px -12px rgba(255, 255, 255, 0.4); }
.ctrl:active { transform: scale(0.93); }
.ctrl svg { width: 30px; height: 30px; fill: var(--bg); }
.ctrl.ghost { width: 54px; height: 54px; background: var(--surface-2); box-shadow: none; }
.ctrl.ghost svg { width: 22px; height: 22px; fill: var(--text); }
.reacts { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.reacts button { font-size: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 48px; height: 48px; cursor: pointer; transition: transform 0.12s; }
.reacts button:active { transform: scale(0.85); }
.bg-note { color: var(--muted); font-size: 13px; margin-top: 18px; max-width: 320px; }
.room-side .card + .card { margin-top: 14px; }
.room-side .btn.wide { margin-top: 14px; }

.members { display: flex; flex-direction: column; gap: 10px; }
.member { display: flex; align-items: center; gap: 12px; }
.member .m-body { flex: 1; min-width: 0; }
.member b { display: block; font-size: 15px; }
.member small { color: var(--muted); font-size: 12px; }
.member.off { opacity: 0.45; }
.member .turn { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.waiting-hint { color: var(--muted); font-size: 13px; padding: 4px 0; }

.queue { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.queue li { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 14px; }
.queue li:hover { background: var(--surface); }
.queue img, .queue .ph { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.queue .meta { flex: 1; min-width: 0; }
.queue .t { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .a { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .avatar { width: 24px; height: 24px; font-size: 10px; }
.queue .empty-row { color: var(--muted); font-size: 13px; padding: 4px; }
.queue.faded li { opacity: 0.55; }
.add-form { display: flex; gap: 8px; margin-top: 12px; }
.add-form input { padding: 10px 13px; font-size: 14px; }

/* ---------- мини-плеер ---------- */
#mini {
  position: fixed; z-index: 25; left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px;
  border-radius: 18px; background: rgba(30, 25, 44, 0.9); border: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  animation: page-in 0.3s ease;
}
@media (min-width: 761px) { #mini { bottom: 20px; } }
#mini img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--grad); }
.mini-text { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; }
.mini-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- шторки ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(5, 4, 9, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0;
  max-width: 520px; margin: 0 auto;
  max-height: 92dvh; overflow-y: auto;
  background: #16121f; border: 1px solid var(--border); border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 10px 22px calc(26px + var(--safe-b));
  animation: sheet-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@media (min-width: 600px) { .sheet { bottom: 50%; transform: translateY(50%); border-radius: 28px; border-bottom: 1px solid var(--border); animation: fade 0.25s; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); margin: 0 auto 18px; }
.sheet h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin-bottom: 8px; }
.sheet .muted { margin-bottom: 18px; }
.sheet .chips { margin-bottom: 20px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg button { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 16px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: all 0.15s; }
.seg button span { font-size: 12px; color: var(--muted); }
.seg button.on { border-color: var(--violet); background: rgba(139, 123, 255, 0.14); }
.ya-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ya-head h2 { margin: 0; font-size: 19px; }
.steps { padding-left: 20px; margin: 0 0 16px; color: #d0c8e4; }
.steps li { margin: 6px 0; }
.code { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: 0.16em; text-align: center; padding: 16px; margin-bottom: 14px; border-radius: 18px; background: var(--surface-2); user-select: all; }
#ya-device .btn { margin-bottom: 12px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 14px 0 6px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; }

.radar { position: relative; width: 170px; height: 170px; margin: 10px auto 22px; display: grid; place-items: center; }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(139, 123, 255, 0.6); animation: ping 2.4s ease-out infinite; }
.radar span:nth-child(2) { animation-delay: 0.8s; } .radar span:nth-child(3) { animation-delay: 1.6s; }
@keyframes ping { from { transform: scale(0.35); opacity: 1; } to { transform: scale(1.1); opacity: 0; } }
.radar-core { width: 72px; height: 72px; border-radius: 50%; background: var(--grad); background-size: cover; background-position: center; box-shadow: 0 0 40px rgba(139, 123, 255, 0.6); }
#match-wait { text-align: center; }

/* ---------- звук, уведомления, реакции ---------- */
#unlock { position: fixed; inset: 0; z-index: 50; background: rgba(8, 6, 14, 0.7); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: grid; place-items: center; padding: 20px; animation: fade 0.2s; }
.unlock-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.unlock-cover { width: 150px; height: 150px; border-radius: 24px; background: var(--grad); background-size: cover; background-position: center; box-shadow: 0 30px 70px -20px rgba(255, 107, 157, 0.6); }
.unlock-card b { font-family: var(--display); font-size: 20px; font-weight: 600; }

#toasts { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: rgba(30, 25, 42, 0.96); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; font-size: 14px; font-weight: 600; animation: toast-in 0.25s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.toast.error { border-color: rgba(255, 107, 107, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

#float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
.floater { position: absolute; bottom: -60px; font-size: 42px; animation: float-up 3.2s ease-out forwards; display: flex; flex-direction: column; align-items: center; }
.floater small { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; color: #111; }
@keyframes float-up {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { opacity: 1; transform: translateY(-15vh) scale(1.1); }
  100% { transform: translateY(-85vh) scale(1); opacity: 0; }
}

#install-body ol { padding-left: 20px; margin: 0; }
#install-body li { margin: 4px 0; }
.ios-share { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }

@media (display-mode: standalone) { body { user-select: none; -webkit-user-select: none; } input { user-select: text; -webkit-user-select: text; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
