/* ═══════════════════════════════════════════════════════════════════
   АРЕНА · НА ЖИВО (live) — стил за панела в Арената и за отделната
   страница arena-live.html. Цветовете са от arena-deco.css:
   фон #0d1210 / #121814, текст #f6efdc, приглушен #a9a190, злато #c9a227.
   Всички класове са с префикс .am-live- (правилото от docs/arena/BUILD.md).
   ═══════════════════════════════════════════════════════════════════ */

.am-live {
  --bg: #0d1210;
  --panel: #121814;
  --card: #161d17;
  --card2: #1a211b;
  --line: rgba(201, 162, 39, .26);
  --line2: rgba(201, 162, 39, .46);
  --gold: #c9a227;
  --gold2: #e2c063;
  --gold3: #d8b25a;
  --ink: #f6efdc;
  --muted: #a9a190;
  --dim: #7f7a6c;
  --ok: #57c08a;
  --bad: #e05a4a;
  --me: #e2c063;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.am-live *, .am-live *::before, .am-live *::after { box-sizing: border-box; }

/* ─────────── панел в екрана на Арената (компактен) ─────────── */
#arenaMods .am-live { margin: 26px auto 0; max-width: 1160px; }

.am-live-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px clamp(14px, 2.4vw, 24px) 20px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(201, 162, 39, .09), transparent 60%),
    linear-gradient(180deg, #131a15, #0e1411);
  box-shadow: 0 30px 60px -50px #000;
}
.am-live-card::before, .am-live-card::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 1px solid var(--line2); pointer-events: none;
}
.am-live-card::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.am-live-card::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.am-live-kicker {
  margin: 0 0 6px;
  font: 600 8.5px/1 system-ui, sans-serif;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #8d8574;
}
.am-live-h {
  margin: 0;
  font: 600 clamp(20px, 2.6vw, 28px)/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: .1em;
  color: var(--ink);
}
.am-live-sub { margin: 6px 0 0; font: italic 400 12.5px/1.5 Georgia, serif; color: var(--muted); }

.am-live-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }

