/* Стиль как в «Фотоохоте» и «Давай познакомимся»: светлые обои и матовое стекло iOS поверх них. */
:root {
  /* Без этого Chrome и Samsung Internet в тёмной теме сами затемняют светлый сайт. */
  color-scheme: only light;
  --ink: #1c1c1e;
  --muted: rgba(60, 60, 67, 0.72);
  --accent: #ea580c;
  --ok: #248a3d;
  --ok-soft: rgba(52, 199, 89, 0.2);
  --bad: #d70015;
  --bad-soft: rgba(255, 59, 48, 0.16);
  --warn: #c93400;
  --warn-soft: rgba(255, 149, 0, 0.2);
  /* Края и тени тёмные, а не белые: стекло видно и на белом фоне компании, не только на обоях. */
  --line: rgba(60, 60, 67, 0.14);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-blur: blur(24px) saturate(180%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 30px rgba(31, 38, 135, 0.14);
  /* Заливка полей как в iOS: серая, поэтому поле видно и на белом. */
  --fill: rgba(118, 118, 128, 0.12);
  --fill-line: rgba(60, 60, 67, 0.2);
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  /* Обои меняет скрипт комнаты: готовые или своё фото ведущего. */
  --wallpaper: url("/static/wallpapers/gallery.svg");
  --wallpaper-color: #f3ece4;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--wallpaper-color) var(--wallpaper) center / cover no-repeat fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

h1, h2 { letter-spacing: -0.02em; }

/* ---------- стекло ---------- */

.glass, .card, .stage, .player, .login {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}

/* Кнопки как Liquid Glass в iOS 26: прозрачное стекло с размытым фоном под ним,
   ярким бликом сверху и светлой каймой. Тонкий тёмный контур и тень держат форму
   кнопки и на белом фоне компании, где одно стекло растворилось бы. */
button, .btn {
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  /* Прозрачная середина с лёгким тоном: сквозь кнопку видно фон, и она не белеет на светлом.
     Форму дают яркая кайма и блик у верхнего края. */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 38%, rgba(60, 60, 90, 0.06) 100%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(255, 255, 255, 0.3),
    0 0 0 0.5px rgba(0, 0, 0, 0.14),
    0 6px 18px rgba(31, 38, 135, 0.12);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
button:hover, .btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.1) 38%, rgba(60, 60, 90, 0.1) 100%);
}
button:active, .btn:active {
  transform: scale(0.97);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(31, 38, 135, 0.12);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
/* Внутри стеклянной карточки своё размытие кнопке вредно: Chrome даёт ей размывать только
   белую подложку карточки, без обоев, и кнопка белеет. Без него сквозь кнопку видно карточку. */
:is(.card, .stage, .player, .login, .glass) :is(button, .btn) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* Главная кнопка: то же стекло, гуще и с жирной надписью, чтобы выделялась среди соседних. */
button.primary, .btn.primary {
  font-weight: 700;
  /* Главная: то же стекло, тон чуть гуще, чтобы выделялась среди соседних. */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.05) 38%, rgba(40, 40, 70, 0.12) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.4),
    0 0 0 0.5px rgba(0, 0, 0, 0.18),
    0 8px 22px rgba(31, 38, 135, 0.16);
}
button.primary:hover, .btn.primary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.12) 38%, rgba(40, 40, 70, 0.16) 100%);
}
button.ok { color: var(--ok); }
button.bad { color: var(--bad); }
button.big, .btn.big { padding: 18px 24px; font-size: 19px; }

/* Поля как в iOS: серая заливка без рамки, скругление; при вводе становятся светлее. */
input, select {
  font: inherit;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--fill);
  color: var(--ink);
  width: 100%;
  transition: background 140ms ease, box-shadow 140ms ease;
}
input::placeholder { color: rgba(60, 60, 67, 0.5); }
input:focus, select:focus { outline: none; background: rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 3px rgba(60, 60, 67, 0.18); }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.4em; margin: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.small-link { font-size: 14px; word-break: break-all; color: var(--muted); }


.card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { margin: 0; font-size: 20px; }

/* ---------- вход ---------- */

