:root {
  --bg: #17132a;
  --panel: #2b2648;
  --panel2: #37305c;
  --panel3: #221d3a;
  --line: #0f0c1d;
  --text: #f3eeff;
  --muted: #a59bc7;
  --red: #f96d62;
  --yellow: #ffb62e;
  --blue: #3aa0f2;
  --green: #6abf23;
  --ink: #1b1730;
  --track: #221d3a;
  --knob: #2b2648;
  --free: #262141;
  --free-t: #5b5380;
  --free-b: #1b1730;
  --dim: #4a4370;
  --pfbody: #37355f;
  --sub: #b9aef0;
  --back: rgba(12, 9, 24, .72);
  --head: 'Lilita One', 'DT Rubik Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --body: 'Baloo 2', 'DT Nunito', 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: clamp(9px, min(1.04vw, 1.85vh), 26px); height: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: var(--body); font-weight: 700; font-size: 1.15rem; -webkit-font-smoothing: antialiased;
  user-select: none;
}
#bg {
  position: fixed; inset: -42rem 0 0 -42rem; z-index: 0; pointer-events: none;
  background: url(/img/bg-pattern.svg) 0 0 / 42rem 42rem; animation: drift 90s linear infinite;
}
@keyframes drift { to { transform: translate(42rem, 42rem); } }
#app { position: fixed; inset: 0; z-index: 1; display: flex; }
.screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; position: relative; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: scale(.985); } }
h1, h2, h3 { font-family: var(--head); font-weight: 900; margin: 0; text-transform: uppercase; letter-spacing: .02em; }
h1 { font-size: 5rem; line-height: 1; text-shadow: 0 .35rem 0 var(--line); }
.muted { color: var(--muted); }
.hide { display: none !important; }
img { -webkit-user-drag: none; }

/* ---------- кнопки ---------- */
.btn {
  --c: var(--panel2); --t: var(--text);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--head); font-weight: 900; font-size: 1.35rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--t); background: var(--c); border: .25rem solid var(--line); border-radius: 99rem;
  padding: .75rem 1.9rem; cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: 0 .4rem 0 var(--line), inset 0 -.3rem 0 rgba(0, 0, 0, .16); transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn::before {
  content: ''; position: absolute; left: .75rem; top: .4rem; width: .9rem; height: .7rem;
  border: .2rem solid rgba(255, 255, 255, .42); border-right: 0; border-bottom: 0; border-radius: 1rem 0 0 0; pointer-events: none;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-.08rem); }
