/* ==========================================================================
   КВИЗ-ПАТИ — экран ведущего (ТВ / проектор). Слой поверх base.css.
   Только этот файл: host.html + host.css + host.js. Внешних ресурсов нет.
   Макет 16:9, читаемость с дивана, работает 1024×600 … 1920×1080.
   ========================================================================== */

/* ---------- сцена ---------- */
.host-body {
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-0);
}

.host {
  position: relative;
  height: 100dvh;
  min-height: 100dvh;
  padding: clamp(10px, 2.4vmin, 34px) clamp(12px, 2.8vw, 46px);
  gap: clamp(6px, 1.2vh, 14px);
  overflow: hidden;
  user-select: none;
}

.host__blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.host__blobs .blob {
  animation-duration: 22s;
}

/* ---------- HUD ---------- */
.hud {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vmin, 26px);
  min-height: clamp(44px, 7.2vh, 92px);
  padding: clamp(5px, 1vmin, 14px) clamp(10px, 2vmin, 28px);
  border-radius: var(--r-pill);
  background: rgba(13, 8, 32, 0.62);
  border: 1px solid var(--stroke);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hud__brand {
  display: flex;
  align-items: center;
  gap: 0.45em;
  flex: 0 0 auto;
}

.hud__logo {
  font-size: clamp(18px, 3.4vmin, 42px);
  line-height: 1;
  filter: drop-shadow(0 0 14px rgba(255, 62, 138, 0.55));
}

.hud__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(13px, 2.3vmin, 28px);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud__name-accent {
  background: linear-gradient(100deg, var(--pink), var(--amber) 55%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hud__ctx {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1vmin, 14px);
  flex: 1 1 auto;
  min-width: 0;
}

.hud__chip {
  background: rgba(255, 255, 255, 0.07);
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hud__chip--question {
  color: var(--cyan);
  border-color: rgba(53, 224, 255, 0.32);
  background: rgba(53, 224, 255, 0.1);
}

.hud__timer {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vmin, 16px);
  flex: 0 1 clamp(150px, 24vw, 400px);
  min-width: 110px;
}

.hud__timer-track {
  position: relative;
  flex: 1;
  height: clamp(7px, 1.3vh, 14px);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}

.hud__timer-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  transform-origin: left center;
  will-change: width;
}

.hud__timer-num {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(15px, 2.4vmin, 30px);
  min-width: 2.1em;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hud__timer--urgent .hud__timer-bar {
  background: linear-gradient(90deg, var(--amber), var(--red));
}

.hud__timer--urgent .hud__timer-num {
  color: var(--red);
  animation: tick-pulse 0.9s ease-in-out infinite;
}

.hud__right {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vmin, 18px);
  flex: 0 0 auto;
}

.hud__room {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1vmin, 14px);
  padding: clamp(3px, 0.7vmin, 9px) clamp(9px, 1.6vmin, 22px);
  border-radius: var(--r-pill);
  background: rgba(53, 224, 255, 0.09);
  border: 1px solid rgba(53, 224, 255, 0.28);
}

