/* Ритмия — интерфейс поверх 3D-сцены.
   Правило: мало элементов, стеклянные панели, одна главная кнопка.
   --beat (0…1) обновляется каждый кадр из main.js: интерфейс «дышит» в такт. */

@font-face { font-family: 'Unbounded'; font-weight: 600; font-display: swap; src: url(../fonts/unbounded-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-weight: 600; font-display: swap; src: url(../fonts/unbounded-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-21FF, U+2212, U+2215, U+266A; }
@font-face { font-family: 'Unbounded'; font-weight: 800; font-display: swap; src: url(../fonts/unbounded-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-weight: 800; font-display: swap; src: url(../fonts/unbounded-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-21FF, U+2212, U+2215, U+266A; }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url(../fonts/manrope-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url(../fonts/manrope-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-21FF, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url(../fonts/manrope-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url(../fonts/manrope-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-21FF, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(../fonts/manrope-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(../fonts/manrope-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-21FF, U+2212, U+2215; }

:root {
  --bg: #140A26;
  --pink: #FF5FB0;
  --violet: #8F6BFF;
  --mint: #4FE3C1;
  --gold: #FFC857;
  --text: #F7F1FF;
  --muted: rgba(247, 241, 255, 0.62);
  --faint: rgba(247, 241, 255, 0.38);
  --glass: rgba(26, 13, 48, 0.62);
  --glass-strong: rgba(22, 11, 42, 0.84);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --beat: 0;
  --pad: clamp(12px, 2.4vmin, 24px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 500 15px/1.4 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- Экраны ---------- */

.screen {
  position: fixed; inset: 0; display: none;
  padding: calc(var(--pad) + var(--safe-t)) var(--pad) calc(var(--pad) + var(--safe-b));
  pointer-events: none;
}
.screen[data-on] { display: flex; flex-direction: column; animation: screen-in .28s ease-out; }
.screen :is(button, input, form, .side-panel, .center-card, .results-card, .lobby-info, .player-card, .board, .host-tools) { pointer-events: auto; }
@keyframes screen-in { from { opacity: 0; } }

#s-loading { background: radial-gradient(120% 90% at 50% 110%, #3A1460 0%, var(--bg) 60%); pointer-events: auto; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Логотип ---------- */

.logo {
  font: 800 22px/1 var(--display);
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, #fff 10%, #FFC2E2 45%, var(--pink) 70%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 calc(6px + var(--beat) * 10px) rgba(255, 95, 176, calc(0.25 + var(--beat) * 0.35)));
}
.logo.big { font-size: clamp(44px, 11vmin, 84px); }

.loading { margin: auto; display: grid; justify-items: center; gap: 22px; text-align: center; }
.loader { width: min(260px, 60vw); height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.loader i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--violet)); transition: width .3s ease; }

/* ---------- Верхняя строка ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.topbar .title { font: 600 18px/1.1 var(--display); text-align: center; flex: 1; text-shadow: 0 2px 14px rgba(0, 0, 0, .5); }
.top-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: rgba(60, 34, 100, .7); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.small { width: 30px; height: 30px; background: transparent; border-color: transparent; backdrop-filter: none; }
.icon-btn.small svg { width: 17px; height: 17px; opacity: .7; }
.icon-btn .snd-off { display: none; }
body.muted .icon-btn .snd-on { display: none; }
body.muted .icon-btn .snd-off { display: inline; }

.pill {
  height: 40px; padding: 0 6px 0 12px; border-radius: 22px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-weight: 800; font-variant-numeric: tabular-nums;
}
.pill.static { padding-right: 14px; }
.note-ic {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), #FF9E57); color: #3A1D00;
  font-size: 13px; font-weight: 800; line-height: 1;
}
.pill .plus {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pink); color: #fff; font-size: 18px; line-height: 1;
}

/* ---------- Кнопки ---------- */

.btn {
  height: 52px; padding: 0 22px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 800; font-size: 16px;
  transition: transform .1s, filter .15s, background .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn.primary {
  background: linear-gradient(105deg, var(--pink), #C35BFF 60%, var(--violet));
  color: #fff;
  box-shadow: 0 8px 26px -8px rgba(255, 95, 176, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.glass {
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.btn.glass:hover:not(:disabled) { background: rgba(60, 34, 100, .72); }
.btn.ghost { background: rgba(255, 255, 255, .07); }
.btn.gold { background: linear-gradient(105deg, var(--gold), #FF9E57); color: #3A1D00; }
.btn.mint { background: var(--mint); color: #062A22; }
.btn.slim { height: 40px; padding: 0 16px; font-size: 14px; border-radius: 12px; }

/* Главная кнопка «Танцевать» — единственный громкий элемент меню */
.btn.huge {
  height: auto; min-height: 84px; padding: 14px 28px; border-radius: 26px;
  flex-direction: column; gap: 3px;
  box-shadow:
    0 0 0 calc(var(--beat) * 7px) rgba(255, 95, 176, calc(0.28 - var(--beat) * 0.2)),
    0 12px 40px -10px rgba(255, 95, 176, calc(0.55 + var(--beat) * 0.35)),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn.huge span { font: 800 26px/1.05 var(--display); letter-spacing: -0.01em; }
.btn.huge small { font-weight: 600; font-size: 13px; opacity: .85; }

.link-btn { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.link-btn:hover { color: var(--text); }

/* ---------- Меню ---------- */

.menu-body {
  flex: 1; display: flex; flex-direction: column; justify-content: space-between;
  width: min(400px, 46vw); padding-top: 18px;
}
.player-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px 12px 12px; border-radius: 20px; width: fit-content; max-width: 100%;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.player-card > div:last-child { min-width: 0; }
.level-ring {
  --p: 0;
  width: 50px; height: 50px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: conic-gradient(var(--mint) calc(var(--p) * 1turn), rgba(255, 255, 255, .1) 0);
  position: relative;
}
.level-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #1F1038; }
.level-ring span { position: relative; font: 800 17px/1 var(--display); }
.nick-row { display: flex; align-items: center; gap: 2px; }
.nick { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp { width: 170px; max-width: 100%; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); margin: 4px 0 4px; overflow: hidden; }
.xp i { display: block; height: 100%; background: var(--mint); border-radius: inherit; transition: width .5s; }

.menu-actions { display: grid; gap: 12px; justify-items: stretch; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.row3 .btn { height: 72px; flex-direction: column; gap: 5px; font-size: 13px; padding: 0 6px; border-radius: 18px; }
.row3 .btn svg { width: 24px; height: 24px; color: #E3D6FF; }
.menu-actions .link-btn { justify-self: start; }

/* ---------- Боковая панель (гардероб, магазин) ---------- */

.side-panel {
  margin-top: 14px; width: min(430px, 48vw); flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.side-panel.wide { width: min(560px, 56vw); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; flex: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 36px; padding: 0 14px; border-radius: 18px;
  font-weight: 700; font-size: 14px; color: var(--muted);
  background: rgba(255, 255, 255, .05);
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: #fff; color: #24113F; }
.tab:disabled { opacity: .35; }

.hint { margin: 0; color: var(--muted); font-size: 13px; min-height: 18px; }

.grid {
  flex: 1; min-height: 0; overflow: hidden;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; align-content: start;
  padding: 2px;
}
.item {
  position: relative; aspect-ratio: 1 / 1.12; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 6px; text-align: center;
  background: rgba(255, 255, 255, .05); border: 1.5px solid transparent;
  transition: background .15s, border-color .15s, transform .1s;
}
.item:hover { background: rgba(255, 255, 255, .09); }
.item:active { transform: scale(.96); }
.item[aria-pressed="true"] { border-color: var(--mint); background: rgba(79, 227, 193, .1); }
.item.trying[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 200, 87, .1); }
.item .nm { font-size: 12px; font-weight: 700; line-height: 1.15; color: var(--muted); }
.item[aria-pressed="true"] .nm { color: var(--text); }
.swatch {
  width: 44px; height: 44px; border-radius: 50%;
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, .25), 0 0 0 2px rgba(255, 255, 255, .12);
}
.swatch.orig { background: conic-gradient(var(--pink), var(--gold), var(--mint), var(--violet), var(--pink)); opacity: .75; }
.portrait { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; background: #2A1748; }
.glyph { font-size: 30px; line-height: 44px; height: 44px; filter: saturate(1.1); }
.price {
  position: absolute; top: 6px; right: 6px;
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 800; padding: 2px 6px 2px 3px; border-radius: 10px;
  background: rgba(0, 0, 0, .45); color: var(--gold);
}
.price .note-ic { width: 15px; height: 15px; font-size: 9px; }
.price.pack { background: linear-gradient(90deg, #FF5FB0, #B98CFF); color: #fff; padding: 2px 7px; font-size: 10px; letter-spacing: .02em; }

.panel-foot { flex: none; min-height: 52px; display: flex; align-items: center; gap: 10px; }
.panel-foot .btn { flex: 1; }
.panel-foot .try-text { flex: 1.2; font-size: 13px; color: var(--muted); line-height: 1.3; }
.panel-foot .try-text b { color: var(--text); display: block; font-size: 15px; }

/* ---------- Магазин ---------- */

.shop-scroll { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 18px; align-content: start; padding: 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.shop-scroll h3 { margin: 0 0 8px; font: 600 15px/1.2 var(--display); color: var(--muted); }
.offer {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 14px;
  padding: 18px; border-radius: 20px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 95, 176, .38), transparent 60%),
    radial-gradient(100% 120% at 100% 100%, rgba(143, 107, 255, .4), transparent 60%),
    rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 95, 176, .35);
}
.offer h4 { margin: 0; font: 800 20px/1.1 var(--display); }
.offer p { margin: 0; color: var(--muted); font-size: 13px; grid-column: 1; }
.offer .btn { grid-row: 1 / span 2; grid-column: 2; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.packs > .pack {
  display: grid; justify-items: center; gap: 8px; padding: 16px 12px 12px; border-radius: 18px;
  background: rgba(255, 255, 255, .05); text-align: center;
}
.pack .amount { font: 800 24px/1 var(--display); display: flex; align-items: center; gap: 7px; }
.pack .amount .note-ic { width: 26px; height: 26px; font-size: 15px; }
.pack .label { font-size: 13px; color: var(--muted); }
.pack .btn { width: 100%; }
.pack.ad .amount { color: var(--mint); }
.cur-ic { width: 16px; height: 16px; vertical-align: -3px; }
/* наборы и одежда за рубли */
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.set-card { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 10px; border-radius: 18px; background: rgba(255, 255, 255, .05); text-align: center; }
.set-card > b { font-size: 14px; line-height: 1.2; }
.set-card .set-what { font-size: 12px; color: var(--muted); line-height: 1.3; }
.set-card .btn, .set-card .owned { margin-top: auto; width: 100%; }
.set-card.have { opacity: .7; }
.set-card .owned { color: var(--mint); font-weight: 700; font-size: 13px; padding: 8px 0; }
.set-ics { display: flex; justify-content: center; gap: 4px; min-height: 64px; align-items: center; }
.set-i { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 14px; background: rgba(0, 0, 0, .2); overflow: hidden; }
.set-i img { width: 100%; height: 100%; object-fit: contain; }
.set-i.glyph { font-size: 26px; color: var(--gold); }
.tracks { display: grid; gap: 8px; }
.track {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, .05);
}
.track .play {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .1);
}
.track .play svg { width: 18px; height: 18px; }
.track.playing .play { background: var(--mint); color: #062A22; }
.track .info { flex: 1; min-width: 0; }
.track .info b { display: block; }
.track .info span { font-size: 12px; color: var(--muted); }
.track .owned { font-size: 13px; color: var(--mint); font-weight: 700; padding: 0 8px; }

/* ---------- С другом ---------- */

.center-card {
  margin: auto; width: min(400px, 100%);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 26px 24px; border-radius: 26px; text-align: center;
  background: var(--glass-strong); border: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.center-card h2 { margin: 0; font: 800 22px/1.15 var(--display); }
.center-card p { margin: 0 0 4px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join { display: flex; gap: 10px; }
.join input {
  flex: 1; min-width: 0; width: 0; height: 52px; border-radius: 16px; padding: 0 16px;
  background: rgba(0, 0, 0, .3); border: 1.5px solid var(--line-strong);
  font: 800 22px/1 var(--display); letter-spacing: .25em; text-transform: uppercase; text-align: center;
  user-select: text; -webkit-user-select: text;
}
.join input::placeholder { letter-spacing: normal; font: 600 16px var(--body); color: var(--faint); text-transform: none; }
.join input:focus { outline: none; border-color: var(--mint); }

/* ---------- Лобби ---------- */

.lobby-info {
  align-self: center; margin-top: 10px;
  display: flex; align-items: center; gap: 16px; padding: 10px 12px 10px 18px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.lobby-info:empty { display: none; }
.lobby-info .code { font: 800 30px/1 var(--display); letter-spacing: .14em; color: var(--gold); }
.lobby-info .meta { font-size: 13px; color: var(--muted); line-height: 1.35; white-space: nowrap; }
.lobby-info .meta b { color: var(--text); }
.lobby-info .wait { font: 800 28px/1 var(--display); color: var(--mint); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: center; }
.lobby-bottom { margin-top: auto; display: grid; gap: 12px; justify-items: center; }
.host-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.host-tools:empty { display: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 18px; font-weight: 700; font-size: 13px;
  background: var(--glass); border: 1px solid var(--line); color: var(--muted);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.chip[aria-pressed="true"] { background: #fff; color: #24113F; border-color: #fff; }
.host-tools .row { display: flex; gap: 8px; justify-content: center; width: 100%; }

.emotes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.emote {
  width: 48px; height: 48px; border-radius: 50%; font-size: 22px; line-height: 1;
  display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .12s;
}
.emote:active { transform: scale(.88); }
.emote:disabled { opacity: .4; }

/* ---------- Бейджи над танцорами ---------- */

#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  display: grid; justify-items: center; gap: 4px; will-change: transform;
}
.tag .nm {
  padding: 4px 10px; border-radius: 12px; white-space: nowrap;
  font-weight: 800; font-size: 13px;
  background: rgba(20, 10, 38, .7); border: 1px solid var(--line);
}
.tag.me .nm { background: var(--pink); border-color: transparent; }
.tag.bot .nm { color: var(--muted); }
.tag .sc { font: 800 13px/1 var(--display); color: var(--gold); text-shadow: 0 1px 6px rgba(0,0,0,.7); font-variant-numeric: tabular-nums; }
.tag .sc:empty { display: none; }
.tag .jg { font: 800 14px/1 var(--display); text-shadow: 0 1px 8px rgba(0,0,0,.8); animation: pop .9s ease-out forwards; }
.tag .jg.perfect { color: var(--gold); }
.tag .jg.great { color: var(--mint); }
.tag .jg.cool { color: #C9B6FF; }
.tag .jg.bad { color: #FF9E7A; }
.tag .jg.miss { color: rgba(255, 255, 255, .6); }
.tag .bubble {
  font-size: 26px; line-height: 1; padding: 8px 10px; border-radius: 18px 18px 18px 4px;
  background: #fff; color: #24113F; box-shadow: 0 6px 20px rgba(0,0,0,.35);
  animation: bubble 2.4s ease-out forwards;
}
@keyframes bubble { 0% { transform: scale(.3) translateY(8px); opacity: 0; } 10% { transform: scale(1.08); opacity: 1; } 18% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }

/* ---------- Игра ---------- */

#s-game { padding-bottom: calc(10px + var(--safe-b)); }
.hud-top { display: flex; align-items: flex-start; gap: 12px; }
.board {
  list-style: none; margin: 0; padding: 6px; border-radius: 16px; min-width: 190px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: grid; gap: 2px; counter-reset: place;
}
.board li {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center;
  padding: 4px 8px; border-radius: 10px; font-size: 13px; counter-increment: place;
  transition: background .2s;
}
.board li::before { content: counter(place); font: 800 12px/1 var(--display); color: var(--faint); }
.board li .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.board li .s { font: 800 13px/1 var(--display); font-variant-numeric: tabular-nums; }
.board li.me { background: rgba(255, 95, 176, .25); }
.board li.left { opacity: .45; }
.song-info { flex: 1; text-align: center; padding-top: 4px; }
.song-name { font: 600 15px/1.2 var(--display); text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.song-progress { width: min(220px, 50%); height: 4px; margin: 8px auto 0; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.song-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--violet)); }

.judge, .combo, .count { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; }
.judge { top: auto; bottom: calc(150px + var(--safe-b)); font: 800 clamp(32px, 7vmin, 60px)/1 var(--display); letter-spacing: -0.01em; }
.judge.show { animation: judge .9s cubic-bezier(.2, .9, .3, 1.2) forwards; }
.judge:not(.perfect) { filter: drop-shadow(0 2px 0 rgba(20, 10, 38, .75)) drop-shadow(0 0 14px rgba(20, 10, 38, .85)); }
.judge.perfect { background: linear-gradient(90deg, var(--gold), #fff, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(20, 10, 38, .75)) drop-shadow(0 0 16px rgba(255, 200, 87, .6)); }
.judge.great { color: var(--mint); text-shadow: 0 0 22px rgba(79, 227, 193, .6); }
.judge.cool { color: #B9A2FF; text-shadow: 0 0 18px rgba(143, 107, 255, .6); }
.judge.bad { color: #FF9E7A; }
.judge.miss { color: rgba(255, 255, 255, .55); }
@keyframes judge { 0% { transform: scale(1.6); opacity: 0; } 15% { transform: scale(.95); opacity: 1; } 25% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes pop { 0% { transform: translateY(6px); opacity: 0; } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.combo { top: auto; bottom: calc(150px + clamp(40px, 8vmin, 66px) + var(--safe-b)); font: 800 18px/1 var(--display); color: var(--gold); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.combo:empty { display: none; }
.count { top: 34%; font: 800 clamp(48px, 13vmin, 110px)/1 var(--display); color: #fff; text-shadow: 0 0 30px rgba(255, 95, 176, .7); }
.count.small-text { font-size: clamp(22px, 5vmin, 40px); }
.count.show { animation: count .7s ease-out forwards; }
@keyframes count { 0% { transform: scale(1.5); opacity: 0; } 20% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

.rhythm {
  margin-top: auto; align-self: center; width: min(620px, 100%);
  display: grid; gap: 10px; justify-items: center;
}
.arrows { display: flex; gap: clamp(4px, 1.2vmin, 10px); justify-content: center; min-height: clamp(44px, 9vmin, 64px); align-items: center; }
.arrows .final-tag { font: 800 13px/1 var(--display); color: var(--gold); margin-right: 6px; }
.arrow {
  width: clamp(38px, 8vmin, 58px); height: clamp(38px, 8vmin, 58px); border-radius: 30%;
  display: grid; place-items: center;
  background: rgba(20, 10, 38, .72); border: 2px solid rgba(255, 255, 255, .22);
  color: #fff; transition: background .08s, border-color .08s, transform .08s;
}
.arrow svg { width: 58%; height: 58%; }
.arrow[data-d="U"] svg { transform: rotate(-90deg); }
.arrow[data-d="D"] svg { transform: rotate(90deg); }
.arrow[data-d="L"] svg { transform: rotate(180deg); }
.arrow.done { background: linear-gradient(135deg, var(--pink), var(--violet)); border-color: transparent; transform: scale(.92); box-shadow: 0 0 16px rgba(255, 95, 176, .55); }
.arrows.complete .arrow { background: linear-gradient(135deg, var(--mint), #3FB7FF); box-shadow: 0 0 16px rgba(79, 227, 193, .55); color: #062A22; }
.arrows.wrong { animation: shake .28s; }
.arrows.wrong .arrow { border-color: #FF6A6A; }
.arrows.gone .arrow { opacity: .25; transform: scale(.85); }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

.timing {
  position: relative; width: min(520px, 92%); height: 26px; border-radius: 14px;
  background: rgba(20, 10, 38, .72); border: 1px solid var(--line-strong);
  overflow: hidden;
}
.ticks { position: absolute; inset: 0; }
.ticks i { position: absolute; top: 8px; bottom: 8px; width: 2px; margin-left: -1px; border-radius: 1px; background: rgba(255, 255, 255, .22); }
.target {
  position: absolute; top: 3px; bottom: 3px; left: 87.5%; width: 30px; margin-left: -15px; border-radius: 10px;
  background: rgba(255, 200, 87, .25); border: 2px solid var(--gold);
  box-shadow: 0 0 calc(6px + var(--beat) * 10px) rgba(255, 200, 87, .6);
}
.cursor {
  position: absolute; top: 2px; bottom: 2px; left: 0; width: 6px; margin-left: -3px; border-radius: 3px;
  background: #fff; box-shadow: 0 0 12px #fff, 0 0 24px var(--pink);
  will-change: transform;
}
.key-hint { font-size: 13px; color: var(--muted); text-align: center; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
kbd {
  display: inline-block; padding: 1px 7px; border-radius: 6px; font: 700 12px var(--body);
  background: rgba(255, 255, 255, .12); border: 1px solid var(--line-strong); border-bottom-width: 2px;
}

.touch { display: none; }
body.touch-ui .touch {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-top: 10px;
}
body.touch-ui .key-hint { display: none; }
body.touch-ui .judge { bottom: calc(250px + var(--safe-b)); }
body.touch-ui .combo { bottom: calc(250px + clamp(40px, 8vmin, 66px) + var(--safe-b)); }
.dpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dpad button {
  width: clamp(56px, 15vw, 72px); height: clamp(56px, 15vw, 72px); border-radius: 22px;
  background: var(--glass) no-repeat center / 46%; border: 1px solid var(--line-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M4 11h11.2l-4.6-4.6L12 5l7 7-7 7-1.4-1.4 4.6-4.6H4z'/%3E%3C/svg%3E");
  touch-action: none;
}
.dpad button[data-dir="L"] { transform: rotate(180deg); }
.dpad button[data-dir="U"] { transform: rotate(-90deg); }
.dpad button[data-dir="D"] { transform: rotate(90deg); }
.dpad button.down { background-color: rgba(255, 95, 176, .55); }
.hit {
  width: clamp(84px, 24vw, 110px); height: clamp(84px, 24vw, 110px); border-radius: 50%; flex: none;
  font: 800 20px/1 var(--display); color: #3A1D00;
  background: radial-gradient(circle at 35% 30%, #FFE3A3, var(--gold) 55%, #FF9E57);
  box-shadow: 0 0 0 calc(var(--beat) * 6px) rgba(255, 200, 87, .25), 0 10px 30px -8px rgba(255, 200, 87, .7);
  touch-action: none;
}
.hit.down { transform: scale(.93); }

/* ---------- Итоги ---------- */

#s-results { justify-content: center; align-items: flex-end; }
.results-card {
  width: min(520px, 100%); display: grid; gap: 14px; padding: 20px; border-radius: 26px;
  background: var(--glass-strong); border: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.results-card h2 { margin: 0; text-align: center; font: 800 24px/1.1 var(--display); }
.podium { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.podium li {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: 14px; background: rgba(255, 255, 255, .05);
}
.podium li .pl { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 800 15px/1 var(--display); background: rgba(255,255,255,.1); }
.podium li:nth-child(1) .pl { background: var(--gold); color: #3A1D00; }
.podium li:nth-child(2) .pl { background: #D9D3EA; color: #24113F; }
.podium li:nth-child(3) .pl { background: #E7A27A; color: #3A1300; }
.podium li .who b { display: block; font-size: 15px; }
.podium li .who span { font-size: 12px; color: var(--muted); }
.podium li .pts { font: 800 18px/1 var(--display); font-variant-numeric: tabular-nums; }
.podium li.me { background: rgba(255, 95, 176, .22); box-shadow: inset 0 0 0 1.5px rgba(255, 95, 176, .6); }
.rewards { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.reward { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 14px; background: rgba(255,255,255,.07); font-weight: 800; }
.reward .note-ic { width: 20px; height: 20px; font-size: 11px; }
.reward.exp { color: var(--mint); }
.res-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

/* ---------- Тост и окно ---------- */

.toast {
  position: fixed; left: 50%; top: calc(16px + var(--safe-t)); transform: translate(-50%, calc(-100% - 40px)); visibility: hidden;
  max-width: min(420px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 16px;
  background: #fff; color: #24113F; font-weight: 700; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.15), visibility 0s .3s; z-index: 50; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .3s cubic-bezier(.2, .9, .3, 1.15); }
.toast.good { background: var(--mint); color: #062A22; }

.modal { position: fixed; inset: 0; display: none; place-items: center; padding: 20px; background: rgba(8, 4, 18, .6); z-index: 40; }
.modal.show { display: grid; }
.modal .center-card { margin: 0; }

.mock-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(8, 4, 18, .82); }
.mock-card { width: min(360px, 100%); display: grid; gap: 14px; padding: 24px; border-radius: 22px; background: #22123F; border: 1px solid var(--line-strong); text-align: center; }
.mock-card p { margin: 0; color: var(--muted); }
.mock-tag { justify-self: center; padding: 4px 12px; border-radius: 10px; background: var(--gold); color: #3A1D00; font-weight: 800; font-size: 13px; }
.mock-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.mock-bar i { display: block; height: 100%; width: 0; background: var(--mint); animation: mockbar 2s linear forwards; }
@keyframes mockbar { to { width: 100%; } }
.mock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.offline {
  position: fixed; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); z-index: 45;
  padding: 8px 16px; border-radius: 14px; background: rgba(255, 106, 106, .92); color: #2A0606; font-weight: 800; font-size: 13px;
}

/* ---------- Портрет (телефон вертикально) ---------- */

@media (max-aspect-ratio: 20/21) {
  .menu-body { width: 100%; padding-top: 10px; }
  .player-card { align-self: center; }
  .menu-actions .link-btn { justify-self: center; }
  .side-panel, .side-panel.wide { width: 100%; flex: none; height: 54%; margin-top: auto; border-radius: 24px; }
  .side-panel.wide { height: auto; flex: 1; margin-top: 14px; }
  .board { min-width: 0; width: 150px; padding: 4px; }
  .board li { padding: 3px 6px; font-size: 12px; grid-template-columns: 14px 1fr auto; gap: 5px; }
  .song-name { font-size: 13px; }
  .lobby-info { gap: 12px; padding: 10px 10px 10px 14px; }
  .lobby-info .code { font-size: 24px; }
  .lobby-info .btn.slim { padding: 0 12px; }
  .count { top: 28%; }
  #s-results { align-items: stretch; }
  .results-card { padding: 16px; gap: 10px; }
  .podium li { padding: 8px 12px 8px 8px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .btn.huge { min-height: 64px; padding: 10px 22px; }
  .btn.huge span { font-size: 21px; }
  .row3 .btn { height: 56px; }
  .menu-actions { gap: 8px; }
  .player-card { padding: 8px 12px 8px 8px; }
  .level-ring { width: 40px; height: 40px; }
  body.touch-ui .dpad button { width: 52px; height: 52px; }
  body.touch-ui .hit { width: 78px; height: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  :root { --beat: 0 !important; }
}

/* ================= v3: комнаты, чат, рейтинг, «Темпо» ================= */

.icon-spacer { width: 44px; flex: none; }
.chat-btn { position: relative; }
.chat-btn .dot, .tab .dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px #1F1038; }
.tab { position: relative; }
.tab .dot { top: 4px; right: 4px; width: 8px; height: 8px; }

/* Уровень — всегда слева от ника */
.lv {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; margin-right: 6px; border-radius: 7px;
  font: 800 11px/1 var(--display); color: #062A22; background: var(--mint); vertical-align: 1px; flex: none;
}
.stats-line { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Бейджи над танцорами: игры и победы, уровень и ник */
.tag .st { display: flex; gap: 8px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.9); }
.tag .nm { display: inline-flex; align-items: center; color: inherit; font: inherit; font-weight: 800; font-size: 13px; }
.tag .nm .lv { height: 18px; min-width: 20px; font-size: 10px; margin-right: 5px; }
.tag.me .nm .lv { background: #fff; color: #A3105C; }
.tag .rd { margin-left: 6px; font-size: 12px; color: var(--mint); }
.tag .rd.host { color: var(--gold); }
.tag.ready .nm { border-color: rgba(79, 227, 193, .7); }
#tags:not(.in-game) .tag .nm { pointer-events: auto; cursor: pointer; }
#tags.in-game .tag .st { display: none; }

/* Список комнат */
.rooms-head { display: flex; justify-content: flex-end; min-height: 18px; }
.rooms-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 8px; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.room-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; text-align: left;
  background: rgba(255, 255, 255, .06); border: 1.5px solid transparent; transition: background .15s, border-color .15s;
}
.room-card:hover:not(:disabled) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 95, 176, .45); }
.room-card:disabled { opacity: .55; }
.rc-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.rc-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-main > span { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.mode-chip { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 8px; background: rgba(143, 107, 255, .3); color: #E3D6FF; }
.mode-chip.tempo { background: rgba(79, 227, 193, .22); color: var(--mint); }
.rc-side { display: grid; justify-items: end; gap: 5px; flex: none; }
.seats { display: flex; gap: 4px; }
.seats i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.seats i.on { background: var(--pink); }
.rc-side .st { font-size: 12px; color: var(--muted); }
.rooms-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: none; }
.empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.45; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }

/* Окно: поля, переключатели */
.field { display: grid; gap: 8px; text-align: left; }
.field .label { font-size: 13px; font-weight: 800; color: var(--muted); }
.field p { margin: 0; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: rgba(0, 0, 0, .3); }
.seg button { flex: 1; height: 38px; border-radius: 10px; font-weight: 800; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: #24113F; }
.seg.small button { height: 32px; font-size: 13px; padding: 0 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.field .chips .chip:not([aria-pressed="true"]) { background: rgba(255,255,255,.06); }

/* Лобби */
.host-tools { flex-direction: column; width: min(560px, 100%); }
.host-tools .chips { justify-content: center; }
.lobby-status { margin: 0; font-size: 14px; color: var(--text); text-align: center; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.start-btn { min-width: 220px; height: 56px; font-size: 18px; }
.lobby-info .meta { white-space: normal; }

/* Рейтинг */
.rating-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
#rating-me .rating-list { flex: none; overflow: visible; }
.rating-list li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.rating-list li.me { background: rgba(255, 95, 176, .22); box-shadow: inset 0 0 0 1.5px rgba(255, 95, 176, .6); }
.rating-list li.empty { display: block; }
.rating-list .rk { font: 800 15px/1 var(--display); color: var(--faint); text-align: center; }
.rating-list li:nth-child(1) .rk { color: var(--gold); }
.rating-list li:nth-child(2) .rk { color: #D9D3EA; }
.rating-list li:nth-child(3) .rk { color: #E7A27A; }
.rating-list .who { display: flex; align-items: center; min-width: 0; text-align: left; font-weight: 800; }
.rating-list .who .n, .msg .who .n, .thread .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rating-list .sub { font-size: 12px; color: var(--muted); }
.rating-list .val { font: 800 14px/1 var(--display); color: var(--gold); white-space: nowrap; }
.rating-me { flex: none; }

/* Чат */
.chat {
  position: fixed; z-index: 30; right: calc(var(--pad)); top: calc(var(--pad) + var(--safe-t) + 54px); bottom: calc(var(--pad) + var(--safe-b));
  width: min(380px, calc(100vw - 2 * var(--pad))); display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border-radius: 22px; background: var(--glass-strong); border: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 8px; }
.chat-head .tabs { flex: 1; flex-wrap: nowrap; }
.chat-head .close { color: var(--muted); font-size: 16px; }
.chat-thread-head { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 2px 4px; user-select: text; -webkit-user-select: text; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.msg { display: grid; gap: 2px; padding: 8px 10px; border-radius: 14px 14px 14px 4px; background: rgba(255, 255, 255, .06); max-width: 92%; align-self: flex-start; }
.msg.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: rgba(255, 95, 176, .2); }
.msg .who { display: flex; align-items: center; font-size: 12px; font-weight: 800; color: var(--muted); text-align: left; min-width: 0; }
.msg .who .lv { height: 16px; min-width: 18px; font-size: 9px; margin-right: 5px; }
.msg .tx { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.thread { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 0; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.06); text-align: left; position: relative; }
.thread .n { font-weight: 800; }
.thread .last { grid-column: 1 / -1; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.thread .on { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.chat-form { display: flex; gap: 8px; flex: none; }
.chat-form[hidden] { display: none; }
.chat-form input {
  flex: 1; min-width: 0; height: 42px; border-radius: 12px; padding: 0 12px; background: rgba(0,0,0,.3); border: 1.5px solid var(--line-strong);
  user-select: text; -webkit-user-select: text;
}
.chat-form input:focus { outline: none; border-color: var(--mint); }

/* Карточка игрока */
.player-pop { display: flex; align-items: center; justify-content: center; gap: 4px; }
.player-pop h2 { font-size: 20px; }
.player-pop .lv { height: 26px; min-width: 30px; font-size: 14px; }
.pp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pp-stats div { display: grid; gap: 2px; padding: 12px 6px; border-radius: 14px; background: rgba(255,255,255,.06); }
.pp-stats b { font: 800 22px/1 var(--display); }
.pp-stats span { font-size: 12px; color: var(--muted); }

/* Гардероб: подвкладки и страницы */
.subtabs { display: flex; gap: 6px; flex: none; }
.subtabs:empty { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; flex: none; min-height: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.pager:empty { display: none; }
.pager .pg { width: 40px; height: 34px; border-radius: 12px; background: rgba(255,255,255,.08); font-size: 22px; line-height: 1; color: var(--text); }
.pager .pg:disabled { opacity: .3; }
.portrait.hair { object-position: center 20%; filter: saturate(.85); }

/* Режимы на игровом экране */
.tempo-ui { display: none; width: 100%; }
body[data-mode="tempo"] .tempo-ui { display: block; }
body[data-mode="tempo"] .classic-ui { display: none; }
.classic-ui { display: grid; gap: 10px; justify-items: center; width: 100%; }
body[data-mode="tempo"] .hit { visibility: hidden; }

.lane {
  position: relative; width: min(760px, 100%); height: clamp(64px, 12vmin, 92px); margin: 0 auto; border-radius: 46px;
  background: linear-gradient(90deg, rgba(20, 10, 38, .2), rgba(20, 10, 38, .78) 30%, rgba(20, 10, 38, .78));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 95, 176, .15), 0 0 30px -10px rgba(143, 107, 255, .6);
  overflow: hidden;
}
.lane-glow { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: linear-gradient(90deg, transparent, rgba(255, 95, 176, .7) 40%, rgba(143, 107, 255, .9)); }
.lane-notes { position: absolute; inset: 0; }
.note {
  position: absolute; left: 0; top: 50%; width: clamp(44px, 8.5vmin, 64px); height: clamp(44px, 8.5vmin, 64px); margin-left: calc(clamp(44px, 8.5vmin, 64px) / -2);
  border-radius: 50%; display: grid; place-items: center; color: #fff; will-change: transform;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 45%), var(--nc, var(--pink));
  box-shadow: 0 0 16px -2px var(--nc, var(--pink)), inset 0 -4px 8px rgba(0,0,0,.25);
}
.note svg { width: 56%; height: 56%; }
.note[data-d="L"] { --nc: #FF4F8B; }
.note[data-d="R"] { --nc: #3FA0FF; }
.note[data-d="U"] { --nc: #2FD3A6; }
.note[data-d="D"] { --nc: #FFB238; }
.note[data-d="U"] svg { transform: rotate(-90deg); }
.note[data-d="D"] svg { transform: rotate(90deg); }
.note[data-d="L"] svg { transform: rotate(180deg); }
.note.hit { animation: note-hit .26s ease-out forwards; }
.note.missed { animation: note-miss .26s ease-out forwards; }
@keyframes note-hit { to { opacity: 0; scale: 1.7; filter: brightness(2); } }
@keyframes note-miss { to { opacity: 0; scale: .6; filter: grayscale(1); } }
.hitzone {
  position: absolute; top: 50%; left: 84%; width: clamp(58px, 11vmin, 84px); height: clamp(58px, 11vmin, 84px);
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 calc(3px + var(--beat) * 5px) rgba(143, 107, 255, .35), 0 0 24px rgba(143, 107, 255, .7), inset 0 0 18px rgba(79, 227, 193, .35);
}
.hitzone.flash { animation: zone .25s ease-out; }
@keyframes zone { from { box-shadow: 0 0 0 12px rgba(255, 255, 255, .55), 0 0 40px #fff; } }
.judge.small { font-size: clamp(24px, 5vmin, 40px); }

/* Телефон: стрелки как на клавиатуре (буквой «Т») справа, «Бит» слева */
body.touch-ui .touch { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-top: 10px; }
.dpad { display: grid; grid-template-columns: repeat(3, auto); grid-template-areas: ". u ." "l d r"; gap: 8px; }
.dpad button[data-dir="U"] { grid-area: u; }
.dpad button[data-dir="L"] { grid-area: l; }
.dpad button[data-dir="D"] { grid-area: d; }
.dpad button[data-dir="R"] { grid-area: r; }
.dpad button { display: grid; place-items: center; background-image: none; color: #fff; }
.dpad button svg { width: 46%; height: 46%; }
.dpad button[data-dir="L"], .dpad button[data-dir="U"], .dpad button[data-dir="D"] { transform: none; }
.dpad button[data-dir="L"] svg { transform: rotate(180deg); }
.dpad button[data-dir="U"] svg { transform: rotate(-90deg); }
.dpad button[data-dir="D"] svg { transform: rotate(90deg); }

/* Без размытия фона (Firefox): панели плотнее */
body.no-blur :is(.icon-btn, .pill, .btn.glass, .player-card, .side-panel, .center-card, .results-card, .lobby-info, .board, .emote, .chip, .chat, .dpad button) {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
body.no-blur { --glass: rgba(26, 13, 48, .86); --glass-strong: rgba(22, 11, 42, .94); }

@media (max-aspect-ratio: 20/21) {
  .chat { top: auto; left: var(--pad); right: var(--pad); width: auto; height: 62%; }
  .rooms-foot { grid-template-columns: 1fr; }
  .start-btn { min-width: 0; width: 100%; }
  .rating-list li { grid-template-columns: 26px 1fr auto; }
  .rating-list .sub { display: none; }
}

/* ---------- v5: гардероб ---------- */
.w-style { flex: none; display: flex; justify-content: flex-end; font: 800 13px/1 var(--display); color: var(--gold); margin-bottom: -4px; }
.tabs.wrap .tab { height: 32px; padding: 0 11px; font-size: 13px; }
.subtabs .chip.has { box-shadow: inset 0 0 0 1.5px rgba(79, 227, 193, .55); }
.item .st { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 800; color: rgba(255, 200, 87, .75); }
.item .ic { width: 50px; height: 50px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); }
.look-ic { display: flex; align-items: flex-end; height: 50px; }
.look-ic .ic { width: 34px; height: 34px; margin: 0 -4px; }
.look-ic .ic:nth-child(2) { width: 40px; height: 40px; z-index: 1; }
.portrait.native { width: 54px; height: 54px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(79, 227, 193, .5); }
.glyph.dim { opacity: .45; }

/* ---------- v5: комнаты ---------- */
.rooms-head { justify-content: space-between; align-items: center; gap: 10px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.search svg { width: 17px; height: 17px; fill: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 600 14px var(--body); }
.search input::placeholder { color: var(--faint); }
.room-row { display: flex; align-items: center; gap: 6px; }
.room-row .room-card { flex: 1; min-width: 0; }
.info-btn svg { fill: var(--text); }
.room-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.room-meta .muted { width: 100%; text-align: center; }
.room-players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.room-players li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.room-players .who { flex: 1; min-width: 0; display: flex; align-items: center; font-weight: 800; text-align: left; }
.room-players .sub { font-size: 12px; color: var(--muted); }
.btn.danger { color: #FF8FA8; }
.btn.primary.danger { background: linear-gradient(105deg, #FF4F7B, #FF7A59); color: #fff; }
.lobby-info .icon-btn.small svg { fill: var(--text); }

/* ---------- v5: друзья ---------- */
.friends-btn { position: relative; }
.friends-btn .dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px #1F1038; }
.friends-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 8px; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.friends-list.modal-list { max-height: 46vh; text-align: left; }
.friend { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.friend.online { background: rgba(79, 227, 193, .08); }
.friend .who { display: flex; align-items: center; min-width: 0; font-weight: 800; text-align: left; }
.friend .who .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend .fs { grid-column: 1; font-size: 12px; color: var(--muted); margin-top: 2px; }
.friend .fs.on, .friend .fs.room { color: var(--mint); }
.friend .acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; align-items: center; }
.friend .acts .btn.slim { height: 34px; padding: 0 12px; font-size: 13px; }
.f-hint { margin: 0; flex: none; text-align: center; }
.player-pop .on { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); display: inline-block; margin-left: 6px; }


/* ---------- v5: настройки ---------- */
.settings-scroll { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 18px; align-content: start; padding: 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.settings-scroll section { display: grid; gap: 8px; }
.settings-scroll h3 { margin: 0; font: 600 15px/1.2 var(--display); color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .04); }
.set-row > span { font-weight: 700; font-size: 14px; display: grid; gap: 2px; }
.set-row small { font-weight: 600; font-size: 11px; color: var(--faint); }
.set-row .seg { flex: none; }
.gender-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-card { display: grid; justify-items: center; gap: 8px; padding: 14px 10px; border-radius: 18px; background: rgba(255, 255, 255, .07); border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.g-card:hover { border-color: var(--pink); background: rgba(255, 95, 176, .12); }
.g-card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.g-card b { font: 800 16px/1 var(--display); }

@media (max-width: 700px), (orientation: portrait) {
  .set-row { flex-direction: column; align-items: stretch; }
  .set-row .seg { width: 100%; }
  .friend { grid-template-columns: 1fr; }
  .friend .acts { grid-column: 1; grid-row: auto; margin-top: 8px; flex-wrap: wrap; }
}
.lobby-info .icon-btn.info { width: 40px; height: 40px; }
.lobby-info .icon-btn.info svg { width: 20px; height: 20px; fill: var(--text); }

/* 3D-иконки вещей (client/icons) */
.item .ic-img {
  width: 70%; max-width: 76px; aspect-ratio: 1; object-fit: contain; flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 46%, rgba(190, 170, 255, .16), rgba(190, 170, 255, 0) 70%);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .35));
  -webkit-user-drag: none; user-select: none; pointer-events: none;
}
.item .ic-img.tall { border-radius: 14px; }
.panel-foot .only-one { flex: 0 1 auto; font-size: 12px; padding: 0 10px; white-space: nowrap; }
@media (max-width: 440px) {
  .panel-foot:has(.only-one) { flex-wrap: wrap; }
  .panel-foot:has(.only-one) .try-text { flex-basis: 100%; }
}

/* Редактор внешности */
.looks-ed { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; overflow-y: auto; max-height: 100%; }
.le-row { display: grid; grid-template-columns: 112px 54px 1fr 54px; align-items: center; gap: 8px; font-size: 13px; }
.le-row .le-name { color: var(--text); font-weight: 700; }
.le-row .le-name b { color: var(--gold); font-weight: 800; margin-left: 4px; }
.le-row .le-ends { color: var(--muted); font-size: 11px; text-align: center; }
.le-row input[type=range] { width: 100%; accent-color: var(--pink); }
.le-row .le-sw { grid-column: 2 / 5; display: flex; flex-wrap: wrap; gap: 7px; }
.le-sw .sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); box-shadow: inset 0 -4px 6px rgba(0,0,0,.25); }
.le-sw .sw.on { border-color: #fff; transform: scale(1.12); }
.le-sw .sw.orig { background: conic-gradient(var(--pink), var(--gold), var(--mint), var(--violet), var(--pink)); }
.looks-ed .link-btn { align-self: flex-start; }
@media (max-width: 440px) { .le-row { grid-template-columns: 90px 40px 1fr 40px; font-size: 12px; } }

/* ---------- Плеер в меню: компактная плашка в правом нижнем углу ---------- */
.mplayer {
  position: absolute; right: calc(var(--pad) + 4px); bottom: calc(var(--pad) + var(--safe-b));
  display: flex; align-items: center; gap: 8px; width: 290px; max-width: calc(100vw - 2 * var(--pad));
  padding: 6px 6px 6px 6px; border-radius: 16px; pointer-events: auto;
  background: rgba(22, 11, 42, .55); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: .82; transition: opacity .2s;
}
.mplayer:hover { opacity: 1; }
.mp-eq {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: flex-end; justify-content: center; gap: 2px;
  padding: 9px 7px; background: linear-gradient(135deg, rgba(255, 95, 176, .35), rgba(143, 107, 255, .35));
}
.mp-eq i { width: 3px; height: 30%; border-radius: 2px; background: var(--text); opacity: .85; transition: height .12s; }
.mplayer.on .mp-eq i { height: calc(20% + var(--beat) * 70%); }
.mplayer.on .mp-eq i:nth-child(2) { height: calc(55% - var(--beat) * 35%); }
.mplayer.on .mp-eq i:nth-child(3) { height: calc(35% + var(--beat) * 55%); }
.mplayer.on .mp-eq i:nth-child(4) { height: calc(70% - var(--beat) * 40%); }
.mp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.mp-info b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-info span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-bar { height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .12); margin-top: 4px; overflow: hidden; }
.mp-bar i { display: block; height: 100%; width: 0; background: var(--mint); border-radius: inherit; }
.mp-ctl { flex: none; display: flex; align-items: center; gap: 0; }
.mp-b { position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.mp-b:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.mp-b svg { width: 15px; height: 15px; fill: currentColor; }
.mp-b.big { width: 32px; height: 32px; background: var(--text); color: #24113F; margin: 0 2px; }
.mp-b.big:hover { background: #fff; color: #24113F; }
.mp-b.big svg { width: 16px; height: 16px; }
.mp-b.act { color: var(--mint); }
.mp-b em { position: absolute; right: 2px; bottom: 2px; font: 800 8px/1 var(--display); font-style: normal; color: var(--mint); }
.pl-modes { display: flex; gap: 6px; justify-content: center; margin-top: 2px; }
.pl-modes .btn { font-size: 13px; }
.pl-modes .btn.act { box-shadow: inset 0 0 0 1.5px var(--mint); color: var(--mint); }
.pl-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; margin: 6px 0 10px; text-align: left; }
.pl-row { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 14px; text-align: left; }
.pl-row:hover { background: rgba(255, 255, 255, .06); }
.pl-row.on { background: rgba(255, 95, 176, .14); }
.pl-row b { display: block; font-size: 14px; }
.pl-row small { color: var(--muted); font-size: 12px; }
.pl-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); flex: none; }
.pl-ic svg { width: 16px; height: 16px; fill: currentColor; }
@media (max-aspect-ratio: 20/21) { .mplayer { width: auto; left: auto; bottom: auto; top: calc(var(--pad) + var(--safe-t) + 56px); max-width: 200px; } .mplayer .mp-info { display: none; } }
.rename-row { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; }
.rename-row input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); color: var(--text); font: 700 16px var(--body, inherit); }
.rename-row input:focus { outline: none; border-color: var(--pink); }
.pl-modes .btn svg { width: 15px; height: 15px; fill: currentColor; }
.mp-info { cursor: pointer; }

/* ---------- Префиксы и VIP-ник ---------- */
.pfx { display: inline-block; font: 800 0.78em/1.25 var(--display); letter-spacing: .02em; padding: 0 0.45em; border-radius: 0.5em; vertical-align: 0.08em; white-space: nowrap;
  background: rgba(143, 107, 255, .2); color: #CDBDFF; }
.pfx.c-violet { background: rgba(143, 107, 255, .22); color: #D3C4FF; }
.pfx.c-pink { background: rgba(255, 95, 176, .22); color: #FFB8DD; }
.pfx.c-mint { background: rgba(79, 227, 193, .18); color: #9FF5E0; }
.pfx.c-gold { background: linear-gradient(90deg, #FFE08A, #FFB83D); color: #3A2400; }
.pfx.c-fire { background: linear-gradient(90deg, #FF7A3D, #FF3D7F); color: #fff; }
.pfx.c-ice { background: linear-gradient(90deg, #7FE3FF, #8F9BFF); color: #12203A; }
.pfx.c-rainbow { background: linear-gradient(90deg, #FF5FB0, #FFC857, #4FE3C1, #8F6BFF); background-size: 200% 100%; color: #1A0E31; animation: pfx-rb 4s linear infinite; }
.pfx.c-white { background: rgba(255, 255, 255, .9); color: #24113F; }
@keyframes pfx-rb { to { background-position: 200% 0; } }
.n.vip { background: linear-gradient(90deg, #FFE7A0, #FFC857 40%, #FF9F3D); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.n.vip::after { content: ' ♛'; color: #FFC857; -webkit-text-fill-color: #FFC857; font-size: .85em; }
.nick .pfx { font-size: 11px; }

.profile-row { display: flex; gap: 8px; margin-top: 8px; pointer-events: auto; }
.profile-row .btn { height: 34px; padding: 0 12px; font-size: 13px; gap: 6px; }
.pfx-ic { color: var(--gold); }
.vip-btn { background: linear-gradient(90deg, rgba(255, 200, 87, .2), rgba(255, 159, 61, .2)); border: 1px solid rgba(255, 200, 87, .45); color: #FFE3A3; }
.vip-btn.on { background: linear-gradient(90deg, #FFE08A, #FFB83D); color: #3A2400; border-color: transparent; }
.crown { font-size: 1.05em; line-height: 1; }
.pass-btn { background: linear-gradient(90deg, #8F6BFF, #FF5FB0); color: #fff; }
.price.pass { background: linear-gradient(90deg, #8F6BFF, #FF5FB0); color: #fff; padding: 2px 6px; font-size: 9px; letter-spacing: .04em; }
.price.vip { background: linear-gradient(90deg, #FFE08A, #FFB83D); color: #3A2400; padding: 2px 6px; font-size: 10px; }

/* ---------- Карточка батл-пасса (справа вверху) ---------- */
.pass-card {
  position: absolute; right: var(--pad); top: calc(var(--pad) + var(--safe-t) + 58px); pointer-events: auto;
  display: flex; align-items: center; gap: 12px; width: 250px; padding: 10px 14px 10px 10px; border-radius: 18px; text-align: left; color: var(--text);
  background: linear-gradient(135deg, rgba(143, 107, 255, .55), rgba(255, 95, 176, .45)), rgba(22, 11, 42, .7);
  border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 10px 30px -10px rgba(255, 95, 176, .55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .15s;
}
.pass-card:hover { transform: translateY(-1px); }
.pass-card.glow { box-shadow: 0 0 0 2px rgba(255, 200, 87, calc(.35 + var(--beat) * .5)), 0 10px 30px -8px rgba(255, 200, 87, .6); }
.pc-lv { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; align-content: center; background: rgba(20, 10, 38, .55); border: 1px solid rgba(255, 255, 255, .2); }
.pc-lv b { font: 800 19px/1 var(--display); }
.pc-lv small { font-size: 10px; color: var(--muted); }
.pc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-t small { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .75); font-weight: 800; }
.pc-t b { font: 800 14px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-bar { display: block; height: 5px; border-radius: 5px; background: rgba(0, 0, 0, .3); overflow: hidden; margin-top: 4px; }
.pc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #FFE08A, #FFC857); border-radius: inherit; }
.pc-bar.big { height: 9px; }
.pc-dot { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: #3A2400; font: 800 12px/22px var(--display); text-align: center; }

/* ---------- Окна: префиксы, VIP, батл-пасс ---------- */
.px-tabs { margin: 6px 0 10px; flex-wrap: wrap; }
.px-tabs button { flex: 1 1 auto; white-space: nowrap; padding: 0 10px; height: 34px; font-size: 13px; }
.px-row .btn { flex: none; white-space: nowrap; }
.px-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; margin-bottom: 12px; text-align: left; }
.px-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.px-row.on { background: rgba(79, 227, 193, .12); box-shadow: inset 0 0 0 1px rgba(79, 227, 193, .4); }
.px-row.locked .px-prev > :not(small) { opacity: .55; }
.px-prev { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-weight: 700; }
.px-prev small { color: var(--muted); font-weight: 600; font-size: 12px; }
.px-on { color: var(--mint); font-weight: 800; font-size: 13px; white-space: nowrap; }

.vip-modal { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.vip-head { text-align: center; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, rgba(255, 224, 138, .25), rgba(255, 159, 61, .18)); border: 1px solid rgba(255, 200, 87, .35); }
.vip-head h2 { margin: 2px 0; background: linear-gradient(90deg, #FFE7A0, #FFB83D); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vip-head p { margin: 0; color: var(--muted); }
.crown.big { font-size: 34px; color: #FFC857; }
.vip-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.vip-perks li { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.vip-perks li span { color: var(--muted); font-size: 13px; }
.vip-items { display: flex; gap: 6px; flex-wrap: wrap; }
.vip-items .vi { width: 44px; height: 44px; border-radius: 10px; background: rgba(0, 0, 0, .25); display: grid; place-items: center; overflow: hidden; }
.vip-items .vi img, .vip-items .vi svg { width: 40px; height: 40px; object-fit: contain; }
.vip-buy { height: 50px; font-size: 16px; }
.reward.vipr { background: linear-gradient(90deg, #FFE08A, #FFB83D); color: #3A2400; }


/* ---------- Список музыки в комнате ---------- */
.song-list { max-height: 210px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; text-align: left; }
.song-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 12px; background: rgba(255, 255, 255, .05); cursor: pointer; pointer-events: auto; }
.song-row:hover { background: rgba(255, 255, 255, .09); }
.song-row.on { background: rgba(255, 95, 176, .16); box-shadow: inset 0 0 0 1px rgba(255, 95, 176, .5); }
.sp-play { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--text); }
.sp-play svg { width: 15px; height: 15px; fill: currentColor; }
.sp-play.playing { background: var(--mint); color: #12301F; }
.sp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-t b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-t small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-ok { color: var(--pink); font-weight: 800; }
#host-tools .song-list { max-height: 150px; margin: 4px 0; }
@media (max-aspect-ratio: 20/21) { .pass-card { top: auto; bottom: calc(var(--pad) + var(--safe-b) + 230px); width: 210px; } }
.center-card:has(.pass-modal) { width: min(860px, 94vw); max-width: 94vw; max-height: 92vh; overflow-y: auto; }

/* =====================================================================
   Версия 7: «Бэкстейдж клуба»
   Профиль — пропуск за кулисы на ленте, «Играть» — входной билет,
   панели — LED-экраны сцены с подсвеченной кромкой. Смелость — в билете
   и пропуске; всё остальное — тише и строже.
   ===================================================================== */
:root {
  --night: #100620;
  --panel-bg: rgba(18, 8, 36, .84);
  --panel-edge: linear-gradient(90deg, rgba(255, 79, 168, 0), rgba(255, 79, 168, .9) 30%, rgba(62, 230, 224, .9) 70%, rgba(62, 230, 224, 0));
  --cyan: #3EE6E0;
  --pink: #FF4FA8;
}

/* --- логотип: неоновая трубка --- */
.brand .logo {
  font: 800 28px/1 var(--display); letter-spacing: .01em;
  color: #FFF5FB; background: none; -webkit-background-clip: initial; background-clip: initial;
  text-shadow: 0 0 1px #fff, 0 0 6px rgba(255, 79, 168, .95), 0 0 18px rgba(255, 79, 168, calc(.45 + var(--beat) * .4)), 0 0 42px rgba(143, 107, 255, .5);
  filter: none;
}

/* --- верхняя строка экранов: заголовок слева, у кнопки «назад» --- */
.topbar .title { flex: 1; text-align: left; font: 800 24px/1 var(--display); letter-spacing: .005em; padding-left: 4px; text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.icon-btn { background: rgba(18, 8, 36, .7); border-color: rgba(255, 255, 255, .12); }
.icon-btn:hover { background: rgba(40, 18, 76, .85); border-color: rgba(255, 255, 255, .22); }

/* --- панели экранов: LED-экран с подсветкой по верхней кромке --- */
.side-panel {
  position: relative; background: var(--panel-bg); border: 1px solid rgba(255, 255, 255, .08); border-radius: 22px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.side-panel::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px;
  background: var(--panel-edge); box-shadow: 0 0 14px rgba(255, 79, 168, .55); pointer-events: none;
}
.tab { background: transparent; border: 1px solid rgba(255, 255, 255, .1); }
.tab[aria-selected="true"] { background: #FBF5FF; color: #1C0B36; border-color: #FBF5FF; box-shadow: 0 0 18px -4px rgba(255, 255, 255, .45); }
.item { background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06); }
.item:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }
.item[aria-pressed="true"] { border-color: var(--cyan); background: rgba(62, 230, 224, .08); box-shadow: 0 0 0 1px var(--cyan), 0 0 22px -8px var(--cyan); }

/* --- меню: левая колонка --- */
.menu-body { width: min(380px, 44vw); padding-top: 14px; }

/* пропуск за кулисы: прорезь для ленты сверху, голографическая полоса */
.player-card.pass-badge {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  width: 100%; padding: 22px 16px 14px; border-radius: 18px;
  background:
    linear-gradient(115deg, rgba(255, 79, 168, .16), transparent 38%),
    linear-gradient(295deg, rgba(62, 230, 224, .12), transparent 40%),
    rgba(18, 8, 36, .86);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.player-card.pass-badge::before {
  /* прорезь под ленту */
  content: ''; position: absolute; top: 8px; left: 50%; width: 44px; height: 7px; margin-left: -22px; border-radius: 4px;
  background: rgba(0, 0, 0, .55); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .08);
}
.player-card.pass-badge::after {
  /* голографическая полоса по левому краю */
  content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--pink), #8F6BFF, var(--cyan));
}
.pb-top { display: flex; align-items: center; gap: 12px; }
.pb-who { min-width: 0; flex: 1; }
.pass-badge .nick { font-size: 18px; }
.pass-badge .xp { width: 100%; height: 6px; margin: 2px 0 0; background: rgba(255, 255, 255, .08); }
.pass-badge .xp i { background: linear-gradient(90deg, var(--cyan), #9BFFF7); box-shadow: 0 0 10px rgba(62, 230, 224, .6); }
.pb-foot { display: flex; justify-content: space-between; }
.pass-badge .level-ring { width: 54px; height: 54px; background: conic-gradient(var(--cyan) calc(var(--p) * 1turn), rgba(255, 255, 255, .1) 0); }
.pass-badge .level-ring::before { background: #170A2E; }
.pass-badge .profile-row { margin-top: 2px; }
.pass-badge .profile-row .btn { flex: 1; height: 34px; border-radius: 10px; }
.pfx-btn { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: var(--text); }
.pfx-btn:hover { background: rgba(255, 255, 255, .11); }

/* --- «Играть»: входной билет с отрывным корешком --- */
.ticket {
  --notch: 11px;
  position: relative; display: flex; align-items: stretch; width: 100%; min-height: 90px; border-radius: 18px; color: #fff; text-align: left;
  background: linear-gradient(100deg, #FF4FA8 0%, #D24CF0 55%, #8F6BFF 100%);
  /* полукруглые вырезы по краям линии отрыва */
  -webkit-mask: radial-gradient(circle var(--notch) at calc(100% - 78px) 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at calc(100% - 78px) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at calc(100% - 78px) 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at calc(100% - 78px) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  filter: drop-shadow(0 14px 26px rgba(255, 79, 168, calc(.35 + var(--beat) * .35)));
  transition: transform .12s, filter .2s;
}
.ticket:hover { transform: translateY(-2px); }
.ticket:active { transform: scale(.985); }
.tk-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 14px 20px 14px 24px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 10px); }
.tk-main b { font: 800 34px/1 var(--display); letter-spacing: .005em; text-shadow: 0 2px 12px rgba(80, 0, 60, .35); }
.tk-main small { font-weight: 700; font-size: 13px; opacity: .88; }
.tk-stub { flex: none; width: 78px; display: grid; place-items: center; border-left: 2px dashed rgba(255, 255, 255, .55); background: rgba(40, 0, 70, .18); }
.tk-stub svg { width: 34px; height: 34px; fill: #fff; filter: drop-shadow(0 0 calc(4px + var(--beat) * 10px) rgba(255, 255, 255, .8)); transform: scale(calc(1 + var(--beat) * .08)); }

/* --- три плитки разделов --- */
.row3 .btn { height: 76px; border-radius: 16px; background: rgba(18, 8, 36, .8); border: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.row3 .btn svg { width: 26px; height: 26px; color: #fff; filter: drop-shadow(0 0 6px rgba(255, 79, 168, .55)); }
.row3 .btn:hover { border-color: rgba(255, 79, 168, .55); background: rgba(40, 14, 70, .85); }

/* --- карточка батл-пасса: тоже «билет», но золото по краю --- */
.pass-card { border-radius: 16px; background: linear-gradient(120deg, rgba(143, 107, 255, .6), rgba(255, 79, 168, .5)), rgba(18, 8, 36, .85); }

/* --- плеер в углу — тише --- */
.mplayer { background: rgba(18, 8, 36, .72); border-color: rgba(255, 255, 255, .1); }

/* --- магазин: предложения VIP и пасса в ряд --- */
.offer-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.offer-row .offer { padding: 14px; grid-template-columns: 1fr; }
.offer-row .offer .btn { grid-row: auto; grid-column: 1; height: 38px; }
.offer-row .offer h4 { font-size: 17px; }
.vip-offer { border-color: rgba(255, 209, 102, .45); background: radial-gradient(120% 140% at 0% 0%, rgba(255, 209, 102, .28), transparent 60%), rgba(255, 255, 255, .04); }
.vip-offer h4 { color: #FFE3A3; }
.pass-offer { border-color: rgba(143, 107, 255, .5); }
.shop-scroll h3 { font: 800 15px/1.2 var(--display); color: var(--text); }

/* --- модальные окна в стиле панелей --- */
.center-card { background: rgba(18, 8, 36, .94); border: 1px solid rgba(255, 255, 255, .1); position: relative; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .85); }
.center-card::before { content: ''; position: absolute; left: 22px; right: 22px; top: -1px; height: 2px; border-radius: 2px; background: var(--panel-edge); box-shadow: 0 0 14px rgba(255, 79, 168, .5); }

@media (max-aspect-ratio: 20/21) {
  .menu-body { width: 100%; }
  .player-card.pass-badge { padding-top: 20px; }
  .tk-main b { font-size: 28px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .ticket { min-height: 66px; }
  .tk-main b { font-size: 26px; }
  .player-card.pass-badge { padding: 16px 12px 10px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .ticket, .tk-stub svg { transition: none; transform: none; } }
@media (max-aspect-ratio: 20/21) {
  /* на телефоне плеер — строкой под верхней панелью, не поверх пропуска */
  #s-menu .mplayer { position: static; order: 1; width: 100%; max-width: none; margin-top: 8px; opacity: 1; }
  #s-menu .mplayer .mp-info { display: flex; }
  #s-menu .menu-body { order: 2; }
  #s-menu .topbar { order: 0; }
}

/* ==========================================================================
   Режимы 8.0: «Темпо Дуо», «Импульс», «Эхо», «Батл»
   ========================================================================== */
.mode-chip.duo { background: rgba(63, 160, 255, .22); color: #9CCBFF; }
.mode-chip.pulse { background: rgba(255, 95, 176, .22); color: #FFB3DA; }
.mode-chip.echo { background: rgba(255, 200, 87, .2); color: var(--gold); }
.mode-chip.battle { background: rgba(255, 90, 90, .22); color: #FF9E9E; }

body:is([data-mode="duo"], [data-mode="echo"], [data-mode="battle"]) .tempo-ui { display: block; }
body:is([data-mode="duo"], [data-mode="pulse"], [data-mode="echo"], [data-mode="battle"]) .classic-ui { display: none; }
body:not([data-mode="classic"]) .hit { visibility: hidden; }
.hud-top { position: relative; z-index: 3; }
.judge, .combo, .count, .turn-banner { z-index: 4; }

/* Дуо: два круга в середине, ноты летят навстречу */
.duo-zone { display: none; }
body[data-mode="duo"] .duo-zone { display: block; }
body[data-mode="duo"] #hitzone { display: none; }
#hz-l { left: 42%; border-color: rgba(255, 79, 139, .9); box-shadow: 0 0 0 calc(3px + var(--beat) * 5px) rgba(255, 79, 139, .3), 0 0 24px rgba(255, 79, 139, .6); }
#hz-r { left: 58%; border-color: rgba(63, 160, 255, .9); box-shadow: 0 0 0 calc(3px + var(--beat) * 5px) rgba(63, 160, 255, .3), 0 0 24px rgba(63, 160, 255, .6); }
body[data-mode="duo"] .lane { background: linear-gradient(90deg, rgba(255, 79, 139, .12), rgba(20, 10, 38, .8) 32%, rgba(20, 10, 38, .8) 68%, rgba(63, 160, 255, .12)); }
body[data-mode="duo"] .lane-glow { background: linear-gradient(90deg, rgba(255, 79, 139, .8), transparent 40%, transparent 60%, rgba(63, 160, 255, .8)); }

/* Эхо и батл: когда не ваш ход — дорожка приглушена */
body[data-idle="1"] .lane { opacity: .35; filter: saturate(.5); transition: opacity .3s; }
.lane { transition: opacity .3s; }

/* Плашка «чей выход» */
.turn-banner {
  position: absolute; left: 50%; top: calc(86px + var(--safe-t)); transform: translateX(-50%);
  width: max-content; max-width: min(calc(100% - 32px), 560px); padding: 8px 18px; border-radius: 20px; text-align: center; text-wrap: balance;
  font: 700 clamp(13px, 2.2vmin, 17px)/1.25 var(--display); color: #fff; pointer-events: none;
  background: rgba(20, 10, 38, .78); border: 1px solid var(--line-strong);
}
.turn-banner:empty { display: none; }
.turn-banner.mine { background: linear-gradient(90deg, rgba(255, 95, 176, .9), rgba(143, 107, 255, .9)); border-color: transparent; box-shadow: 0 0 26px rgba(255, 95, 176, .5); }
.turn-banner.go { background: rgba(79, 227, 193, .2); border-color: rgba(79, 227, 193, .7); color: var(--mint); }
.turn-banner.show { animation: banner .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes banner { from { transform: translateX(-50%) scale(.85); opacity: 0; } }

/* Эхо: полоса связки — 16 половинок доли */
.echo-ui { display: none; width: 100%; }
body[data-mode="echo"] .echo-ui { display: grid; gap: 4px; justify-items: center; }
.echo-label { font: 600 12px/1 var(--body); color: var(--muted); text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.echo-strip {
  position: relative; width: min(620px, 100%); height: clamp(36px, 6.5vmin, 46px); border-radius: 14px;
  background: rgba(20, 10, 38, .78); border: 1px solid var(--line-strong); overflow: hidden;
}
.echo-cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(16, 1fr); }
.ec { display: grid; place-items: center; border-left: 1px solid rgba(255, 255, 255, .14); }
.ec.half { border-left-color: rgba(255, 255, 255, .05); }
.ec:first-child { border-left: 0; }
.ec.on { background: rgba(255, 200, 87, .08); }
.ec.pop .arrow { animation: ec-pop .3s ease-out; }
@keyframes ec-pop { from { transform: scale(1.6); filter: brightness(2); } }
.arrow.mini { width: clamp(22px, 4.4vmin, 32px); height: clamp(22px, 4.4vmin, 32px); border-radius: 30%; border-width: 1px; background: var(--nc, var(--pink)); border-color: transparent; }
.arrow.mini[data-d="L"] { --nc: #FF4F8B; } .arrow.mini[data-d="R"] { --nc: #3FA0FF; }
.arrow.mini[data-d="U"] { --nc: #2FD3A6; } .arrow.mini[data-d="D"] { --nc: #FFB238; }
.echo-cursor { position: absolute; top: 3px; bottom: 3px; left: 0; width: 4px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px #fff, 0 0 18px var(--gold); }

/* Импульс: круги по всему полю */
.pulse-field { display: none; position: absolute; left: var(--pad); right: var(--pad); top: calc(88px + var(--safe-t)); bottom: calc(64px + var(--safe-b)); z-index: 2; touch-action: none; }
body[data-mode="pulse"] .pulse-field { display: block; pointer-events: auto; }
body[data-mode="pulse"] .tempo-ui, body[data-mode="pulse"] #touch { display: none !important; }
.pulse-paths { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ps-body { fill: none; stroke-linecap: round; opacity: .9; filter: drop-shadow(0 0 10px rgba(0,0,0,.4)); transition: opacity .25s; }
.ps-line { fill: none; stroke: rgba(20, 10, 38, .82); stroke-linecap: round; transition: opacity .25s; }
.ps-body.gone, .ps-line.gone { opacity: 0 !important; }
.pn { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform, opacity; }
.pn-core, .pn-ring { position: absolute; left: calc(var(--r) * -1); top: calc(var(--r) * -1); width: calc(var(--r) * 2); height: calc(var(--r) * 2); border-radius: 50%; box-sizing: border-box; }
.pn-core {
  display: grid; place-items: center; font: 800 calc(var(--r) * .8)/1 var(--display); color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.5), transparent 50%), var(--c);
  border: 3px solid #fff; box-shadow: 0 0 18px -2px var(--c), inset 0 -5px 10px rgba(0,0,0,.25);
  text-shadow: 0 2px 4px rgba(0,0,0,.35);
}
.pn-ring { border: 3px solid var(--c); box-shadow: 0 0 12px var(--c); will-change: transform; }
.pn-end .pn-core { background: rgba(20, 10, 38, .6); border-style: dashed; border-color: var(--c); box-shadow: none; }
.pn.grabbed .pn-core { opacity: .35; }
.pn.hit { animation: pn-hit .3s ease-out forwards; }
.pn.missed { animation: pn-miss .3s ease-out forwards; }
.pn.hit.perfect .pn-core { border-color: var(--gold); }
@keyframes pn-hit { to { opacity: 0; scale: 1.6; filter: brightness(1.8); } }
@keyframes pn-miss { to { opacity: 0; scale: .7; filter: grayscale(1); } }
.pn-ball {
  position: absolute; left: calc(var(--r) * -.62); top: calc(var(--r) * -.62); width: calc(var(--r) * 1.24); height: calc(var(--r) * 1.24);
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 calc(var(--r) * .9) rgba(255, 255, 255, .12); pointer-events: none; z-index: 1001;
  transition: box-shadow .12s;
}
.pn-ball.held { box-shadow: 0 0 0 calc(var(--r) * 1.1) rgba(79, 227, 193, .3), 0 0 24px var(--mint); }

/* Телефон: в «Дуо» — две большие кнопки по краям */
.duo-pad { display: none; }
body.touch-ui[data-mode="duo"] .dpad, body.touch-ui[data-mode="duo"] #hit-btn { display: none; }
body.touch-ui[data-mode="duo"] .duo-pad { display: flex; justify-content: space-between; width: 100%; }
body.touch-ui:not([data-mode="classic"]) #hit-btn { display: none; }
body.touch-ui:not([data-mode="classic"]) .touch { justify-content: center; }
.duo-pad button {
  width: min(40vw, 170px); height: clamp(74px, 18vw, 96px); border-radius: 26px; display: grid; place-items: center; color: #fff;
  background: rgba(20, 10, 38, .7); border: 2px solid rgba(255, 255, 255, .25); touch-action: none;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.duo-pad button svg { width: 34%; height: 34%; }
.duo-pad button[data-dir="L"] { border-color: rgba(255, 79, 139, .8); box-shadow: inset 0 0 24px rgba(255, 79, 139, .3); }
.duo-pad button[data-dir="L"] svg { transform: rotate(180deg); }
.duo-pad button[data-dir="R"] { border-color: rgba(63, 160, 255, .8); box-shadow: inset 0 0 24px rgba(63, 160, 255, .3); }
.duo-pad button.down { transform: scale(.94); filter: brightness(1.4); }

/* Создание комнаты: подсказка про соло */
.solo-note { margin-top: 6px; }
.seg button.lock { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .turn-banner.show, .ec.pop .arrow, .pn.hit, .pn.missed { animation: none; } }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 calc(33% - 4px); min-width: 0; white-space: nowrap; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.tag .jg.mini { font-size: 12px; animation-duration: .6s; }

/* 8.1: выход из танца, штраф, Дуо поменьше */
.hud-top .icon-btn + .icon-btn { margin-left: -4px; }
.ban-note {
  margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.4;
  background: rgba(255, 90, 90, .14); border: 1px solid rgba(255, 120, 120, .5); color: #FFD3D3;
}
.ban-note b { color: #fff; }
body[data-mode="duo"] .note { --ns: clamp(40px, 7.4vmin, 54px); width: var(--ns); height: var(--ns); margin-left: calc(var(--ns) / -2); }
body[data-mode="duo"] .duo-zone { width: clamp(50px, 9vmin, 72px); height: clamp(50px, 9vmin, 72px); }

/* Импульс: слайдер ведётся вручную — пройденная часть светится */
.ps-done { fill: none; stroke-linecap: round; opacity: .95; filter: drop-shadow(0 0 8px rgba(255,255,255,.5)); transition: opacity .25s; }
.ps-done.gone { opacity: 0 !important; }
.pn.slider .pn-core { box-shadow: 0 0 0 4px rgba(255,255,255,.25), 0 0 22px -2px var(--c); }
.pn.slider:not(.grabbed) .pn-core { animation: grab-me 1s ease-in-out infinite; }
@keyframes grab-me { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .pn.slider:not(.grabbed) .pn-core { animation: none; } }

.st-add { color: var(--mint); font-weight: 800; }

/* вещь с элементами (воротник, перчатки к платью) */
.item .kit { position: absolute; left: 6px; bottom: 6px; font: 800 10px/1 var(--display); padding: 3px 5px; border-radius: 6px; background: rgba(79, 227, 193, .25); color: var(--mint); }

/* ---------- Батл-пасс (окно игрока) ----------
   Уровни — колонки; в каждой: номер на линии прогресса, бесплатная и премиум-карточка.
   Под карточкой — место под «Забрать»: кнопка видна, только когда награду можно забрать. */
.center-card:has(.bp) { width: min(940px, 96vw); max-width: 96vw; max-height: 94vh; overflow-y: auto; padding: 16px; }
.bp { display: flex; flex-direction: column; gap: 12px; text-align: left; width: 100%; }
.bp-head { position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 20px; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, #FF5FB0 0%, rgba(255, 95, 176, 0) 55%), linear-gradient(120deg, #6B4BE0, #B04BC8 60%, #FF5FB0); }
.bp-head::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .06) 0 2px, transparent 2px 14px); pointer-events: none; }
.bp-title { flex: 1; min-width: 0; position: relative; z-index: 1; }
.bp-title > small { font: 800 11px/1 var(--display); text-transform: uppercase; letter-spacing: .12em; opacity: .85; }
.bp-title h2 { margin: 4px 0 10px; font: 800 24px/1.1 var(--display); }
.bp-xp { display: flex; align-items: center; gap: 12px; }
.bp-bar { flex: 1; height: 10px; border-radius: 99px; background: rgba(20, 8, 40, .45); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3); }
.bp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FFE08A, #FFC857); box-shadow: 0 0 12px rgba(255, 200, 87, .7); }
.bp-xpt { font-size: 13px; white-space: nowrap; opacity: .92; }
.bp-xpt b { font-weight: 800; }
.bp-title > small.bp-how { display: block; margin-top: 7px; font: 600 11px/1.3 var(--body); text-transform: none; letter-spacing: 0; opacity: .78; }
.bp-lv { position: relative; z-index: 1; flex: none; width: 92px; height: 92px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(20, 8, 40, .4); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .25); }
.bp-lv span { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.bp-lv b { font: 800 34px/1 var(--display); }
.bp-lv small { font-size: 11px; opacity: .8; }

.bp-prem { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-radius: 16px; font-size: 13px;
  background: linear-gradient(90deg, rgba(255, 224, 138, .16), rgba(255, 159, 61, .1)); border: 1px solid rgba(255, 200, 87, .4); }
.bp-prem > span:not(.bp-crown) { flex: 1; color: var(--muted); }
.bp-prem b { color: #FFE3A3; }
.bp-prem.on > span:not(.bp-crown) { color: #FFE3A3; }
.bp-crown { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: #3A2400; background: linear-gradient(135deg, #FFE08A, #FFB83D); }

.bp-board { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 6px; }
.bp-side { display: grid; grid-template-rows: 40px 1fr 1fr; gap: 8px; padding-bottom: 8px; }
.bp-s { display: flex; align-items: center; padding: 0 0 34px 2px; font: 800 11px/1.25 var(--display); color: var(--muted); }
.bp-s.paid { color: var(--gold); }
.bp-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.bp-cols { display: flex; }
.bp-col { flex: none; width: 118px; padding: 0 5px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 40px 1fr 1fr; gap: 8px; }

/* номер уровня на линии прогресса */
.bp-num { position: relative; display: grid; place-items: center; }
.bp-num::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: rgba(255, 255, 255, .1); }
.bp-col:first-child .bp-num::before { left: 50%; }
.bp-col:last-child .bp-num::before { right: 50%; }
.bp-col.open .bp-num::before { background: linear-gradient(90deg, var(--mint), #9BFFE6); }
.bp-num b { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 800 13px/1 var(--display);
  background: #2A1A47; color: var(--muted); box-shadow: 0 0 0 2px rgba(255, 255, 255, .14); }
.bp-col.open .bp-num b { background: var(--mint); color: #0D2B23; box-shadow: 0 0 0 3px rgba(79, 227, 193, .25); }
.bp-col.next .bp-num b { background: #fff; color: #24113F; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25), 0 0 16px rgba(255, 255, 255, .5); }
.bp-np { position: absolute; left: 50%; right: 0; top: 50%; height: 4px; margin-top: -2px; background: linear-gradient(90deg, var(--mint) var(--p), transparent var(--p)); }
.bp-col.next .bp-num::before { background: linear-gradient(90deg, var(--mint) 50%, rgba(255, 255, 255, .1) 50%); }

/* ячейка: карточка + место под кнопку */
.bp-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bp-card { position: relative; height: 112px; border-radius: 16px; padding: 10px 8px 9px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.bp-slot.paid .bp-card { background: linear-gradient(180deg, rgba(255, 200, 87, .14), rgba(255, 159, 61, .05)); border-color: rgba(255, 200, 87, .3); }
.bp-vis { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; overflow: hidden; }
.bp-name { width: 100%; text-align: center; font-size: 12px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; line-height: 1; }
.bp-ico.coins { color: #3A2400; background: radial-gradient(circle at 35% 30%, #FFF1BF, #FFC857 60%, #E89B2E); box-shadow: 0 4px 14px -4px rgba(255, 200, 87, .8); }
.bp-ico.vip { color: #3A2400; background: linear-gradient(135deg, #FFE08A, #FF9F3D); }
.bp-ico.song { color: #fff; background: linear-gradient(135deg, var(--violet), var(--pink)); }
.bp-ico.none { color: var(--faint); font-size: 20px; }
.bp-item { width: 62px; height: 62px; display: grid; place-items: center; }
.bp-item img, .bp-item svg { width: 62px; height: 62px; object-fit: contain; }
.bp-item .glyph { font-size: 34px; }
.bp-pfx { max-width: 100%; display: grid; place-items: center; }
.bp-pfx .pfx { max-width: 100%; font-size: 10px; white-space: normal; text-align: center; line-height: 1.35; padding: 2px 6px; }
.bp-badge { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 900; }
.bp-badge.ok { background: var(--mint); color: #0D2B23; }
.bp-badge.lock { background: #2A1A47; box-shadow: 0 0 0 2px rgba(255, 200, 87, .5); font-size: 11px; }
.bp-card.empty { background: transparent; border-style: dashed; }
.bp-card.empty .bp-name { color: var(--faint); font-weight: 600; }
.bp-card.wait { opacity: .72; }
.bp-card.locked .bp-vis, .bp-card.locked .bp-name { opacity: .55; filter: saturate(.5); }
.bp-card.got .bp-vis, .bp-card.got .bp-name { opacity: .5; }
.bp-card.ready { border-color: rgba(255, 200, 87, .9); box-shadow: 0 0 0 1px rgba(255, 200, 87, .5), 0 8px 24px -8px rgba(255, 200, 87, .8); transform: translateY(-2px); }
.bp-claim { height: 28px; border: 0; border-radius: 99px; font: 800 12px/1 var(--display); color: #3A2400; cursor: pointer;
  background: linear-gradient(90deg, #FFE08A, #FFB83D); box-shadow: 0 4px 14px -4px rgba(255, 184, 61, .9); }
.bp-claim:hover { filter: brightness(1.08); }
.bp-claim:disabled { visibility: hidden; }
@media (max-width: 560px) {
  .bp-head { padding: 12px; gap: 10px; }
  .bp-title h2 { font-size: 19px; }
  .bp-lv { width: 70px; height: 70px; }
  .bp-lv b { font-size: 26px; }
  .bp-xpt { font-size: 11px; }
  .bp-board { grid-template-columns: 20px minmax(0, 1fr); }
  .bp-s { writing-mode: vertical-rl; transform: rotate(180deg); padding: 0 0 0 34px; justify-content: center; font-size: 10px; }
  .bp-col { width: 104px; padding: 0 4px; }
  .bp-card { height: 104px; }
  .bp-prem { flex-wrap: wrap; }
}
.bp .row2 > .btn:only-child { grid-column: 1 / -1; flex: 1; width: 100%; }
/* вещь «только за рубли»: цена в ₽ на карточке гардероба */
.price.rub { background: linear-gradient(90deg, #4FE3C1, #3EC4E6); color: #062A24; padding: 2px 7px; font-size: 11px; }
#w-grid .item { aspect-ratio: auto; min-height: 0; overflow: hidden; }
/* карточка гардероба ниже обычной: картинка ужимается, название (до 2 строк) помещается целиком */
#w-grid .item { justify-content: flex-start; gap: 4px; padding-top: 24px; padding-bottom: 8px; }
#w-grid .item > :is(.ic-img, .ic, .glyph, .swatch, .portrait, .look-ic) { flex: 1 1 0; min-height: 0; width: auto; height: auto; max-height: 76px; max-width: 100%; aspect-ratio: 1; object-fit: contain; }
#w-grid .item > .glyph { display: grid; place-items: center; line-height: 1; }
#w-grid .item > .swatch { max-height: 48px; }
#w-grid .item .nm { flex: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* подразделы (Голова … Спина) помещаются в панель */
.subtabs { flex-wrap: wrap; }
.subtabs .chip { padding: 0 11px; }
/* лобби комнаты: кнопка гардероба в шапке, плеер в правом нижнем углу */
.topbar .room-wr { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; }
.topbar .room-wr svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 520px) { .topbar .room-wr span { display: none; } .topbar .room-wr { padding: 0 11px; } }
/* плеер в лобби: на широком экране — в углу, на телефоне — строкой над эмоциями */
@media (max-aspect-ratio: 20/21) {
  .mplayer.in-room { position: static; order: -1; width: 100%; max-width: 380px; top: auto; opacity: 1; }
  .mplayer.in-room .mp-info { display: flex; }
}

/* меню: «Танцпол» и «Свободная игра» под кнопкой «Играть» */
.menu-mid .btn { height: 50px; border-radius: 16px; gap: 8px; font-size: 14px; white-space: nowrap; padding: 0 8px; background: rgba(18, 8, 36, .8); border: 1px solid rgba(255, 255, 255, .1); }
.menu-mid .btn svg { width: 20px; height: 20px; fill: currentColor; color: #fff; filter: drop-shadow(0 0 6px rgba(79, 227, 193, .55)); }
.menu-mid .btn:hover { border-color: rgba(79, 227, 193, .55); background: rgba(14, 30, 50, .85); }
@media (max-width: 440px) { .menu-mid .btn { height: 44px; font-size: 13px; } }

/* выбор танцпола */
.v-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.v-card { position: relative; display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center; padding: 8px; border-radius: 18px; text-align: left;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.v-card:hover { background: rgba(255, 255, 255, .07); }
.v-card[aria-pressed="true"] { border-color: var(--cyan, #3EE6E0); background: rgba(62, 230, 224, .08); box-shadow: 0 0 0 1px var(--cyan, #3EE6E0), 0 0 22px -8px var(--cyan, #3EE6E0); }
.v-card img { width: 132px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: #1a1030; display: block; }
.v-card b { display: block; font: 800 16px/1.2 var(--display); }
.v-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 4px; }
.v-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.v-tag.own { background: rgba(79, 227, 193, .16); color: var(--mint); }
.v-tag.on { background: var(--mint); color: #0D2B23; }
.v-tag.price { background: rgba(255, 200, 87, .14); color: var(--gold); }
@media (max-width: 440px) { .v-card { grid-template-columns: 104px 1fr; } .v-card img { width: 104px; } }
.soon { text-align: center; }
.soon-ic { font-size: 54px; line-height: 1; margin: 4px 0 6px; filter: drop-shadow(0 0 16px rgba(79, 227, 193, .6)); }
.soon h2 { margin: 6px 0; }

/* ---------- Свободная игра: список ---------- */
.w-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.chip { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chip[aria-pressed="true"] { background: rgba(255,95,176,.18); border-color: var(--pink); color: var(--text); }
.w-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.w-card { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 16px; text-align: left;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: background .15s, transform .15s; }
.w-card:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.w-card.off { opacity: .55; }
.w-card img { width: 112px; height: 70px; object-fit: cover; border-radius: 11px; background: #1d1230; }
.w-c-body { display: grid; gap: 3px; min-width: 0; }
.w-c-body b { font: 700 15px/1.2 var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-c-body small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-c-body .lock { font-style: normal; margin-right: 4px; }
.w-c-tags { display: flex; gap: 6px; }
.tg { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(79,227,193,.12); color: var(--mint); }
.tg.warn { background: rgba(255,95,95,.14); color: #ff9a9a; }
.w-c-count { font: 600 13px/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.w-c-count b { color: var(--text); font-size: 18px; }
.w-c-count.full b { color: #ff9a9a; }
.w-empty { margin: auto; display: grid; gap: 8px; justify-items: center; text-align: center; padding: 30px 10px; }
.w-empty span { color: var(--muted); }
.w-form { display: grid; gap: 12px; }
.w-form .fld { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.w-form .fld b { color: var(--text); }
.w-form input[type=text], .w-form input:not([type]), .w-form input[type=number] { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(0,0,0,.25); color: var(--text); width: 100%; user-select: text; }
.w-form input[type=range] { width: 100%; accent-color: var(--pink); }
.w-form .two { grid-template-columns: 1fr 1fr; gap: 10px; }
.w-form .two label { display: grid; gap: 6px; }
.w-form .chk { display: flex; align-items: center; gap: 8px; color: var(--text); }
.w-locs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.w-loc { position: relative; display: grid; gap: 4px; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; }
.w-loc input { position: absolute; opacity: 0; pointer-events: none; }
.w-loc img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; background: #1d1230; }
.w-loc b { color: var(--text); font-size: 13px; }
.w-loc small { font-size: 11px; line-height: 1.25; }
.w-loc:has(input:checked) { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink), 0 0 18px -6px var(--pink); background: rgba(255,95,176,.1); }

/* ---------- Открытый мир: HUD ---------- */
#s-world { padding: 0; }
#wtags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.w-tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; white-space: nowrap; transform-origin: 50% 100%; will-change: transform; }
.w-tag .lv { font: 700 10px/1 var(--display); padding: 3px 5px; border-radius: 6px; background: #2fbf8f; color: #06281c; }
.w-tag .nm { font: 700 13px/1 var(--body); padding: 4px 8px; border-radius: 8px; background: rgba(20,10,36,.62); border: 1px solid rgba(255,255,255,.14); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.w-tag .nm.vip { color: var(--gold); }
.w-tag.me .nm { background: rgba(255,95,176,.75); border-color: transparent; }
.w-tag.owner .nm::after { content: ' 👑'; }
.w-bubble { position: absolute; left: 0; top: 0; max-width: 240px; padding: 7px 11px; border-radius: 14px 14px 14px 4px; background: rgba(255,255,255,.94); color: #241433;
  font: 600 13px/1.3 var(--body); white-space: normal; word-break: break-word; box-shadow: 0 6px 18px rgba(0,0,0,.35); transform-origin: 50% 100%; transition: opacity .5s; }
.w-bubble.out { opacity: 0; }
.w-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 10px; pointer-events: none;
  background: linear-gradient(rgba(10,4,20,.55), rgba(10,4,20,0)); }
.w-top > * { pointer-events: auto; }
.w-title { display: grid; min-width: 0; margin-right: auto; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.w-title b { font: 700 16px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.w-title span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-chip { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; max-width: 30vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-chip .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.w-chip .eq i { width: 3px; background: var(--mint); border-radius: 2px; animation: eqb .9s ease-in-out infinite; }
.w-chip .eq i:nth-child(2) { animation-delay: -.3s; } .w-chip .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eqb { 0%, 100% { height: 3px; } 50% { height: 12px; } }
#s-world .icon-btn { font-size: 18px; }
.w-chat { position: absolute; left: 12px; bottom: calc(12px + var(--safe-b)); width: min(380px, 44vw); display: grid; gap: 6px; pointer-events: none; }
.w-log { max-height: 30vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; pointer-events: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent, #000 18%); mask-image: linear-gradient(transparent, #000 18%); }
.w-log::-webkit-scrollbar { display: none; }
.w-msg { font-size: 13px; line-height: 1.35; padding: 3px 9px; border-radius: 10px; background: rgba(14,6,26,.5); text-shadow: 0 1px 2px rgba(0,0,0,.6); width: fit-content; max-width: 100%; word-break: break-word; transition: opacity .6s; user-select: text; }
.w-msg .who { font-weight: 800; color: var(--pink); }
.w-msg.mine .who { color: var(--mint); }
.w-msg.sys { color: var(--muted); font-style: italic; font-size: 12px; background: none; }
.w-msg.old { opacity: .35; }
#w-form { pointer-events: auto; }
#w-input { width: 100%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(14,6,26,.6); color: var(--text); user-select: text; }
#w-input:focus { outline: none; border-color: var(--pink); background: rgba(14,6,26,.85); }
.w-acts { position: absolute; right: 12px; bottom: calc(12px + var(--safe-b)); display: flex; gap: 8px; }
.w-act { display: grid; justify-items: center; gap: 2px; min-width: 64px; padding: 8px 10px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); font-size: 12px; backdrop-filter: blur(6px); }
.w-act i { font-style: normal; font-size: 22px; line-height: 1; }
.w-act.act, .w-act.on { border-color: var(--pink); background: rgba(255,95,176,.22); }
.w-panel { position: absolute; right: 12px; bottom: calc(86px + var(--safe-b)); width: min(360px, 92vw); max-height: 58vh; overflow-y: auto; padding: 12px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--line); pointer-events: auto; animation: screen-in .2s; }
.w-p-h { font: 700 15px/1.2 var(--display); margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.w-p-h small { font: 500 12px var(--body); color: var(--muted); }
.w-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.w-dn { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 12px; }
.w-dn i { font-style: normal; font-size: 26px; line-height: 1; }
.w-dn:hover { background: rgba(255,255,255,.1); }
.w-dn.on { border-color: var(--mint); background: rgba(79,227,193,.15); }
.w-people { display: grid; gap: 4px; }
.w-people .who { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; text-align: left; }
.w-people .who:hover { background: rgba(255,255,255,.07); }
.w-help { position: absolute; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); max-width: min(720px, 92vw); display: grid; gap: 4px; text-align: center; padding: 10px 16px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--line); font-size: 13px; pointer-events: auto; animation: screen-in .3s; }
.w-help kbd { display: inline-block; min-width: 22px; padding: 1px 6px; margin: 0 1px; border-radius: 6px; background: rgba(255,255,255,.12); border: 1px solid var(--line-strong); font: 700 11px/18px var(--body); }
.w-touch { display: none; }
@media (pointer: coarse) {
  .w-touch { display: block; }
  .w-joy { position: absolute; left: 22px; bottom: calc(28px + var(--safe-b)); width: 128px; height: 128px; border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.18); pointer-events: auto; touch-action: none; }
  .w-joy i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: rgba(255,255,255,.35); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
  .w-tbtns { position: absolute; right: 16px; bottom: calc(96px + var(--safe-b)); display: flex; gap: 10px; align-items: flex-end; }
  .w-act.round { min-width: 0; width: 56px; height: 56px; border-radius: 50%; font-size: 22px; place-content: center; pointer-events: auto; }
  .w-act.round.big { width: 72px; height: 72px; font-size: 28px; }
  .w-chat { bottom: calc(172px + var(--safe-b)); width: min(300px, 60vw); }
  .w-chat .w-log { max-height: 20vh; }
  .w-acts { bottom: calc(18px + var(--safe-b)); }
  .w-panel { bottom: calc(180px + var(--safe-b)); }
}
@media (max-width: 640px) {
  .w-chip { max-width: 34vw; }
  .w-title b { max-width: 30vw; }
  .w-card { grid-template-columns: 84px 1fr auto; }
  .w-card img { width: 84px; height: 56px; }
  .w-locs { grid-template-columns: 1fr; }
  .w-loc { grid-template-columns: 96px 1fr; align-items: center; }
  .w-loc img { grid-row: span 2; }
}
@media (pointer: coarse) {
  .w-panel { bottom: calc(76px + var(--safe-b)); max-height: calc(100% - 150px); z-index: 5; }
}
@media (max-height: 520px) {
  .w-panel { width: min(560px, 72vw); }
  .w-grid { grid-template-columns: repeat(5, 1fr); }
  .w-grid.six { grid-template-columns: repeat(6, 1fr); }
  .w-dn { padding: 6px 2px; }
  .w-dn i { font-size: 20px; }
  .w-help { top: calc(56px + var(--safe-t)); font-size: 12px; padding: 8px 12px; }
}

/* ---------- Экран загрузки поверх игры ---------- */
.busy { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: auto; opacity: 0; transition: opacity .22s ease;
  background: radial-gradient(120% 90% at 50% 110%, rgba(58, 20, 96, .96) 0%, rgba(20, 10, 38, .97) 60%); }
.busy.on { opacity: 1; }
.busy-in { display: grid; justify-items: center; gap: 18px; text-align: center; }
.busy .logo { font-size: clamp(30px, 7vmin, 52px); }
.busy p { margin: 0; color: var(--muted); font-weight: 600; }
.busy-eq { display: flex; gap: 5px; align-items: flex-end; height: 34px; }
.busy-eq i { width: 7px; height: 34px; border-radius: 4px; background: linear-gradient(var(--pink), var(--violet)); transform-origin: 50% 100%; animation: busyeq 1s ease-in-out infinite; will-change: transform; }
.busy-eq i:nth-child(2) { animation-delay: -.2s; } .busy-eq i:nth-child(3) { animation-delay: -.4s; } .busy-eq i:nth-child(4) { animation-delay: -.6s; } .busy-eq i:nth-child(5) { animation-delay: -.8s; }
/* transform — анимация идёт и тогда, когда сборка сцены занимает главный поток */
@keyframes busyeq { 0%, 100% { transform: scaleY(.24); } 50% { transform: scaleY(1); } }
.w-locs { max-height: 46vh; overflow-y: auto; }
.w-dcat { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 6px 2px 6px; }

/* ---------- вход на сайт (почта и пароль) и сообщения площадок: authgate.js ---------- */
.auth-gate { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(120% 90% at 50% 0%, rgba(143, 107, 255, .28), transparent 60%), rgba(12, 6, 26, .9); backdrop-filter: blur(6px); }
.ag-card { width: min(380px, 100%); display: grid; gap: 14px; padding: 26px 24px 22px; border-radius: 24px; background: #22123F; border: 1px solid var(--line-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45); text-align: center; }
.ag-card { grid-template-columns: minmax(0, 1fr); margin: auto 0; flex: none; }
.ag-card > * { min-width: 0; }
.ag-card .logo { font-size: 30px; justify-self: center; }
.ag-card h3 { margin: 0; font: 800 19px var(--display); }
.ag-tabs { margin: 2px 0 4px; }
.ag-note { margin: 0; color: var(--muted); font-size: 14px; }
.ag-f, .ag-cap { display: grid; gap: 6px; text-align: left; }
.ag-f span, .ag-cap > span { font-size: 13px; font-weight: 800; color: var(--muted); }
.ag-f input, .ag-cap input { width: 100%; min-width: 0; height: 48px; border-radius: 14px; padding: 0 14px; background: rgba(0, 0, 0, .3); border: 1.5px solid var(--line-strong);
  font: 600 16px var(--body); color: var(--text); user-select: text; -webkit-user-select: text; outline: none; transition: border-color .15s; }
.ag-f input:focus, .ag-cap input:focus { border-color: var(--violet); }
.ag-f.bad input, .ag-cap.bad input { border-color: var(--pink); }
.ag-cap input { letter-spacing: .3em; text-transform: uppercase; font-weight: 800; text-align: center; }
.ag-cap-row { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.ag-cap-img { flex: 1 1 0; min-width: 0; height: 76px; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .3); }
.ag-cap-img svg { display: block; width: auto; height: 72px; max-width: 100%; }
.ag-cap-img small { color: var(--faint); }
.ag-cap-row .btn { flex: none; width: 48px; height: auto; padding: 0; font-size: 20px; }
.ag-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ag-err { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 95, 176, .14); color: #FFC2DF; font-size: 14px; font-weight: 700; }
.ag-go { height: 52px; font-size: 17px; }
.ag-hint { margin: 0; color: var(--muted); font-size: 14px; }
.ag-hint a { color: var(--mint); font-weight: 800; }
.ag-hint.small { font-size: 12px; color: var(--faint); }

/* ============ Телефон горизонтально (body.phone: касание, ландшафт, высота до 560 px) ============ */
/* --- главное меню: компактно, без логотипа; батл-пасс — в верхней строке слева от нот --- */
body.phone .screen { padding-left: calc(var(--pad) + env(safe-area-inset-left, 0px)); padding-right: calc(var(--pad) + env(safe-area-inset-right, 0px)); }
body.phone #s-menu .brand { display: none; }
body.phone #s-menu .topbar { position: absolute; top: calc(8px + var(--safe-t)); right: calc(var(--pad) + env(safe-area-inset-right, 0px)); left: auto; min-height: 0; z-index: 2; }
body.phone .top-actions { gap: 6px; }
body.phone .icon-btn { width: 38px; height: 38px; }
body.phone .icon-btn svg { width: 19px; height: 19px; }
body.phone .pill { height: 38px; }
body.phone #s-menu .menu-body { width: min(320px, 42vw); padding-top: 0; margin-top: -2px; justify-content: flex-start; gap: 8px; }
body.phone .menu-actions { gap: 7px; }
body.phone .player-card.pass-badge { padding: 9px 10px 9px; gap: 4px; border-radius: 16px; }
body.phone .player-card.pass-badge::after { display: none; }
body.phone .pb-top { gap: 9px; }
body.phone .level-ring { width: 34px; height: 34px; }
body.phone .level-ring span { font-size: 14px; }
body.phone .nick { font-size: 14px; }
body.phone .stats-line { font-size: 11px; gap: 8px; margin-top: 0; }
body.phone .player-card .xp { width: 100%; height: 4px; margin: 2px 0 0; }
body.phone .pb-foot { display: none; }
body.phone .profile-row { margin-top: 4px; gap: 6px; }
body.phone .profile-row .btn { height: 28px; padding: 0 8px; font-size: 11.5px; gap: 4px; flex: 1; min-width: 0; }
body.phone .ticket { min-height: 52px; border-radius: 16px; }
body.phone .tk-main { padding: 7px 14px 7px 16px; gap: 2px; }
body.phone .tk-main b { font-size: 22px; }
body.phone .tk-main small { font-size: 11px; }
body.phone .tk-stub { width: 52px; }
body.phone .tk-stub svg { width: 24px; height: 24px; }
body.phone .menu-mid .btn { height: 38px; font-size: 13px; border-radius: 14px; }
body.phone .menu-mid .btn svg { width: 17px; height: 17px; }
body.phone .row2 { gap: 7px; }
body.phone .row3 { gap: 7px; }
body.phone .row3 .btn { height: 46px; flex-direction: row; gap: 6px; font-size: 12px; border-radius: 14px; }
body.phone .row3 .btn svg { width: 17px; height: 17px; }
body.phone .mplayer { width: 230px; padding: 4px; border-radius: 14px; }
body.phone .mplayer .mp-eq { width: 28px; height: 28px; padding: 7px 6px; }
/* батл-пасс строкой в верхней панели */
body.phone .top-actions .pass-card { position: relative; right: auto; top: auto; width: auto; max-width: 190px; height: 38px; padding: 3px 10px 3px 3px; gap: 7px; border-radius: 999px; }
body.phone .top-actions .pass-card .pc-lv { width: 32px; height: 32px; border-radius: 50%; }
body.phone .top-actions .pass-card .pc-lv b { font-size: 14px; }
body.phone .top-actions .pass-card .pc-lv small { display: none; }
body.phone .top-actions .pass-card .pc-t { min-width: 0; gap: 2px; }
body.phone .top-actions .pass-card .pc-t small { display: none; }
body.phone .top-actions .pass-card .pc-t b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.phone .top-actions .pass-card .pc-bar { height: 3px; }
body.phone .top-actions .pass-card .pc-dot { top: -4px; right: -4px; }

/* --- свободная игра: «Танцы» и «Эмоции» — в верхней строке, музыка — значком; бег и прыжок — ниже --- */
body.phone .w-top { gap: 6px; padding: calc(8px + var(--safe-t)) 10px 8px; }
body.phone .w-top .icon-btn { width: 36px; height: 36px; }
body.phone .w-title b { font-size: 14px; max-width: 26vw; }
body.phone .w-title span { font-size: 11px; max-width: 26vw; }
body.phone .w-chip { height: 36px; padding: 0 11px; font-size: 12px; }
body.phone #w-music { font-size: 0; gap: 0; width: 36px; padding: 0; justify-content: center; }
body.phone #w-music > span:not(.eq) { font-size: 16px; }
body.phone .w-top .w-acts { position: static; display: flex; gap: 6px; }
body.phone .w-top .w-act { display: flex; flex-direction: row; align-items: center; gap: 5px; min-width: 0; height: 36px; padding: 0 11px 0 9px; border-radius: 999px; font-size: 12px; }
body.phone .w-top .w-act i { font-size: 16px; }
body.phone .w-panel { top: calc(54px + var(--safe-t)); bottom: auto; right: 10px; max-height: calc(100% - 70px - var(--safe-t) - var(--safe-b)); }
body.phone .w-tbtns { bottom: calc(18px + var(--safe-b)); right: 16px; }
body.phone .w-joy { bottom: calc(18px + var(--safe-b)); }
body.phone .w-chat { bottom: calc(158px + var(--safe-b)); }

/* --- танец: «Бит» прямоугольный ближе к центру, стрелки крупнее; в Темпо стрелки справа, как в классике;
       в Дуо две кнопки ближе к центру --- */
body.phone.touch-ui .touch { align-items: flex-end; }
body.phone.touch-ui .hit { width: clamp(150px, 24vw, 230px); height: 74px; border-radius: 22px; margin-left: 8vw; font-size: 22px;
  background: linear-gradient(160deg, #FFE3A3, var(--gold) 50%, #FF9E57); }
body.phone.touch-ui .hit.down { transform: scale(.96); }
body.phone.touch-ui .dpad { gap: 8px; }
body.phone.touch-ui .dpad button { width: 70px; height: 70px; border-radius: 22px; }
@media (max-height: 370px) { body.phone.touch-ui .dpad button { width: 62px; height: 62px; } body.phone.touch-ui .hit { height: 66px; } }
body.phone.touch-ui:not([data-mode="classic"]):not([data-mode="duo"]) .touch { justify-content: flex-end; }
body.phone.touch-ui[data-mode="duo"] .duo-pad { justify-content: space-between; padding: 0 9vw; }
body.phone.touch-ui[data-mode="duo"] .duo-pad button { width: min(26vw, 190px); height: 80px; }
@media (max-height: 560px) {
  .auth-gate { padding: 8px; }
  .ag-card { gap: 8px; padding: 12px 18px 12px; border-radius: 18px; width: min(420px, 100%); }
  .ag-card .logo { display: none; }
  .ag-f input, .ag-cap input { height: 40px; border-radius: 12px; }
  .ag-cap-img { height: 58px; }
  .ag-cap-img svg { height: 54px; }
  .ag-go { height: 44px; font-size: 15px; }
  .ag-hint.small { display: none; }
}