.btn:active { transform: translateY(.25rem); box-shadow: 0 .15rem 0 var(--line), inset 0 -.15rem 0 rgba(0, 0, 0, .16); }
.btn:disabled, .btn.disabled { opacity: .5; filter: saturate(.55); cursor: default; pointer-events: none; }
.btn.red { --c: var(--red); --t: var(--ink); }
.btn.yellow { --c: var(--yellow); --t: var(--ink); }
.btn.blue { --c: var(--blue); --t: var(--ink); }
.btn.green { --c: var(--green); --t: var(--ink); }
.btn.discord { --c: #5865f2; --t: #fff; }
.btn.big { font-size: 2.6rem; padding: 1.3rem 3.4rem; min-width: 28rem; }
.btn.mid { font-size: 1.7rem; padding: 1rem 2.4rem; }
.btn.small { font-size: 1.05rem; padding: .5rem 1.2rem; }
.btn.wide { width: 100%; }
.btn svg { width: 1.4em; height: 1.4em; flex: none; }
.btn.big .playico { width: 1.25em; height: 1.25em; color: #fff; filter: drop-shadow(0 .22rem 0 #b33a36); margin-right: .2rem; }
.menu-grid .btn:nth-child(1) { transform: rotate(-1.5deg); }
.menu-grid .btn:nth-child(2) { transform: rotate(1.5deg); }
.menu-grid .btn:nth-child(3) { transform: rotate(1.3deg); }
.menu-grid .btn:nth-child(4) { transform: rotate(-1.4deg); }
.menu-grid .btn:hover { filter: brightness(1.08); }
.iconbtn { padding: .7rem 1.4rem; }
.iconbtn svg { width: 1.9rem; height: 1.9rem; }

.panel { background: var(--panel); border: .25rem solid var(--line); border-radius: 1.4rem; box-shadow: 0 .5rem 0 var(--line); }
input[type=text], select {
  font: inherit; color: var(--text); background: var(--panel3); border: .22rem solid var(--line); border-radius: .8rem;
  padding: .75rem 1rem; outline: none; min-width: 0; user-select: text;
}
input[type=text]:focus, select:focus { border-color: var(--blue); }
input::placeholder { color: #7f76a3; }
select { cursor: pointer; }
select:disabled { opacity: .75; cursor: default; }
label.lbl { font-family: var(--head); font-weight: 900; text-transform: uppercase; color: var(--muted); font-size: 1.15rem; letter-spacing: .03em; }

/* ---------- логотип ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; font-family: 'Lilita One', var(--head); line-height: .8; filter: drop-shadow(0 .45rem 0 var(--line)); }
.logo .top { display: flex; align-items: center; gap: 1.1rem; }
.logo .dub, .logo .tog { color: var(--ink); -webkit-text-stroke: 1.5rem #fff; paint-order: stroke fill; letter-spacing: .02em; }
.logo .dub { font-size: 13rem; }
.logo .tog { font-size: 8.2rem; margin-top: -.6rem; }
.logo .bars { display: flex; align-items: center; gap: .55rem; }
.logo .bars i { display: block; width: 1.05rem; border-radius: 1rem; background: var(--red); animation: bar 1.1s ease-in-out infinite alternate; }
.logo .bars i:nth-child(1) { height: 3.6rem; }
.logo .bars i:nth-child(2) { height: 6.4rem; animation-delay: -.4s; }
.logo .bars i:nth-child(3) { height: 3.9rem; animation-delay: -.8s; }
@keyframes bar { from { transform: scaleY(.7); } to { transform: scaleY(1.08); } }
.logo.small { font-size: .5rem; }
.logo.small .dub { font-size: 7rem; -webkit-text-stroke-width: .85rem; }
.logo.small .tog { font-size: 4.4rem; -webkit-text-stroke-width: .85rem; margin-top: -.3rem; }
.logo.small .bars i { width: .6rem; }
.logo.small .bars i:nth-child(1) { height: 2rem; }
.logo.small .bars i:nth-child(2) { height: 3.5rem; }
.logo.small .bars i:nth-child(3) { height: 2.1rem; }

/* ---------- вход, меню ---------- */
.split { flex-direction: row; gap: 4rem; padding: 0 6rem; }
.split .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; min-width: 0; }
.split .art { flex: 1; display: flex; align-items: flex-end; justify-content: center; align-self: stretch; min-width: 0; }
.split .art img { max-height: 92vh; max-width: 100%; }
.split .art.cast img { max-height: 90vh; animation: sway 7s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: translateY(.25rem); } 50% { transform: translateY(-.25rem); } }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 1.6rem; width: 36rem; }
.menu-grid .btn { width: 100%; }
.profile { cursor: pointer; position: absolute; top: 2rem; right: 2rem; display: flex; align-items: center; gap: .8rem; padding: .5rem 1.6rem .5rem .6rem; border-radius: 99rem; font-family: var(--head); font-size: 1.3rem; }
.ava { position: relative; width: 2.6rem; height: 2.6rem; flex: none; display: inline-flex; }
.ava .ph { position: absolute; inset: 0; border-radius: 50%; border: .18rem solid var(--ring, var(--line)); background: var(--panel2); overflow: hidden; display: flex; align-items: center; justify-content: center; font-family: var(--head); color: var(--muted); }
.ava.framed .ph { border-color: transparent; inset: .06rem; }
.ava .ph img { width: 100%; height: 100%; object-fit: cover; }
.ava .fr { position: absolute; left: -14.1%; top: -14.1%; width: 128.2%; height: 128.2%; max-width: none; pointer-events: none; }
.or { font-family: var(--head); color: var(--muted); font-size: 1.1rem; text-transform: uppercase; }
.joinrow { display: flex; gap: 1rem; align-items: center; }
.joinrow input { width: 21rem; font-size: 1.3rem; text-transform: uppercase; }
.login-box { display: flex; flex-direction: column; gap: 1.3rem; align-items: center; margin-top: 1rem; }
.login-box .devrow { display: flex; gap: .8rem; }