.hud__room-label {
  font-size: clamp(9px, 1.2vmin, 14px);
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.hud__room-code {
  font-weight: 900;
  font-size: clamp(17px, 2.8vmin, 34px);
  letter-spacing: 0.14em;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(53, 224, 255, 0.5);
  line-height: 1;
}

.hud__sound {
  display: grid;
  place-items: center;
  width: clamp(36px, 5.8vh, 62px);
  height: clamp(36px, 5.8vh, 62px);
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  font-size: clamp(15px, 2.3vmin, 28px);
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.hud__sound:hover {
  background: var(--surface-3);
  transform: scale(1.05);
}

.hud__sound--muted {
  opacity: 0.55;
}

/* ---------- сцена/экраны ---------- */
.stage {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
}

.screen--active {
  display: flex;
  animation: screen-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(1.4vh) scale(0.988);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.screen--lobby {
  background: radial-gradient(ellipse 60% 55% at 30% 45%, rgba(255, 62, 138, 0.12), transparent 70%);
}

.screen--intro {
  background: radial-gradient(ellipse 72% 62% at 50% 40%, rgba(255, 197, 62, 0.08), transparent 72%);
}

.screen--question {
  background: radial-gradient(ellipse 74% 62% at 50% 46%, rgba(53, 224, 255, 0.07), transparent 72%);
}

.screen--judge {
  background: radial-gradient(ellipse 74% 62% at 50% 42%, rgba(255, 197, 62, 0.08), transparent 72%);
}

.screen--reveal {
  background: radial-gradient(ellipse 70% 62% at 32% 42%, rgba(62, 242, 155, 0.09), transparent 72%);
}

.screen--leaderboard {
  background: radial-gradient(ellipse 76% 62% at 50% 40%, rgba(255, 197, 62, 0.07), transparent 72%);
}

.screen--wager {
  background: radial-gradient(ellipse 72% 62% at 50% 40%, rgba(255, 62, 138, 0.11), transparent 72%);
}

.screen--final {
  background: radial-gradient(ellipse 70% 60% at 42% 30%, rgba(255, 197, 62, 0.14), transparent 70%);
}

/* ---------- общий лейбл ---------- */
.label {
  font-weight: 800;
  font-size: clamp(10px, 1.45vmin, 17px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.label--pink { color: var(--pink); }
.label--cyan { color: var(--cyan); }
.label--green { color: var(--green); }
.label--amber { color: var(--amber); }

/* ==========================================================================
   ЛОББИ
   ========================================================================== */
.lobby {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(8px, 1.8vmin, 26px);
  height: 100%;
  min-height: 0;
}

.lobby__join {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.6vh, 20px);
  min-height: 0;
  padding: clamp(10px, 2vmin, 30px);
  border-color: rgba(255, 62, 138, 0.28);
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 62, 138, 0.14), transparent 70%),
    rgba(255, 255, 255, 0.055);
}

.lobby__code {
  box-shadow: var(--glow-pink), inset 0 0 40px rgba(255, 62, 138, 0.12);
}

.lobby__code .code-box__char {
  font-size: clamp(38px, 11vmin, 128px);
  letter-spacing: 0.02em;
  animation: pop-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.lobby__qrrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.4vmin, 34px);
  min-width: 0;
  max-width: 100%;
}

.lobby__qr {
  position: relative;
  flex: 0 0 auto;
  width: clamp(92px, 21vh, 240px);
  aspect-ratio: 1;
  padding: clamp(5px, 0.9vmin, 12px);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 0 46px rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.lobby__qrimg {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.lobby__qr--ready .lobby__qrimg { display: block; }
.lobby__qr--ready .lobby__qrfallback { display: none; }

.lobby__qrfallback {
  position: absolute;
  inset: clamp(5px, 0.9vmin, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background:
    repeating-conic-gradient(#231a4a 0% 25%, #ffffff 0% 50%) 0 0 / 14px 14px;
  color: #231a4a;
}

.lobby__qrfallback span {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(12px, 2vmin, 26px);
  letter-spacing: 0.1em;
}

.lobby__how {
  display: flex;
  flex-direction: column;
  gap: clamp(1px, 0.5vh, 7px);
  min-width: 0;
}

.lobby__how-title {
  font-size: clamp(12px, 1.9vmin, 24px);
  font-weight: 600;
  color: var(--muted);
}

.lobby__how-url {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(19px, 3.3vmin, 46px);
  line-height: 1.05;
  color: var(--cyan);
  text-shadow: 0 0 22px rgba(53, 224, 255, 0.35);
  white-space: nowrap;
}

.lobby__how-code {
  font-weight: 900;
  font-size: clamp(26px, 4.6vmin, 66px);
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--lime);
  text-shadow: 0 0 22px rgba(182, 255, 62, 0.35);
}

.lobby__how-hint {
  font-size: clamp(10px, 1.5vmin, 17px);
  max-width: 26ch;
}

.lobby__playerlink {
  padding: 0.25em 0.7em;
  border-radius: var(--r-pill);
  color: var(--dim);
  font-size: clamp(10px, 1.4vmin, 16px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.lobby__playerlink:hover {
  color: var(--cyan);
  background: rgba(53, 224, 255, 0.08);
}

/* игроки в лобби */
.lobby__players {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.4vh, 16px);
  min-height: 0;
  padding: clamp(10px, 2vmin, 26px);
}

.lobby__players-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
}

.lobby__count {
  font-size: clamp(12px, 1.8vmin, 22px);
}

.lobby__count b {
  color: var(--amber);
  font-size: 1.2em;
}

.lobby__grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(196px, 100%), 1fr));
  grid-auto-rows: clamp(46px, 9.4vh, 100px);
  align-content: center;
  gap: clamp(6px, 1.2vmin, 16px);
  overflow: hidden;
}

.lobby__empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vh, 12px);
  text-align: center;
  min-height: 0;
}

.lobby__empty-emoji {
  font-size: clamp(38px, 9vh, 108px);
  line-height: 1;
  filter: drop-shadow(0 0 26px rgba(53, 224, 255, 0.35));
  animation: pulse-soft 2.4s ease-in-out infinite;
}

.lobby__empty-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(20px, 3.2vmin, 44px);
}

.lobby__empty-text {
  color: var(--muted);
  font-size: clamp(12px, 1.8vmin, 22px);
  max-width: 34ch;
}

/* карточка игрока (создаёт JS) */
.pcard {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vmin, 16px);
  min-width: 0;
  min-height: 0;
  padding: clamp(4px, 0.9vh, 12px) clamp(7px, 1.3vmin, 16px);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--stroke);
  overflow: hidden;
  animation: pop-in 0.38s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.pcard::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: clamp(3px, 0.5vmin, 6px);
  background: var(--pcolor, var(--pink));
  opacity: 0.9;
}

.pcard--new {
  box-shadow: 0 0 0 2px var(--pcolor, var(--pink)), 0 0 24px rgba(255, 255, 255, 0.12);
}

.pcard--offline {
  opacity: 0.45;
  filter: grayscale(0.7);
}

.pcard__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(28px, 6.2vh, 62px);
  height: clamp(28px, 6.2vh, 62px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 2px var(--pcolor, var(--pink)), 0 0 16px var(--pcolor, var(--pink));
  font-size: clamp(15px, 3.2vh, 34px);
  line-height: 1;
}

.pcard__name {
  font-weight: 800;
  font-size: clamp(13px, 2vmin, 28px);
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pcard__status {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: clamp(10px, 1.4vmin, 16px);
  color: var(--green);
}

/* ==========================================================================
   ЗАСТАВКА РАУНДА
   ========================================================================== */
.intro {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.2vh, 16px);
  text-align: center;
  min-height: 0;
  padding: clamp(8px, 2vh, 28px);
  overflow: hidden;
}

