/* ============================================================
   Игровой экран (проектор)
   ============================================================ */

.screen-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2vh, 26px) clamp(18px, 3vw, 56px) clamp(8px, 1.2vh, 16px);
  overflow: hidden;
}

.screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex: none;
  padding-bottom: clamp(8px, 1.4vh, 18px);
}

.screen-brand {
  font-size: clamp(19px, 2.1vw, 36px);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
}

.players-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: clamp(12px, 0.95vw, 16px);
  color: var(--muted);
  white-space: nowrap;
}

.players-pill b {
  color: var(--text);
  font-size: 1.15em;
}

.players-pill .icon {
  width: 1.1em;
  height: 1.1em;
  color: var(--accent-2);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: clamp(36px, 2.6vw, 46px);
  height: clamp(36px, 2.6vw, 46px);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.icon-btn svg {
  width: 55%;
  height: 55%;
}

.screen-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.screen-view {
  display: none;
  flex: 1;
  min-height: 0;
}

.screen-view.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.35s ease both;
}

.eyebrow {
  display: block;
  font-size: clamp(10px, 0.8vw, 13px);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.kicker {
  font-size: clamp(11px, 0.9vw, 15px);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ---------- Игровое поле ---------- */

.grid-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(236px, 25vw, 400px);
  gap: clamp(16px, 2.2vw, 40px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 1.05vw, 18px);
  min-height: 0;
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: clamp(11px, 1.35vw, 22px);
  border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(9, 14, 26, 0.68), rgba(9, 14, 26, 0.54)),
    linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018) 58%, rgba(124, 92, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 30px rgba(0, 0, 0, 0.18);
  color: #e9edff;
  font-size: clamp(26px, 4.6vw, 86px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease,
    background 0.2s ease;
  user-select: none;
}

.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(124, 92, 255, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.cell span {
  position: relative;
  z-index: 1;
  display: block;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.cell:not(.completed):hover {
  transform: translateY(-4px) scale(1.025);
  border-color: rgba(124, 92, 255, 0.62);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.42), 0 0 46px rgba(124, 92, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.cell:not(.completed):hover::before {
  opacity: 1;
}

.cell.completed {
  cursor: default;
  color: #6d7897;
  border-color: rgba(255, 255, 255, 0.06);
  background: linear-gradient(150deg, rgba(10, 15, 28, 0.8), rgba(10, 15, 28, 0.7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cell.completed .cell-check {
  position: absolute;
  top: 9%;
  right: 9%;
  width: 1.15em;
  height: 1.15em;
  color: #5a6582;
  font-size: clamp(13px, 1.2vw, 22px);
}

.cell.completed span {
  opacity: 0.9;
}

.cell.disabled {
  cursor: default;
}

.cell.zooming {
  animation: cellZoom 0.46s cubic-bezier(0.5, 0, 0.7, 1) forwards;
  z-index: 6;
  pointer-events: none;
}

@keyframes cellZoom {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.09);
    border-color: rgba(160, 138, 255, 0.9);
    box-shadow: 0 0 90px rgba(124, 92, 255, 0.7), inset 0 0 60px rgba(124, 92, 255, 0.35);
    opacity: 1;
  }
  100% {
    transform: scale(2.2);
    border-radius: 40px;
    opacity: 0;
    filter: blur(7px);
  }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 45;
  pointer-events: none;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--zx, 50%) var(--zy, 50%), rgba(190, 178, 255, 0.95), rgba(124, 92, 255, 0.5) 22%, transparent 60%);
}

.zoom-overlay.active {
  animation: zoomFlash 0.5s ease-out forwards;
}

@keyframes zoomFlash {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  18% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: scale(2.4);
  }
}

/* ---------- Боковая панель ---------- */

.grid-aside {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.5vh, 18px);
  min-height: 0;
}

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.2vh, 15px);
  padding: clamp(14px, 1.7vw, 26px);
  border-radius: clamp(18px, 1.6vw, 28px);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  flex: none;
}

.qr-caption {
  text-align: center;
}

.qr-caption h3 {
  margin: 4px 0 0;
  font-size: clamp(15px, 1.25vw, 22px);
  letter-spacing: -0.01em;
}

.qr-frame {
  width: 100%;
  max-width: clamp(150px, 15vw, 250px);
  aspect-ratio: 1;
  padding: 9px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.join-link {
  width: 100%;
  text-align: center;
  font-size: clamp(11px, 0.92vw, 16px);
  font-weight: 700;
  color: #cdd6ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: clamp(11px, 0.8vw, 13.5px);
  font-weight: 600;
  transition: 0.18s ease;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.copy-btn svg {
  width: 15px;
  height: 15px;
}

.aside-players {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: clamp(13px, 1.4vw, 20px);
  border-radius: clamp(16px, 1.4vw, 24px);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.028);
  overflow: hidden;
}

.aside-title {
  font-size: clamp(11px, 0.85vw, 14px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  flex: none;
}

.aside-title b {
  color: var(--text);
}

.players-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent);
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 9px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: clamp(10px, 0.82vw, 14px);
  color: #dbe2f8;
  animation: popIn 0.3s ease both;
}

