/* FUNBASE — общие стили игр и админки. Тёмная тема, красный акцент. */
:root {
  --bg: #111113;
  --surface: #1b1b1f;
  --surface-2: #26262b;
  --surface-3: #303036;
  --line: #2c2c32;
  --text: #ffffff;
  --muted: #9a9aa3;
  --accent: #e0283c;
  --accent-hover: #f03a4e;
  --accent-ink: #ffffff;
  --danger: #e0283c;
  --ok: #34c77b;
  --warn: #ffb020;
  --soft: #d4d4d8;      /* второстепенный текст, светлее muted */
  --hover: rgba(255,255,255,.08);
  --veil: rgba(255,255,255,.05);
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

/* Светлая тема: включается атрибутом <html data-theme="light"> (сервер ставит его по куки/аккаунту) */
:root[data-theme="light"] {
  --bg: #f2f2f5;
  --surface: #ffffff;
  --surface-2: #ececf1;
  --surface-3: #e1e1e8;
  --line: #dcdce3;
  --text: #16161a;
  --muted: #686872;
  --soft: #3d3d45;
  --hover: rgba(0,0,0,.06);
  --veil: rgba(0,0,0,.05);
  --accent: #cc1a2e;
  --accent-hover: #dd2a3d;
  --ok: #16834c;
  --warn: #c27c00;
  color-scheme: light;
}
:root[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(20,20,30,.06), 0 8px 24px -12px rgba(20,20,30,.12); }
/* Тёмные «острова» в светлой теме — только там, где видео с камер */
:root[data-theme="light"] :is(.dark-island, .tile, .spotlight, .calib-cam, .screen-wrap, .judge-media) {
  --bg: #111113; --surface: #1b1b1f; --surface-2: #26262b; --surface-3: #303036; --line: #2c2c32;
  --text: #ffffff; --muted: #9a9aa3; --soft: #d4d4d8; --hover: rgba(255,255,255,.08); --veil: rgba(255,255,255,.05);
  color: var(--text);
}

/* Переключатель темы */
.prefs { display: flex; align-items: center; gap: 6px; }
.site-head > .prefs { margin-left: auto; }
.site-head > nav ~ .prefs { margin-left: 0; }
.prefs.corner { position: absolute; top: 16px; right: 16px; z-index: 5; }
.pref-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 99px; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; transition: background .15s, transform .15s; }
.pref-btn:hover { background: var(--surface-3); }
.pref-btn:active { transform: scale(.92); }
.pref-btn svg { width: 18px; height: 18px; }
.pref-lang { display: flex; background: var(--surface-2); border-radius: 99px; padding: 3px; }
.pref-lang button { border: 0; background: none; color: var(--muted); font: 800 12px/1 var(--font); padding: 8px 9px; border-radius: 99px; cursor: pointer; }
.pref-lang button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.pref-lang button:hover:not([aria-pressed="true"]) { color: var(--text); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
a { color: inherit; }
svg { fill: currentColor; }

.screen { min-height: 100%; }
#join, #calib, #gone { display: grid; place-items: center; padding: 32px 16px; }
#join { position: relative; }

.card { background: var(--surface); border-radius: 16px; padding: 32px; width: min(460px, 100%); }
h2 { font: 800 20px/1.2 var(--font); margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font: 700 13px/1.2 var(--font); margin: 24px 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.eyebrow { color: var(--accent); font: 800 12px/1 var(--font); text-transform: uppercase; letter-spacing: .12em; }

.logo { font: 900 44px/.95 var(--font); letter-spacing: -.03em; text-transform: uppercase; text-decoration: none; }
.logo span { color: var(--accent); }
.logo.small { font-size: 18px; white-space: nowrap; }
.lead { color: var(--muted); margin: 14px 0 24px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 18px 0 0; }
.hint a { color: var(--text); }
.error { color: var(--accent-hover); min-height: 1.2em; margin: 12px 0 0; font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); text-transform: none; }

label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid transparent; border-radius: 8px;
  padding: 11px 12px; outline: none; transition: border-color .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer; font-weight: 700; font-size: 14px;
  background: var(--surface-2); transition: background .15s, transform .08s;
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary, .btn.danger { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled), .btn.danger:hover:not(:disabled) { background: var(--accent-hover); }
.btn.white { background: #fff; color: #111; border-radius: 99px; }
.btn.white:hover { background: #e9e9ec; }
.btn.big { width: 100%; padding: 15px 20px; font-size: 15px; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; justify-content: center; }
.row.end { justify-content: flex-end; }

.icon-btn {
  border: 0; background: transparent; width: 38px; height: 38px; border-radius: 8px;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--text); flex: none;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn svg { width: 22px; height: 22px; }
#playBtn .pause, #playBtn.playing .play { display: none; }
#playBtn.playing .pause { display: block; }
#micBtn .on, #micBtn[aria-pressed="true"] .off, #streamerBtn .off, #streamerBtn[aria-pressed="true"] .on { display: none; }
#micBtn[aria-pressed="true"] .on { display: block; color: var(--ok); }
#streamerBtn[aria-pressed="true"] .off { display: block; color: var(--accent); }
#micBtn .off { color: var(--muted); }

.badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.badge.out { background: var(--accent); color: #fff; }
.badge.warn { background: var(--text); color: var(--bg); }
.empty { color: var(--muted); padding: 22px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }

/* ---------- Вход ---------- */
.join-wrap { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 420px); gap: 20px; align-items: start; width: min(900px, 100%); }
.back-link { grid-column: 1 / -1; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.back-link:hover { color: var(--text); }
.join-card { width: 100%; }
.join-tabs, .source-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 14px; }
.tab { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 7px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); }
.tab.active { background: var(--surface-3); color: var(--text); }
.rooms-card { width: 100%; }
.rooms-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rooms-head h2 { margin: 0; }
.room-list { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.room-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; border: 0; cursor: pointer;
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px; transition: background .15s;
}
.room-item:hover { background: var(--surface-3); }
.room-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-sub { grid-column: 1; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-count { grid-column: 2; grid-row: 1 / 3; align-self: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Калибровка ---------- */
.calib-card { text-align: center; }
.calib-cam { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 14px; }
.calib-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.calib-ring { position: absolute; inset: 0; border: 4px solid transparent; border-radius: 12px; transition: border-color .2s; }
.calib-ring.good { border-color: var(--ok); }
.calib-ring.bad { border-color: var(--accent); }
#calibText { color: var(--muted); min-height: 3em; }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--text); border-radius: inherit; transition: width .08s linear; }
.meter-fill.hot { background: var(--accent); }

/* ---------- Игра ---------- */
#game { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 0;
  border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.chip b { color: var(--text); }
.chip svg { width: 14px; height: 14px; }
.passchip { cursor: pointer; }
/* Пароль всегда под спойлером: стример может быть в эфире */
.spoiler { filter: blur(6px); user-select: none; transition: filter .15s; }
.spoiler.revealed { filter: none; user-select: text; }
.streamer .spoiler.revealed { filter: blur(6px); }
.streamer .secret { filter: blur(7px); user-select: none; }
.status { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }

.stage { --side: 44%; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 14px var(--side); padding: 12px; min-height: 0; }
.splitter { cursor: col-resize; position: relative; touch-action: none; outline: none; }
.splitter::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 48px; transform: translate(-50%, -50%);
  border-radius: 99px; background: var(--line); transition: background .15s, height .15s;
}
.splitter:hover::after, .splitter:focus-visible::after, .splitter.drag::after { background: var(--accent); height: 80px; }

.screen-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; min-height: 0; }
#movie, .yt-mount, .yt-mount iframe { width: 100%; height: 100%; object-fit: contain; background: #000; border: 0; display: block; }
.yt-mount { position: absolute; inset: 0; }
.yt-shield { position: absolute; inset: 0; z-index: 2; } /* клики по самому YouTube сломали бы синхронизацию */

.controls {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px;
  padding: 26px 14px 10px; background: linear-gradient(transparent, rgba(0,0,0,.85)); z-index: 5;
}
.controls .time { font-variant-numeric: tabular-nums; font-size: 13px; color: #ddd; white-space: nowrap; }
input[type=range] { padding: 0; accent-color: var(--accent); background: transparent; border: 0; }
#seek { width: 100%; display: block; margin: 0; }
/* «Смешливость»: над полосой — где в этом видео смеялись чаще (по прошлым играм) */
.seek-wrap { flex: 1; min-width: 60px; position: relative; }
.heat { position: absolute; left: 0; right: 0; bottom: calc(100% - 2px); width: 100%; height: 26px; pointer-events: none; }
.heat path { fill: rgba(255,255,255,.28); stroke: rgba(255,255,255,.55); stroke-width: 1; vector-effect: non-scaling-stroke; }
#volume { width: 80px; }
.vol-icon { width: 20px; height: 20px; color: #ddd; flex: none; }

.overlay { position: absolute; inset: 0; z-index: 10; }
.overlay.panel { background: rgba(17,17,19,.96); overflow: auto; padding: 28px; }
.countdown { display: grid; place-items: center; background: rgba(0,0,0,.55); pointer-events: none; }
.countdown span { font: 900 150px/1 var(--font); color: #fff; text-shadow: 0 10px 40px rgba(0,0,0,.6); animation: pop .9s ease-out infinite; }
@keyframes pop { from { transform: scale(1.3); opacity: .2; } 30% { transform: scale(1); opacity: 1; } }
.unblock { display: grid; place-items: center; background: rgba(0,0,0,.6); }
.unblock .btn { width: auto; }
.hidden-warn {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 8;
  background: var(--accent); color: #fff; font-weight: 800; padding: 10px 18px; border-radius: 10px;
}

/* Лобби */
.lobby-inner { max-width: 820px; margin: 0 auto; }
.lobby-inner h2 { margin-top: 8px; }
.video-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.video-card { text-align: left; border: 2px solid transparent; background: var(--surface); border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.video-card:hover { border-color: var(--surface-3); }
.video-card.selected { border-color: var(--accent); }
.video-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
.video-card .meta { padding: 8px 10px; }
.t { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d { color: var(--muted); font-size: 12px; }
.link-form { display: flex; gap: 8px; }
.link-form input { flex: 1; min-width: 0; }
.chosen-line { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 2px solid var(--accent); border-radius: 10px; padding: 8px; margin: 10px 0 14px; }
.chosen-line img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mode { text-align: left; border: 2px solid transparent; background: var(--surface); border-radius: 10px; padding: 14px; cursor: pointer; display: grid; gap: 4px; }
.mode b { font-size: 15px; }
.mode span { color: var(--muted); font-size: 13px; }
.mode.active { border-color: var(--accent); }
.settings { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-bottom: 18px; }
.settings label { margin: 0; }
.settings label.check { padding-bottom: 10px; }
.lobby-guest { text-align: center; padding-top: 6vh; }
.lobby-guest p { color: var(--muted); }
.chosen { max-width: 360px; margin: 16px auto 0; }
.chosen img { width: 100%; border-radius: 10px; }
.chosen .t { margin-top: 8px; }
.rules-line { margin-top: 18px; font-size: 13px; }

/* Попался */
.caught { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.caught-title { font: 900 clamp(38px, 6vw, 72px)/1 var(--font); color: var(--accent); text-transform: uppercase; letter-spacing: -.03em; animation: shake .5s ease-in-out; text-align: center; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: rotate(-4deg) scale(1.1); } 40% { transform: rotate(3deg); } 60% { transform: rotate(-2deg); } }
.caught-time, .caught-hint { color: var(--muted); margin: 0; }
.caught-hint { font-size: 13px; }
.caught-list { display: grid; gap: 14px; width: 100%; max-width: 900px; }
.catch-entry { background: var(--surface); border-radius: 12px; padding: 14px; }
.catch-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.catch-head .name { font: 800 20px/1.2 var(--font); }
.caught-list.multi { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); max-width: 1100px; }
.caught { container-type: size; }
/* Ролик занимает всю свободную высоту, но кнопка «Продолжить» остаётся на экране */
.replay-box { position: relative; aspect-ratio: 4/3; width: min(100%, max(220px, calc((100cqh - 300px) * 4 / 3))); margin: 0 auto; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px var(--accent), 0 12px 40px rgba(0,0,0,.45); }
.caught-list.multi .replay-box { width: min(100%, max(180px, calc((100cqh - 400px) / 2 * 4 / 3))); }
.replay-box video, .replay-box img { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.replay-tag { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff; font: 900 12px/1 var(--font); letter-spacing: .1em; padding: 6px 10px; border-radius: 99px; pointer-events: none; animation: rec-blink 1.2s steps(2, start) infinite; }
@keyframes rec-blink { 50% { opacity: .55; } }
.replay-wait { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #e4e4e7; font-size: 13px; text-align: center; animation: replay-wait-off 0s 12s forwards; }
@keyframes replay-wait-off { to { opacity: 0; } }
#continueBtn, #againBtn { max-width: 360px; }

/* Режим «Счёт» без паузы */
.flashes { position: absolute; top: 12px; right: 12px; z-index: 9; display: grid; gap: 8px; pointer-events: none; }
.flash { display: flex; gap: 10px; align-items: center; background: rgba(17,17,19,.92); border-left: 4px solid var(--accent); border-radius: 10px; padding: 8px; width: 260px; animation: slidein .25s ease-out; }
.flash img, .flash .ph { width: 88px; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex: none; }
.flash b { display: block; }
.flash span { color: var(--muted); font-size: 12px; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }

/* Итоги */
.finished-inner { max-width: 820px; margin: 0 auto; text-align: center; }
.finished-title { font: 900 clamp(28px, 5vw, 50px)/1.05 var(--font); text-transform: uppercase; letter-spacing: -.02em; }
.finished-sub { color: var(--muted); }
.ranking { list-style: none; padding: 0; margin: 20px auto; max-width: 480px; display: grid; gap: 8px; counter-reset: r; }
.ranking li { counter-increment: r; display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 10px; padding: 10px 14px; text-align: left; border: 2px solid transparent; }
.ranking li::before { content: counter(r); font: 900 18px var(--font); color: var(--muted); width: 22px; }
.ranking li:first-child { border-color: var(--accent); }
.ranking li:first-child::before { color: var(--accent); }
.ranking .n { flex: 1; font-weight: 700; }
.ranking .s { color: var(--muted); font-size: 13px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 24px; }
.gallery figure { margin: 0; background: var(--surface); border-radius: 10px; overflow: hidden; }
.gallery figure { position: relative; cursor: zoom-in; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #000; }
.gallery .play { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11px; padding-left: 2px; pointer-events: none; }
.gallery figcaption { padding: 6px 8px; font-size: 12px; color: var(--muted); text-align: left; }
.gallery figcaption b { color: var(--text); }

/* Плитки игроков */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; justify-content: center; overflow: hidden; min-height: 0; }
.tile { position: relative; background: var(--surface); border: 2px solid transparent; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; transition: border-color .2s; container-type: inline-size; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile.me video { transform: scaleX(-1); }
.tile .nocam { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; padding: 8px; }
.tile .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.85)); display: flex; align-items: center; gap: 6px; }
.tile .nm { font-weight: 800; font-size: clamp(13px, 4.5cqw, 22px); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .lives { display: flex; gap: 2px; align-items: center; }
.tile .lives svg { width: clamp(12px, 3.6cqw, 20px); height: clamp(12px, 3.6cqw, 20px); color: var(--accent); }
.tile .lives svg.lost { color: #4a4a50; }
.tile .count { font-weight: 800; font-size: clamp(12px, 3.8cqw, 18px); background: var(--accent); padding: 1px 8px; border-radius: 99px; }
.tile .bar { position: absolute; left: 0; top: 0; height: clamp(4px, 1.2cqw, 7px); background: #fff; width: 0; transition: width .12s linear; z-index: 1; }
.tile .bar.hot { background: var(--accent); }
.tile .tag { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.65); }
.tile .tag.host { color: var(--accent); }
.tile .tag.host:not(.hidden) + .tag.st { top: 34px; }
.tile.out { opacity: .5; }
.tile.out video { filter: grayscale(1); }
.tile.caught-now { border-color: var(--accent); animation: flash .6s ease-in-out 3; }
.tile.noface { border-color: var(--warn); }
.tile.offline { opacity: .35; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px rgba(224,40,60,.5); } }
.tile-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; align-items: center; z-index: 2; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-actions, .tile:focus-within .tile-actions, .tile.touch .tile-actions { opacity: 1; }
.tile-btn { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 99px; border: 0; background: rgba(0,0,0,.7); cursor: pointer; }
.tile-btn:hover { background: rgba(0,0,0,.9); }
.tile-btn.danger:hover { background: var(--accent); }
.tile-vol { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.7); border-radius: 99px; padding: 3px 9px; font-size: 11px; font-weight: 700; }
.tile-vol input { width: 70px; }
.tile-vol button { border: 0; background: none; padding: 0; cursor: pointer; display: grid; }
.tile-vol svg { width: 16px; height: 16px; }
.tile-vol.muted { color: var(--accent); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--surface-2); padding: 9px 14px; border-radius: 8px; font-size: 13px; animation: fadein .2s; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 100; display: grid; place-items: center; cursor: zoom-out; padding: 16px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; border-radius: 10px; cursor: default; background: #000; }

.dialog { background: var(--surface); color: var(--text); border: 0; border-radius: 16px; padding: 26px; width: min(460px, calc(100% - 32px)); }
.dialog::backdrop { background: rgba(0,0,0,.7); }
.dialog label { margin-top: 12px; }

@media (max-width: 900px) {
  .join-wrap { grid-template-columns: 1fr; }
  #game { height: auto; min-height: 100dvh; }
  .stage { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .splitter { display: none; }
  .screen-wrap { aspect-ratio: 16/9; min-height: 420px; }
  .tiles { grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .status { display: none; }
  .overlay.panel { padding: 16px; }
  .modes { grid-template-columns: 1fr; }
  .tile-actions { opacity: 1; }
}
@media (max-width: 520px) {
  #volume, .vol-icon, .passchip { display: none; }
  .card { padding: 22px; }
  .logo { font-size: 34px; }
  .topbar { gap: 8px; padding: 8px 10px; }
}

/* ---------- Роли и аккаунты (общие для всех игр FUNBASE) ---------- */
.role { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; margin-left: 6px; font: 900 10px/1 var(--font); letter-spacing: .06em; border-radius: 5px; flex: none; }
.role svg { width: 12px; height: 12px; }
.role-owner { background: var(--accent); color: #fff; padding: 3px 6px; }
.role-moderator { background: var(--text); color: var(--bg); padding: 3px 6px; }
.role-vip { background: #ff8a00; color: #1a0e00; padding: 3px 6px; }
.role-streamer { background: #9146ff; color: #fff; padding: 3px 6px; }
.role-youtuber { background: transparent; color: #ff3b3b; box-shadow: inset 0 0 0 1.5px #ff3b3b; padding: 3px 6px; }
.role-user { color: var(--ok); }
.role-user svg { width: 14px; height: 14px; }
.tile .nm .role { font-size: clamp(9px, 2.6cqw, 12px); }
.user-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; font-weight: 700; font-size: 14px; text-decoration: none; }
.user-chip:hover { background: var(--surface-3); }
.nav-link { color: var(--soft); text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-link:hover { color: var(--text); }
.auth-area { display: flex; align-items: center; gap: 12px; }
.signed-as { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 12px; margin-bottom: 14px; font-size: 14px; }
.signed-as b { font-size: 15px; }
.signed-as a { color: var(--muted); font-size: 13px; }
.lvl { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin-right: 8px; border-radius: 6px; background: var(--surface-3); color: var(--text); font: 900 11px/1 var(--font); flex: none; }

/* Субтитры: меню и полоса, закрывающая вшитые субтитры */
.cc-wrap { position: relative; }
.cc-menu { position: absolute; bottom: 46px; right: -40px; width: 280px; background: var(--surface); border-radius: 12px; padding: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.6); z-index: 20; }
.cc-menu label { margin-bottom: 10px; }
.cc-menu .hint { margin: 4px 0 0; }
.cc-menu input[type=range] { width: 100%; }
#ccBtn[aria-pressed="true"] { color: var(--accent); }
.sub-band { position: absolute; z-index: 3; pointer-events: none; backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); background: rgba(10,10,12,.72); border-radius: 6px; }

/* Позвать друга */
.invite-wrap { position: relative; }
.invite-menu { position: absolute; top: 46px; right: 0; width: 290px; background: var(--surface); border-radius: 12px; padding: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.6); z-index: 40; display: grid; gap: 6px; }
.invite-menu h4 { margin: 2px 4px 4px; font-size: 15px; }
.invite-menu .hint { margin: 4px; }
.invite-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; border: 0; background: var(--surface-2); border-radius: 8px; padding: 9px 10px; cursor: pointer; text-align: left; }
.invite-row:hover:not(:disabled) { background: var(--surface-3); }
.invite-row:disabled { opacity: .5; cursor: default; }
.invite-row .nm { font-weight: 700; display: flex; align-items: center; min-width: 0; }
.invite-row .st { color: var(--muted); font-size: 12px; white-space: nowrap; }
/* Новые заявки в друзья — точка на нике в шапке */
.user-chip { position: relative; }
.user-chip .dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.captcha:not(:empty) { margin: 4px 0 14px; min-height: 0; }

/* Аватарки: квадрат со скруглением, как всё на сайте */
.ava { width: var(--s, 32px); height: var(--s, 32px); border-radius: calc(var(--s, 32px) * .22); object-fit: cover; flex: none; background: var(--surface-3); display: inline-block; vertical-align: middle; }
.ava-letter { display: inline-grid; place-items: center; color: #fff; font: 900 calc(var(--s, 32px) * .46)/1 var(--font); background: hsl(var(--h) 55% 32%); }
.user-chip .ava { margin-right: 8px; }
.crop-dialog { width: min(380px, calc(100% - 32px)); }
.crop-view { width: 300px; height: 300px; margin: 0 auto 12px; border-radius: 22%; overflow: hidden; background: #000; box-shadow: 0 0 0 2px var(--accent); }
.crop-view canvas { width: 300px; height: 300px; display: block; cursor: grab; touch-action: none; }
.crop-view canvas:active { cursor: grabbing; }
.crop-zoom input { width: 100%; }
/* Плитка без камеры: аватарка по центру */
.tile .nocam .ava { --s: min(40%, 140px); width: var(--s); height: auto; aspect-ratio: 1; }

/* Выбор пола при регистрации и в профиле */
.gender-pick { display: grid; grid-template-columns: auto 1fr 1fr; gap: 10px; align-items: center; margin: 0 0 14px; }
.gp-label { font-weight: 600; font-size: 13px; color: var(--muted); }
.gp { display: flex; align-items: center; gap: 10px; border: 2px solid transparent; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-weight: 700; }
.gp img { width: 40px; height: 40px; border-radius: 9px; }
.gp.active { border-color: var(--accent); }
.gender-switch { display: flex; gap: 4px; background: var(--surface-2); border-radius: 8px; padding: 3px; }
.gender-switch button { flex: 1; border: 0; background: transparent; color: var(--muted); font-weight: 800; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.gender-switch button.active { background: var(--accent); color: #fff; }

/* ---------- Телефоны и планшеты ---------- */
/* Двойной тап по кнопкам не должен приближать страницу */
a, button, input, select, textarea, label, .btn, .chip, .icon-btn { touch-action: manipulation; }
/* iPhone приближает страницу, если у поля ввода шрифт мельче 16px */
@media (pointer: coarse), (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
.crop-name { margin-top: 10px; }

/* ---------- Телефон как камера ---------- */
.phonecam-dialog.wide { width: min(560px, calc(100% - 24px)); }
.cam-choice { display: grid; gap: 10px; margin-bottom: 14px; }
.cam-choice .mode { background: var(--surface-2); text-align: left; }
.qr-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: center; }
.pc-qr { width: 200px; height: 200px; background: #fff; border-radius: 14px; padding: 8px; display: grid; place-items: center; }
.pc-qr svg { width: 100%; height: 100%; display: block; }
.qr-steps { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--soft); font-size: 14px; }
.pc-link { word-break: break-all; }
.pc-status { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; margin: 12px 0; color: var(--warn); }
.pc-status i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pcblink 1.2s infinite; }
.pc-status.ok { color: var(--ok); } .pc-status.ok i { animation: none; }
.pc-status.bad { color: var(--accent); }
@keyframes pcblink { 50% { opacity: .3; } }
.pc-preview { border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 12px; aspect-ratio: 16/9; }
.pc-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.phone-cam-link { display: block; text-align: center; margin-top: 10px; color: var(--muted); font-size: 13.5px; font-weight: 700; background: none; border: 0; cursor: pointer; width: 100%; text-decoration: underline; text-underline-offset: 3px; }
.phone-cam-link:hover { color: var(--text); }
@media (max-width: 560px) { .qr-wrap { grid-template-columns: 1fr; justify-items: center; } }

/* ---------- «Не смейся» и «Большая игра» на телефоне ---------- */
@media (max-width: 760px) {
  /* Видео 16:9 во всю ширину, без минимальной высоты — иначе блок раздувается шире экрана */
  .screen-wrap { min-height: 0; width: 100%; }
  /* Лобби, «попался», итоги — панели поверх видео: даём им высоту экрана, листаются внутри */
  .screen-wrap:has(> .overlay.panel:not(.hidden)) { aspect-ratio: auto; height: min(78vh, 680px); }
  /* Верхняя панель: без логотипа и слова «Комната», при нехватке места — листается */
  .topbar { overflow-x: auto; scrollbar-width: none; }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar .logo.small { display: none; }
  .topbar #copyLink { font-size: 0; gap: 4px; }
  .topbar #copyLink b { font-size: 13px; }
  .topbar .chip { padding: 6px 9px; flex: none; }
  .topbar .icon-btn { width: 36px; height: 36px; }
}
/* На тач-экранах кнопки плитки («Жалоба», «Выгнать», «Калибровка») — по тапу, а не поверх имени всё время */
@media (max-width: 900px) {
  .tile-actions { opacity: 0; pointer-events: none; }
  .tile.touch .tile-actions { opacity: 1; pointer-events: auto; }
}
@media (max-width: 760px) {
  /* Камеры сразу под видео, без пустой полосы посередине */
  .tiles { align-content: start; }
  .stage { align-content: start; grid-auto-rows: max-content; }
}

/* ---------- Паки 16+ / 18+ ---------- */
.age-badge { display: inline-block; font: 900 11px/1 var(--font); padding: 4px 7px; border-radius: 6px; background: #ffb020; color: #111; vertical-align: middle; margin-left: 6px; letter-spacing: .02em; flex: none; }
.age-badge.a18 { background: var(--accent); color: #fff; }
.age-dialog { text-align: center; }
.age-dialog h2 { margin: 12px 0 0; }
.age-dialog .lead { margin: 12px 0 0; }
.age-mark { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--accent); display: grid; place-items: center; font: 900 26px var(--font); color: var(--accent); }
.age-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.age-btns .btn { width: 100%; padding: 13px 10px; }
/* Обложки 18+ размыты, пока возраст не подтверждён */
.age-blur img, img.age-blur { filter: blur(14px) brightness(.7); }
.age-blur { overflow: hidden; }

/* ---------- Карточки игр: уровни Default → Common → Uncommon → Rare → Legendary ---------- */
.t-default { --c: #6f6f7a; --c2: #34343c; --glow: transparent; }
.t-common { --c: #dfe3ea; --c2: #868c97; --glow: rgba(223, 227, 234, .12); }
.t-uncommon { --c: #3ddc84; --c2: #11804a; --glow: rgba(61, 220, 132, .22); }
.t-rare { --c: #4c9dff; --c2: #2742d6; --glow: rgba(76, 157, 255, .32); }
.t-legendary { --c: #ffcf40; --c2: #ff6a00; --glow: rgba(255, 170, 40, .4); }

/* Значок у ника в комнате: ромбик цвета уровня */
.cbadge { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 5px; vertical-align: middle; flex: none; }
.cbadge i { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; background: linear-gradient(135deg, var(--c), var(--c2)); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55), 0 0 6px var(--glow); }
.cb-common { --c: #f2f4f8; --c2: #8b919c; --glow: transparent; }
.cb-uncommon { --c: #5cf09d; --c2: #11804a; --glow: rgba(61, 220, 132, .5); }
.cb-rare { --c: #7db8ff; --c2: #2742d6; --glow: rgba(76, 157, 255, .6); }
.cb-legendary { --c: #ffe27a; --c2: #ff6a00; --glow: rgba(255, 170, 40, .8); }
.cb-legendary i { animation: cb-pulse 2.4s ease-in-out infinite; }
@keyframes cb-pulse { 50% { box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55), 0 0 11px var(--glow); } }

/* Сама карточка */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin: 0 0 32px; }
.ach { position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 16px; padding: 2px; background: linear-gradient(160deg, var(--c), var(--c2) 70%); box-shadow: 0 10px 28px -12px var(--glow); isolation: isolate; min-width: 0; }
.ach > * { background: #141418; }
.ach-art { position: relative; border-radius: 14px 14px 0 0; aspect-ratio: 5 / 4; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(70% 70% at 50% 42%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%), linear-gradient(180deg, color-mix(in srgb, var(--c2) 28%, #141418), #141418); }
.ach-emblem { width: 46%; height: auto; color: var(--c); filter: drop-shadow(0 4px 14px var(--glow)); }
.ach-tier { position: absolute; left: 10px; top: 10px; font: 900 10.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--c); background: rgba(0, 0, 0, .45); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); padding: 4px 7px; border-radius: 99px; }
.ach-pips { position: absolute; right: 10px; top: 12px; display: flex; gap: 3px; }
.ach-pips i { width: 6px; height: 6px; transform: rotate(45deg); border-radius: 1px; background: rgba(255, 255, 255, .14); }
.ach-pips i.on { background: var(--c); box-shadow: 0 0 5px var(--glow); }
.ach-body { border-radius: 0 0 14px 14px; padding: 10px 12px 12px; display: grid; gap: 7px; align-content: start; }
.ach-body h3 { margin: 0; font: 800 16px/1.15 var(--font); color: var(--text); text-transform: none; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ach-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c2), var(--c)); }
.ach-pts { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ach-pts b { color: var(--text); font-weight: 800; }
.ach-meta { font-size: 12px; color: var(--muted); }
.ach-boost { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 2px; }
.ach-boost .btn { padding: 5px 0; font-size: 12px; min-height: 0; min-width: 0; }

/* Default — ещё не прокачана: приглушённая */
.ach.t-default { box-shadow: none; }
.ach.t-default .ach-emblem { filter: none; opacity: .55; }
/* Rare — свечение */
.ach.t-rare { box-shadow: 0 0 0 1px rgba(76, 157, 255, .25), 0 12px 32px -10px var(--glow); }
/* Legendary — переливающаяся рамка, блик и свечение */
.ach.t-legendary { background: conic-gradient(from var(--ach-a, 0deg), #ffcf40, #ff6a00, #ff2d55, #ffcf40, #fff1b8, #ffcf40); animation: ach-spin 6s linear infinite; box-shadow: 0 0 0 1px rgba(255, 200, 60, .35), 0 14px 38px -10px var(--glow); }
.ach.t-legendary .ach-art::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255, 240, 200, .28) 50%, transparent 60%); transform: translateX(-60%); animation: ach-shine 3.6s ease-in-out infinite; pointer-events: none; }
.ach.t-legendary .ach-emblem { animation: ach-float 3s ease-in-out infinite; }
@property --ach-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ach-spin { to { --ach-a: 360deg; } }
@keyframes ach-shine { 0%, 30% { transform: translateX(-60%); } 70%, 100% { transform: translateX(60%); } }
@keyframes ach-float { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .ach.t-legendary, .ach.t-legendary .ach-art::after, .ach.t-legendary .ach-emblem, .cb-legendary i { animation: none; } }
@media (max-width: 520px) {
  .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ach-body { padding: 9px 10px 10px; }
  .ach-body h3 { font-size: 14.5px; }
  .ach-tier { left: 8px; top: 8px; font-size: 9.5px; padding: 3px 6px; }
  .ach-pips { right: 8px; top: 10px; }
}

/* Светлая тема: общие детали игр (баннеры итогов, чат, таймеры, второстепенный текст, жёлтые акценты) */
:root[data-theme="light"] .result-banner { background: linear-gradient(135deg, #fde2e5, var(--surface)); }
:root[data-theme="light"] .result-banner b { color: #a86f00; }
:root[data-theme="light"] .chat-msg.mine { background: #fde2e5; }
:root[data-theme="light"] .chat-msg.mine b { color: #c0162b; }
:root[data-theme="light"] :is(.timer-line i, .timer-line div, .ctimer i, .parts i b) { background: var(--text); }
:root[data-theme="light"] .ctimer { background: rgba(0,0,0,.08); }
:root[data-theme="light"] :is(.log li .q, .hist li .q, .all-clips li .q, .noms, .picked) { color: var(--soft); }
:root[data-theme="light"] .picked b { color: var(--text); }
:root[data-theme="light"] :is(.turn-body .say b, .scores li:first-child .place, .noms b, .queue li.next::before, .glog .l-vote, .react-btn, .react-btn[data-react="clap"]) { color: #b07d00; }
:root[data-theme="light"] .glog .l-night { color: #3b4fc4; }
:root[data-theme="light"] .count { color: var(--text); }
:root[data-theme="light"] :is(.reveal-list li.cur .mini-play, .all-clips .mini-play) { background: var(--surface-3); }
:root[data-theme="light"] .pack:focus-visible { outline-color: var(--text); }
:root[data-theme="light"] .btn.guess.on { box-shadow: 0 0 0 3px var(--text); }
:root[data-theme="light"] .vote-btns .btn.on { box-shadow: inset 0 0 0 2px var(--text); }

/* Светлая тема: карточки игр — белые, цвет уровня в рамке, свечении и эмблеме */
:root[data-theme="light"] .t-default { --ink: #8b8b96; }
:root[data-theme="light"] .t-common { --c: #c5cad4; --ink: #5d6470; --glow: rgba(120, 130, 150, .18); }
:root[data-theme="light"] .t-uncommon { --ink: #0f9a52; }
:root[data-theme="light"] .t-rare { --ink: #2563eb; }
:root[data-theme="light"] .t-legendary { --ink: #e07800; }
:root[data-theme="light"] .ach > * { background: #fff; }
:root[data-theme="light"] .ach-art { background: radial-gradient(70% 70% at 50% 42%, color-mix(in srgb, var(--c) 34%, transparent), transparent 72%), linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, #fff), #fff); }
:root[data-theme="light"] .ach-emblem { color: var(--ink, var(--c2)); filter: drop-shadow(0 4px 10px var(--glow)); }
:root[data-theme="light"] .ach-tier { color: var(--ink, var(--c2)); background: rgba(255, 255, 255, .85); border-color: color-mix(in srgb, var(--ink, var(--c2)) 40%, transparent); }
:root[data-theme="light"] .ach-pips i { background: rgba(0, 0, 0, .12); }
:root[data-theme="light"] .ach-pips i.on { background: var(--ink, var(--c)); }
:root[data-theme="light"] .ach-bar { background: rgba(0, 0, 0, .08); }
:root[data-theme="light"] .ach { box-shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 10px 26px -14px var(--glow); }
:root[data-theme="light"] .ach.t-default { background: linear-gradient(160deg, #dcdce3, #c9c9d2); }

/* «Не смейся»: панель лобби поверх экрана — светлая */
:root[data-theme="light"] .screen-wrap .overlay.panel { --bg: #f2f2f5; --surface: #fff; --surface-2: #ececf1; --surface-3: #e1e1e8; --line: #dcdce3; --text: #16161a; --muted: #686872; --soft: #3d3d45;
  background: rgba(255,255,255,.97); color: var(--text); }
:root[data-theme="light"] .screen-wrap { background: #e9e9ee; }

/* Светлая тема: текст на красном — всегда белый; разные мелочи из аудита контраста */
:root[data-theme="light"] :is(.tile .count, .live, .profile-head .lvl, div.how > div > b, .aopt .k, .ptile .tag.host, .q-audio .note, .tag.host, .seat .num, .mini-play.on, .ibtn:hover, .tile-btn.danger:hover, .site-head nav a.donate-link:hover, .site-head.open .nav-toggle) { color: #fff; }
:root[data-theme="light"] .soon-art span { color: #9a9aa6; }
:root[data-theme="light"] .t-default { --ink: #6f6f7a; }
:root[data-theme="light"] .part { color: #fff; }
:root[data-theme="light"] .lset { background: var(--surface-2); }

/* Профиль: блок «Пасхалки» */
.eggs { margin: 18px 0 8px; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 14px; }
.eggs-head { display: grid; grid-template-columns: auto auto minmax(120px, 1fr) auto; align-items: center; gap: 14px; }
.lk-toggle { display: inline-flex; align-items: center; gap: 6px; }
.lk-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: rotate .2s; }
.lk-toggle[aria-expanded="true"] svg { rotate: 180deg; }
.lk-body { display: grid; gap: 14px; }
.eggs-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 10px 26px -10px rgba(224,40,60,.8); }
.eggs-ico svg { width: 22px; height: 22px; fill: none; }
.eggs-txt b { display: block; font: 900 16px/1.2 var(--font); letter-spacing: .02em; text-transform: uppercase; }
.eggs-txt span { color: var(--muted); font-size: 14px; }
.eggs-txt em { font-style: normal; font-weight: 900; color: var(--text); }
.eggs-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.eggs-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #ff8a96); box-shadow: 0 0 14px rgba(224,40,60,.6); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.eggs-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.egg-slot { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); font: 800 13px/1 var(--font); letter-spacing: .04em; }
.egg-slot svg { width: 15px; height: 15px; fill: none; }
.egg-slot.found { border: 1px solid var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: 0 0 18px -8px rgba(224,40,60,.8); letter-spacing: 0; }
.egg-slot.found svg { color: var(--accent); }
.eggs-hint { margin: 0; color: var(--muted); font-size: 13.5px; }
@media (max-width: 520px) { .eggs-head { grid-template-columns: auto 1fr; } .eggs-bar, .lk-toggle { grid-column: 1 / -1; } .lk-toggle { justify-content: center; } }

/* ---------- SEO: «Как играть», вопросы, подборки (тексты — lib/seo-content.js) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1.logo { margin: 0; }
.seo-about { width: min(900px, 100%); margin-top: 28px; background: var(--surface); border-radius: 16px; padding: 32px; }
.seo-about h2 { font: 900 clamp(22px, 3.4vw, 30px)/1.1 var(--font); letter-spacing: -.02em; margin: 10px 0 12px; }
.seo-about h3 { margin-top: 28px; }
.seo-intro { color: var(--soft); margin: 0; max-width: 70ch; }
.seo-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 22px 0 0; }
.seo-facts div { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.seo-facts dt { color: var(--muted); font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; }
.seo-facts dd { margin: 6px 0 0; font-weight: 700; }
.seo-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: st; }
.seo-steps li { counter-increment: st; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; color: var(--soft); }
.seo-steps li::before { content: '0' counter(st); font: 900 14px/1.6 var(--font); color: var(--accent); }
.seo-faq { border-top: 1px solid var(--line); }
.seo-faq details { border-bottom: 1px solid var(--line); }
.seo-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px 2px; font-weight: 700; }
.seo-faq summary::-webkit-details-marker { display: none; }
.seo-faq summary::after { content: ''; flex: none; width: 12px; height: 12px; background: linear-gradient(var(--accent), var(--accent)) center / 12px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) center / 2px 12px no-repeat; transition: transform .2s; }
.seo-faq details[open] summary::after { transform: rotate(45deg); }
.seo-faq summary:hover { color: var(--accent); }
.seo-faq p { margin: -4px 0 16px; color: var(--soft); max-width: 70ch; }
.seo-more { display: flex; flex-wrap: wrap; gap: 8px; }
.seo-more a { text-decoration: none; font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-radius: 99px; background: var(--surface-2); transition: background .15s, color .15s; }
.seo-more a:hover { background: var(--accent); color: var(--accent-ink, #fff); }
.seo-more.seo-coll { margin-top: 8px; }
.seo-more.seo-coll a { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.seo-more.seo-coll a:hover { box-shadow: none; background: var(--accent); }
.seo-home { margin-top: 8px; }
.seo-home .seo-faq { background: var(--surface); border: 0; border-radius: 16px; padding: 4px 24px; }
.seo-home .seo-faq details:last-child { border-bottom: 0; }
.seo-home .seo-coll { margin-top: 16px; }
/* Подборки */
.coll { padding-bottom: 40px; }
.coll > .eyebrow { margin-top: 28px; }
.coll-title { font: 900 clamp(34px, 6.4vw, 64px)/.98 var(--font); text-transform: uppercase; letter-spacing: -.03em; margin: 14px 0 18px; max-width: 16ch; overflow-wrap: anywhere; }
.coll-lead { color: var(--soft); font-size: 17px; max-width: 64ch; margin: 0; }
.coll-p { color: var(--soft); max-width: 70ch; margin: -6px 0 18px; }
.coll-sec .section-title { margin-top: 44px; }
.coll-sec .seo-faq { background: var(--surface); border: 0; border-radius: 16px; padding: 4px 24px; }
.coll-sec .seo-faq details:last-child { border-bottom: 0; }
.coll-sec .seo-more + .seo-more { margin-top: 10px; }
.seo-table-wrap { margin-top: 28px; overflow-x: auto; border-radius: 16px; background: var(--surface); }
.seo-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.seo-table th, .seo-table td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.seo-table tr:last-child > * { border-bottom: 0; }
.seo-table thead th { font: 800 12px/1.2 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.seo-table thead th:last-child, .seo-table td:last-child { color: var(--text); font-weight: 700; }
.seo-table thead th:last-child { color: var(--accent); }
.seo-table td { color: var(--muted); }
.seo-table tbody th { font-weight: 800; white-space: nowrap; }
@media (max-width: 600px) {
  .seo-about { padding: 22px 18px; }
  .seo-home .seo-faq, .coll-sec .seo-faq { padding: 2px 16px; }
}
@media (prefers-reduced-motion: reduce) { .seo-faq summary::after { transition: none; } }

/* Светлая тема: у полей видимая рамка — иначе на серых панелях (настройки «Мафии» и т. п.) они сливаются с фоном */
:root[data-theme="light"] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea) { border-color: #d2d2db; }
:root[data-theme="light"] :is(input, select, textarea):focus { border-color: var(--accent); }
/* Пока поверх видео открыта панель (лобби, «попался», итоги), само видео прячем: иначе сквозь полупрозрачную панель
   проступает его кадр и белый заголовок YouTube */
.screen-wrap:has(> .overlay.panel:not(.hidden)) :is(#movie, .yt-mount) { visibility: hidden; }

/* Профиль: постройки из «Песочницы» */
.sand-builds { margin: 8px 0 18px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.sb-card { display: flex; flex-direction: column; gap: 4px; border-radius: 14px; overflow: hidden; background: var(--surface); text-decoration: none; color: var(--text); padding-bottom: 10px; transition: transform .2s; }
.sb-card:hover { transform: translateY(-3px); }
.sb-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; background: #0b0b0e; }
.sb-card b { padding: 0 12px; font-weight: 800; font-size: 14px; }
.sb-card span { padding: 0 12px; color: var(--muted); font-size: 12px; }