.intro__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78vmin, 900px);
  height: min(78vmin, 900px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 62, 138, 0.28), transparent 58%),
    radial-gradient(circle at 62% 42%, rgba(53, 224, 255, 0.2), transparent 55%);
  filter: blur(40px);
  opacity: 0.85;
  pointer-events: none;
  animation: intro-glow 6s ease-in-out infinite alternate;
}

@keyframes intro-glow {
  from { transform: translate(-50%, -50%) scale(0.94); opacity: 0.65; }
  to { transform: translate(-50%, -50%) scale(1.08); opacity: 0.95; }
}

.intro__kicker {
  position: relative;
  font-weight: 800;
  font-size: clamp(13px, 2.2vmin, 30px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--amber);
}

.intro__emoji {
  position: relative;
  font-size: clamp(44px, 11vh, 130px);
  line-height: 1;
  filter: drop-shadow(0 0 34px rgba(255, 197, 62, 0.4));
  animation: intro-emoji 2.6s ease-in-out infinite;
}

@keyframes intro-emoji {
  0%, 100% { transform: translateY(0) rotate(-3deg) scale(1); }
  50% { transform: translateY(-1.4vh) rotate(3deg) scale(1.06); }
}

.intro__title {
  position: relative;
  font-size: clamp(44px, min(13vmin, 18vh), 190px);
  line-height: 0.92;
  background: linear-gradient(100deg, #fff, var(--pink) 45%, var(--amber) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 40px rgba(255, 62, 138, 0.35));
  max-width: 96%;
}

.intro__tagline {
  position: relative;
  font-weight: 700;
  font-size: clamp(16px, 2.8vmin, 42px);
  color: var(--text);
  opacity: 0.92;
  max-width: 40ch;
}

.intro__meta {
  position: relative;
  font-weight: 800;
  font-size: clamp(11px, 1.7vmin, 22px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.intro__pips {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.1vmin, 14px);
  margin-top: clamp(2px, 0.6vh, 8px);
}

.pip {
  width: clamp(9px, 1.8vmin, 18px);
  height: clamp(9px, 1.8vmin, 18px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.pip--done {
  background: var(--pink);
  box-shadow: 0 0 14px rgba(255, 62, 138, 0.6);
}

.pip--current {
  background: var(--amber);
  transform: scale(1.35);
  box-shadow: 0 0 18px rgba(255, 197, 62, 0.75);
}

.intro__progress {
  position: relative;
  width: min(72%, 1000px);
  height: clamp(8px, 1.6vh, 20px);
  margin-top: clamp(2px, 0.8vh, 10px);
}

.intro__next {
  position: relative;
  font-size: clamp(11px, 1.6vmin, 20px);
}

.intro__next b {
  color: var(--amber);
  font-family: var(--font-mono);
}

/* ==========================================================================
   ВОПРОС
   ========================================================================== */
.question {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 1vh, 14px);
  padding: clamp(6px, 1.8vh, 26px) clamp(8px, 2vw, 48px);
  min-height: 0;
  text-align: center;
}

.question__top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.4vmin, 18px);
  flex: 0 0 auto;
}

.question__badge {
  letter-spacing: 0.14em;
}

.question__final {
  letter-spacing: 0.16em;
  animation: pulse-soft 1.4s ease-in-out infinite;
}

.question__unit {
  font-weight: 800;
  font-size: clamp(11px, 1.7vmin, 22px);
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.question__text {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-wrap: balance;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, min(5vw, 7.6vh), 92px);
  line-height: 1.06;
  letter-spacing: 0.005em;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.4);
}

.question__text--long {
  font-size: clamp(22px, min(3.9vw, 6.2vh), 72px);
}

.question__hint {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  color: var(--muted);
  font-size: clamp(11px, 1.7vmin, 22px);
  font-weight: 600;
}

.question__hint-emoji {
  animation: pulse-soft 2s ease-in-out infinite;
}

.question__timer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vmin, 34px);
  width: 100%;
}

.question__seconds {
  font-weight: 900;
  font-size: clamp(38px, min(9vmin, 13vh), 150px);
  line-height: 0.9;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  min-width: 1.6em;
  text-shadow: 0 0 30px rgba(255, 197, 62, 0.35);
}

.question__seconds--urgent {
  color: var(--red);
  text-shadow: 0 0 34px rgba(255, 84, 112, 0.55);
  animation: tick-pulse 0.9s ease-in-out infinite;
}

.question__timer-right {
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.7vh, 9px);
  flex: 1 1 auto;
  max-width: min(78%, 1400px);
  text-align: left;
}

.question__progress {
  height: clamp(9px, 1.8vh, 22px);
}

