/* ══════════════════════════════════════════════════════════════
   Trustway Quiz - общая дизайн-система (клиент + админка)
   Тёмная navy/purple тема, мобайл-фёрст, адаптив.
   Шрифт - системный стек (без внешних зависимостей): UI на армянском,
   который Nunito всё равно не покрывает, плюс работает офлайн/в LAN.
   ════════════════════════════════════════════════════════════════ */
:root {
  --bg: #0a0e27;
  --bg-grad: radial-gradient(1200px 600px at 70% -10%, #1c1c54 0%, transparent 60%), linear-gradient(160deg, #0a0e27 0%, #11143a 100%);
  --card: #16213e;
  --card-light: #1e2a4a;
  --purple: #6c63ff;
  --purple-light: #242456;
  --purple-dark: #4b44cc;
  --teal: #00b894;
  --red: #e84393;
  --amber: #f59e0b;
  --amber-light: #2a2010;
  --green: #10b981;
  --green-light: #0c2a1e;
  --text: #e7e7ff;
  --text2: #a3a3cc;
  --border: #2a2a5a;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --radius: 16px;
  --gold: #f7c64b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

/* ── Иконки (инлайн SVG) ────────────────────────────────────── */
.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex-shrink: 0; display: inline-block; }
.icon.big { width: 1.5em; height: 1.5em; }

/* ── Жетон-монета ───────────────────────────────────────────── */
.token-icon {
  display: inline-block;
  width: 1.05em; height: 1.05em;
  vertical-align: -.2em;
  background: url('token.png') center/contain no-repeat;
  flex-shrink: 0;
}
.token-icon.lg { width: 1.5em; height: 1.5em; }

/* ── Header ─────────────────────────────────────────────────── */
header {
  width: 100%;
  background: linear-gradient(135deg, #1a1a4e, #0d0d35);
  padding: 12px clamp(14px, 4vw, 24px);
  padding-top: calc(12px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 9px; color: #fff; font-size: clamp(17px, 4.5vw, 20px); font-weight: 900; letter-spacing: -.3px; }
.logo .token-icon { width: 1.3em; height: 1.3em; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill {
  background: rgba(108, 99, 255, .22); color: #fff;
  border: 1px solid #6c63ff66; border-radius: 20px;
  padding: 6px 13px; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; gap: 6px;
}
.pill .progress-percent { font-weight: 900; font-size: 15px; color: var(--gold); }
.pill-link { cursor: pointer; text-decoration: none; transition: background .15s; }
.pill-link:hover { background: rgba(108, 99, 255, .4); }

/* ── Screens ────────────────────────────────────────────────── */
.screen { display: none; width: 100%; max-width: 920px; padding: clamp(16px, 4vw, 28px) clamp(12px, 4vw, 20px) 48px; }
.screen.active { display: block; }

.page-title { font-size: clamp(22px, 6vw, 28px); font-weight: 900; margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--text2); margin-bottom: 22px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  padding: 12px 20px; border-radius: 12px;
  font-family: inherit; font-weight: 800; font-size: 14px;
  cursor: pointer; transition: all .15s; border: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px;
}
.btn .icon { width: 1.25em; height: 1.25em; }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-secondary { background: var(--purple-light); color: var(--text); border: 1px solid var(--purple); }
.btn-secondary:hover { background: #2c2c66; }
.btn-danger { background: #2a1a2a; color: var(--red); border: 1.5px solid #e8439366; }
.btn-danger:hover { background: #34203a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.start-btn, .next-btn {
  width: 100%; padding: 16px; border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), #a78bfa);
  color: #fff; border: none; font-family: inherit; font-weight: 900; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .15s; box-shadow: 0 6px 18px rgba(108, 99, 255, .35); min-height: 52px;
}
.start-btn:hover, .next-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(108, 99, 255, .45); }

/* ── Forms ──────────────────────────────────────────────────── */
label.field-label { font-size: 12px; font-weight: 800; color: var(--text2); text-transform: uppercase; letter-spacing: .6px; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.field-input, .adm-input {
  width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 16px; font-family: inherit; font-weight: 600; outline: none;
  transition: border-color .2s; background: var(--card-light); color: var(--text);
}
.field-input:focus, .adm-input:focus { border-color: var(--purple); }
select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c63ff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
  cursor: pointer;
}

.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) {
  .name-row { grid-template-columns: 1fr; }
}

/* ── Tabs (используется в админке) ──────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--purple-light); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.tab { flex: 1; min-width: 120px; padding: 10px; font-weight: 800; font-size: 13px; cursor: pointer; border-radius: 9px; text-align: center; color: var(--text2); transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tab.active { background: var(--card); color: var(--purple); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Rules box ──────────────────────────────────────────────── */
.rules-box { background: var(--card-light); border-radius: 12px; padding: 16px; border: 1px solid var(--border); }
.rules-box h4 { font-size: 13px; font-weight: 900; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 8px; }
.rules-box h4:first-child { margin-top: 0; }
.rule { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text); line-height: 1.5; margin-bottom: 8px; }
.rule .icon { color: var(--purple); margin-top: 1px; }
.rule b { color: #fff; font-weight: 800; }
.rule .good { color: var(--green); }
.rule .bad { color: var(--amber); }

/* ── Game: progress ─────────────────────────────────────────── */
.progress-wrap { height: 8px; background: var(--purple-light); border-radius: 99px; margin-bottom: 18px; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), #a78bfa); border-radius: 99px; transition: width .5s; }
.q-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 800; color: var(--text2); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px; flex-wrap: wrap; }
.q-meta .score { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }

/* ── Game layout ────────────────────────────────────────────── */
.game-layout { display: flex; gap: 20px; align-items: flex-start; }
.game-main { flex: 2; min-width: 0; }
.game-history { flex: 1; min-width: 230px; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); position: sticky; top: 84px; border: 1px solid var(--border); }

/* ── Player card ────────────────────────────────────────────── */
.player-card { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 16px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); }
.player-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--purple); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.player-avatar .icon { width: 24px; height: 24px; }
.player-info { flex: 1; min-width: 0; }
.player-name-txt { font-size: 16px; font-weight: 900; }
.player-tokens-txt { font-size: 13px; color: var(--text2); font-weight: 700; margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.player-tokens-txt .sep { opacity: .4; }
.tokens-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.tok { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); border: 1.5px solid #d97706; transition: all .3s; }
.tok.e { background: #23234d; border-color: var(--border); }
.player-card.knocked { border: 2px solid var(--red); background: #2a1a2a; }
.player-card.knocked .player-avatar { background: var(--red); }

/* ── Lifelines ──────────────────────────────────────────────── */
.lifelines { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.lifeline-btn { flex: 1; min-width: 130px; padding: 12px; border-radius: 12px; border: 2px solid var(--border); background: var(--card); font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; align-items: center; gap: 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); color: var(--text); min-height: 64px; }
.lifeline-btn .icon { width: 24px; height: 24px; }
.lifeline-btn .ll-cost { font-size: 11px; color: var(--text2); font-weight: 800; display: flex; align-items: center; gap: 4px; }
.lifeline-btn:disabled { opacity: .35; cursor: not-allowed; }
.lifeline-btn.used { opacity: .3; cursor: not-allowed; text-decoration: line-through; }
.lifeline-5050 { color: #e8a04e; border-color: #e8a04e55; }
.lifeline-5050:hover:not(:disabled) { background: #2a2010; border-color: #e8a04e; }
.lifeline-hall { color: #5aa9e6; border-color: #5aa9e655; }
.lifeline-hall:hover:not(:disabled) { background: #0a2336; border-color: #5aa9e6; }

/* ── Bet card ───────────────────────────────────────────────── */
.bet-card { background: linear-gradient(135deg, #1a1a4e 0%, #11113a 100%); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; border: 1px solid var(--purple); }
.bet-card-title { color: #fff; font-size: 18px; font-weight: 900; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.bet-hint { color: rgba(255, 255, 255, .68); font-size: 13px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bet-btns { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.bet-btn { flex: 1; max-width: 110px; min-width: 72px; height: 64px; border-radius: 12px; border: 2.5px solid rgba(108, 99, 255, .4); background: rgba(108, 99, 255, .15); font-family: inherit; font-size: 22px; font-weight: 900; cursor: pointer; transition: all .15s; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bet-btn small { font-size: 11px; opacity: .85; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.bet-btn:hover:not(:disabled) { background: rgba(108, 99, 255, .3); }
.bet-btn.active { background: #fff; border-color: #fff; color: var(--purple); }
.bet-btn:disabled { opacity: .3; cursor: not-allowed; }
.bet-lock-btn { width: 100%; padding: 14px; border-radius: 12px; background: #fff; color: var(--purple); border: none; font-family: inherit; font-weight: 900; font-size: 15px; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; }
.bet-lock-btn:hover:not(:disabled) { background: #f1f0ff; }
.bet-lock-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Timer ──────────────────────────────────────────────────── */
.timer-wrap { display: flex; justify-content: center; margin-bottom: 18px; }
#timer-text { min-width: 124px; text-align: center; padding: 12px 22px; border-radius: 16px; background: #2a2010; color: var(--amber); border: 2px solid #f59e0b66; box-shadow: 0 8px 22px rgba(245, 158, 11, .16); font-weight: 900; font-size: clamp(28px, 8vw, 34px); line-height: 1; font-variant-numeric: tabular-nums; }
#timer-text.warning { color: var(--amber); border-color: var(--amber); }
#timer-text.urgent { background: #2a1a2a; color: #ef4444; border-color: #ef444466; box-shadow: 0 8px 22px rgba(239, 68, 68, .16); }

/* ── Question + options ─────────────────────────────────────── */
#question-text { font-size: clamp(17px, 4.6vw, 19px); font-weight: 800; line-height: 1.45; margin-bottom: 20px; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.option-btn { padding: 14px; border-radius: 12px; background: var(--card); border: 2.5px solid var(--border); text-align: left; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; transition: all .15s; display: flex; gap: 10px; align-items: center; color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); min-height: 56px; }
.option-btn:hover:not(:disabled) { border-color: var(--purple); background: var(--purple-light); }
.option-btn .opt-badge { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; flex-shrink: 0; }
.option-btn.correct { border-color: var(--green); background: var(--green-light); }
.option-btn.correct .opt-badge { background: var(--green); color: #fff; }
.option-btn.wrong { border-color: var(--red); background: #2a1a2a; }
.option-btn.wrong .opt-badge { background: var(--red); color: #fff; }

.question-placeholder { background: var(--card-light); border-radius: var(--radius); padding: 30px 20px; text-align: center; margin-bottom: 20px; border: 1px dashed var(--border); color: var(--text2); }
.question-placeholder .icon { width: 42px; height: 42px; color: var(--purple); margin-bottom: 10px; }
.question-placeholder p { font-size: 15px; font-weight: 800; }

/* ── Result banner + summary ────────────────────────────────── */
#result-banner { display: none; padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 800; font-size: 14px; align-items: center; gap: 10px; line-height: 1.4; }
#result-banner.show { display: flex; }
#result-banner .icon { width: 22px; height: 22px; flex-shrink: 0; }
#result-banner.correct { background: var(--green-light); color: #34d399; border: 1px solid var(--green); }
#result-banner.wrong { background: var(--amber-light); color: #fbbf24; border: 1px solid var(--amber); }

.bets-summary { display: none; background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.bets-summary.show { display: block; }
.bets-summary .sum-title { font-size: 12px; font-weight: 800; margin-bottom: 8px; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.bet-result-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; margin-bottom: 4px; font-size: 13px; font-weight: 800; }
.bet-result-row .brt-icon { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bet-result-row.gain { background: var(--green-light); color: #34d399; }
.bet-result-row.loss { background: var(--amber-light); color: #fbbf24; }
.bet-result-row.bonus { background: linear-gradient(135deg, #ffd700, #ffb347); color: #5d3a00; }

.next-btn-wrap { display: none; margin-top: 16px; }
.next-btn-wrap.show { display: block; }

/* ── History ────────────────────────────────────────────────── */
.history-title { font-size: 14px; font-weight: 900; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.history-list { max-height: 420px; overflow-y: auto; }
.history-empty { text-align: center; color: var(--text2); padding: 20px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.history-empty .icon { width: 30px; height: 30px; opacity: .6; }
.history-item { padding: 10px; border-radius: 10px; margin-bottom: 8px; background: var(--card-light); border: 1px solid var(--border); }
.history-item.correct { background: var(--green-light); border-left: 4px solid var(--green); }
.history-item.wrong { background: var(--amber-light); border-left: 4px solid var(--amber); }
.history-q-num { font-size: 11px; font-weight: 800; color: var(--text2); }
.history-q-text { font-size: 12px; font-weight: 700; margin: 4px 0; }
.history-answer { font-size: 11px; display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.history-answer .lbl { font-weight: 800; color: var(--text2); }
.history-bet { font-size: 11px; color: var(--text2); margin-top: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-weight: 700; }

/* история-аккордеон на мобильном */
.history-toggle { display: none; }

/* ── Overlays ───────────────────────────────────────────────── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(10, 14, 39, .95); z-index: 100; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.overlay.show { display: flex; }
.overlay-box { background: var(--card); border-radius: 20px; padding: 28px 24px; max-width: 360px; width: 100%; border: 1px solid var(--border); text-align: center; margin: auto; }
.overlay-box.lg { max-width: 640px; text-align: left; }

.ko-icon { width: 56px; height: 56px; color: var(--red); margin: 0 auto 12px; display: block; }
.ko-title { font-size: 26px; font-weight: 900; color: var(--red); margin-bottom: 8px; }
.ko-sub { font-size: 14px; color: var(--text2); margin-bottom: 22px; line-height: 1.5; display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }

/* Hall help */
.hall-title { font-size: 20px; font-weight: 900; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hall-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.hall-bar-row { display: flex; align-items: center; gap: 10px; }
.hall-bar-label { font-weight: 900; font-size: 13px; width: 18px; text-align: center; }
.hall-bar-wrap { flex: 1; height: 28px; background: var(--card-light); border-radius: 6px; overflow: hidden; }
.hall-bar-fill { height: 100%; border-radius: 6px; transition: width .8s ease; display: flex; align-items: center; padding-left: 8px; font-size: 12px; font-weight: 800; color: #fff; }
.hall-pct { font-weight: 800; font-size: 13px; width: 38px; text-align: right; color: var(--text2); }

/* ── Final screen ───────────────────────────────────────────── */
.final-medal { width: 72px; height: 72px; margin: 0 auto; }
.final-stat-grid { display: flex; gap: 10px; margin-bottom: 14px; }
.final-stat { flex: 1; border-radius: 10px; padding: 12px; text-align: center; }
.final-stat .num { font-size: 26px; font-weight: 900; }
.final-stat .lbl { font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 4px; }
.final-stat.ok { background: var(--green-light); color: var(--green); }
.final-stat.bad { background: var(--amber-light); color: #fbbf24; }
.final-stat.tot { background: var(--purple-light); color: var(--purple); }

.lb-row { display: flex; align-items: center; gap: 12px; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; background: var(--card); border: 2px solid transparent; }
.lb-row.me { background: var(--purple-light); border-color: var(--purple); }
.lb-rank { font-size: 18px; font-weight: 900; min-width: 30px; text-align: center; }
.lb-name { flex: 1; font-weight: 800; font-size: 14px; min-width: 0; }
.lb-date { font-size: 11px; color: var(--text2); font-weight: 600; }
.lb-tokens { font-weight: 900; font-size: 18px; display: flex; align-items: center; gap: 5px; }

/* ── Toast + bonus ──────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(120px); background: #11112a; color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 700; transition: transform .3s ease; z-index: 999; border: 1px solid var(--purple); max-width: 90vw; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow); }
.toast.show { transform: translateX(-50%) translateY(0); }

.bonus-notification { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: linear-gradient(135deg, #ffd700, #ffb347); color: #5d3a00; padding: 20px 30px; border-radius: 24px; font-weight: 900; font-size: clamp(18px, 5vw, 24px); z-index: 1000; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); text-align: center; animation: bonusPop .9s ease-out forwards; }
.bonus-notification small { font-size: 14px; display: block; margin-top: 5px; opacity: .9; font-weight: 800; }
@keyframes bonusPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ── Admin-specific ─────────────────────────────────────────── */
.adm-section { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; border: 1px solid var(--border); }
.adm-section-title { font-size: 13px; font-weight: 900; color: var(--text2); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 16px; display: flex; align-items: center; gap: 7px; }
.adm-section-title .icon { color: var(--purple); }
.adm-label { font-size: 12px; font-weight: 800; color: var(--text2); display: block; margin-bottom: 6px; margin-top: 12px; }
.adm-label:first-of-type { margin-top: 0; }
.adm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adm-msg { margin-top: 10px; font-size: 13px; font-weight: 800; display: none; }
.adm-msg.show { display: block; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn { flex: 1; min-width: 90px; padding: 10px; border-radius: 10px; border: 2px solid var(--border); background: var(--card-light); color: var(--text2); font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; transition: all .15s; }
.seg-btn.active { border-color: var(--purple); background: var(--purple-light); color: #fff; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: none; }

/* Question editor */
.q-item { background: var(--card-light); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.q-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.q-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.q-item textarea { width: 100%; border: 1.5px solid var(--border); background: var(--card); border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 14px; resize: vertical; min-height: 44px; outline: none; font-weight: 700; color: var(--text); }
.q-item textarea:focus { border-color: var(--purple); }
.option-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.opt-letter-badge { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.opt-A { background: #ede9ff; color: #6c63ff; }
.opt-B { background: #d4f5ed; color: #00916e; }
.opt-C { background: #fef3c7; color: #b45309; }
.opt-D { background: #fde8f3; color: #c42678; }
.option-row input[type=radio] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; flex-shrink: 0; }
.option-row input[type=text] { flex: 1; min-width: 0; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 16px; font-family: inherit; font-weight: 600; outline: none; color: var(--text); background: var(--card); }
.option-row input[type=text]:focus { border-color: var(--purple); }
.option-row.correct input[type=text] { border-color: var(--green); background: var(--green-light); }
.q-item-tools { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--purple); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); }
.upload-area { border: 2px dashed var(--purple); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; transition: all .2s; margin-bottom: 14px; background: var(--card-light); }
.upload-area:hover { background: var(--purple-light); }
.upload-area input { display: none; }
.upload-area .icon { width: 32px; height: 32px; color: var(--purple); margin-bottom: 8px; }

/* ══════════════ Responsive (мобильный) ══════════════════════ */
@media (max-width: 720px) {
  .game-layout { flex-direction: column; }
  .game-history { width: 100%; position: static; order: 2; }
  .game-main { order: 1; width: 100%; }
  .history-list { max-height: 320px; }
  /* история сворачивается на телефоне */
  .game-history.collapsible .history-list { display: none; }
  .game-history.collapsible.open .history-list { display: block; }
  .history-toggle { display: flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text); cursor: pointer; font-family: inherit; }
  .history-title { margin-bottom: 0; border-bottom: none; padding-bottom: 0; justify-content: space-between; cursor: pointer; }
  .game-history.collapsible.open .history-title { margin-bottom: 12px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
}

@media (max-width: 560px) {
  .options-grid { grid-template-columns: 1fr; }
  .adm-grid2 { grid-template-columns: 1fr; }
  .bet-btn { font-size: 20px; height: 60px; }
  .final-stat .num { font-size: 22px; }
  .lb-tokens { font-size: 16px; }
  .btn { padding: 11px 16px; }
}