/* ---------- лобби ---------- */
.lobby { justify-content: flex-start; padding: 1.1rem 2rem 1rem; gap: 1rem; }
.lobby > .logo { zoom: .82; }
.lobby-body { display: flex; gap: 1.4rem; width: min(78rem, 100%); flex: 1; min-height: 0; }
.players { width: 21rem; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; min-height: 0; }
.players h3 { font-size: 1.5rem; padding: .1rem .3rem; }
.plist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; min-height: 5rem; padding-right: .2rem; }
.prow { display: flex; align-items: center; gap: .7rem; background: var(--panel2); border: .2rem solid var(--line); border-radius: .8rem; padding: .35rem .7rem; height: 3.3rem; flex: none; font-family: var(--head); font-size: 1.35rem; }
.prow .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow.off { opacity: .45; }
.prow .crown { width: 1.9rem; height: 1.9rem; }
.prow .you { background: #6cc41f; color: var(--ink); border: .18rem solid var(--line); border-radius: 99rem; font-size: .85rem; padding: .35rem .5rem; }
.prow.free { justify-content: center; color: var(--free-t); background: var(--free); font-size: 1.05rem; border-color: var(--free-b); }
.players .btnrow { flex-wrap: nowrap; gap: .6rem; }
.codeline { text-align: center; font-size: .95rem; color: var(--muted); }
.codeline b { font-family: var(--head); color: var(--text); letter-spacing: .08em; font-size: 1.15rem; }
.lobby-right { flex: 1; display: flex; flex-direction: column; gap: 1rem; min-width: 0; min-height: 0; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.mode { height: 7.2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; font-family: var(--head); font-size: 1.4rem; text-transform: uppercase; position: relative; }
.mode img { height: 4rem; }
.mode.on { background: var(--yellow); color: var(--ink); }
.mode.soon { opacity: .45; }
.mode.soon::after { content: 'скоро'; position: absolute; top: .5rem; right: .7rem; font-size: .8rem; background: var(--line); color: var(--muted); padding: .15rem .5rem; border-radius: 1rem; }
.lsettings { flex: 1; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; min-height: 0; }
.lsettings h3 { font-size: 1.5rem; }
.srow { display: flex; align-items: center; gap: 1rem; }
.srow select, .srow input { flex: 1; }
.packlist { flex: 1; overflow-y: auto; min-height: 6rem; display: flex; flex-direction: column; gap: .25rem; padding-right: .3rem; }
.pack { display: flex; align-items: center; gap: .8rem; padding: .45rem .7rem; border-radius: .5rem; cursor: pointer; flex: none; }
.pack img, .pack .noicon { width: 3.2rem; height: 1.8rem; object-fit: cover; border-radius: .2rem; background: var(--panel3); flex: none; }
.pack .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack .n { color: var(--muted); font-size: .92em; white-space: nowrap; }
.pack:hover { background: var(--panel2); }
.pack.on { background: var(--yellow); color: #fff8e6; text-shadow: 0 .08rem 0 rgba(0, 0, 0, .25); }
.pack.on .n { color: #fff0cc; }
.pack.busy { opacity: .5; cursor: default; }
.ro .pack { cursor: default; }
.ro .pack:not(.on):hover { background: none; }
.lobby-foot { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.lobby-foot .hintline { min-height: 0; font-size: .95rem; }
.lobby-foot .row { display: flex; gap: 1.2rem; align-items: center; }
::-webkit-scrollbar { width: .55rem; }
::-webkit-scrollbar-thumb { background: #554c80; border-radius: 1rem; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .25); border-radius: 1rem; }
.corner { position: absolute; top: 1.6rem; z-index: 5; }
.corner.l { left: 1.8rem; } .corner.r { right: 1.8rem; }

/* ---------- роли ---------- */
.roles { gap: 2rem; padding: 2rem; }
.rgrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; max-width: 86rem; max-height: 60vh; overflow-y: auto; padding: .3rem .3rem .8rem; }
.rcard { width: 12.2rem; height: 14.4rem; padding: 1rem .6rem; display: flex; flex-direction: column; align-items: center; gap: .2rem; cursor: pointer; text-align: center; transition: transform .1s; }
.rgrid.dense .rcard { width: 10rem; height: 11.4rem; }
.rgrid.dense .rcard .ava { width: 3rem; height: 3rem; }
.rcard:hover { transform: translateY(-.25rem); }
.rcard .rn { font-family: var(--head); font-size: 1.45rem; line-height: 1.05; max-height: 3.2rem; overflow: hidden; word-break: break-word; }
.rcard .rc { color: var(--muted); font-family: var(--head); font-size: 1rem; }
.rcard .own { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; font-family: var(--head); font-size: 1.2rem; }
.rcard .own.orig { color: var(--muted); font-family: var(--body); font-size: .95rem; }
.rcard .ava { width: 3.8rem; height: 3.8rem; border-width: .22rem; }
.rcard.taken { background: var(--panel2); cursor: default; }
.rcard.mine { background: var(--yellow); color: var(--ink); cursor: pointer; }
.rcard.mine .rc { color: #7a5a17; }
.hintline { color: var(--muted); font-size: 1.05rem; text-align: center; min-height: 1.4em; }
.btnrow { display: flex; gap: 1.2rem; align-items: center; justify-content: center; flex-wrap: wrap; }

/* ---------- запись ---------- */
.rec { justify-content: flex-start; padding: 1.4rem 2rem 1.2rem; gap: .7rem; }
.rec-head { text-align: center; }
.rec-head .ttl { font-family: var(--head); font-size: 1.6rem; }
.dots { display: flex; gap: .45rem; justify-content: center; margin-top: .6rem; height: .7rem; }
.dots i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--dim); }
.dots i.got { background: var(--green); }
.dots i.cur { box-shadow: 0 0 0 .16rem var(--yellow); background: var(--yellow); }
.dots i.cur.got { background: var(--green); }
.linecount { position: absolute; top: 1.6rem; right: 2rem; font-family: var(--head); text-transform: uppercase; font-size: 2.1rem; text-align: right; line-height: 1.1; }
.linecount small { display: block; font-size: 1.2rem; color: var(--yellow); }
.stage { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: .8rem; position: relative; background: #1b1733; overflow: hidden; }
.stage video { max-width: 100%; max-height: 100%; height: 100%; background: #000; }
.stage .cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 11rem; color: #fff; text-shadow: 0 .5rem 0 var(--line), 0 0 2rem rgba(0, 0, 0, .6); pointer-events: none; }
.stage .recbadge { position: absolute; top: 1.2rem; left: 1.4rem; background: var(--red); color: var(--ink); font-family: var(--head); padding: .3rem 1rem; border-radius: 99rem; border: .2rem solid var(--line); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.stage.recording { box-shadow: 0 .5rem 0 var(--line), inset 0 0 0 .35rem var(--red); }
.who { font-family: var(--head); text-transform: uppercase; color: #2fd08c; font-size: 1.15rem; letter-spacing: .04em; }
.caption { font-family: var(--head); font-size: 1.9rem; text-align: center; max-width: 80rem; line-height: 1.15; max-height: 4.5rem; overflow-y: auto; user-select: text; }
.wave { width: 100%; height: 8.5rem; flex: none; padding: .6rem; position: relative; background: #29243f; }
.wave canvas { width: 100%; height: 100%; display: block; }
.status { font-size: 1.1rem; color: var(--muted); min-height: 1.5em; text-align: center; }
.status.warn { color: var(--yellow); }
.status.live { color: var(--red); }
.rec-bottom { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.rec-bottom .l { display: flex; gap: 1rem; }
.rec-bottom .c { display: flex; gap: 1rem; }

/* ---------- ожидание, шоу ---------- */
.wait { gap: 1.2rem; }
.wait img.pop { height: 12rem; animation: bob 1.6s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-.8rem) rotate(2deg); } }
.wait h1.red { color: var(--red); font-size: 5.4rem; }
.wait .sub { font-family: var(--head); color: var(--sub); font-size: 1.9rem; }
.wcards { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; max-width: 80rem; margin-top: 1.2rem; }
.wcard { width: 11.5rem; padding: 1rem .6rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; background: var(--panel2); font-family: var(--head); font-size: 1.3rem; text-align: center; }
.wcard .ava { width: 4.2rem; height: 4.2rem; border-width: .22rem; }
.wcard .st { font-size: 1rem; color: var(--red); }
.wcard .st.ok { color: var(--green); }
.wcard.off { opacity: .5; }

.show { justify-content: flex-start; padding: 1.6rem 2rem 1.6rem; gap: 1.4rem; }
.show .frame { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; width: 100%; }
.show .frame .panel { padding: 1rem; max-height: 100%; height: 100%; display: flex; background: #1b1733; }
.show video { max-height: 100%; max-width: 100%; background: #000; }
.curtains { position: fixed; inset: 0; z-index: 55; overflow: hidden; }
.curtains .c { position: absolute; top: 0; bottom: 0; width: 53.5%; background: #db1516 url(/img/curtain.svg) 0 0 / 37.5% 100% repeat-x; will-change: transform; }
.curtains .c.l { left: 0; transform: translateX(-100%); transform-origin: left center; }
.curtains .c.r { right: 0; transform: translateX(100%); transform-origin: right center; background-position: 100% 0; }
.results { gap: 1.2rem; }
.results .frame.panel { padding: .9rem; background: #1b1733; }
.results video { height: 44vh; max-width: 80vw; display: block; background: #000; }
.results .pt { font-family: var(--head); font-size: 1.6rem; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

/* ---------- окна ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: var(--back); display: flex; align-items: center; justify-content: center; animation: fadein .15s; }
.modal { padding: 1.4rem 2rem; max-width: min(64rem, 94vw); max-height: 94vh; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; }
.modal h2 { font-size: 2rem; text-align: center; }
.modal p { margin: 0; color: var(--muted); text-align: center; }
.modal .btnrow { margin-top: .6rem; }
.set { width: 46rem; }
.set .f { display: flex; flex-direction: column; gap: .45rem; }
.set .f .top { display: flex; justify-content: space-between; align-items: baseline; }
.set .f .val { font-family: var(--head); font-size: 1.15rem; }
.set .f small, .set small { color: var(--muted); font-size: .9rem; font-weight: 700; }
.set .inline { display: flex; gap: .8rem; align-items: center; }
.set .inline select { flex: 1; }
.set hr { border: 0; border-top: .12rem solid var(--dim); width: 100%; margin: .2rem 0; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: .8rem; border-radius: 1rem; background: linear-gradient(90deg, var(--yellow) var(--p, 50%), var(--track) var(--p, 50%)); outline: none; margin: .5rem 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--knob); border: .28rem solid var(--line); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--knob); border: .28rem solid var(--line); cursor: pointer; }
.meter { flex: 1; height: 1.9rem; border-radius: 99rem; background: var(--track); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: .85rem; color: var(--muted); }
.meter .zone { position: absolute; top: 0; bottom: 0; left: 55%; width: 27%; background: rgba(92, 201, 63, .28); }
.meter .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--yellow); border-radius: 99rem; transition: width .06s linear; }
.meter span { position: relative; }
.toggle { width: 4.4rem; height: 2.3rem; border-radius: 99rem; background: var(--panel2); border: .22rem solid var(--line); position: relative; cursor: pointer; flex: none; }
.toggle::after { content: ''; position: absolute; top: .22rem; left: .25rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 2.25rem; }
.how ol { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: .6rem; font-size: 1.1rem; max-width: 40rem; }
.preview video { max-width: 80vw; max-height: 70vh; background: #000; border-radius: .6rem; }

/* ---------- чат ---------- */
#chat-root { position: fixed; right: 1.8rem; bottom: 1.5rem; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: .8rem; }
.chatbtn { position: relative; }
.chatbtn .badge { position: absolute; top: -.5rem; right: -.3rem; background: var(--red); color: var(--ink); border: .18rem solid var(--line); border-radius: 99rem; font-size: .85rem; min-width: 1.6rem; padding: .05rem .3rem; text-align: center; font-family: var(--head); }
.chat { width: 24rem; height: 30rem; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.chat .hd { display: flex; align-items: center; justify-content: space-between; }
.chat .hd h3 { font-size: 1.5rem; }
.chat .msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; font-size: 1rem; user-select: text; padding-right: .3rem; }
.chat .msgs .sys { color: var(--muted); text-align: center; font-size: .88rem; }
.chat .msgs b { color: var(--yellow); }
.chat .inp { display: flex; gap: .6rem; }
.chat .inp input { flex: 1; font-size: 1rem; padding: .6rem .8rem; }
.chat .send { padding: .5rem .8rem; }

#toasts { position: fixed; left: 50%; top: 1.4rem; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast { background: var(--panel2); border: .22rem solid var(--line); border-radius: 99rem; padding: .6rem 1.6rem; box-shadow: 0 .35rem 0 var(--line); animation: fadein .2s; }
.toast.err { background: var(--red); color: var(--ink); }
.loader { font-family: var(--head); font-size: 1.6rem; color: var(--muted); }

@media (max-aspect-ratio: 1/1) {
  html { font-size: clamp(8px, 1.9vw, 18px); }
  .split { flex-direction: column; padding: 2rem; }
  .split .art { display: none; }
}

/* ---------- профиль ---------- */
.prow[data-uid] { cursor: pointer; }
.prow.plated { background-position: right center; background-size: cover; background-repeat: no-repeat; }
.prow.plated.pdark { color: #fff; text-shadow: 0 .1rem 0 rgba(0, 0, 0, .55); }
.prow.plated.plight { color: #221f2b; }
.modal.pf { --pfc: #8cc4f5; padding: 0; gap: 0; width: 44rem; border-color: var(--line); box-shadow: 0 .5rem 0 var(--line), inset 0 0 0 .3rem var(--pfc); overflow: hidden auto; }
.pf-head { display: flex; align-items: center; gap: 1.6rem; padding: 1.6rem 2rem; min-height: 10.5rem; margin: .3rem .3rem 0; border-radius: 1.1rem 1.1rem 0 0; }
.pf-head .ava { width: 7.2rem; height: 7.2rem; }
.pf-head .ava .ph { border-width: .26rem; font-size: 3rem; }
.pf-name { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; min-width: 0; }
.pf-name .nm { font-family: var(--head); font-size: 2.2rem; color: #221f2b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28rem; }
.pf-head.walled .nm { color: #fff; text-shadow: 0 .16rem 0 var(--line), 0 0 .8rem rgba(0, 0, 0, .5); }
.pf-body { background: var(--pfbody); margin: 0 .3rem .3rem; border-radius: .8rem .8rem 1.1rem 1.1rem; padding: 1rem 1rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.pf-body .lbl { font-size: 1rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.stat { background: var(--panel2); border: .2rem solid var(--line); border-radius: .7rem; padding: .7rem .4rem .6rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.stat b { font-family: var(--head); font-size: 2.3rem; line-height: 1; }
.stat span { font-family: var(--head); text-transform: uppercase; color: var(--sub); font-size: .92rem; text-align: center; }
.badges { display: flex; gap: .7rem; flex-wrap: wrap; min-height: 3.2rem; align-items: center; }
.badge-m { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--tier); border: .2rem solid var(--line); box-shadow: inset 0 0 0 .22rem rgba(255, 255, 255, .35), inset 0 -.25rem 0 rgba(0, 0, 0, .18); display: inline-flex; align-items: center; justify-content: center; color: #221f2b; }
.badge-m svg { width: 2rem; height: 2rem; }
.tabs { display: flex; gap: .6rem; justify-content: center; }
.le-box { height: 15.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; padding: .2rem .3rem; }
.crow { display: flex; align-items: center; gap: 1rem; }
.crow .lbl { width: 6rem; flex: none; }
.sws { display: flex; gap: .5rem; flex-wrap: nowrap; justify-content: space-between; }
.sw { width: 2.35rem; height: 2.35rem; flex: none; border-radius: 50%; border: .2rem solid var(--line); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative; font-style: normal; }
.sw.on { box-shadow: 0 0 0 .22rem var(--text); }
.sw.none { background: #2b2648; color: #fff; }
.sw.none svg { width: 1.3rem; height: 1.3rem; }
.sw.plus { background: #a6e84a; color: #221f2b; font-family: var(--head); font-size: 1.5rem; overflow: hidden; }
.sw.plus input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.lgrid { display: grid; gap: .7rem; }
.lgrid.plates { grid-template-columns: repeat(3, 1fr); }
.lgrid.walls { grid-template-columns: repeat(4, 1fr); }
.lgrid.frames { grid-template-columns: repeat(7, 1fr); }
.lcell { border: .2rem solid var(--line); border-radius: .7rem; background: var(--panel3); cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; }
.lcell.on { box-shadow: 0 0 0 .25rem var(--text); }
.lcell > svg { width: 1.6rem; height: 1.6rem; }
.lcell > span { display: block; width: 100%; height: 100%; background-size: cover; background-position: right center; }
.lgrid.plates .lcell { height: 3.4rem; }
.lgrid.walls .lcell { height: 5.4rem; }
.lgrid.walls .lcell > span { background-position: center; }
.lgrid.frames .lcell { aspect-ratio: 1; overflow: visible; }
.lgrid.frames .lcell .ava { width: 62%; height: 62%; }
#le-row .prow { cursor: default; }

/* ---------- светлая тема ---------- */
:root[data-theme=light] {
  --bg: #fdfdfb; --panel: #ffffff; --panel2: #efecfa; --panel3: #f2effc; --line: #241f1d; --text: #221f2b; --muted: #6f6a80; --ink: #221f2b;
  --track: #e4e0ee; --knob: #ffffff; --free: #f6f4fb; --free-t: #a8a2b5; --free-b: #c9c2d8; --dim: #c9c2d8; --pfbody: #efecfa; --sub: #6f6a80; --back: rgba(34, 31, 43, .45);
}
:root[data-theme=light] #bg { filter: invert(1) grayscale(1); opacity: .5; }
:root[data-theme=light] h1 { text-shadow: none; }
:root[data-theme=light] .logo .dub, :root[data-theme=light] .logo .tog { color: #fff; -webkit-text-stroke-color: #221f2b; }
:root[data-theme=light] .logo { filter: drop-shadow(0 .45rem 0 rgba(36, 31, 29, .25)); }
:root[data-theme=light] input::placeholder { color: #a8a2b5; }
:root[data-theme=light] .pack.on { color: #221f2b; text-shadow: none; }
:root[data-theme=light] .pack.on .n { color: #6b4d10; }
:root[data-theme=light] .who { color: #1c9a66; }
:root[data-theme=light] .status.warn { color: #c7362c; }
:root[data-theme=light] .linecount small, :root[data-theme=light] .chat .msgs b { color: #c77d00; }
:root[data-theme=light] .mode.soon::after { color: #fff; }
:root[data-theme=light] ::-webkit-scrollbar-thumb { background: #c9c2d8; }
:root[data-theme=light] ::-webkit-scrollbar-track { background: rgba(0, 0, 0, .06); }
:root[data-theme=light] .toggle::after { background: #fff; box-shadow: 0 0 0 .12rem var(--line); }
:root[data-theme=light] .stage, :root[data-theme=light] .show .frame .panel, :root[data-theme=light] .results .frame.panel { background: #14102a; }
:root[data-theme=light] .wave { background: #2a2438; }
:root[data-theme=light] .sw.none { background: #efecfa; color: #221f2b; }
:root[data-theme=light] .lcell { color: #221f2b; }

/* ---------- запись: эффекты голоса ---------- */
.corner.l { display: flex; gap: .7rem; }
.rec-bottom .l .btn { font-size: 1.1rem; padding: .7rem 1.3rem; }
.fxwrap { position: relative; }
.fxmenu { position: absolute; left: 0; bottom: calc(100% + .8rem); z-index: 20; padding: .8rem; display: flex; flex-direction: column; gap: .5rem; width: 17rem; }
.fxmenu .ttl { font-size: .9rem; color: var(--muted); text-align: center; }
.fxmenu .btn { justify-content: flex-start; width: 100%; }
.linecount small.hot { color: var(--red); }
.dots.many { gap: .22rem; }
.dots.many i { width: .34rem; height: .34rem; }
.show .btnrow .sub { font-family: var(--head); color: var(--sub); font-size: 1.7rem; }

/* ---------- связь, возврат, игроки не в сети ---------- */
#net { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 95; background: var(--red); color: var(--ink); font-family: var(--head); font-size: 1.2rem; padding: .6rem 1.6rem; border: .22rem solid var(--line); border-radius: 99rem; box-shadow: 0 .35rem 0 var(--line); }
.backbtn { margin-top: 1.2rem; font-size: 1.5rem; padding: .9rem 2rem; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.15); transform: scale(1.03); } }
.prow .offl { font-family: var(--body); font-size: .85rem; opacity: .9; white-space: nowrap; }
.wcard.away { border-style: dashed; }
.wcard.away .ava { opacity: .5; }
.wcard .btn { margin-top: .2rem; }

/* ---------- плеер ---------- */
.player { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: .8rem; background: #000; }
.player video { display: block; max-width: 100%; max-height: 100%; background: #000; cursor: pointer; }
.player.locked video { cursor: default; }
.show .frame .panel.player { padding: 0; height: 100%; aspect-ratio: 16 / 9; max-width: 100%; }
.show .player video { width: 100%; height: 100%; object-fit: contain; }
.results .frame.panel.player { padding: 0; }
.pbar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: .8rem; padding: 2.2rem 1.1rem .8rem; background: linear-gradient(transparent, rgba(8, 6, 18, .88)); color: #fff; transition: opacity .25s; }
.player.idle .pbar { opacity: 0; }
.player.idle { cursor: none; }
.pbtn { all: unset; width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; flex: none; color: #fff; }
.pbtn:hover { background: rgba(255, 255, 255, .16); }
.pbtn svg { width: 1.7rem; height: 1.7rem; fill: currentColor; }
.player.locked .pbtn[data-a=play] { opacity: .35; cursor: default; }
.ptime { font-family: var(--head); font-size: 1.1rem; min-width: 3rem; text-align: center; font-variant-numeric: tabular-nums; }
.pseek { position: relative; flex: 1; height: 1.6rem; cursor: pointer; touch-action: none; }
.pseek::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: .5rem; margin-top: -.25rem; border-radius: 1rem; background: rgba(255, 255, 255, .28); }
.pfill { position: absolute; left: 0; top: 50%; height: .5rem; margin-top: -.25rem; border-radius: 1rem; background: var(--yellow); }
.pknob { position: absolute; top: 50%; width: 1.2rem; height: 1.2rem; margin: -.6rem 0 0 -.6rem; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .18rem rgba(0, 0, 0, .35); }
.player.locked .pseek { cursor: default; }
.player.locked .pknob { display: none; }
.pvol { width: 6.5rem !important; flex: none; height: .5rem !important; }
.pbig { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 6, 18, .55); pointer-events: none; }
.pbig span { font-family: var(--head); font-size: 1.8rem; color: #fff; background: rgba(8, 6, 18, .8); padding: .6rem 1.6rem; border-radius: 99rem; }
.modal.mixer { width: 46rem; }
.mixrows { display: flex; flex-direction: column; gap: .7rem; max-height: 52vh; overflow-y: auto; padding: .2rem .4rem .2rem 0; }
.mixrow { display: flex; align-items: center; gap: .9rem; }
.mixrow .mx-who { width: 13rem; flex: none; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.mixrow .mx-who b { font-family: var(--head); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mixrow .lvl { height: .4rem; border-radius: 1rem; background: var(--track); overflow: hidden; }
.mixrow .lvl i { display: block; height: 100%; background: var(--green); }
.mixrow .val { width: 3.6rem; text-align: right; font-family: var(--head); }
.mixstate { min-height: 1.4rem; text-align: center; color: var(--muted); }

/* ---------- приглашения ---------- */
.modal.invite { width: 40rem; }
.invlist { display: flex; flex-direction: column; gap: .6rem; max-height: 52vh; min-height: 9rem; overflow-y: auto; padding: .2rem .4rem .2rem 0; }
.invrow { display: flex; align-items: center; gap: .9rem; background: var(--panel2); border: .2rem solid var(--line); border-radius: .9rem; padding: .5rem .8rem; }
.invrow .ava, .invcard .ava { width: 3rem; height: 3rem; flex: none; }
.invrow .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.invrow .nm b { font-family: var(--head); font-weight: 400; font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invrow .nm small { color: var(--muted); font-size: .9rem; }
.invhere { font-family: var(--head); color: var(--green); white-space: nowrap; }
.invempty { margin: auto; text-align: center; color: var(--muted); line-height: 1.5; }
#invites { position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 92; display: flex; flex-direction: column; gap: .7rem; width: min(42rem, 94vw); }
.invcard { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; animation: fadein .2s; }
.invcard .txt { flex: 1; min-width: 0; line-height: 1.25; }
.invcard .txt b { font-family: var(--head); font-weight: 400; }
.invcard .txt small { display: block; color: var(--muted); font-size: .9rem; }

/* ---------- мастерская Steam ---------- */
.packbtns { display: flex; justify-content: center; gap: .9rem; flex: none; }
.modal.ws { width: min(78rem, 96vw); height: 90vh; max-height: 90vh; overflow: hidden; }
.wsbar { display: flex; align-items: flex-end; gap: .9rem; flex: none; }
.wsbar input[type=text] { flex: 1.3; }
.wsbar label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.wsbar label span { font-family: var(--head); text-transform: uppercase; font-size: .8rem; color: var(--muted); letter-spacing: .03em; }
.wsbar select { width: 100%; padding: .55rem .7rem; }
.wsbar input[type=text] { padding: .55rem .9rem; }
.wscount { flex: 1; text-align: right; color: var(--muted); padding-bottom: .5rem; white-space: nowrap; }
.wslist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .45rem; padding-right: .4rem; }
.wsrow { display: flex; align-items: center; gap: 1rem; flex: none; background: var(--panel2); border: .18rem solid var(--line); border-radius: .8rem; padding: .45rem .8rem .45rem .45rem; }
.wsrow img, .wsrow .noimg { width: 4.4rem; height: 4.4rem; object-fit: cover; border-radius: .5rem; background: var(--panel3); flex: none; }
.wsrow .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.wsrow .nm b { font-family: var(--head); font-weight: 400; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsrow .nm small { color: var(--muted); font-size: .95rem; }
.wsrow .subs { display: flex; align-items: center; gap: .35rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wsrow .subs svg { width: 1.2rem; height: 1.2rem; }
.wsrow .act { width: 12.5rem; flex: none; display: flex; justify-content: flex-end; }
.wsst { font-family: var(--head); color: var(--muted); white-space: nowrap; }
.wsst.ok { color: var(--green); }
.wsst.live { color: var(--yellow); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .55; } }
.wsmsg { text-align: center; color: var(--muted); padding: 1.4rem; flex: none; }
.wsmsg.err { color: var(--red); }
.wsfoot { display: flex; align-items: center; gap: 1rem; flex: none; }
.wsjobs { flex: 1; color: var(--muted); font-size: .95rem; }

/* ползунки «от — до» в мастерской */
.wsrange { flex: 1.25; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.wsrange > span { font-family: var(--head); text-transform: uppercase; font-size: .8rem; color: var(--muted); letter-spacing: .03em; }
.wsrange > span b { font-weight: 400; color: var(--text); text-transform: none; font-size: .95rem; }
.dual { position: relative; height: 2.75rem; }
.dual::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: .8rem; margin-top: -.4rem; border-radius: 1rem; background: var(--track); }
.dual i { position: absolute; top: 50%; height: .8rem; margin-top: -.4rem; border-radius: 1rem; background: var(--yellow); }
.dual input[type=range] { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; background: none; pointer-events: none; }
.dual input[type=range]::-webkit-slider-thumb { pointer-events: auto; position: relative; z-index: 1; }
.dual input[type=range]::-moz-range-thumb { pointer-events: auto; }
.dual input[type=range]::-moz-range-track { background: none; }
.wscount { flex: .9; }

/* ---------- зрители ---------- */
.specrow { display: flex; align-items: center; justify-content: center; gap: .8rem; font-family: var(--head); text-transform: uppercase; color: var(--muted); font-size: 1rem; }
.prow .spec { display: inline-flex; opacity: .85; }
.prow .spec svg { width: 1.5rem; height: 1.5rem; }
/* ---------- сохранённые ролики ---------- */
.topright { position: absolute; top: 2rem; right: 2rem; display: flex; align-items: center; gap: .9rem; z-index: 2; }
.topright .profile { position: static; }
.modal.recwin { width: min(92rem, 96vw); height: 90vh; max-height: 90vh; overflow: hidden; }
.recs { flex: 1; min-height: 0; display: flex; gap: 1.2rem; }
.reclist { width: 24rem; flex: none; overflow-y: auto; display: flex; flex-direction: column; gap: .45rem; padding-right: .4rem; }
.recrow { display: flex; gap: .8rem; align-items: center; padding: .5rem; border-radius: .8rem; background: var(--panel2); border: .18rem solid var(--line); cursor: pointer; flex: none; }
.recrow.on { border-color: var(--yellow); box-shadow: 0 0 0 .12rem var(--yellow); }
.recrow img, .recrow .noimg { width: 5.4rem; height: 3.1rem; object-fit: cover; border-radius: .4rem; background: var(--panel3); flex: none; }
.recrow .nm { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.recrow .nm b { font-family: var(--head); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recrow .nm small { color: var(--muted); font-size: .85rem; }
.faces { display: flex; gap: .2rem; margin-top: .15rem; }
.faces .ava { width: 1.7rem; height: 1.7rem; border-width: .12rem; font-size: .8rem; }
.recview { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .7rem; }
.recplayer { flex: 1; min-height: 0; }
.recplayer video { width: 100%; height: 100%; object-fit: contain; }
.rectitle { display: flex; align-items: center; gap: 1rem; flex: none; }
.rectitle b { font-family: var(--head); font-weight: 400; font-size: 1.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rectitle span { color: var(--muted); flex: 1; white-space: nowrap; }
.reccast { display: flex; flex-wrap: wrap; gap: .6rem; flex: none; max-height: 9rem; overflow-y: auto; }
.recp { display: flex; align-items: center; gap: .6rem; background: var(--panel2); border: .18rem solid var(--line); border-radius: .8rem; padding: .35rem .9rem .35rem .45rem; }
.recp .ava { width: 2.6rem; height: 2.6rem; flex: none; }
.recp b { font-family: var(--head); font-weight: 400; display: block; line-height: 1.1; }
.recp small { color: var(--muted); font-size: .85rem; display: block; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recp.viewer { opacity: .7; }