.question__round {
  font-weight: 700;
  font-size: clamp(10px, 1.5vmin, 19px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.question__answered {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vmin, 26px);
}

.answered__avatars {
  display: flex;
  align-items: center;
  gap: clamp(3px, 0.7vmin, 9px);
}

.answered__count {
  font-weight: 800;
  font-size: clamp(15px, 2.4vmin, 32px);
  color: var(--text);
}

.answered__count b {
  color: var(--green);
  font-family: var(--font-mono);
}

.answered__count > b:last-of-type {
  color: var(--text);
}

.answered__label {
  color: var(--muted);
  font-weight: 600;
}

.apip {
  display: grid;
  place-items: center;
  width: clamp(24px, 5vh, 52px);
  height: clamp(24px, 5vh, 52px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  font-size: clamp(12px, 2.6vh, 28px);
  line-height: 1;
  opacity: 0.35;
  transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease,
    background 0.2s ease;
}

.apip--on {
  opacity: 1;
  background: rgba(62, 242, 155, 0.14);
  border-color: rgba(62, 242, 155, 0.55);
  box-shadow: 0 0 16px rgba(62, 242, 155, 0.3);
  transform: scale(1.04);
}

.apip--check {
  color: var(--green);
  font-weight: 900;
  font-size: 55%;
}

.question__dots {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.9vmin, 11px);
  padding-bottom: clamp(0px, 0.4vh, 6px);
}

.qdot {
  width: clamp(6px, 1.15vh, 12px);
  height: clamp(6px, 1.15vh, 12px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  transition: transform 0.2s ease, background 0.2s ease;
}

.qdot--done {
  background: var(--pink);
}

.qdot--current {
  background: var(--amber);
  transform: scale(1.4);
  box-shadow: 0 0 12px rgba(255, 197, 62, 0.7);
}

/* ==========================================================================
   СУДЕЙСТВО ФИНАЛА (judge)
   ========================================================================== */
.judge {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.1vh, 14px);
  padding: clamp(4px, 1.4vh, 18px) clamp(6px, 2vw, 40px);
  min-height: 0;
}

.judge__head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(8px, 1.8vmin, 26px);
  align-items: stretch;
  min-height: 0;
}

.judge__head-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2px, 0.7vh, 9px);
  min-width: 0;
}

.judge__question {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(15px, min(2.5vw, 3.6vh), 38px);
  line-height: 1.12;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.judge__ref {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2px, 0.6vh, 8px);
  min-width: 0;
  overflow: hidden;
  border-color: rgba(62, 242, 155, 0.34);
  background:
    radial-gradient(ellipse 100% 100% at 0% 0%, rgba(62, 242, 155, 0.13), transparent 62%),
    rgba(255, 255, 255, 0.06);
}

.judge__ref-answer {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(17px, min(2.9vw, 4.2vh), 46px);
  line-height: 1.06;
  text-wrap: balance;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  background: linear-gradient(100deg, #eafff2, #3ef29b 60%, #35e0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.judge__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 2vmin, 24px);
  min-width: 0;
}

.judge__progress {
  font-weight: 800;
  font-size: clamp(11px, 1.7vmin, 20px);
  color: var(--muted);
  white-space: nowrap;
}

.judge__progress b {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 1.1em;
}

.judge__progress b:last-of-type {
  color: var(--text);
}

.judge__hint {
  font-size: clamp(9px, 1.3vmin, 15px);
  line-height: 1.25;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.judge__grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
  align-content: center;
  gap: clamp(5px, 1.1vmin, 14px);
  overflow: hidden;
}

.judge__grid--n1 {
  grid-template-columns: minmax(0, 1fr);
}

.jcard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(6px, 1.3vmin, 16px);
  min-height: clamp(56px, 8.6vh, 104px);
  padding: clamp(4px, 1vh, 12px) clamp(8px, 1.6vmin, 20px);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--stroke);
  overflow: hidden;
  animation: pop-in 0.3s ease both;
}

.jcard--correct {
  background: rgba(62, 242, 155, 0.1);
  border-color: rgba(62, 242, 155, 0.55);
}

.jcard--wrong {
  background: rgba(255, 84, 112, 0.09);
  border-color: rgba(255, 84, 112, 0.5);
}

.jcard--undecided {
  border-color: rgba(255, 197, 62, 0.34);
}

.jcard__avatar {
  font-size: clamp(16px, 3.2vh, 36px);
  line-height: 1;
}

.jcard__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  line-height: 1.12;
}

.jcard__name {
  font-weight: 800;
  font-size: clamp(11px, 1.7vmin, 22px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jcard__answer {
  font-size: clamp(11px, 1.75vmin, 23px);
  color: var(--text);
  opacity: 0.94;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jcard--empty .jcard__answer {
  color: var(--dim);
  font-style: italic;
}

.jcard__wager {
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.35vmin, 16px);
  font-weight: 800;
  color: var(--amber);
  white-space: nowrap;
}

.jcard__actions {
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.9vmin, 10px);
}

.judge-btn {
  display: grid;
  place-items: center;
  width: clamp(30px, 5.4vh, 58px);
  height: clamp(30px, 5.4vh, 58px);
  border-radius: 50%;
  border: 2px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.07);
  font-size: clamp(13px, 2.5vh, 30px);
  line-height: 1;
  opacity: 0.6;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}

.judge-btn:hover:not(:disabled) {
  opacity: 1;
  transform: translateY(-1px) scale(1.04);
}

.judge-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.judge-btn:disabled {
  cursor: progress;
  opacity: 0.35;
}

.judge-btn--yes.judge-btn--active {
  opacity: 1;
  background: rgba(62, 242, 155, 0.22);
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(62, 242, 155, 0.45);
}

.judge-btn--no.judge-btn--active {
  opacity: 1;
  background: rgba(255, 84, 112, 0.2);
  border-color: var(--red);
  box-shadow: 0 0 18px rgba(255, 84, 112, 0.45);
}

.judge.is-busy .judge-btn {
  opacity: 0.32;
  pointer-events: none;
}

/* ==========================================================================
   РЕЗУЛЬТАТ ВОПРОСА (reveal)
   ========================================================================== */
.reveal {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 13px);
  min-height: 0;
}

.reveal__main {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr);
  gap: clamp(8px, 1.8vmin, 26px);
  flex: 1 1 55%;
  min-height: 0;
}

