:root {
  --ink: #ffffff;
  --muted: #d9d2ff;
  --night: #1c1a5c;
  --glass: rgba(22, 18, 74, 0.62);
  --line: rgba(255, 255, 255, 0.78);
  --peach: #ffa36e;
  --gold: #ffe2c2;
  --good: #a8ff9e;
  --bad: #ff8a8a;
  --dock: 150px;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Golos Text', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: linear-gradient(180deg, #2b2a78 0%, #5a50b8 40%, #a58ae0 66%, #f2b8d8 82%, #6c6cd0 100%) fixed;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.glass {
  background: var(--glass);
  border: 2px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 0 28px rgba(190, 170, 255, 0.55);
  backdrop-filter: blur(6px);
}
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; justify-content: center; }

.btn {
  min-height: 48px; padding: 0 22px; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--line); background: rgba(255, 255, 255, 0.08);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn.primary { background: var(--peach); color: #2a1650; border-color: #ffd2b5; box-shadow: 0 0 18px rgba(255, 154, 98, 0.7); }
.btn.primary:hover { background: #ffb588; }
.btn.big { min-height: 58px; font-size: 18px; font-family: var(--display); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.file { position: relative; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: rgba(20, 16, 70, 0.5); font-size: 15px; cursor: default;
}
button.chip { cursor: pointer; }
button.chip:hover { background: rgba(255, 255, 255, 0.16); }
.chip.done { border-color: var(--good); }

/* ---------- бренд и вход ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.logo-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #ffb088; box-shadow: 0 0 14px #ff9a62; flex: none; }
.brand-name { font-family: var(--display); font-weight: 900; font-size: 26px; letter-spacing: 0.03em; text-transform: uppercase; text-shadow: 0 0 18px rgba(255, 154, 98, 0.9); }
.brand.small .brand-name { font-size: clamp(14px, 1.4vw, 22px); }
.brand.small .logo-dot { width: 24px; height: 24px; }

.landing {
  height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 32px 16px 40px;
}
.lead { max-width: 520px; text-align: center; margin: 0; color: #f3efff; font-size: 17px; line-height: 1.45; }
.nek-hero { width: 190px; height: 280px; filter: drop-shadow(0 0 8px rgba(255, 170, 150, 0.9)); }
.nek-hero svg { width: 100%; height: 100%; }
.entry, .join { width: min(460px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.entry input, .join input {
  min-height: 50px; border-radius: 12px; border: 2px solid var(--line); background: rgba(10, 8, 40, 0.55);
  padding: 0 14px; font-size: 18px; width: 100%;
}
.entry .row input { flex: 1; text-transform: uppercase; letter-spacing: 0.12em; }
.lbl { font-weight: 700; font-size: 15px; }
.room-chip { font-size: 16px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(20, 16, 70, 0.5); }
.room-chip b { font-family: var(--display); letter-spacing: 0.1em; color: var(--gold); }
.roles { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.roles legend { margin-bottom: 8px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, 0.35); cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--peach); background: rgba(255, 163, 110, 0.14); }
.role-opt input { margin-top: 4px; accent-color: var(--peach); width: 18px; height: 18px; }
.role-opt span { display: flex; flex-direction: column; gap: 2px; }
.role-opt small { color: var(--muted); font-size: 14px; }
.small-link { text-align: center; font-size: 14px; }

/* ---------- студия ---------- */
.stage {
  position: relative; height: 100vh; height: 100dvh; display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 1.2vh; padding: 2vh 2.4vw 0; overflow: hidden;
}
.role-full .stage { height: calc(100dvh - var(--dock)); }
.sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sky .hill { position: absolute; border-radius: 50%; }
.sky .h1 { left: -8%; top: 58%; width: 60%; height: 46%; background: #4a4db4; }
.sky .h2 { left: 46%; top: 54%; width: 66%; height: 52%; background: #5458c2; }
.sky .h3 { left: -10%; top: 76%; width: 120%; height: 60%; background: #2f3590; }
.sky .glow { position: absolute; left: 36%; top: 80%; width: 28%; height: 16%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 190, 150, 0.5), rgba(255, 190, 150, 0)); }
.topbar { display: flex; align-items: center; gap: 16px; }
.top-mid { flex: 1; text-align: center; font-family: var(--display); font-weight: 700; font-size: clamp(14px, 1.3vw, 20px); color: var(--gold); }
.top-right { display: flex; gap: 8px; }
.top-right .chip b { font-family: var(--display); letter-spacing: 0.08em; color: var(--gold); }

.panel {
  justify-self: center; width: min(1180px, 100%); min-height: 0; overflow-y: auto;
  padding: clamp(14px, 2vh, 28px) clamp(16px, 2vw, 32px); display: flex; flex-direction: column; justify-content: center;
}
.h2 { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw, 38px); margin: 0 0 12px; text-align: center; }
.center-block { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.lobby { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.join-info { display: flex; gap: 24px; align-items: center; }
.qr { width: clamp(96px, 15vh, 180px); aspect-ratio: 1; background: #fff; border-radius: 14px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.join-text { display: flex; flex-direction: column; gap: 6px; }
.url { font-size: clamp(14px, 1.3vw, 20px); word-break: break-all; }
.code { font-family: var(--display); font-weight: 900; font-size: clamp(30px, 4.2vw, 64px); letter-spacing: 0.12em; color: var(--gold); text-shadow: 0 0 20px rgba(255, 154, 98, 0.7); }
.warn { background: rgba(255, 120, 120, 0.2); border: 1.5px solid #ffb0b0; padding: 10px 14px; border-radius: 12px; max-width: 640px; text-align: center; margin: 0; }
.host-lobby { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(560px, 100%); }
.pack-line { font-size: 17px; text-align: center; }

.board-wrap { display: flex; flex-direction: column; gap: 10px; height: 100%; justify-content: center; }
.board-head { text-align: center; font-size: clamp(15px, 1.4vw, 22px); }
.board { display: grid; grid-template-columns: minmax(120px, 1.7fr) repeat(var(--cols), minmax(0, 1fr)); gap: clamp(5px, 0.6vw, 10px); }
.board .theme {
  display: flex; align-items: center; padding: 0 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.08);
  font-weight: 700; font-size: clamp(12px, 1.15vw, 18px); min-height: clamp(38px, 6.5vh, 70px); line-height: 1.15;
}
.cell {
  border-radius: 10px; border: 1.5px solid rgba(255, 226, 194, 0.55); background: rgba(255, 255, 255, 0.06);
  font-family: var(--display); font-weight: 700; font-size: clamp(14px, 1.6vw, 26px); color: var(--gold);
  min-height: clamp(38px, 6.5vh, 70px); cursor: pointer;
}
.cell:not(:disabled):hover { background: var(--peach); color: #2a1650; box-shadow: 0 0 20px #ff9a62; }
.cell:disabled { cursor: default; }
.cell.played { border-style: dashed; border-color: rgba(255, 255, 255, 0.18); background: transparent; }
.cell.empty { visibility: hidden; }
.board.mini { grid-template-columns: minmax(80px, 1.3fr) repeat(var(--cols), minmax(0, 1fr)); gap: 5px; }
.board.mini .theme { font-size: 12px; min-height: 42px; padding: 0 8px; }
.board.mini .cell { font-size: 14px; min-height: 42px; }

.q { display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 16px); align-items: center; text-align: center; }
.q-meta { font-family: var(--display); font-weight: 700; font-size: clamp(13px, 1.2vw, 18px); color: var(--peach); letter-spacing: 0.04em; text-transform: uppercase; }
.q-text { font-family: var(--display); font-weight: 500; font-size: clamp(22px, 3vw, 46px); line-height: 1.25; max-width: 1050px; }
.q-text.mid { font-size: clamp(18px, 2.2vw, 34px); }
.q-text.small { font-size: clamp(15px, 1.5vw, 22px); color: #ece6ff; }
.q-status { font-size: clamp(15px, 1.4vw, 22px); color: var(--muted); }
.q-status.hot { color: var(--gold); font-weight: 700; animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.attempts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; font-size: clamp(14px, 1.2vw, 18px); color: #ffd0d0; }
.answer { font-size: clamp(20px, 2.4vw, 36px); }
.answer b { font-family: var(--display); color: var(--gold); text-shadow: 0 0 16px rgba(255, 154, 98, 0.8); }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: min(720px, 100%); }
.results li { display: grid; grid-template-columns: 1fr 2fr auto; gap: 12px; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); text-align: left; font-size: clamp(14px, 1.3vw, 19px); }
.results li.ok { border: 1.5px solid var(--good); }
.results li.bad { border: 1.5px solid rgba(255, 138, 138, 0.6); }
.results em { font-style: normal; font-family: var(--display); font-weight: 700; }
.results li.ok em { color: var(--good); }
.results li.bad em { color: var(--bad); }

.scale { position: relative; width: min(900px, 100%); height: 150px; margin-top: 10px; }
.scale-line { position: absolute; left: 0; right: 0; top: 40px; height: 3px; background: rgba(255, 255, 255, 0.6); border-radius: 2px; }
.mk { position: absolute; top: 30px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.mk-dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--c, #fff); background: rgba(20, 16, 70, 0.9); box-shadow: 0 0 10px var(--c, #fff); }
.mk-lbl { margin-top: calc(6px + var(--row, 0) * 26px); white-space: nowrap; font-size: 14px; padding: 2px 8px; border-radius: 8px; background: rgba(20, 16, 70, 0.75); }
.mk.win .mk-lbl { color: var(--good); font-weight: 700; }
.mk.truth { top: 33px; z-index: 2; }
.mk.truth .mk-dot { border-color: var(--peach); background: var(--peach); width: 16px; height: 16px; }
.mk.truth .mk-lbl { position: absolute; bottom: 24px; margin: 0; background: var(--peach); color: #2a1650; font-weight: 700; font-family: var(--display); }

.box-q { gap: 6px; }
.box-q .q-text.mid { font-size: clamp(16px, 1.9vw, 30px); }
.box-wrap { width: min(640px, 100%); display: flex; flex-direction: column; align-items: center; }
.box-scene { width: 100%; max-height: 22vh; filter: drop-shadow(0 0 8px rgba(255, 211, 110, 0.6)); }
.box-label { font-family: var(--display); font-weight: 700; color: #ffe9b0; }

.standings { list-style: none; padding: 0; margin: 0; width: min(520px, 100%); display: flex; flex-direction: column; gap: 6px; }
.standings li { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); font-size: 18px; }
.standings .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.standings .nm { flex: 1; }
.standings b { font-family: var(--display); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.podium-final { display: flex; align-items: flex-end; gap: 18px; }
.pf { display: flex; flex-direction: column; align-items: center; gap: 4px; order: 2; }
.pf1 { order: 2; } .pf2 { order: 1; } .pf3 { order: 3; }
.pf-fig { width: clamp(60px, 6vw, 110px); filter: drop-shadow(0 0 6px var(--c)); }
.pf-fig svg { width: 100%; display: block; }
.pf-name { font-weight: 700; }
.pf-score { font-family: var(--display); color: var(--gold); }
.pf-place { font-family: var(--display); font-weight: 900; font-size: 24px; width: clamp(70px, 7.5vw, 120px); text-align: center; border-radius: 12px 12px 0 0; background: rgba(255, 255, 255, 0.12); border: 2px solid var(--line); border-bottom: 0; }
.pf1 .pf-place { height: 64px; } .pf2 .pf-place { height: 44px; } .pf3 .pf-place { height: 30px; }

.timer { position: relative; height: 10px; width: min(1180px, 100%); justify-self: center; border-radius: 6px; background: rgba(255, 255, 255, 0.15); }
.timer-fill { position: absolute; inset: 0; border-radius: 6px; background: var(--gold); transform-origin: left; box-shadow: 0 0 12px rgba(255, 226, 194, 0.8); }
.timer-fill.low { background: var(--peach); }
.tsec { position: absolute; right: 0; top: -24px; font-family: var(--display); font-size: 14px; color: var(--gold); }

.floor { display: flex; align-items: flex-end; justify-content: center; gap: 1vw; height: clamp(170px, 34vh, 380px); }
.pods { flex: 1; display: flex; gap: 0.8vw; align-items: flex-end; min-width: 0; }
.pods.left { justify-content: flex-end; }
.pods.right { justify-content: flex-start; }
.host { position: relative; height: 100%; aspect-ratio: 420 / 620; flex: none; }
.nek { height: 100%; filter: drop-shadow(0 0 6px rgba(255, 170, 150, 0.95)); }
.nek svg { height: 100%; width: 100%; display: block; }
.bubble {
  position: absolute; left: 70%; bottom: 74%; width: clamp(220px, 26vw, 420px); z-index: 3;
  background: rgba(255, 255, 255, 0.95); color: #2a2160; padding: 12px 16px; border-radius: 18px;
  font-size: clamp(14px, 1.3vw, 20px); line-height: 1.35; box-shadow: 0 0 24px rgba(255, 200, 230, 0.7);
}
.bubble::before { content: 'НЕКТАРИНА'; display: block; font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; color: #d2553a; margin-bottom: 4px; }
.bubble.pop { animation: pop 0.35s ease-out; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.pod { position: relative; width: clamp(64px, 9.5vw, 170px); display: flex; flex-direction: column; align-items: center; transition: transform 0.2s; }
.pod-fig { width: 100%; filter: drop-shadow(0 0 5px var(--c)); margin-bottom: -4px; }
.pod-fig svg { width: 100%; display: block; }
.pod-desk {
  width: 100%; border: 2px solid var(--line); border-top: 6px solid rgba(255, 255, 255, 0.4); border-radius: 0 0 14px 14px;
  background: rgba(20, 16, 70, 0.7); padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pod-name { font-family: var(--display); font-weight: 700; font-size: clamp(10px, 1vw, 16px); text-shadow: 0 0 8px var(--c); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-name small { font-family: var(--body); font-weight: 400; color: var(--muted); }
.pod-score { font-family: var(--display); font-weight: 900; font-size: clamp(14px, 1.6vw, 26px); color: var(--gold); background: rgba(10, 8, 36, 0.8); border: 1.5px solid rgba(255, 226, 194, 0.5); border-radius: 8px; padding: 2px 10px; }
.pod-cards { display: flex; gap: 3px; }
.pod-cards i { width: 8px; height: 11px; border-radius: 2px; border: 1.5px solid var(--peach); }
.pod.ans { transform: translateY(-10px); }
.pod.ans .pod-desk { border-top-color: var(--c); box-shadow: 0 0 22px var(--c); }
.pod.off { opacity: 0.4; }
.pod.out .pod-fig { opacity: 0.55; }
.badges { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 3px; align-items: center; z-index: 2; }
.badge { font-family: var(--display); font-weight: 700; font-size: clamp(9px, 0.75vw, 12px); padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); color: #2a1650; white-space: nowrap; }
.badge.hot { background: var(--peach); box-shadow: 0 0 12px #ff9a62; }
.badge.ok { background: var(--good); }
.badge.off { background: rgba(255, 255, 255, 0.4); }
.pod.fx-pepper .pod-fig { animation: wobble 0.25s infinite; }
@keyframes wobble { 50% { transform: rotate(4deg); } }

.hostctl { position: absolute; left: 2.4vw; bottom: 1.6vh; display: flex; gap: 6px; z-index: 4; }
.hostctl .chip { font-size: 13px; padding: 6px 10px; opacity: 0.75; }
.hostctl .chip:hover { opacity: 1; }

/* ---------- пульт ---------- */
.remote {
  position: relative; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
}
.r-head { display: flex; align-items: center; gap: 10px; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--c); box-shadow: 0 0 10px var(--c); }
.me-name { font-family: var(--display); font-size: 17px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-score { font-family: var(--display); font-weight: 900; font-size: 22px; color: var(--gold); }
.r-say { font-size: 14px; color: #fff2ea; min-height: 0; }
.r-say:empty { display: none; }
.say-name { font-weight: 700; color: var(--peach); }
.r-status { font-size: 16px; text-align: center; color: var(--muted); min-height: 22px; }
.r-status b { color: var(--ink); }
.r-timer { position: relative; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.15); }
.r-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; overflow-y: auto; }
.r-main .host-lobby { width: 100%; }
.r-main .board-wrap { width: 100%; height: auto; }
.wait-big { font-family: var(--display); font-weight: 700; font-size: 26px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.wait-big small { font-family: var(--body); font-weight: 400; font-size: 16px; color: var(--muted); }
.wait-big.good { color: var(--good); font-size: 54px; }
.wait-big.bad { color: var(--bad); font-size: 54px; }

.buzz {
  position: relative; width: min(74vw, 44vh, 360px); aspect-ratio: 1; border-radius: 50%; cursor: pointer;
  border: 4px solid var(--c); background: rgba(20, 16, 70, 0.6); box-shadow: 0 0 26px var(--c), inset 0 0 30px rgba(255, 255, 255, 0.12);
  font-family: var(--display); font-weight: 900; font-size: clamp(26px, 8vw, 44px); letter-spacing: 0.06em;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: translate 0.25s, transform 0.08s, background 0.15s;
}
.buzz.early { opacity: 0.6; }
.buzz.ready { background: var(--c); color: #1c1240; box-shadow: 0 0 50px var(--c); }
.buzz.dead { opacity: 0.35; }
.buzz.pressed { transform: scale(0.94); }
.ans { display: flex; flex-direction: column; gap: 10px; width: min(520px, 100%); }
.ans input { min-height: 58px; border-radius: 14px; border: 2px solid var(--line); background: rgba(10, 8, 40, 0.6); padding: 0 16px; font-size: 20px; width: 100%; }
.bet-wrap { display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; }

.r-cards { display: flex; gap: 10px; justify-content: center; align-items: center; min-height: 56px; flex-wrap: wrap; }
.card-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--peach); background: rgba(255, 163, 110, 0.14); font-weight: 700; position: relative;
}
.card-btn:disabled { opacity: 0.4; cursor: default; }
.card-btn kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; opacity: 0.7; }
.card-ico { width: 22px; height: 22px; }
.c-freeze { border-color: #9ff3ff; background: rgba(159, 243, 255, 0.14); }
.c-slime { border-color: #a8ff9e; background: rgba(168, 255, 158, 0.14); }
.c-pepper { border-color: #ff8a7a; background: rgba(255, 138, 122, 0.14); }
.c-jam { border-color: #ffd36e; background: rgba(255, 211, 110, 0.14); }
.c-shield { border-color: #c9a7ff; background: rgba(201, 167, 255, 0.14); }
.shield-on { font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid #9ff3ff; color: #9ff3ff; }

.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; display: none; }
.fx-layer.on { display: block; pointer-events: auto; }
.ice {
  position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; border-radius: 0;
  background: linear-gradient(160deg, rgba(220, 245, 255, 0.82), rgba(160, 215, 255, 0.72)); color: #10335a;
  display: flex; align-items: center; justify-content: center; touch-action: manipulation;
}
.cracks { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-label { position: relative; font-family: var(--display); font-weight: 900; font-size: 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.fx-label small { font-family: var(--body); font-weight: 600; font-size: 16px; }
.slime-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(8, 1fr); touch-action: none; }
.slime-grid i { background: rgba(110, 210, 80, 0.88); border-radius: 40%; transition: opacity 0.2s; }
.slime-grid i.gone { opacity: 0; }
.slime-label { position: absolute; left: 0; right: 0; top: 40%; color: #133d10; }
.shake .remote, .shake .dock { animation: shake 0.3s infinite; }
@keyframes shake { 25% { transform: translate(2px, -1px); } 75% { transform: translate(-2px, 1px); } }

.modal { position: fixed; inset: 0; z-index: 30; background: rgba(10, 8, 40, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-in { width: min(560px, 100%); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-title { font-family: var(--display); font-weight: 700; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.target { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 14px; border: 2px solid var(--c); background: rgba(255, 255, 255, 0.06); cursor: pointer; font-weight: 700; }
.target svg { width: 70px; filter: drop-shadow(0 0 4px var(--c)); }

/* ---------- полный режим: нижняя панель ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--dock); z-index: 10;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 16px;
  padding: 10px 24px; background: rgba(18, 15, 64, 0.9); border-top: 2px solid var(--line); box-shadow: 0 -6px 30px rgba(190, 170, 255, 0.35);
}
.d-status { font-size: 17px; color: var(--muted); }
.d-status b { color: var(--ink); }
.d-main { display: flex; align-items: center; justify-content: center; gap: 16px; min-width: 0; }
.dock .buzz { width: 120px; font-size: 22px; }
.dock .wait-big { font-size: 20px; }
.dock .wait-big.good, .dock .wait-big.bad { font-size: 36px; }
.dock .ans { flex-direction: row; }
.dock .ans input { min-height: 52px; }
.dock .r-cards { justify-content: flex-end; }

.toasts { position: fixed; top: 76px; right: 20px; z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: rgba(255, 255, 255, 0.95); color: #2a2160; padding: 10px 16px; border-radius: 14px; font-weight: 600; box-shadow: 0 0 18px rgba(255, 200, 230, 0.7); transition: opacity 0.5s, transform 0.5s; max-width: 340px; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.role-remote .toasts { left: 16px; right: 16px; top: 12px; align-items: stretch; }
.offline { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; background: #ff8a8a; color: #2a1650; padding: 10px 18px; border-radius: 999px; font-weight: 700; }

@media (max-width: 760px) {
  .join-info { flex-direction: column; }
  .stage { padding: 12px 12px 0; }
  .brand.small .brand-name { display: none; }
  .bubble { left: auto; right: 0; bottom: 100%; }
  .dock { grid-template-columns: 1fr; height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- анкета ---------- */
.r-main:has(.end-wrap) { justify-content: flex-start; }
.end-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; padding-block: 8px 16px; }
.fb { width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; }
.fb-title { font-family: var(--display); font-weight: 700; font-size: 20px; text-align: center; color: var(--gold); }
.stars { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.stars legend { width: 100%; text-align: center; font-weight: 700; margin-bottom: 8px; }
.stars label { cursor: pointer; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars span { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); font-family: var(--display); font-weight: 700; }
.stars input:checked + span { background: var(--peach); color: #2a1650; border-color: #ffd2b5; }
.stars input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.fb-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.fb-field textarea, .report-text { width: 100%; border-radius: 12px; border: 2px solid var(--line); background: rgba(10, 8, 40, 0.6); padding: 10px 12px; font: inherit; font-weight: 400; resize: vertical; }
.report-text { min-height: 40vh; font-size: 13px; }
.fb-modal { max-height: 90vh; overflow-y: auto; align-items: center; }
.report-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.report-box .small { word-break: break-all; }
.btn.flag { min-height: 40px; font-size: 14px; padding: 0 14px; border-color: rgba(255, 138, 138, 0.7); color: #ffd0d0; }

/* ---------- 3D-студия ---------- */
.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: none; z-index: 0; }
.has3d .gl { display: block; }
.has3d .sky { display: none; }
.has3d .floor .pods, .has3d .floor .host { visibility: hidden; }
.stage > .topbar, .stage > .panel, .stage > .timer, .stage > .hostctl { position: relative; z-index: 3; }
.has3d .panel { background: rgba(22, 18, 74, 0.72); }
.labels3d { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; display: none; }
.has3d .labels3d { display: block; }
.lbl3d {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px 7px; border-radius: 12px; background: rgba(20, 16, 70, 0.78); border: 1.5px solid rgba(255, 255, 255, 0.55);
  will-change: transform; transform-origin: 50% 50%; min-width: 96px;
}
.lbl3d .badges { position: absolute; bottom: 100%; margin-bottom: 4px; left: 50%; transform: translateX(-50%); top: auto; }
.lbl-name { font-family: var(--display); font-weight: 700; font-size: 15px; white-space: nowrap; text-shadow: 0 0 8px var(--c); }
.lbl-name small { font-family: var(--body); font-weight: 400; color: var(--muted); }
.lbl-score { font-family: var(--display); font-weight: 900; font-size: 22px; color: var(--gold); }
.bubble3d { position: absolute; left: 0; top: 0; bottom: auto; z-index: 4; will-change: transform; display: none; }
.has3d .bubble3d:not([hidden]) { display: block; }
.has3d .floor .bubble { display: none; }
.style-pick { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.style-pick select { min-height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: rgba(20, 16, 70, 0.8); color: var(--ink); padding: 0 10px; font: inherit; }
.hostctl .style-pick { opacity: 0.85; }
.hostctl .style-pick select { min-height: 32px; font-size: 13px; }

.lobby { gap: 10px; }
.lobby .h2 { margin: 0; }
.lobby-row { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; justify-content: center; width: 100%; }
.lobby-row .host-lobby { width: min(420px, 100%); gap: 10px; }
.has3d .floor { height: clamp(150px, 36vh, 400px); }

/* ничего не обрезается: окно центрируется, а если не влезает — прокручивается сверху */
.panel { justify-content: flex-start; }
.panel > * { margin-block: auto; }
.board-wrap { height: 100%; min-height: 0; }
.board { flex: 1; min-height: 0; grid-auto-rows: minmax(28px, 1fr); }
.board .theme, .board .cell { min-height: 0; }
.has3d .box-scene { max-height: 13vh; }
.has3d .q-text { font-size: clamp(20px, 2.6vw, 42px); }
.has3d .q-text.mid { font-size: clamp(16px, 1.9vw, 30px); }
@media (max-height: 820px) {
  .has3d .floor { height: clamp(140px, 33vh, 360px); }
  .lobby .h2 { font-size: clamp(18px, 2vw, 28px); }
  .lobby .qr { width: clamp(84px, 13vh, 150px); }
}
.hostctl { left: 10px; top: 64px; bottom: auto; flex-direction: column; align-items: flex-start; gap: 5px; max-width: 150px; }
.hostctl .chip { font-size: 12px; padding: 5px 9px; }
.hostctl .style-pick { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 11px; }
.hostctl .style-pick select { max-width: 140px; }

/* лобби компактное: всё влезает, кнопка «Начать» всегда видна */
[data-phase="lobby"].has3d .floor { height: clamp(110px, 23vh, 280px); }
.lobby { gap: clamp(6px, 1.2vh, 12px); }
.lobby .h2 { font-size: clamp(18px, 2vw, 30px); }
.lobby-row { gap: 12px 36px; }
.lobby .join-info { gap: 16px; }
.lobby .qr { width: clamp(80px, 14vh, 160px); }
.lobby .code { font-size: clamp(28px, 3.6vw, 56px); line-height: 1; }
.lobby .url { font-size: 13px; color: var(--muted); }
.lobby-row .host-lobby { width: auto; max-width: 560px; gap: clamp(6px, 1vh, 10px); }
.host-lobby .row.wrap .btn { min-height: 44px; }
.host-lobby .style-pick select { min-height: 44px; }
.host-lobby .btn.big { min-height: 52px; min-width: 240px; }
@media (max-height: 700px) {
  [data-phase="lobby"].has3d .floor { height: 20vh; }
  .lobby .h2 { display: none; }
  .lobby .url { display: none; }
}
/* пульт ведущего не занимает место в сетке студии */
.stage > .hostctl { position: absolute; z-index: 5; }
.board .cell { font-size: clamp(13px, min(1.6vw, 3.2vh), 26px); }
.board .theme { font-size: clamp(11px, min(1.15vw, 2.4vh), 18px); }

/* меню ведущего: одна кнопка внизу слева, раскрывается вверх */
.stage > .hostctl { left: 14px; top: auto; bottom: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 170px; }
.hostctl .hc-menu { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 8px; border-radius: 12px; background: rgba(22, 18, 74, 0.85); }
.hostctl .hc-menu[hidden] { display: none; }
.hostctl .hc-toggle { opacity: 0.9; }
.board { grid-auto-rows: minmax(20px, 1fr); }
@media (max-height: 720px) {
  .panel { padding: 10px 16px; }
  .board-head { font-size: 14px; }
  .board-wrap { gap: 6px; }
}
/* в 3D ящик и так стоит на сцене — в окне только подпись размера */
.has3d .box-wrap > :not(.box-label) { display: none; }
.has3d .box-label { font-size: clamp(14px, 1.4vw, 20px); }
.has3d .q-text { font-size: clamp(18px, min(2.6vw, 4.6vh), 42px); }
.has3d .q-text.mid { font-size: clamp(15px, min(1.9vw, 3.6vh), 30px); }
@media (max-height: 720px) {
  :root { --dock: 116px; }
  [data-phase]:not([data-phase="lobby"]).has3d .floor { height: 30vh; }
}

/* слизь */
.fx-layer.slime { background: transparent; }
.role-full .fx-layer.slime { position: fixed; inset: 0; }
.slime-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; animation: slime-in 0.45s cubic-bezier(.2,1.6,.4,1) both, slime-sag 6s ease-in 0.45s both; transform-origin: 50% 0; filter: drop-shadow(0 6px 10px rgba(10, 60, 10, 0.35)); }
.slime-canvas.gone { opacity: 0; transition: opacity 0.35s; }
@keyframes slime-in { from { transform: scale(0.6, 0.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slime-sag { from { transform: none; } to { transform: translateY(1.5%) scaleY(1.03); } }
.slime-label { position: absolute; left: 0; right: 0; top: 38%; z-index: 2; color: #fff; text-shadow: 0 2px 0 #1d5b12, 0 0 14px rgba(0, 0, 0, 0.45); }
.slime-label small { color: #eaffdf; }

/* лобби v3: одна строка, без длинной ссылки — влезает даже в маленькое окно */
.lobby-row { flex-wrap: nowrap; gap: 12px clamp(16px, 3vw, 40px); }
.lobby .join-info { flex: none; }
.lobby .join-text { align-items: flex-start; gap: 8px; }
.lobby .copy-link { font-size: 13px; }
.lobby-row .host-lobby { flex: 0 1 auto; min-width: 0; align-items: stretch; }
.host-lobby .pack-line { font-size: clamp(13px, 1.2vw, 16px); }
.host-lobby .row.wrap { justify-content: flex-start; flex-wrap: wrap; }
.host-lobby .style-pick > span { display: none; }
.host-lobby .btn.big { min-width: 0; width: 100%; }
.lobby .qr { width: clamp(72px, 14vh, 150px); }
@media (max-width: 760px) { .lobby-row { flex-wrap: wrap; } }
@media (max-height: 820px) {
  [data-phase="lobby"].has3d .floor { height: clamp(90px, 19vh, 220px); }
  .lobby .h2 { display: none; }
}

/* пук: зелёный газ поверх всего */
.gas-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; background: radial-gradient(circle at 50% 60%, rgba(150, 200, 40, 0.35), rgba(90, 140, 20, 0.55)); animation: gas-in 0.5s ease-out both; }
.gas-layer.fade { opacity: 0; transition: opacity 0.4s; }
.gas-layer i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; background: radial-gradient(closest-side, rgba(170, 220, 60, 0.75), rgba(120, 170, 30, 0)); filter: blur(8px); animation: gas-drift 3.5s ease-in-out infinite alternate; }
.gas-layer i:nth-child(1) { left: -10%; top: -10%; }
.gas-layer i:nth-child(2) { left: 40%; top: -15%; animation-delay: -0.6s; }
.gas-layer i:nth-child(3) { left: 70%; top: 10%; animation-delay: -1.2s; }
.gas-layer i:nth-child(4) { left: -15%; top: 40%; animation-delay: -1.8s; }
.gas-layer i:nth-child(5) { left: 25%; top: 35%; animation-delay: -0.3s; }
.gas-layer i:nth-child(6) { left: 60%; top: 45%; animation-delay: -2.1s; }
.gas-layer i:nth-child(7) { left: -5%; top: 70%; animation-delay: -0.9s; }
.gas-layer i:nth-child(8) { left: 35%; top: 75%; animation-delay: -1.5s; }
.gas-layer i:nth-child(9) { left: 75%; top: 70%; animation-delay: -2.4s; }
.gas-label { position: absolute; left: 0; right: 0; top: 40%; color: #fff; text-shadow: 0 2px 0 #3d5a0b, 0 0 18px rgba(0, 0, 0, 0.5); font-size: clamp(28px, 6vw, 56px); }
.gas-label small { font-size: clamp(14px, 2vw, 20px); color: #f3ffd8; }
@keyframes gas-in { from { opacity: 0; transform: scale(1.2); } to { opacity: 1; transform: none; } }
@keyframes gas-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, -4vh) scale(1.25); } }
body.gassed .stage, body.gassed .remote, body.gassed .dock { animation: shake 0.22s infinite; filter: hue-rotate(40deg) saturate(1.4); }
/* перец сильнее: всё трясёт */
body.shake .stage, body.shake .remote, body.shake .dock { animation: shake-hard 0.11s infinite; }
@keyframes shake-hard { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(7px, -4px) rotate(0.6deg); } 50% { transform: translate(-6px, 5px) rotate(-0.5deg); } 75% { transform: translate(5px, 3px) rotate(0.4deg); } 100% { transform: translate(-4px, -5px) rotate(0); } }
.buzz { transition: translate 0.18s cubic-bezier(.3,1.6,.5,1); }

/* тумба: имя, очки, значки пакостей; состояние — свечением */
.pod-extra { display: flex; gap: 3px; justify-content: center; margin-top: 2px; }
.pc { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: var(--gold); }
.pc .card-ico { width: 14px; height: 14px; }
.pc-freeze { color: #bfe9ff; } .pc-slime { color: #a8ff9e; } .pc-pepper { color: #ff8a6a; }
.pc-jam { color: #ffd36e; } .pc-shield { color: #9ff3ff; } .pc-fart { color: #c8e85a; }
.pc-on { background: rgba(159, 243, 255, 0.35); box-shadow: 0 0 8px #9ff3ff; }
.lbl3d { transition: box-shadow 0.25s, border-color 0.25s; }
.lbl3d.st-hot, .pod.st-hot .pod-desk { border-color: var(--peach); box-shadow: 0 0 0 2px var(--peach), 0 0 22px 4px rgba(255, 154, 98, 0.85); }
.lbl3d.st-choose, .pod.st-choose .pod-desk { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 18px 2px rgba(255, 255, 255, 0.55); animation: choose-pulse 1.4s ease-in-out infinite; }
.lbl3d.st-ready, .pod.st-ready .pod-desk { box-shadow: 0 0 0 2px var(--good), 0 0 14px 2px rgba(120, 255, 160, 0.6); }
.lbl3d.st-off { filter: grayscale(1); }
@keyframes choose-pulse { 50% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 0 6px 1px rgba(255, 255, 255, 0.3); } }

/* вопрос с картинкой */
.q-img-row { display: flex; gap: clamp(12px, 2vw, 28px); align-items: center; justify-content: center; min-height: 0; }
.q-img { display: block; height: clamp(110px, 30vh, 380px); max-width: min(60%, 620px); object-fit: contain; border-radius: 16px; background: rgba(255, 255, 255, 0.06); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); animation: img-in 0.5s cubic-bezier(.2,1.4,.4,1) both; }
.q-img-side { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; flex: 1; min-width: 0; }
.q-img.thumb { height: clamp(60px, 12vh, 140px); max-width: 40%; margin: 0 auto 6px; animation: none; }
@keyframes img-in { from { transform: scale(0.7) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) { .q-img-row { flex-direction: column; } .q-img { max-width: 100%; height: clamp(110px, 26vh, 260px); } }

/* продолжи ряд */
.series { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 4px; margin: clamp(6px, 1.4vh, 16px) 0; }
.sq { font-family: var(--display); font-weight: 900; font-size: clamp(20px, min(3vw, 5vh), 46px); min-width: 1.6em; padding: 0.12em 0.4em; border-radius: 12px; background: rgba(255, 255, 255, 0.1); color: var(--ink); text-align: center; }
.sq.new { animation: sq-pop 0.5s cubic-bezier(.2,1.8,.4,1) both; background: rgba(255, 226, 194, 0.25); color: var(--gold); }
.sq.hole { color: rgba(255, 255, 255, 0.35); border: 2px dashed rgba(255, 255, 255, 0.25); background: transparent; }
.sq.goal { color: #2a1650; background: var(--peach); box-shadow: 0 0 18px #ff9a62; }
.sq.sq-ans { color: #10331a; background: var(--good); box-shadow: 0 0 18px rgba(120, 255, 160, 0.7); }
.sq-sep { font-family: var(--display); font-weight: 700; font-size: clamp(18px, 2.4vw, 34px); color: var(--muted); }
@keyframes sq-pop { from { transform: scale(0.2) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* кот в мешке */
.cat-q .cat-art { animation: cat-wiggle 1.2s ease-in-out infinite; }
.cat-q .cat-art svg { width: clamp(70px, 14vh, 130px); height: auto; }
@keyframes cat-wiggle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.give { display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; }
.give-title { font-family: var(--display); font-weight: 700; font-size: 18px; }
.give-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.give-btn { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.dock .give { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.r-series { font-family: var(--display); font-weight: 900; font-size: 26px; color: var(--gold); margin-top: 6px; letter-spacing: 0.02em; }
@media (max-height: 720px) { .q-img { height: clamp(90px, 22vh, 240px); } .sq { font-size: clamp(18px, 4.4vh, 34px); } }
.results.compact { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.results.compact li { display: inline-flex; gap: 8px; align-items: baseline; padding: 5px 12px; grid-template-columns: none; }