.player-chip .avatar {
  display: grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  border-radius: 50%;
  font-size: 0.78em;
  font-weight: 800;
  color: #0a1020;
  flex: none;
}

.player-chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-chip.more {
  color: var(--muted);
  padding: 4px 10px;
}

.setup-note {
  flex: none;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.025);
  display: none;
}

.setup-note h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.setup-note p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

body[data-phase="setup"] .qr-card {
  display: none;
}

body[data-phase="setup"] .aside-players {
  display: none;
}

body[data-phase="setup"] .setup-note {
  display: block;
}

body[data-phase="setup"] .cell {
  cursor: default;
  color: #48536f;
}

body[data-phase="setup"] .cell:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

/* ---------- Вопрос ---------- */

.question-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(20px, 3.4vw, 64px);
  align-items: stretch;
  animation: fadeUp 0.4s ease both;
}

.q-media {
  position: relative;
  min-height: 0;
  border-radius: clamp(18px, 2vw, 32px);
  border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 40%, rgba(124, 92, 255, 0.14), rgba(7, 11, 22, 0.6) 70%), #070b14;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.q-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: fadeIn 0.5s ease both;
}

.q-media .media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #4a5674;
  font-size: clamp(14px, 1.1vw, 18px);
  font-weight: 600;
}

.q-media .media-placeholder .big-q {
  font-size: clamp(60px, 9vw, 160px);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(140deg, rgba(124, 92, 255, 0.5), rgba(55, 208, 255, 0.25));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.q-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2.4vh, 32px);
  min-width: 0;
  padding: clamp(18px, 2vw, 34px);
  border-radius: clamp(18px, 1.8vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(160deg, rgba(8, 13, 25, 0.6), rgba(8, 13, 25, 0.32));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.q-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: clamp(11px, 1vw, 17px);
  font-weight: 800;
  letter-spacing: 0.17em;
  color: var(--accent-2);
  text-transform: uppercase;
}

.q-counter {
  color: var(--dim);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.q-text {
  margin: 0;
  font-size: clamp(25px, 3.15vw, 58px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.015em;
  max-height: 46vh;
  overflow-y: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  padding-right: 4px;
}

.timer-block {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.6vw, 26px);
}

.timer-ring {
  position: relative;
  width: clamp(82px, 8.2vw, 148px);
  height: clamp(82px, 8.2vw, 148px);
  flex: none;
}

.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring circle {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}

.ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.ring-fg {
  stroke: var(--accent-2);
  stroke-dasharray: 326.726;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 10px rgba(55, 208, 255, 0.55));
  transition: stroke 0.3s ease, filter 0.3s ease;
}

.timer-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(24px, 2.5vw, 46px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.timer-block.urgent .ring-fg {
  stroke: var(--false);
  filter: drop-shadow(0 0 12px rgba(255, 84, 112, 0.6));
}

.timer-block.urgent .timer-num {
  color: #ff9db0;
}

.timer-block.closed .ring-fg {
  stroke: rgba(255, 84, 112, 0.6);
  filter: none;
}

.timer-block.closed .timer-num {
  color: #ff8fa5;
  font-size: clamp(18px, 1.7vw, 30px);
}

.timer-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.timer-label {
  font-size: clamp(12px, 1vw, 17px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.voted-line {
  font-size: clamp(14px, 1.15vw, 20px);
  color: var(--muted);
}

.voted-line b {
  color: var(--text);
  font-size: 1.15em;
}

.vote-progress {
  height: clamp(8px, 0.8vw, 13px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.vote-progress i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c5cff, #37d0ff);
  box-shadow: 0 0 18px rgba(55, 208, 255, 0.5);
  transition: width 0.4s ease;
}

.waiting-admin {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 13px;
  border: 1px solid rgba(255, 206, 92, 0.3);
  background: rgba(255, 206, 92, 0.08);
  color: #ffe3a3;
  font-size: clamp(12px, 1vw, 16px);
  font-weight: 600;
  line-height: 1.4;
}

.waiting-admin.visible {
  display: flex;
}

.waiting-admin::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold);
  flex: none;
  animation: pulseDot 1.4s infinite;
}

/* ---------- Результаты ---------- */

.correct-callout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(13px, 1.5vw, 22px) clamp(16px, 1.8vw, 28px);
  border-radius: clamp(14px, 1.2vw, 20px);
  border: 1px solid rgba(47, 227, 164, 0.4);
  background: linear-gradient(120deg, rgba(47, 227, 164, 0.16), rgba(47, 227, 164, 0.04));
  box-shadow: 0 0 50px rgba(47, 227, 164, 0.1);
}

.correct-callout.is-false {
  border-color: rgba(255, 84, 112, 0.42);
  background: linear-gradient(120deg, rgba(255, 84, 112, 0.16), rgba(255, 84, 112, 0.04));
  box-shadow: 0 0 50px rgba(255, 84, 112, 0.1);
}

.cc-label {
  font-size: clamp(10px, 0.85vw, 14px);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.cc-value {
  font-size: clamp(34px, 3.6vw, 64px);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--true);
  text-shadow: 0 0 40px rgba(47, 227, 164, 0.35);
}

.correct-callout.is-false .cc-value {
  color: #ff7d94;
  text-shadow: 0 0 40px rgba(255, 84, 112, 0.35);
}

.vote-bars {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vh, 18px);
}