.reveal__answer-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3px, 0.9vh, 12px);
  min-height: 0;
  overflow: hidden;
  position: relative;
  border-color: rgba(62, 242, 155, 0.34);
  background:
    radial-gradient(ellipse 100% 100% at 0% 0%, rgba(62, 242, 155, 0.14), transparent 62%),
    rgba(255, 255, 255, 0.06);
}

.reveal__answer {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, min(5.6vw, 9.4vh), 104px);
  line-height: 1.02;
  text-wrap: balance;
  background: linear-gradient(100deg, #eafff2, #3ef29b 55%, #35e0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px rgba(62, 242, 155, 0.28));
}

.reveal__answer--long {
  font-size: clamp(24px, min(4.2vw, 7vh), 76px);
}

.reveal__answer-sub {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(14px, 2.3vmin, 34px);
  color: var(--text);
  opacity: 0.88;
}

.reveal__explain {
  font-size: clamp(12px, 1.9vmin, 25px);
  line-height: 1.35;
  color: var(--muted);
  max-width: 70ch;
}

.reveal__source {
  font-size: clamp(9px, 1.3vmin, 15px);
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.reveal__source a {
  color: var(--cyan);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.reveal__dist-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(4px, 1vh, 12px);
  min-height: 0;
  overflow: hidden;
}

.reveal__dist {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(4px, 1vh, 12px);
  min-height: 0;
}

.dist-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(5px, 1.1vmin, 14px);
  min-width: 0;
}

.dist-row__label {
  font-weight: 700;
  font-size: clamp(11px, 1.7vmin, 23px);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dist-row__track {
  height: clamp(13px, 2.3vh, 30px);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.dist-row__bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(53, 224, 255, 0.85), rgba(255, 62, 138, 0.9));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.dist-row__count {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(12px, 1.9vmin, 25px);
  min-width: 2.2em;
  text-align: right;
  color: var(--text);
}

.dist-row--correct .dist-row__label {
  color: var(--green);
}

.dist-row--correct .dist-row__bar {
  background: linear-gradient(90deg, rgba(62, 242, 155, 0.55), var(--green));
  box-shadow: 0 0 18px rgba(62, 242, 155, 0.4);
}

.dist-row--correct .dist-row__count {
  color: var(--green);
}

.dist-row--muted .dist-row__bar {
  background: rgba(255, 255, 255, 0.22);
}

.dist-note {
  color: var(--muted);
  font-size: clamp(11px, 1.6vmin, 20px);
  line-height: 1.35;
}

.dist-note b {
  color: var(--green);
}

.reveal__results-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reveal__next {
  font-size: clamp(10px, 1.5vmin, 19px);
  font-weight: 600;
}

.reveal__next b {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 1.15em;
}

.reveal__results {
  flex: 0 1 auto;
  max-height: 46%;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: clamp(3px, 0.7vh, 9px);
  overflow: hidden;
}

.result-row {
  flex: 1 1 calc(50% - 9px);
  min-height: 48px;
  max-height: clamp(48px, 9vh, 92px);
  display: grid;
  grid-template-columns: minmax(0, 1.55em) minmax(0, 2.1em) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(4px, 0.9vmin, 12px);
  min-height: 0;
  padding: clamp(2px, 0.4vh, 8px) clamp(6px, 1.2vmin, 16px);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  animation: pop-in 0.3s ease both;
}

.result-row--correct {
  background: rgba(62, 242, 155, 0.1);
  border-color: rgba(62, 242, 155, 0.28);
}

.result-row--wrong {
  opacity: 0.72;
}

.result-row__mark {
  font-size: clamp(12px, 2.1vmin, 26px);
  line-height: 1;
  text-align: center;
}

.result-row__avatar {
  font-size: clamp(14px, 2.7vh, 30px);
  line-height: 1;
  text-align: center;
}

.result-row__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
}

.result-row__name {
  font-weight: 800;
  font-size: clamp(11px, 1.7vmin, 22px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row__answer {
  font-size: clamp(9px, 1.35vmin, 17px);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row__delta {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(11px, 1.8vmin, 24px);
  color: var(--green);
  white-space: nowrap;
}

.result-row__delta--zero {
  color: var(--dim);
}

.result-row__delta--minus {
  color: var(--red);
}

.result-row__wager {
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.3vmin, 16px);
  font-weight: 800;
  color: var(--amber);
  white-space: nowrap;
}

/* ==========================================================================
   ТАБЛИЦА РАУНДА
   ========================================================================== */
.lb {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1.2vh, 16px);
  padding: clamp(4px, 1.4vh, 18px) clamp(6px, 2vw, 40px);
  min-height: 0;
}

.lb__head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.lb__title {
  line-height: 0.96;
}

.lb__sub {
  margin-top: clamp(1px, 0.4vh, 6px);
  font-weight: 700;
  font-size: clamp(10px, 1.5vmin, 19px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lb__next {
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  font-size: clamp(11px, 1.6vmin, 20px);
  white-space: nowrap;
}

.lb__next b {
  font-family: var(--font-mono);
  font-size: clamp(20px, 3.2vmin, 42px);
  color: var(--amber);
  line-height: 1;
}

.lb__table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.7vh, 9px);
}

.lb__row,
.lb__item {
  --lb-cols: minmax(0, 0.26fr) minmax(0, 1fr) minmax(0, 0.3fr) minmax(0, 0.34fr);
  display: grid;
  grid-template-columns: var(--lb-cols);
  align-items: center;
  gap: clamp(5px, 1.2vmin, 18px);
  min-width: 0;
}

.lb__row--head {
  flex: 0 0 auto;
  padding: 0 clamp(8px, 1.6vmin, 24px);
}

.lb__row--head .lb__cell {
  font-weight: 800;
  font-size: clamp(9px, 1.3vmin, 16px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.lb__cell--rank,
.lb__cell--player {
  text-align: left;
}

.lb__cell--delta,
.lb__cell--score {
  text-align: right;
}

.lb__list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3px, 0.6vh, 8px);
  overflow: hidden;
}

.lb__item {
  flex: 0 1 auto;
  min-height: clamp(40px, 7.4vh, 96px);
  padding: clamp(2px, 0.5vh, 8px) clamp(8px, 1.6vmin, 24px);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--stroke);
  animation: pop-in 0.32s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.lb__item--place1 {
  background: linear-gradient(90deg, rgba(255, 197, 62, 0.24), rgba(255, 197, 62, 0.04));
  border-color: rgba(255, 197, 62, 0.5);
  box-shadow: 0 0 26px rgba(255, 197, 62, 0.16);
}

.lb__item--place2 {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 255, 255, 0.24);
}