/* ─────────── бутони ─────────── */
.am-live-btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line2);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(201, 162, 39, .18), rgba(201, 162, 39, .06));
  color: #f4e6bf;
  font: 600 12px/1 system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, color .15s;
}
.am-live-btn:hover { background: linear-gradient(180deg, rgba(201, 162, 39, .3), rgba(201, 162, 39, .12)); border-color: var(--gold2); }
.am-live-btn:active { transform: translateY(1px); }
.am-live-btn[disabled] { opacity: .45; cursor: not-allowed; }
.am-live-btn--gold {
  background: linear-gradient(180deg, #e2c063, #b98f24);
  color: #1a1408; border-color: #f0d68a;
  text-shadow: none;
}
.am-live-btn--gold:hover { background: linear-gradient(180deg, #f0d68a, #c9a227); }
.am-live-btn--ghost {
  background: transparent; color: var(--muted); border-color: rgba(255, 255, 255, .12);
}
.am-live-btn--ghost:hover { color: var(--ink); border-color: var(--line2); background: rgba(255, 255, 255, .04); }
.am-live-btn--sm { min-height: 36px; padding: 0 14px; font-size: 10.5px; letter-spacing: .1em; }

/* ─────────── поле за код ─────────── */
.am-live-code-in {
  width: 148px; min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #0b100d;
  color: var(--ink);
  font: 600 18px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .28em;
  text-align: center;
  text-transform: uppercase;
}
.am-live-code-in::placeholder { color: #4d574d; letter-spacing: .18em; }
.am-live-code-in:focus { outline: none; border-color: var(--gold2); box-shadow: 0 0 0 2px rgba(201, 162, 39, .16); }

.am-live-hint { margin: 10px 0 0; font: 400 11.5px/1.5 system-ui, sans-serif; color: var(--dim); }
.am-live-err { margin: 10px 0 0; font: 500 12px/1.5 system-ui, sans-serif; color: var(--bad); }
.am-live-ok { margin: 10px 0 0; font: 500 12px/1.5 system-ui, sans-serif; color: var(--ok); }

/* ─────────── списък отворени стаи (панел и лоби) ─────────── */
.am-live-rooms { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.am-live-rooms li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 3px;
  background: rgba(255, 255, 255, .015);
  font: 400 12px/1.3 system-ui, sans-serif;
  color: var(--muted);
}
.am-live-rooms b {
  font: 600 14px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .16em; color: var(--gold2);
}
.am-live-rooms .am-live-grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-live-rooms .am-live-tag {
  font: 600 9px/1 system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--dim);
}

/* ─────────── отделна страница ─────────── */
body.am-live-page {
  margin: 0;
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(201, 162, 39, .10), transparent 60%),
    radial-gradient(70% 50% at 50% 110%, rgba(32, 74, 55, .35), transparent 65%),
    #0b100d;
  min-height: 100vh;
  color: #f6efdc;
  /* шушулка: глава · сцена (разтяга се) · долна лента, за да не виси
     съдържанието в горния ъгъл на висок екран */
  display: flex;
  flex-direction: column;
}
body.am-live-page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image:
    linear-gradient(rgba(201, 162, 39, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 39, .04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(90% 70% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(90% 70% at 50% 30%, #000 30%, transparent 75%);
}

.am-live-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1120px; margin: 0 auto; padding: 16px clamp(14px, 3vw, 28px) 8px;
}
.am-live-back {
  color: var(--muted); text-decoration: none;
  font: 500 11.5px/1 system-ui, sans-serif; letter-spacing: .1em;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 3px; padding: 9px 12px;
}
.am-live-back:hover { color: var(--ink); border-color: var(--line2); }
.am-live-brand {
  font: 600 10px/1 system-ui, sans-serif; letter-spacing: .34em; text-transform: uppercase; color: #8d8574;
}
.am-live-who { font: 500 11.5px/1 system-ui, sans-serif; color: var(--dim); min-width: 90px; text-align: right; }

.am-live-stage { position: relative; z-index: 2; max-width: 1120px; margin: 0 auto; padding: 8px clamp(12px, 3vw, 28px) 34px; }

/* страницата: сцената заема остатъка от екрана и центрира играта по височина */
body.am-live-page #arenaLivePage { display: flex; flex-direction: column; flex: 1 1 auto; padding-bottom: 58px; }
body.am-live-page .am-live-top { width: 100%; }
body.am-live-page .am-live-stage {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.am-live-page .am-live-stage > * { width: 100%; }

/* долна лента с изход към Арената (извън JS корена, за да не изчезва) */
.am-live-foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(201, 162, 39, .14);
  background: linear-gradient(180deg, rgba(11, 16, 13, .78), rgba(11, 16, 13, .97));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.am-live-foot a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 3px;
  color: #a9a190; text-decoration: none;
  font: 500 11px/1 system-ui, sans-serif;
  letter-spacing: .1em;
}
.am-live-foot a:hover { color: #f6efdc; border-color: rgba(201, 162, 39, .46); }
.am-live-foot span { font: 400 10.5px/1 system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #6f6a5e; }

.am-live-hero { text-align: center; padding: 14px 0 22px; }
.am-live-title {
  margin: 0;
  font: 600 clamp(28px, 5vw, 46px)/1 Georgia, serif;
  letter-spacing: .14em;
  color: #f6efdc;
  text-shadow: 0 0 26px rgba(201, 162, 39, .3);
}
.am-live-tagline { margin: 10px 0 0; font: italic 400 13.5px/1.5 Georgia, serif; color: var(--muted); }

/* две карти за вход */
.am-live-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
@media (max-width: 720px) { .am-live-split { grid-template-columns: 1fr; } }

.am-live-panel {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(180deg, #131a15, #0e1411);
  padding: 20px 18px;
}
.am-live-panel h3 {
  margin: 0 0 4px;
  font: 600 15px/1.2 Georgia, serif; letter-spacing: .1em; color: #f2e6c8;
}
.am-live-panel p { margin: 0 0 14px; font: 400 12px/1.5 system-ui, sans-serif; color: var(--dim); }

/* ─────────── стая ─────────── */
.am-live-codebox {
  text-align: center; padding: 18px 12px 20px;
  border: 1px solid var(--line); border-radius: 5px;
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(201, 162, 39, .12), transparent 60%),
    #101613;
}
.am-live-code {
  margin: 6px 0 4px;
  font: 600 clamp(38px, 8vw, 62px)/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .26em;
  color: var(--gold2);
  text-shadow: 0 0 30px rgba(201, 162, 39, .45);
  padding-left: .26em;
}
.am-live-code-note { font: 400 11.5px/1.5 system-ui, sans-serif; color: var(--dim); }

.am-live-seats { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-top: 16px; }
.am-live-vs { align-self: center; font: 600 12px/1 system-ui, sans-serif; letter-spacing: .2em; color: var(--dim); }

.am-live-seat {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 4px;
  background: rgba(255, 255, 255, .02);
}
.am-live-seat.is-me { border-color: rgba(226, 192, 99, .55); background: rgba(201, 162, 39, .07); }
/* празното място е block, не flex: иначе текстовите възли и <br> стават
   отделни flex-елементи и „бот след 19 сек“ се разпада на две криви колони */
.am-live-seat.is-empty {
  display: block;
  border-style: dashed;
  color: var(--dim);
  font: 400 12px/1.6 system-ui, sans-serif;
  text-align: center;
  padding: 16px 14px;
}
.am-live-seat.is-empty b { color: var(--gold3); font-weight: 600; white-space: nowrap; }
.am-live-seat.is-ready { box-shadow: inset 0 0 0 1px rgba(87, 192, 138, .35); }

.am-live-face {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: radial-gradient(60% 60% at 40% 30%, #2b3a2c, #131a15);
  font: 600 15px/1 Georgia, serif; color: var(--gold2);
  text-transform: uppercase;
}
.am-live-seat.is-me .am-live-face { border-color: var(--me); }
.am-live-name { font: 600 13.5px/1.2 system-ui, sans-serif; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.am-live-role { font: 400 10.5px/1.4 system-ui, sans-serif; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }

.am-live-wait { margin: 16px 0 0; font: 400 12.5px/1.6 system-ui, sans-serif; color: var(--muted); text-align: center; }
.am-live-wait b { color: var(--gold3); font-weight: 600; }

/* ─────────── мач ─────────── */
.am-live-match { display: grid; grid-template-columns: 210px minmax(0, 1fr) 210px; gap: 14px; align-items: start; max-width: 1000px; margin: 0 auto; }
@media (max-width: 860px) {
  .am-live-match { grid-template-columns: 1fr 1fr; }
  .am-live-match .am-live-center { grid-column: 1 / -1; order: 3; }
  .am-live-match .am-live-player { order: 1; }
}

.am-live-player {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 5px;
  background: rgba(255, 255, 255, .02);
  padding: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.am-live-player.is-me { border-color: rgba(226, 192, 99, .45); background: rgba(201, 162, 39, .06); }
.am-live-player.is-answered { border-color: rgba(87, 192, 138, .5); }
.am-live-player-head { display: flex; align-items: center; gap: 10px; }
.am-live-player-score {
  margin: 10px 0 0;
  font: 600 30px/1 Georgia, serif;
  color: var(--gold3);
  letter-spacing: .04em;
}
.am-live-player-score small { font: 400 11px/1 system-ui, sans-serif; color: var(--dim); letter-spacing: .1em; margin-left: 6px; }
.am-live-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.am-live-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, .4);
}
.am-live-dots i.on { background: var(--gold2); border-color: var(--gold2); box-shadow: 0 0 8px -1px rgba(226, 192, 99, .8); }
.am-live-dots i.bad { background: rgba(224, 90, 74, .8); border-color: var(--bad); }
.am-live-player-foot { margin: 8px 0 0; font: 400 10.5px/1.4 system-ui, sans-serif; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }

.am-live-center { text-align: center; }
.am-live-qhead { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 6px; }
.am-live-qn { font: 600 12px/1 system-ui, sans-serif; letter-spacing: .22em; color: var(--dim); text-transform: uppercase; }

/* пръстен на времето */
.am-live-ring { width: 66px; height: 66px; transform: rotate(-90deg); }
.am-live-ring circle { fill: none; stroke-width: 3.4; }
.am-live-ring .am-live-ring-bg { stroke: rgba(255, 255, 255, .09); }
.am-live-ring .am-live-ring-fg {
  stroke: var(--gold2);
  stroke-linecap: round;
  transition: stroke .25s;
}
.am-live-ring.is-low .am-live-ring-fg { stroke: var(--bad); }
.am-live-ring-text {
  font: 600 20px/1 ui-monospace, Consolas, monospace;
  color: var(--gold2);
}
.am-live-ring.is-low + .am-live-ring-text, .am-live-ring-wrap.is-low .am-live-ring-text { color: var(--bad); }
.am-live-ring-wrap { position: relative; display: inline-grid; place-items: center; }
.am-live-ring-wrap .am-live-ring-text { position: absolute; }

.am-live-q {
  margin: 14px auto 0;
  max-width: 720px;
  font: 500 clamp(17px, 2.2vw, 22px)/1.45 Georgia, serif;
  color: #f7f0dd;
  min-height: 3.2em;
}

.am-live-opts { display: grid; gap: 9px; margin: 16px auto 0; max-width: 720px; text-align: left; }
.am-live-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 4px;
  background: linear-gradient(180deg, #18201a, #131a15);
  color: var(--ink);
  font: 400 14px/1.4 system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .08s;
}
.am-live-opt:hover:not([disabled]) { border-color: var(--line2); background: linear-gradient(180deg, #1e281f, #161d17); }
.am-live-opt:active:not([disabled]) { transform: scale(.995); }
.am-live-opt[disabled] { cursor: default; }
.am-live-opt-key {
  flex: 0 0 26px; width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid rgba(201, 162, 39, .4);
  border-radius: 3px;
  font: 600 11px/1 system-ui, sans-serif; color: var(--gold3);
  letter-spacing: .04em;
}
.am-live-opt.is-pick { border-color: var(--gold2); background: rgba(201, 162, 39, .16); }
.am-live-opt.is-ok { border-color: var(--ok); background: rgba(87, 192, 138, .16); }
.am-live-opt.is-bad { border-color: var(--bad); background: rgba(224, 90, 74, .14); }
.am-live-opt.is-ok .am-live-opt-key { border-color: var(--ok); color: var(--ok); }
.am-live-opt.is-bad .am-live-opt-key { border-color: var(--bad); color: var(--bad); }
.am-live-opt.is-other { border-style: dashed; border-color: rgba(201, 162, 39, .5); }

.am-live-gain {
  margin-left: auto;
  font: 600 14px/1 ui-monospace, Consolas, monospace;
  color: var(--gold2);
  white-space: nowrap;
}
.am-live-gain.is-zero { color: var(--dim); }

.am-live-why {
  margin: 14px auto 0; max-width: 720px;
  padding: 12px 14px;
  border-left: 2px solid var(--gold);
  background: rgba(201, 162, 39, .07);
  font: 400 12.5px/1.6 system-ui, sans-serif;
  color: #ded3b8;
  text-align: left;
}
.am-live-why b { color: var(--gold2); font-weight: 600; }

/* ─────────── 3-2-1 преди първия въпрос ───────────
   Докато сървърът още не е дал опции, екранът е брояч: криеме
   „ВЪПРОС 0 / 10“ и изкарваме „Приготви се…“ едро, с уголемен пръстен.
   Правилото е само с :has() — без него изгледът остава както преди. */
.am-live-center:has(> .am-live-opts:empty) .am-live-qn { display: none; }
.am-live-center:has(> .am-live-opts:empty) #amQ {
  min-height: 0;
  margin-top: 8px;
  font: 600 clamp(26px, 4.2vw, 42px)/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold2);
  text-shadow: 0 0 30px rgba(201, 162, 39, .28);
}
.am-live-center:has(> .am-live-opts:empty) .am-live-ring-wrap {
  transform: scale(1.45);
  margin: 16px 0 10px;
  transform-origin: center;
}
.am-live-center:has(> .am-live-opts:empty) .am-live-ring-text { font-size: 19px; }

.am-live-revealpick {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 14px auto 0; max-width: 720px;
}
.am-live-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  font: 400 11.5px/1.3 system-ui, sans-serif;
  color: var(--muted);
  background: rgba(255, 255, 255, .02);
  max-width: 100%;
}
.am-live-chip b { color: var(--ink); font-weight: 600; }
.am-live-chip.ok { border-color: rgba(87, 192, 138, .55); }
.am-live-chip.bad { border-color: rgba(224, 90, 74, .5); }

/* ─────────── край ─────────── */
.am-live-final { text-align: center; padding: 8px 0 0; }
.am-live-vsline {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  max-width: 760px; margin: 16px auto 0;
}
.am-live-final-score {
  font: 600 clamp(34px, 7vw, 56px)/1 Georgia, serif;
  color: var(--ink);
  letter-spacing: .04em;
}
.am-live-final-score.is-win { color: var(--gold2); text-shadow: 0 0 26px rgba(201, 162, 39, .45); }
.am-live-final-name { font: 500 12px/1.3 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.am-live-final-dash { font: 400 26px/1 Georgia, serif; color: var(--dim); }
.am-live-verdict {
  margin: 18px 0 0;
  font: 600 clamp(16px, 2.4vw, 22px)/1.2 Georgia, serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold2);
}
h1.am-live-title.am-live-verdict { font-size: clamp(26px, 4vw, 38px); color: var(--gold2); }
h1.am-live-title.am-live-verdict.is-lose { color: var(--bad); }
h1.am-live-title.am-live-verdict.is-draw { color: var(--muted); }
.am-live-verdict.is-lose { color: var(--bad); }
.am-live-verdict.is-draw { color: var(--muted); }

.am-live-meta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0 0; }
.am-live-stat {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 4px;
  background: rgba(255, 255, 255, .02);
  font: 400 11px/1.4 system-ui, sans-serif;
  color: var(--dim);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.am-live-stat b { display: block; margin-top: 4px; font: 600 17px/1 Georgia, serif; color: var(--gold3); letter-spacing: .02em; }
.am-live-stat b.is-up { color: var(--ok); }
.am-live-stat b.is-down { color: var(--bad); }

.am-live-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 22px 0 0; }

/* ─────────── класация ─────────── */
.am-live-top-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.am-live-top-table th, .am-live-top-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  font: 400 12px/1.3 system-ui, sans-serif;
  color: var(--muted);
  text-align: left;
}
.am-live-top-table th { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.am-live-top-table td:first-child { width: 28px; color: var(--dim); font-family: ui-monospace, Consolas, monospace; }
.am-live-top-table td.am-live-td-r { text-align: right; font-family: ui-monospace, Consolas, monospace; color: var(--gold3); }
.am-live-top-table tr.is-me td { color: var(--ink); }

/* ─────────── служебни ─────────── */
.am-live-hide { display: none !important; }
.am-live-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.am-live-loading { text-align: center; padding: 40px 0; color: var(--dim); font: 400 12.5px/1.5 system-ui, sans-serif; }
.am-live-spin {
  width: 22px; height: 22px; margin: 0 auto 10px;
  border: 2px solid rgba(201, 162, 39, .25);
  border-top-color: var(--gold2);
  border-radius: 50%;
  animation: am-live-spin 900ms linear infinite;
}
@keyframes am-live-spin { to { transform: rotate(360deg); } }

.am-live-flash { animation: am-live-flash 500ms ease-out; }
@keyframes am-live-flash {
  from { box-shadow: 0 0 0 0 rgba(226, 192, 99, .5); }
  to { box-shadow: 0 0 0 22px rgba(226, 192, 99, 0); }
}

/* ─────────── телефон 390 px ─────────── */
@media (max-width: 480px) {
  .am-live-top { padding: 12px 12px 4px; flex-wrap: wrap; }
  .am-live-brand { order: 3; width: 100%; text-align: center; letter-spacing: .24em; }
  .am-live-who { min-width: 0; }
  .am-live-stage { padding: 4px 12px 22px; }
  .am-live-code { font-size: 34px; letter-spacing: .2em; }
  .am-live-seats { grid-template-columns: 1fr; gap: 8px; }
  .am-live-vs { display: none; }
  .am-live-btn { min-height: 46px; }
  .am-live-code-in { width: 100%; }
  /* код + „Влез“ на един ред: полето се свива, бутонът остава цял */
  .am-live-row .am-live-code-in { flex: 1 1 0; width: auto; min-width: 0; }
  .am-live-row .am-live-btn { flex: 0 0 auto; padding: 0 16px; }
  /* главните действия са през целия ред — иначе висят по средата наляво */
  .am-live-panel > .am-live-btn { width: 100%; }
  /* трите плочки не се събират на един ред при 390 — две по две, третата на цял ред */
  .am-live-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .am-live-meta > .am-live-stat:nth-child(3):last-child,
  .am-live-meta > .am-live-stat:only-child { grid-column: 1 / -1; }
  .am-live-stat { padding: 9px 10px; font-size: 9.5px; }
  .am-live-stat b { font-size: 15px; line-height: 1.25; }
  .am-live-opt { min-height: 56px; font-size: 13.5px; }
  .am-live-q { font-size: 17px; }
  .am-live-qn { letter-spacing: .12em; }
  .am-live-player-score { font-size: 24px; }
  .am-live-ring { width: 54px; height: 54px; }
  .am-live-final-score { font-size: 32px; }
  .am-live-actions .am-live-btn { flex: 1 1 100%; }
  .am-live-foot { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .am-live-foot span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .am-live-flash, .am-live-spin { animation: none; }
  .am-live-btn:active { transform: none; }
}