.vote-row {
  padding: clamp(11px, 1.2vw, 18px) clamp(13px, 1.5vw, 22px);
  border-radius: clamp(13px, 1.2vw, 20px);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: 0.25s ease;
}

.vote-row.winner {
  border-color: rgba(47, 227, 164, 0.38);
  background: rgba(47, 227, 164, 0.055);
  box-shadow: 0 0 40px rgba(47, 227, 164, 0.07);
}

.vote-row.winner.is-false {
  border-color: rgba(255, 84, 112, 0.4);
  background: rgba(255, 84, 112, 0.06);
  box-shadow: 0 0 40px rgba(255, 84, 112, 0.08);
}

.vr-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.vr-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(14px, 1.35vw, 24px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #d9e0f5;
}

.vote-row.is-true .vr-label {
  color: #77f3c8;
}

.vote-row.is-false .vr-label {
  color: #ff9caf;
}

.vr-label .win-badge {
  font-size: 0.52em;
  font-weight: 800;
  letter-spacing: 0.09em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(47, 227, 164, 0.16);
  color: var(--true);
  border: 1px solid rgba(47, 227, 164, 0.35);
}

.vote-row.is-false .win-badge {
  background: rgba(255, 84, 112, 0.16);
  color: #ff93a8;
  border-color: rgba(255, 84, 112, 0.35);
}