.lb__item--place3 {
  background: linear-gradient(90deg, rgba(255, 137, 102, 0.16), rgba(255, 137, 102, 0.03));
  border-color: rgba(255, 137, 102, 0.3);
}

.lb__item--star {
  box-shadow: inset 0 0 0 1px rgba(182, 255, 62, 0.35), 0 0 24px rgba(182, 255, 62, 0.14);
}

.lb__rank {
  display: flex;
  align-items: center;
  gap: clamp(2px, 0.5vmin, 8px);
  min-width: 0;
}

.lb__rank-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(15px, 2.7vh, 38px);
  line-height: 1;
  color: var(--text);
}

.lb__item--place1 .lb__rank-num { color: var(--amber); }
.lb__item--place2 .lb__rank-num { color: #e6e1ff; }
.lb__item--place3 .lb__rank-num { color: #ffb28a; }

.lb__move {
  font-size: clamp(9px, 1.4vmin, 17px);
  font-weight: 900;
  line-height: 1;
}

.lb__move--up { color: var(--green); }
.lb__move--down { color: var(--red); }
.lb__move--same { color: var(--dim); }

.lb__player {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.1vmin, 14px);
  min-width: 0;
}

.lb__avatar {
  flex: 0 0 auto;
  font-size: clamp(15px, 2.9vh, 36px);
  line-height: 1;
}

.lb__pname {
  font-weight: 800;
  font-size: clamp(12px, 1.9vmin, 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.lb__crown {
  flex: 0 0 auto;
  font-size: clamp(11px, 1.8vmin, 24px);
}

.lb__delta {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(12px, 1.9vmin, 28px);
  text-align: right;
  color: var(--green);
  white-space: nowrap;
}

.lb__delta--zero { color: var(--dim); }

.lb__score {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(14px, 2.3vmin, 34px);
  text-align: right;
  white-space: nowrap;
  color: var(--text);
}

.lb__item--place1 .lb__score { color: var(--amber); }

/* ==========================================================================
   СТАВКИ (финал)
   ========================================================================== */
.wager {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(5px, 1.3vh, 18px);
  padding: clamp(4px, 1.4vh, 18px) clamp(6px, 2vw, 40px);
  text-align: center;
  min-height: 0;
}

.wager__head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, 0.6vh, 8px);
}

.wager__kicker {
  font-weight: 800;
  font-size: clamp(11px, 1.7vmin, 22px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--amber);
}

.wager__title {
  font-size: clamp(30px, min(6.4vmin, 9vh), 104px);
  line-height: 0.98;
}

.wager__sub {
  color: var(--muted);
  font-size: clamp(11px, 1.8vmin, 23px);
  max-width: 58ch;
}

.wager__mid {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.4vmin, 34px);
  width: min(92%, 1200px);
}

.wager__bigtimer {
  font-weight: 900;
  font-size: clamp(44px, min(9.5vmin, 14vh), 165px);
  line-height: 0.85;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(255, 197, 62, 0.4);
}

.wager__bigtimer--urgent {
  color: var(--red);
  text-shadow: 0 0 40px rgba(255, 84, 112, 0.5);
  animation: tick-pulse 0.9s ease-in-out infinite;
}

.wager__timer-right {
  flex: 1 1 auto;
  max-width: min(72%, 1100px);
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.7vh, 9px);
  text-align: left;
}

.wager__progress {
  height: clamp(9px, 1.8vh, 22px);
}

.wager__count {
  font-weight: 700;
  font-size: clamp(11px, 1.7vmin, 21px);
  color: var(--muted);
}

.wager__count b {
  color: var(--green);
}

.wager__grid {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-content: center;
  gap: clamp(6px, 1.4vmin, 18px);
  overflow: hidden;
}

.wcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 0.6vh, 8px);
  min-height: 0;
  padding: clamp(6px, 1.4vh, 16px);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  overflow: hidden;
  animation: pop-in 0.36s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.wcard--placed {
  background:
    radial-gradient(ellipse 90% 80% at 50% 0%, rgba(62, 242, 155, 0.16), transparent 70%),
    rgba(255, 255, 255, 0.07);
  border-color: rgba(62, 242, 155, 0.5);
  box-shadow: 0 0 24px rgba(62, 242, 155, 0.14);
}

.wcard--waiting {
  opacity: 0.62;
}

.wcard__avatar {
  font-size: clamp(26px, 6.4vh, 74px);
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.18));
}