.login {
  width: calc(100% - 32px);
  max-width: 380px;
  margin: 28vh auto 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- игрок ---------- */

/* Страница игрока помещается в экран телефона целиком и не листается без нужды:
   отступ сверху и снизу внутри высоты экрана, а не сверх неё. */
body.player-page { padding: 16px 0; overscroll-behavior: none; }
.player {
  max-width: 480px;
  /* На телефоне по 16 px от краёв, на широком экране по центру. */
  margin: 0 max(16px, calc((100% - 480px) / 2));
  padding: 24px 20px 28px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.player h1 { font-size: 28px; margin: 4px 0 0; }
.player .item { font-size: 40px; font-weight: 800; color: var(--accent); word-break: break-word; margin: 0; }
.player .item-photo { width: 100%; max-height: 42vh; object-fit: contain; border-radius: 18px; background: rgba(255, 255, 255, 0.6); }
.player .timer { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.player .big-btn { width: 100%; padding: 20px; font-size: 21px; }
.code-input { text-align: center; font-size: 28px; letter-spacing: 0.2em; text-transform: uppercase; }
.status { font-size: 19px; margin: 0; }
.big-label { font-size: 19px; color: var(--ink); margin-bottom: 8px; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.status.warn { color: var(--warn); }

/* ---------- список комнат ---------- */

.admin-page { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.admin-page > header { display: flex; align-items: center; gap: 8px; }
.admin-page > header h1 { flex: 1; margin: 0; font-size: 34px; }
/* Комнаты списком: строка на комнату, кнопки справа. Пустой список не показываем. */
.room-list { list-style: none; margin: 0; padding: 6px 18px; gap: 0; }
.room-list:empty { display: none; }
.room-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.room-row + .room-row { border-top: 1px solid rgba(60, 60, 67, 0.15); }
.room-title { flex: 1 1 200px; font-size: 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.room-title .muted { font-size: 14px; }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.room-actions .btn, .room-actions button { padding: 10px 16px; font-size: 15px; }

/* Окно создания комнаты поверх списка. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.modal-card { width: 100%; max-width: 820px; background: var(--glass-strong); }
.modal-card > .row:first-child { justify-content: space-between; }
.modal-card > .row:first-child > * { flex: 0 0 auto; }
.modal-card .close { padding: 8px 14px; }


/* План раундов: строка на раунд. */
.plan { display: flex; flex-direction: column; gap: 8px; }
/* Раунд в две строки: номер и песня, под ними предмет и правило прохода.
   Так строка не сжимается в узкой колонке пульта и названия не обрезаются. */
/* Форма плана на пульте: отступ между раундами и кнопками «Сохранить» и «Отмена». */
#plan-form, #plan-editor { display: flex; flex-direction: column; gap: 12px; }
#plan-form { gap: 18px; }
.plan-count { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.plan-count input { width: 90px; }
.plan-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "no song song"
    ". item rule"
    ". file file";
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: var(--fill);
}
.plan-row .no { grid-area: no; font-weight: 800; text-align: center; color: var(--muted); }
.plan-row .plan-song { grid-area: song; background: rgba(255, 255, 255, 0.8); }
.plan-row .plan-item-input { grid-area: item; background: rgba(255, 255, 255, 0.8); }
.plan-row .plan-rule { grid-area: rule; display: flex; gap: 8px; align-items: center; min-width: 0; }
.plan-row .plan-rule select { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.8); }
.plan-row .plan-rule input { width: 90px; flex: 0 0 auto; background: rgba(255, 255, 255, 0.8); }
.plan-row .final-note { font-weight: 600; color: var(--accent); font-size: 14px; }
.plan-row .own-file { grid-area: file; display: flex; align-items: center; gap: 8px; margin: 0; }
.plan-row .own-file input { width: auto; flex: 1; padding: 8px; }
/* Узкая колонка (пульт на ноутбуке, телефон): всё в столбик. Считаем по ширине самого списка. */
.plan { container-type: inline-size; }
@container (max-width: 460px) {
  .plan-row { grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "no song" ". item" ". rule" ". file"; }
}

.wallpapers { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-width: 620px; }
.wallpapers button {
  aspect-ratio: 4 / 3;
  padding: 0;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(255, 255, 255, 0.6);
  font-size: 12px;
  align-items: flex-end;
  padding-bottom: 6px;
}
.wallpapers button[aria-pressed="true"] { border-color: var(--ink); }
/* «Своё фото»: пунктирная плитка с плюсом; с выбранным фото показывает его. */
.wallpapers .upload {
  background: rgba(255, 255, 255, 0.45) center / cover no-repeat;
  border-style: dashed;
  border-color: rgba(60, 60, 67, 0.35);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px;
  color: var(--muted);
}
.wallpapers .upload::before { content: "+"; font-size: 26px; font-weight: 300; line-height: 1; }
.wallpapers .upload[aria-pressed="true"] { border-style: solid; border-color: var(--ink); justify-content: flex-end; color: var(--ink); }
.wallpapers .upload[aria-pressed="true"]::before { content: none; }

/* ---------- пульт ведущего ---------- */

/* Пульт на всю ширину и ровно в высоту экрана: страница не листается,
   длинный план и много фото листаются внутри своих блоков. */
.host-page { padding: 16px; display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr); gap: 16px; height: 100vh; height: 100dvh; }
.host-page .col { min-height: 0; }
.host-page .col:last-child { overflow-y: auto; }
.host-page .photos { flex: 1; min-height: 0; }
@media (max-width: 860px) { .host-page { grid-template-columns: 1fr; height: auto; } .host-page .photos { min-height: 70vh; } }
.host-page .col { display: flex; flex-direction: column; gap: 16px; }
.plan-list { display: flex; flex-direction: column; gap: 6px; }
.plan-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.plan-item.done { opacity: 0.5; }
.plan-item.current { background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 2px var(--ink) inset; }
.plan-item .no { font-weight: 800; width: 22px; text-align: center; }
.plan-item .what { flex: 1; min-width: 0; }
.plan-item .what span { display: block; }
.timer-big { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
/* Охота на пульте: слева что ищут, крупно; справа таймер. */
.hunt-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hunt-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hunt-item { font-size: clamp(32px, 4vw, 52px); font-weight: 900; color: var(--accent); letter-spacing: -0.02em; line-height: 1.05; overflow-wrap: anywhere; }
.hunt-head .timer-big { font-size: clamp(36px, 4vw, 52px); text-align: right; }

.room-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.room-head h2 { flex: 1 1 auto; }
/* Стрелка «назад» к списку комнат: круглая стеклянная кнопка слева от названия. */
.back {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 4px 14px rgba(31, 38, 135, 0.1);
  color: var(--ink);
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
}
.back:hover { background: rgba(255, 255, 255, 0.85); }

/* Тумблер как в iOS. */
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; margin: 0; color: var(--ink); font-size: 15px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 52px; height: 32px; border-radius: 999px; background: rgba(120, 120, 128, 0.32); transition: background-color 150ms; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 150ms; }
.switch input:checked + .track { background: #34c759; }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch input:disabled + .track { opacity: 0.5; }
.switch:has(input:disabled) { cursor: not-allowed; color: var(--muted); }

/* Карточки в ряд на всю высоту блока; если не помещаются, ряд листается вбок. */
.subs { flex: 1; min-height: 0; display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.sub-card { flex: 0 0 auto; height: 100%; aspect-ratio: 3 / 5; max-width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 20px; background: var(--fill); border: 2px solid transparent; }
.sub-card.accepted { border-color: var(--ok); }
.sub-card.rejected { border-color: var(--bad); }
.sub-card.review { border-color: var(--warn); }
.sub-photo { flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, 0.6); cursor: zoom-in; }
.sub-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sub-photo.pending { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.sub-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 20px; }
.sub-card .reason { font-size: 14px; }
.badge { align-self: flex-start; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge.accepted { background: var(--ok-soft); color: var(--ok); }
.badge.rejected { background: var(--bad-soft); color: var(--bad); }
.badge.review { background: var(--warn-soft); color: var(--warn); }
.badge.checking { background: rgba(120, 120, 128, 0.16); color: var(--muted); }
.sub-card .actions { display: flex; gap: 8px; }
.sub-card .actions button { flex: 1; padding: 14px 12px; font-size: 17px; }

/* ---------- экран для зала ---------- */

.screen { min-height: 100vh; padding: 3vh 3vw; display: flex; flex-direction: column; gap: 2vh; }
.screen-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.screen-top .title { font-size: clamp(20px, 2.4vw, 34px); font-weight: 700; padding: 10px 22px; }
.screen-top .round { font-size: clamp(18px, 2vw, 28px); font-weight: 600; padding: 10px 22px; }
.stage {
  flex: 1;
  border-radius: 36px;
  padding: 4vh 4vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2.4vh;
}
.stage .headline { font-size: clamp(32px, 4.6vw, 72px); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.stage .sub-headline { font-size: clamp(20px, 2.2vw, 34px); color: var(--muted); font-weight: 600; margin: 0; }
.stage .item { font-size: clamp(56px, 8vw, 140px); font-weight: 900; color: var(--accent); letter-spacing: -0.03em; line-height: 1; margin: 0; }
.stage .item-photo { max-height: 42vh; max-width: 60vw; border-radius: 28px; box-shadow: 0 16px 50px rgba(31, 38, 135, 0.25); background: #fff; }
.stage .timer { font-size: clamp(40px, 5vw, 80px); font-weight: 800; font-variant-numeric: tabular-nums; }
.stage .qr { width: min(66vh, 80vw); background: #ffffff; border-radius: 32px; padding: 3vh; cursor: zoom-in; box-shadow: 0 16px 50px rgba(31, 38, 135, 0.2); }
.stage .link { font-size: clamp(24px, 3vw, 46px); font-weight: 800; letter-spacing: -0.01em; }
.stage .note { font-size: clamp(48px, 7vw, 110px); animation: bounce 1.2s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-14px) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .stage .note { animation: none; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 210px)); justify-content: center; gap: 14px; width: 100%; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 18px; background: rgba(255, 255, 255, 0.6); }
.gallery figcaption { margin-top: 6px; font-weight: 700; }

/* Ожидание игроков: только QR и ссылка поверх размытого фона. */
.screen.lobby { padding: 0; }
.screen.lobby .screen-top { display: none; }
.screen.lobby::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.screen.lobby .stage {
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding: 32px;
  gap: 24px;
  min-height: 100vh;
}
.screen.lobby .qr { width: min(80vh, 90vw); padding: 16px; border-radius: 28px; cursor: default; box-shadow: 0 16px 50px rgba(31, 38, 135, 0.18); }
.screen.lobby .link { font-size: clamp(22px, 3vw, 42px); font-weight: 800; }

/* Пьедестал: 2, 1, 3. Фото стоят на ступенях из цветного стекла. */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 3vw; width: 100%; }
.podium-col { display: flex; flex-direction: column; align-items: center; animation: rise 0.7s ease-out both; }
.podium-col.p1 { animation-delay: 0.5s; }
.podium-col.p2 { animation-delay: 0.2s; }
.podium-photo { position: relative; }
.podium-photo img, .podium-initial {
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 16px 50px rgba(31, 38, 135, 0.25);
  background: rgba(255, 255, 255, 0.7);
}
.p1 .podium-photo img, .p1 .podium-initial { height: 40vh; }
.p2 .podium-photo img, .p2 .podium-initial { height: 30vh; }
.p3 .podium-photo img, .p3 .podium-initial { height: 26vh; }
.podium-col.empty { width: 20vh; }
.podium-initial { display: flex; align-items: center; justify-content: center; font-size: 10vh; font-weight: 900; color: var(--muted); }
.podium-name { font-weight: 800; font-size: clamp(22px, 2.6vw, 42px); margin: 1.4vh 0; max-width: 34vh; text-align: center; overflow-wrap: anywhere; }
.p1 .podium-name { font-size: clamp(28px, 3.4vw, 56px); color: var(--accent); }
.podium-step {
  width: 100%;
  min-width: 22vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  font-size: clamp(40px, 7vh, 96px);
  font-weight: 900;
}
.p1 .podium-step { height: 15vh; background: linear-gradient(180deg, rgba(255, 228, 120, 0.85), rgba(245, 180, 0, 0.55)); }
.p2 .podium-step { height: 10vh; background: linear-gradient(180deg, rgba(240, 244, 250, 0.9), rgba(180, 192, 210, 0.6)); }
.p3 .podium-step { height: 7vh; background: linear-gradient(180deg, rgba(250, 210, 170, 0.9), rgba(205, 127, 50, 0.5)); }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

.confetti { position: absolute; top: 30%; left: 50%; pointer-events: none; }
.confetti span {
  position: absolute;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  opacity: 0;
  animation: burst 1.6s ease-out both;
}
@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 160px)) rotate(540deg); }
}
@media (prefers-reduced-motion: reduce) {
  .podium-col, .confetti span { animation: none; }
  .confetti { display: none; }
}


.big-qr {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.big-qr img { width: min(80vh, 90vw); background: #ffffff; border-radius: 28px; padding: 16px; }
.big-qr .link { font-size: clamp(22px, 3vw, 42px); font-weight: 800; word-break: break-all; text-align: center; }
.big-qr .close { position: absolute; top: 24px; right: 24px; }

/* ---------- песни ---------- */

.songs-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 16px; max-width: 1100px; margin: 0 auto; align-items: start; }
@media (max-width: 800px) { .songs-page { grid-template-columns: 1fr; } }
.songs-page .head { display: flex; align-items: center; justify-content: space-between; }
.song-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.song-list .song { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font-weight: 400; border-radius: 16px; }
.song-list .song.active { background: rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 2px var(--ink) inset; }
.card.inner { background: var(--fill); padding: 12px; }
.card.inner audio { width: 100%; }
.image-preview { max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 16px; background: rgba(255, 255, 255, 0.6); align-self: flex-start; }

/* Фото игрока на весь экран по клику на пульте. */
.photo-view { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(28, 28, 30, 0.75); cursor: zoom-out; }
.photo-view img { max-width: 100%; max-height: 100%; border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }


/* Плеер на пульте: панель «сейчас играет», управляет песней на экране зала.
   Это содержимое карточки действия, а не отдельная карточка: без рамки в рамке. */
.hall-player { display: flex; flex-direction: column; gap: 14px; }
.hp-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hp-top { display: flex; align-items: center; gap: 16px; }
.hp-play {
  width: 56px;
  height: 56px;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}
.hp-play:hover { background: #3a3a3c; }
.hp-play svg { width: 24px; height: 24px; fill: currentColor; }
.hp-play:disabled { background: rgba(60, 60, 67, 0.28); box-shadow: none; }
.hp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hp-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 20px; letter-spacing: -0.01em; }
.hp-item { font-size: 15px; color: var(--accent); font-weight: 600; }
.hp-vol { display: flex; align-items: center; gap: 8px; margin: 0; flex: 0 0 150px; color: var(--muted); }
.hp-vol-icon svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.hp-seek { display: flex; align-items: center; gap: 12px; }
.hp-time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); min-width: 36px; }
.hp-seek .hp-time:last-child { text-align: right; }
.hp-track { position: relative; flex: 1; display: flex; align-items: center; height: 20px; }
.hall-player input[type="range"] {
  --p: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--ink) var(--p), rgba(60, 60, 67, 0.18) var(--p));
  cursor: pointer;
}
.hall-player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--fill-line);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.hall-player input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--fill-line);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.hall-player input[type="range"]:disabled { cursor: default; }
.hall-player.offline input[type="range"] { opacity: 0.4; }
/* Риска на полосе: где песня остановится сама и покажется предмет. */
.hp-track .stop-mark {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 18px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  pointer-events: none;
}
.hp-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.hp-note { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.hp-note.warn { color: var(--warn); font-weight: 600; }
.hp-open { font-weight: 700; color: var(--ink); }
.hp-stop { padding: 14px 26px; font-size: 16px; }
@media (max-width: 560px) {
  .hp-vol { display: none; }
  .hp-stop { width: 100%; }
}

/* Окно подтверждения: стеклянная карточка по центру поверх размытой страницы. */
.dialog-overlay { align-items: center; z-index: 60; }
.dialog { width: 100%; max-width: 420px; background: var(--glass-strong); padding: 22px; gap: 8px; }
.dialog h2 { font-size: 20px; margin: 0; }
.dialog p { margin: 0; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.dialog-actions button { min-width: 120px; }
button.primary.danger { color: #fff; background: var(--bad); border-color: var(--bad); }
button.primary.danger:hover { background: #b80012; }

/* ======================================================================
   Испорченный художник
   ====================================================================== */

:root {
  --gold: linear-gradient(135deg, #f6d58b 0%, #d9a441 40%, #f3cf7d 65%, #b8842c 100%);
  --art-accent: #b45309;
}

textarea {
  font: inherit;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--fill);
  color: var(--ink);
  width: 100%;
  resize: vertical;
}
textarea:focus { outline: none; background: rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 3px rgba(60, 60, 67, 0.18); }

.small { font-size: 14px; }
.center { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.wide { width: 100%; }
.empty-note { text-align: center; padding: 24px; }
.login-title { margin: 0 0 4px; font-size: 24px; text-align: center; }
.modal-card.narrow { max-width: 560px; }
.admin-page > header .back { margin-right: 4px; }

/* Капсула выбора, как в других играх. */
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fill); flex-wrap: wrap; }
.segmented button {
  flex: 1 1 auto;
  padding: 9px 14px;
  font-size: 15px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--muted);
}
.segmented button[aria-checked="true"] { background: #fff; color: var(--art-accent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.segmented.filter { max-width: 420px; }

/* Запретные слова. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 12px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 600; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid rgba(215, 0, 21, 0.25); }
.chips.big { gap: 1.2vh; }
.chips.big .chip { font-size: 3.2vh; padding: 0.8vh 2.2vh; border-width: 2px; }
.forbidden { display: flex; flex-direction: column; gap: 6px; }

/* Золотая рама: оригинал и рисунок нейросети выглядят как картины в галерее. */
.gold-frame {
  position: relative;
  padding: 10px;
  border-radius: 14px;
  background: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), 0 14px 40px rgba(107, 74, 42, 0.28);
  aspect-ratio: 1;
}
.gold-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(120, 80, 20, 0.45);
  pointer-events: none;
}
.gold-frame img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; background: #f4ede3; }
.gold-frame.small { width: 140px; flex: 0 0 auto; padding: 6px; border-radius: 10px; }
.gold-frame.small::after { inset: 6px; }
.gold-frame.empty { display: flex; align-items: center; justify-content: center; color: #7a5a24; font-weight: 700; }

/* ---------- библиотека картин ---------- */

.picture-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.picture-card .gold-frame.small { width: 100%; }
.picture-info { display: flex; flex-direction: column; }
.picture-card .actions button { padding: 9px 14px; font-size: 15px; }
.file-drop { display: flex; align-items: center; justify-content: center; min-height: 64px; border: 2px dashed var(--fill-line); border-radius: 16px; cursor: pointer; color: var(--ink); font-size: 16px; font-weight: 600; margin: 0; }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ---------- пульт ---------- */

.pult { padding: 16px; display: flex; flex-direction: column; gap: 16px; max-width: 1400px; margin: 0 auto; }
.pult-head { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
.pult-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pult-title h1 { margin: 0; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pult-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .pult-grid { grid-template-columns: 1fr; } }
.pult-side { display: flex; flex-direction: column; gap: 16px; }
.stage-card { gap: 14px; padding: 22px; }
.stage-title { margin: 0; font-size: 26px; }
.eyebrow { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--art-accent); }
.stage-row { display: flex; gap: 16px; align-items: flex-start; }
.timer-big { font-size: 96px; line-height: 1; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.timer-big.hot { color: var(--bad); }
.meter { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.meter-bar { height: 100%; background: linear-gradient(90deg, #34c759, #ffcc00, #ff3b30); transform-origin: left; transform: scaleX(0.04); transition: transform 80ms linear; }
.spinner { width: 56px; height: 56px; margin: 8px auto; border-radius: 50%; border: 5px solid rgba(217, 164, 65, 0.25); border-top-color: #d9a441; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.quote { margin: 0; padding: 12px 16px; border-left: 4px solid #d9a441; background: rgba(255, 255, 255, 0.5); border-radius: 8px; font-style: italic; }
.pair { display: flex; gap: 12px; }
.score-line { margin: 0; }
.score-big { font-size: 44px; color: var(--art-accent); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.board .place { width: 24px; font-weight: 800; text-align: center; }
.pult-side .card button { width: 100%; }

/* ---------- экран для зала ---------- */

body.hall { overflow: hidden; }
.hall-screen { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 2.4vh; padding: 3vh 3vw; }
.hall-top { display: flex; align-items: center; gap: 2vh; }
.hall-brand {
  margin: 0;
  padding: 1.2vh 3vh;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.4vh;
  font-weight: 700;
  letter-spacing: 0;
  background-image: linear-gradient(135deg, #b8842c, #d9a441 45%, #8a5a1c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-color: var(--glass);
}
.hall-count { margin-left: auto; padding: 1.2vh 3vh; font-size: 3vh; font-weight: 700; }
.fullscreen { padding: 1vh 1.8vh; font-size: 2.4vh; }
.hall-top .hall-count[hidden] + .fullscreen { margin-left: auto; }
.hall-body { flex: 1; min-height: 0; display: flex; align-items: stretch; justify-content: center; }

.lobby { margin: auto; max-width: 110vh; padding: 5vh 7vh; text-align: center; display: flex; flex-direction: column; gap: 2.4vh; }
.lobby h2 { margin: 0; }
.lobby-title { font-family: Georgia, "Times New Roman", serif; font-size: 7vh; line-height: 1.05; }
.rules { text-align: left; margin: 0 auto; padding-left: 4vh; font-size: 3.2vh; display: flex; flex-direction: column; gap: 1.2vh; }
.lobby .muted { font-size: 2.6vh; margin: 0; }
.waiting { margin: 0; font-size: 3vh; font-weight: 700; color: var(--art-accent); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }

.split { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4vh; align-items: center; }
.split-art { display: flex; justify-content: center; }
.gold-frame.hero { height: min(72vh, 46vw); width: auto; padding: 1.6vh; border-radius: 2vh; }
.gold-frame.hero::after { inset: 1.6vh; }
.split-side { padding: 4vh; display: flex; flex-direction: column; gap: 1.6vh; align-self: stretch; justify-content: center; }
.split-side .eyebrow { font-size: 2.2vh; }
.player-name { margin: 0 0 2vh; font-family: Georgia, "Times New Roman", serif; font-size: 7vh; line-height: 1.05; font-weight: 700; overflow-wrap: anywhere; }
.hint { font-size: 2.6vh; margin: 2vh 0 0; }
.split-side .status { font-size: 3vh; }
.countdown { margin-top: 3vh; display: flex; align-items: center; gap: 3vh; }
.countdown-num { font-family: Georgia, "Times New Roman", serif; font-size: 14vh; line-height: 1; font-weight: 700; min-width: 2ch; font-variant-numeric: tabular-nums; }
.countdown-num.hot { color: var(--bad); animation: pulse 0.6s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.countdown-track { flex: 1; height: 1.6vh; border-radius: 999px; background: rgba(217, 164, 65, 0.25); overflow: hidden; }
.countdown-fill { height: 100%; border-radius: 999px; background: var(--gold); transform-origin: left; transition: transform 200ms linear; }
.split-side.live { box-shadow: var(--glass-shadow), 0 0 0 3px rgba(217, 164, 65, 0.6); }

.pair-hall { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 3vh; align-items: center; }
.pair-hall figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2vh; min-width: 0; }
.pair-hall .gold-frame.hero { height: min(56vh, 36vw); }
.caption { width: 100%; max-width: min(56vh, 36vw); padding: 1.4vh 2.2vh; display: flex; flex-direction: column; gap: 0.6vh; font-size: 2.4vh; }
.caption strong { font-family: Georgia, "Times New Roman", serif; font-size: 3vh; }
.caption em { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pair-mid { display: flex; flex-direction: column; align-items: center; gap: 1vh; text-align: center; max-width: 34vh; }
.arrow { font-size: 10vh; color: #d9a441; }
.percent {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16vh;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background-image: linear-gradient(135deg, #b8842c, #e0a93a 50%, #8a5a1c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.percent-label { font-size: 3.4vh; font-weight: 700; }
.penalty { font-size: 2.4vh; color: var(--bad); font-weight: 600; }
.comment { font-size: 2.4vh; color: var(--muted); font-style: italic; }
.painting { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; background-color: #fbf6ee; overflow: hidden; }
.painting p { position: relative; z-index: 1; margin: 0; font-size: 3vh; font-weight: 700; color: #7a5a24; }
.brush { width: 60%; height: 30%; border-radius: 50%; background: conic-gradient(from 0deg, #ff9ec2, #ffd89a, #9fd8ff, #b6a3ff, #ff9ec2); filter: blur(28px); opacity: 0.8; animation: spin 3s linear infinite; }
.reveal-in { animation: reveal 0.9s ease-out both; }
@keyframes reveal { from { opacity: 0; transform: scale(0.92) rotate(-2deg); } to { opacity: 1; transform: none; } }

.final { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3vh; }
.final-title { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 8vh; color: #8a5a1c; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 4vh; flex: 1; min-height: 0; }
.podium-place { display: flex; flex-direction: column; align-items: center; gap: 1vh; position: relative; animation: reveal 0.8s ease-out both; }
.podium-place.p1 { animation-delay: 0.6s; }
.podium-place.p2 { animation-delay: 0.3s; }
.podium-art { width: 26vh; padding: 1vh; }
.podium-place.p1 .podium-art { width: 34vh; }
.podium-name { font-family: Georgia, "Times New Roman", serif; font-size: 3.4vh; }
.podium-score { font-size: 3vh; font-weight: 800; color: var(--art-accent); }
.podium-step { width: 100%; display: flex; justify-content: center; padding-top: 1vh; border-radius: 1.6vh 1.6vh 0 0; font-size: 4vh; font-weight: 800; background: var(--glass); border: 1px solid var(--line); }
.p1 .podium-step { height: 12vh; background: var(--gold); color: #fff; }
.p2 .podium-step { height: 8vh; }
.p3 .podium-step { height: 5vh; }
.crown { position: absolute; top: -6vh; font-size: 6vh; }
.podium-place.empty { width: 26vh; }

.pult .plan-list { list-style: none; margin: 0; padding: 0; }
.pult .plan-item .what span + span { margin-top: 2px; }
.final { height: 100%; }
.podium { padding-bottom: 0; }
@media (max-width: 600px) {
  .pult { padding: 10px; gap: 10px; }
  .pult-head { padding: 8px 10px; gap: 8px; }
  .pult-head .btn { padding: 8px 12px; font-size: 14px; }
  .pult-title h1 { font-size: 18px; }
  .stage-card { padding: 16px; }
  .stage-title { font-size: 21px; }
  .stage-row .gold-frame.small { width: 108px; }
  .timer-big { font-size: 84px; }
}

/* Заставка: три картины в рамах веером над правилами. */
.showcase { display: flex; justify-content: center; align-items: center; gap: 2vh; margin: -1vh 0 1vh; }
.showcase .gold-frame { width: 17vh; padding: 0.9vh; }
.showcase .gold-frame::after { inset: 0.9vh; }
.showcase .gold-frame:nth-child(1) { transform: rotate(-7deg) translateY(1.5vh); }
.showcase .gold-frame:nth-child(2) { width: 21vh; z-index: 1; }
.showcase .gold-frame:nth-child(3) { transform: rotate(7deg) translateY(1.5vh); }

/* Верхние плашки одной высоты; картина ровно в высоту панели рядом с ней. */
.hall-brand, .hall-count, .fullscreen { height: 7.2vh; display: inline-flex; align-items: center; padding: 0 3vh; }
.hall-brand { font-size: 3.6vh; }
.hall-count { font-size: 3vh; }
.fullscreen { width: 7.2vh; padding: 0; justify-content: center; }
.split { height: 100%; grid-template-rows: 100%; align-items: stretch; }
.split-art { height: 100%; min-height: 0; }
.split-art .gold-frame.hero { height: 100%; width: auto; max-width: 52vw; }