.vr-percent {
  font-size: clamp(24px, 2.5vw, 46px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.vr-track {
  height: clamp(9px, 1vw, 16px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

.vr-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.9s cubic-bezier(0.16, 0.8, 0.24, 1);
}

.vote-row.is-true .vr-track i {
  background: linear-gradient(90deg, #14a979, #45efb4);
  box-shadow: 0 0 20px rgba(47, 227, 164, 0.4);
}

.vote-row.is-false .vr-track i {
  background: linear-gradient(90deg, #d92c4f, #ff7890);
  box-shadow: 0 0 20px rgba(255, 84, 112, 0.4);
}

.vr-count {
  font-size: clamp(10px, 0.85vw, 14px);
  color: var(--dim);
  font-weight: 600;
}

.no-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(22px, 3vh, 40px);
  text-align: center;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.no-votes b {
  color: var(--text);
  font-size: clamp(16px, 1.4vw, 24px);
}

/* ---------- Итоговая таблица ---------- */

.finished-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: stretch;
  animation: fadeIn 0.4s ease both;
}

.podium-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  justify-content: center;
  gap: clamp(10px, 1.6vh, 22px);
}

.finish-title {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 22px);
  min-height: clamp(160px, 30vh, 380px);
  padding-top: 10px;
}

.podium-card {
  flex: 1;
  max-width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: podiumUp 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.podium-card .pc-place {
  font-size: clamp(11px, 0.9vw, 15px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.podium-card .pc-name {
  font-size: clamp(14px, 1.25vw, 22px);
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.podium-card .pc-score {
  font-size: clamp(13px, 1.05vw, 18px);
  color: var(--muted);
  font-weight: 700;
}

.podium-card .pc-pedestal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px 18px 6px 6px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  font-size: clamp(30px, 3.2vw, 56px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.22);
  position: relative;
  overflow: hidden;
}

.podium-card .pc-pedestal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.14), transparent 65%);
}

.podium-card .avatar-lg {
  width: clamp(38px, 3.6vw, 66px);
  height: clamp(38px, 3.6vw, 66px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #0a1020;
  font-size: clamp(16px, 1.6vw, 28px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  flex: none;
}

.podium-card.p1 .pc-pedestal {
  height: clamp(100px, 19vh, 240px);
  border-color: rgba(255, 206, 92, 0.45);
  background: linear-gradient(180deg, rgba(255, 206, 92, 0.28), rgba(255, 206, 92, 0.05));
  box-shadow: 0 0 60px rgba(255, 206, 92, 0.13);
  color: rgba(255, 206, 92, 0.65);
}

.podium-card.p1 .pc-place {
  color: var(--gold);
}

.podium-card.p2 .pc-pedestal {
  height: clamp(76px, 14vh, 180px);
  border-color: rgba(199, 212, 235, 0.32);
  color: rgba(220, 230, 250, 0.5);
}

.podium-card.p3 .pc-pedestal {
  height: clamp(62px, 11vh, 145px);
  border-color: rgba(222, 150, 94, 0.38);
  background: linear-gradient(180deg, rgba(222, 150, 94, 0.22), rgba(222, 150, 94, 0.04));
  color: rgba(240, 176, 120, 0.55);
}

.podium-card.p1 {
  animation-delay: 0.15s;
}

.podium-card.p2 {
  animation-delay: 0.28s;
}

.podium-card.p3 {
  animation-delay: 0.4s;
}

@keyframes podiumUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.finish-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: clamp(12px, 1vw, 16px);
}

.board-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: clamp(18px, 1.7vw, 28px);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  padding: clamp(14px, 1.6vw, 26px);
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: clamp(8px, 1.2vh, 16px);
  flex: none;
}

.board-head h2 {
  margin: 0;
  font-size: clamp(18px, 1.8vw, 30px);
  letter-spacing: -0.01em;
}

.final-board-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(180deg, transparent 0, #000 3%, #000 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 3%, #000 94%, transparent 100%);
}

.final-board {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 6px 26px 0;
}

.board-row {
  display: grid;
  grid-template-columns: clamp(34px, 3vw, 54px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  padding: clamp(7px, 0.95vh, 12px) clamp(10px, 1vw, 16px);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
}

.board-row .br-place {
  font-weight: 900;
  font-size: clamp(14px, 1.15vw, 20px);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.board-row .br-name {
  font-weight: 700;
  font-size: clamp(13px, 1.15vw, 21px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-row .br-score {
  font-weight: 900;
  font-size: clamp(14px, 1.2vw, 22px);
  font-variant-numeric: tabular-nums;
  color: #dfe6ff;
}

.board-row .br-score span {
  font-size: 0.65em;
  color: var(--dim);
  font-weight: 600;
  margin-left: 3px;
}

.board-row.top-1 {
  background: linear-gradient(90deg, rgba(255, 206, 92, 0.16), rgba(255, 206, 92, 0.03));
  border-color: rgba(255, 206, 92, 0.25);
}

.board-row.top-1 .br-place {
  color: var(--gold);
}

.board-row.top-2 {
  background: rgba(199, 212, 235, 0.08);
}

.board-row.top-2 .br-place {
  color: #c7d4eb;
}

.board-row.top-3 {
  background: rgba(222, 150, 94, 0.09);
}

.board-row.top-3 .br-place {
  color: #f0b078;
}

.board-empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Футер ---------- */

.screen-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: none;
  padding-top: clamp(6px, 1vh, 12px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: clamp(6px, 1vh, 14px);
  font-size: clamp(10px, 0.8vw, 13px);
  color: rgba(220, 227, 245, 0.62);
}

.screen-footer b {
  color: var(--muted);
  font-weight: 600;
}

.footer-hint {
  text-align: center;
}

.footer-admin {
  color: #8d79ff;
  font-weight: 700;
}

body[data-phase="setup"] .screen-footer {
  opacity: 0.7;
}

@media (max-width: 1000px) {
  .grid-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .grid-aside {
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
    max-height: 34vh;
  }

  .qr-card {
    flex-direction: row;
    flex: 1;
    padding: 12px;
  }

  .qr-caption {
    text-align: left;
    flex: 1;
  }

  .qr-frame {
    width: clamp(90px, 14vw, 150px);
    flex: none;
  }

  .join-link,
  .copy-btn {
    display: none;
  }

  .aside-players {
    flex: 1;
  }

  .question-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 38vh) minmax(0, 1fr);
    gap: 18px;
  }

  .q-panel {
    justify-content: flex-start;
  }

  .q-text {
    max-height: none;
  }

  .finished-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .podium {
    min-height: 200px;
  }

  .board-side {
    min-height: 50vh;
  }
}

@media (max-width: 640px) {
  .players-pill span {
    display: none;
  }

  .screen-brand {
    font-size: 16px;
  }

  .screen-page {
    padding: 10px 12px;
  }

  .screen-footer {
    display: none;
  }

  .cell {
    font-size: 22px;
    border-radius: 9px;
  }

  .finished-layout {
    display: flex;
    flex-direction: column;
  }

  .podium-side {
    flex: none;
  }

  .finish-title {
    font-size: 32px;
  }

  .podium {
    min-height: 170px;
  }
}