.wcard__name {
  font-weight: 800;
  font-size: clamp(12px, 1.9vmin, 26px);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wcard__state {
  font-weight: 700;
  font-size: clamp(9px, 1.35vmin, 16px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  white-space: nowrap;
}

.wcard--waiting .wcard__state {
  color: var(--muted);
  animation: pulse-soft 1.8s ease-in-out infinite;
}

/* ==========================================================================
   ФИНАЛ (подиум)
   ========================================================================== */
.final {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: clamp(10px, 2.4vmin, 36px);
  min-height: 0;
  padding: clamp(2px, 0.8vh, 10px);
}

.final__left {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 12px);
  min-height: 0;
  min-width: 0;
}

.final__head {
  flex: 0 0 auto;
  text-align: center;
}

.final__kicker {
  font-weight: 800;
  font-size: clamp(10px, 1.5vmin, 20px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--amber);
}

.final__title {
  font-size: clamp(34px, min(7.4vmin, 11vh), 128px);
  line-height: 0.94;
  background: linear-gradient(100deg, #fff, var(--amber) 45%, var(--pink) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 40px rgba(255, 197, 62, 0.3));
}

.final__sub {
  margin-top: clamp(1px, 0.4vh, 6px);
  font-size: clamp(10px, 1.5vmin, 19px);
  font-weight: 600;
}

.final__podium {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: clamp(6px, 1.6vmin, 24px);
}

.final__podium--n2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.final__podium--n1 {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.final__podium--n1 .podium {
  width: min(52%, 420px);
}

.podium {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1px, 0.5vh, 7px);
  min-height: 0;
  min-width: 0;
  height: 100%;
  animation: podium-rise 0.6s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}

.podium--place2 { animation-delay: 0.12s; }
.podium--place3 { animation-delay: 0.24s; }

@keyframes podium-rise {
  from { opacity: 0; transform: translateY(5vh); }
  to { opacity: 1; transform: none; }
}

.podium__crown {
  font-size: clamp(16px, 3.2vh, 46px);
  line-height: 1;
  animation: crown-bob 2.2s ease-in-out infinite;
}

@keyframes crown-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-0.8vh) rotate(6deg); }
}

.podium__avatar {
  display: grid;
  place-items: center;
  width: clamp(54px, min(12.5vmin, 17vh), 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05) 65%);
  box-shadow: 0 0 0 3px var(--pcolor, var(--pink)), 0 0 40px var(--pcolor, var(--pink));
  font-size: clamp(34px, min(8vmin, 11vh), 112px);
  line-height: 1;
}

.podium--place1 .podium__avatar {
  width: clamp(64px, min(14.5vmin, 19.5vh), 196px);
  font-size: clamp(40px, min(9.2vmin, 12.5vh), 128px);
}

.podium__name {
  max-width: 100%;
  font-weight: 900;
  font-size: clamp(12px, 2.2vmin, 30px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium--place1 .podium__name {
  font-size: clamp(14px, 2.6vmin, 36px);
}

.podium__score {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(13px, 2.2vmin, 32px);
  color: var(--amber);
  line-height: 1.1;
}

.podium__block {
  width: 100%;
  display: grid;
  place-items: start center;
  padding-top: clamp(2px, 0.6vh, 10px);
  border-radius: var(--r-md) var(--r-md) 0 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 4vh, 64px);
  line-height: 1;
  color: rgba(10, 6, 24, 0.6);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.2);
}

.podium--place1 .podium__block {
  height: clamp(48px, 15vh, 190px);
  background: linear-gradient(180deg, #ffe28a, var(--amber) 65%, #d99a1c);
}

.podium--place2 .podium__block {
  height: clamp(32px, 9.6vh, 124px);
  background: linear-gradient(180deg, #efeaff, #b9b2e6 65%, #8d86b8);
}

.podium--place3 .podium__block {
  height: clamp(26px, 7.8vh, 100px);
  background: linear-gradient(180deg, #ffc59c, #ff8966 65%, #c75f39);
}

.final__right {
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1.1vh, 14px);
  min-height: 0;
  min-width: 0;
}

.final__standings {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3px, 0.6vh, 8px);
  overflow: hidden;
}

.frow {
  flex: 0 1 auto;
  min-height: clamp(34px, 6.4vh, 84px);
  display: grid;
  grid-template-columns: minmax(0, 1.8em) minmax(0, 1.7em) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(4px, 0.9vmin, 12px);
  min-height: 0;
  padding: clamp(1px, 0.35vh, 6px) clamp(6px, 1.2vmin, 16px);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--stroke);
  animation: pop-in 0.3s ease both;
}

.frow--winner {
  background: linear-gradient(90deg, rgba(255, 197, 62, 0.24), rgba(255, 197, 62, 0.04));
  border-color: rgba(255, 197, 62, 0.5);
}

.frow__rank {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(11px, 1.7vmin, 24px);
  color: var(--muted);
  text-align: center;
}

.frow--winner .frow__rank { color: var(--amber); }

.frow__avatar {
  font-size: clamp(13px, 2.5vh, 30px);
  line-height: 1;
  text-align: center;
}

.frow__name {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 800;
  font-size: clamp(11px, 1.7vmin, 24px);
  min-width: 0;
}

.frow__name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.frow__crown {
  font-size: 0.85em;
  flex: 0 0 auto;
}

.frow__score {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(11px, 1.8vmin, 26px);
  white-space: nowrap;
}

/* ==========================================================================
   НИЖНЯЯ ПАНЕЛЬ ДЕЙСТВИЙ
   ========================================================================== */
.actionbar {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vmin, 28px);
  min-height: clamp(46px, 8.4vh, 100px);
  padding: 0 clamp(2px, 0.8vw, 10px);
}

.actionbar__hint {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: clamp(10px, 1.5vmin, 18px);
  font-weight: 600;
  color: var(--dim);
  letter-spacing: 0.04em;
  min-width: 0;
}

.actionbar__hint kbd {
  display: inline-block;
  padding: 0.15em 0.5em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--stroke-strong);
  border-bottom-width: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.actionbar__btn {
  flex: 0 0 auto;
  min-width: clamp(220px, 26vw, 520px);
  min-height: clamp(50px, 8.4vh, 90px);
  font-size: clamp(17px, 2.6vmin, 36px);
  letter-spacing: 0.06em;
  box-shadow: 0 12px 44px rgba(255, 62, 138, 0.42);
}

.actionbar__btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.24) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: shimmer 2.8s linear infinite;
  pointer-events: none;
}

.actionbar__btn:disabled::after {
  animation: none;
  opacity: 0;
}

.actionbar__btn.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

/* ==========================================================================
   ЭМОДЗИ-РЕАКЦИИ / КОНФЕТТИ
   ========================================================================== */
.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
}

.fx-layer--confetti {
  z-index: 55;
}

.emoji-float {
  position: absolute;
  bottom: -8vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  will-change: transform, opacity;
  animation: host-emoji-float 3.4s ease-out forwards;
}

.emoji-float__glyph {
  font-size: clamp(26px, 5.2vh, 66px);
  line-height: 1;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.28));
}

.emoji-float__name {
  font-size: clamp(9px, 1.4vmin, 15px);
  font-weight: 700;
  color: var(--muted);
  background: rgba(8, 4, 20, 0.6);
  border-radius: var(--r-pill);
  padding: 0.1em 0.5em;
  white-space: nowrap;
}

@keyframes host-emoji-float {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.6) rotate(-8deg);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 0px), -108vh, 0) scale(1.25) rotate(var(--rot, 8deg));
  }
}

.confetti {
  position: absolute;
  top: -6vh;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform;
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(var(--drift, 0px), 120vh, 0) rotate(var(--spin, 720deg));
  }
}

/* ==========================================================================
   ТОСТ / ДЕМО-БЕЙДЖ
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe) + 84px);
  z-index: 90;
  max-width: min(82vw, 900px);
  padding: clamp(8px, 1.4vmin, 16px) clamp(16px, 2.6vmin, 34px);
  border-radius: var(--r-pill);
  background: rgba(20, 12, 40, 0.95);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow-1);
  font-weight: 700;
  font-size: clamp(12px, 1.7vmin, 20px);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.demo-badge {
  position: fixed;
  right: var(--safe);
  bottom: calc(var(--safe) + 6px);
  z-index: 91;
  padding: 0.4em 0.9em;
  border-radius: var(--r-pill);
  background: rgba(255, 197, 62, 0.12);
  border: 1px solid rgba(255, 197, 62, 0.45);
  color: var(--amber);
  font-weight: 800;
  font-size: clamp(9px, 1.3vmin, 15px);
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* ==========================================================================
   ОВЕРЛЕИ (загрузка / переподключение / фатал)
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--safe);
  background: rgba(6, 3, 16, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: screen-in 0.25s ease both;
}

.overlay--fatal {
  z-index: 85;
}

.overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(10px, 2vmin, 24px);
  max-width: min(90vw, 620px);
  padding: clamp(22px, 4.5vmin, 60px) clamp(26px, 5.5vmin, 76px);
  box-shadow: var(--shadow-2);
}

.overlay__title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(20px, 3.4vmin, 46px);
  line-height: 1;
}

.overlay__text {
  font-size: clamp(12px, 1.8vmin, 22px);
  line-height: 1.35;
}

.overlay__emoji {
  font-size: clamp(38px, 7vmin, 90px);
  line-height: 1;
}

.overlay__spinner {
  width: clamp(38px, 6vmin, 72px);
  height: clamp(38px, 6vmin, 72px);
  border-radius: 50%;
  border: clamp(3px, 0.6vmin, 6px) solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--pink);
  border-right-color: var(--cyan);
  animation: overlay-spin 0.9s linear infinite;
}

@keyframes overlay-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   АДАПТИВ / ВЫСОКИЕ ЭКРАНЫ
   ========================================================================== */
/* Совсем низкий экран (например, 1024×600 в браузере с панелями) — ужимаем HUD. */
@media (max-height: 640px) {
  .hud {
    min-height: 44px;
  }
  .actionbar__hint {
    display: none;
  }
  .actionbar {
    justify-content: flex-end;
  }
  .lobby__grid {
    grid-auto-rows: clamp(44px, 8.6vh, 84px);
  }
  .final__kicker,
  .wager__sub {
    display: none;
  }
}

/* Узкий/не-16:9 экран (проектор 4:3 и т.п.) — лобби и финал в одну колонку. */
@media (max-aspect-ratio: 5/4) {
  .lobby {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .final {
    grid-template-columns: minmax(0, 1fr);
  }
  .final__right {
    max-height: 40%;
  }
  .reveal__results {
    max-height: 40%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .host__blobs .blob,
  .intro__glow,
  .intro__emoji,
  .actionbar__btn::after {
    animation: none !important;
  }
}
