/* «Тьма + янтарь»: почти чёрная сцена, тёплый прожектор за картой, золотые засечки, глянцевые цвета игроков.
   Референс и решения — DESIGN_REFERENCE.md. */
:root {
  --bg: #120b06;
  --bg-2: #1c1209;
  --panel: #2a1a0d;
  --panel-2: #3a2412;
  --panel-3: #4d3218;
  --line: #6b4a22;
  --amber: #f0b54a;
  --amber-2: #ffd98a;
  --gold: #d49a2e;
  --gold-dark: #8a5a14;
  --text: #f4e6c4;
  --text-2: #cdb286;
  --text-3: #8f7552;
  --good: #58c24a;
  --bad: #e0453a;
  --radius: 14px;
  --font: "Philosopher", Georgia, serif;
  --font-num: "PT Serif", Georgia, serif;
  --font-title: "Ruslan Display", "Philosopher", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gold-text: linear-gradient(#fff4c8, #f5c65a 45%, #b87818);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.35 var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
}
/* Прожектор: тёплое радиальное свечение, медленно «дышит» */
body::before {
  content: ""; position: fixed; inset: -10%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 55% 42% at 50% 38%, rgba(255, 170, 60, .34), rgba(190, 100, 20, .12) 55%, transparent 75%),
    radial-gradient(ellipse at 50% 120%, rgba(90, 40, 5, .5), transparent 60%);
  animation: breathe 7s ease-in-out infinite;
}
body::after {  /* виньетка и лёгкий шум, без картинок */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .7) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .6  0 0 0 0 .4  0 0 0 0 .15  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes breathe { 50% { opacity: .72; transform: scale(1.04); } }
#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#app { position: relative; z-index: 1; height: 100%; max-width: 520px; margin: 0 auto; }
[hidden] { display: none !important; }
.muted { color: var(--text-3); }

.screen { height: 100%; display: flex; flex-direction: column; padding: 16px 16px calc(16px + var(--safe-b)); gap: 12px; }

.card {
  background: linear-gradient(rgba(58, 36, 18, .92), rgba(36, 22, 11, .94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 210, 140, .12), 0 8px 24px rgba(0, 0, 0, .45);
  padding: 14px;
}

.btn {
  font: 700 18px var(--font); letter-spacing: .03em;
  border-radius: 14px; padding: 14px 18px; border: 0; cursor: pointer;
  color: var(--text); background: var(--panel-2);
  transition: transform .08s, box-shadow .08s, opacity .2s, filter .2s;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; }
/* Глянцевая кнопка Flash-эпохи: градиент + блик + нижняя кромка */
.btn-main {
  position: relative; overflow: hidden;
  color: #2a1500; text-shadow: 0 1px 0 rgba(255, 240, 200, .6);
  background: linear-gradient(#ffe08a, #f2a93a 48%, #d9831c 52%, #b8650f);
  box-shadow: 0 3px 0 #6b3a06, 0 0 24px rgba(255, 170, 60, .35), inset 0 1px 0 rgba(255, 255, 255, .6);
  font-size: 20px; text-transform: uppercase; letter-spacing: .08em;
}
.btn-main:active { box-shadow: 0 1px 0 #6b3a06, 0 0 16px rgba(255, 170, 60, .3); }
.btn-main::after {  /* пробегающий блик */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn-ghost { background: transparent; color: var(--text-2); }

.section-title {
  font: 700 12px var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--text-3);
  text-align: center; margin-bottom: -4px;
}

/* ---------- лобби ---------- */
#scr-lobby { overflow-y: auto; }
.lobby-hero { text-align: center; margin-top: 4px; }
.crest {
  width: 70px; height: 80px; margin: 0 auto 2px; filter: drop-shadow(0 0 14px rgba(255, 170, 60, .45));
  background: center / contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 96'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%23ffe9a8'/><stop offset='.5' stop-color='%23e3a33a'/><stop offset='1' stop-color='%238a5a14'/></linearGradient></defs><path d='M42 4 78 14v30c0 24-16 40-36 48C22 84 6 68 6 44V14z' fill='url(%23g)' stroke='%232a1606' stroke-width='3'/><path d='M42 12 70 20v24c0 19-12 32-28 39C26 76 14 63 14 44V20z' fill='%232a1a0d' stroke='%23ffe0a0' stroke-width='1.5'/><path d='M28 60 56 32M56 60 28 32' stroke='%23f4e6c4' stroke-width='5' stroke-linecap='round'/><circle cx='42' cy='46' r='6' fill='%23f0b54a' stroke='%232a1606' stroke-width='2'/></svg>");
}
.logo {
  font: 400 40px var(--font-title); margin: 0; letter-spacing: .04em;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #3a1f05) drop-shadow(0 0 18px rgba(255, 170, 60, .4));
}
.tagline { margin: 2px 0 0; color: var(--text-2); font-style: italic; }
.profile { padding: 12px 14px; }
.profile-row { display: flex; align-items: center; gap: 10px; }
.profile-name { font-weight: 700; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: flex; gap: 12px; }
.stat { display: flex; align-items: center; gap: 5px; font-family: var(--font-num); }
.stat b { font-size: 17px; color: var(--amber-2); }
.hint-stock { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.hint-chip {
  display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px 3px 3px; border-radius: 99px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line); color: var(--text-2);
}
.hint-chip b { color: var(--text); font-weight: 700; }
.hint-ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #2a1500; background: radial-gradient(circle at 35% 30%, #ffe08a, #d9831c 70%); }
.hint-ico svg { width: 15px; height: 15px; }
.rules summary { cursor: pointer; font-weight: 700; color: var(--amber-2); }
.rules ol { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); font-size: 15px; }
.rules li { margin: 4px 0; }

.ico { display: inline-block; width: 20px; height: 20px; background: center / contain no-repeat; flex: none; }
.ico-gold { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='10' fill='%23f0b54a' stroke='%236b3a06' stroke-width='1.6'/><circle cx='12' cy='12' r='6' fill='none' stroke='%23fff0b8' stroke-width='1.4'/></svg>"); }
.ico-xp { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l2.9 6.6 7.1.6-5.4 4.7 1.6 7L12 17.3 5.8 21l1.6-7L2 9.2l7.1-.6z' fill='%238fcbff' stroke='%23113a7c' stroke-width='1.4' stroke-linejoin='round'/></svg>"); }

.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-card {
  font: 700 15px var(--font); color: var(--text-2); cursor: pointer; padding: 8px 8px 10px;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .2s, box-shadow .2s, color .2s;
}
.map-card[aria-checked="true"] { color: var(--amber-2); border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 0 22px rgba(255, 170, 60, .3); }
.map-thumb-box { width: 100%; height: 64px; display: grid; place-items: center; }
.map-thumb { width: 100%; height: 100%; }
.map-thumb path { fill: #d9a24a; stroke: #6b420f; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.map-card[aria-checked="true"] .map-thumb path { fill: #f4d690; }

.topics { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.topic {
  font: 700 15px var(--font); color: var(--text-2); cursor: pointer;
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35);
}
.topic[aria-checked="true"] { color: #2a1500; background: linear-gradient(#ffe08a, #e0952a); border-color: #ffe08a; }
.fact-card { padding: 12px 14px; }
.fact-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.fact-title { font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.fact-text { margin: 0; color: var(--text-2); font-size: 15px; min-height: 2.6em; }
.btn-link { font: 700 14px var(--font); color: var(--amber-2); background: none; border: 0; padding: 4px 0 4px 12px; cursor: pointer; text-decoration: underline; }

/* ---------- поиск ---------- */
#scr-search { justify-content: center; text-align: center; }
#scr-search .fact-card { text-align: left; }
.search-box h2 {
  font: 400 28px var(--font-title); margin: 10px 0 4px;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hourglass {
  width: 56px; height: 74px; margin: 0 auto; animation: flip 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 170, 60, .5));
  background: center / contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 84'><path d='M10 4h44M10 80h44' stroke='%23f0b54a' stroke-width='5' stroke-linecap='round'/><path d='M14 6c0 22 14 26 14 36S14 58 14 78h36c0-20-14-26-14-36S50 28 50 6z' fill='%232a1a0d' stroke='%23f0b54a' stroke-width='3'/><path d='M20 14h24c-2 10-8 14-12 18-4-4-10-8-12-18zM18 76c2-10 8-14 14-16 6 2 12 6 14 16z' fill='%23ffd98a'/></svg>");
}
@keyframes flip { 0%, 70% { transform: rotate(0) } 100% { transform: rotate(180deg) } }
.search-slots { display: flex; justify-content: center; gap: 12px; margin: 18px 0 8px; }
.slot { width: 80px; text-align: center; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.slot .shield { margin: 0 auto 4px; }
.slot.empty .shield { opacity: .35; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .12 } }

/* Щит игрока (поиск, итоги) */
.shield {
  width: 32px; height: 38px; flex: none; position: relative;
  -webkit-mask: center / contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 40'><path d='M17 1 33 5v13c0 11-7 17-16 21C8 35 1 29 1 18V5z'/></svg>");
          mask: center / contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 40'><path d='M17 1 33 5v13c0 11-7 17-16 21C8 35 1 29 1 18V5z'/></svg>");
  background: linear-gradient(160deg, rgba(255, 255, 255, .45), transparent 45%), var(--c, var(--text-3));
  display: grid; place-items: center; color: #fff; font: 700 14px var(--font-num); text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

/* ---------- матч ---------- */
#scr-match { padding: 8px 8px 0; gap: 6px; position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; min-height: 38px; }
.phase {
  font: 700 19px var(--font); line-height: 1.15;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 #2a1606);
}
/* трекер раундов */
.tracker { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.stage-name { font: 700 13px var(--font); color: var(--amber-2); letter-spacing: .06em; text-transform: uppercase; }
.cells { display: flex; gap: 3px; }
.cell {
  display: flex; gap: 1.5px; padding: 3px; border-radius: 4px; background: rgba(0, 0, 0, .5);
  border: 1px solid var(--line); transition: box-shadow .3s, border-color .3s;
}
.cell i { width: 4px; height: 12px; border-radius: 1px; background: var(--c); opacity: .22; transform: skewX(-14deg); }
.cell i.done { opacity: .95; }
.cell i.cur { opacity: 1; animation: pulse .9s infinite; }
.cell.now { border-color: var(--amber); box-shadow: 0 0 8px rgba(255, 170, 60, .6); }
.cell.past { opacity: .8; }

.fuse { height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .55); overflow: hidden; box-shadow: inset 0 1px 2px #000; }
.fuse-fill { height: 100%; width: 0; background: linear-gradient(90deg, #b8650f, var(--amber-2)); box-shadow: 0 0 8px var(--amber); transition: width .1s linear; }
.fuse-fill.low { background: var(--bad); box-shadow: 0 0 8px var(--bad); animation: pulse .5s infinite; }

.stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.banner {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 99px;
  background: rgba(20, 10, 3, .85); color: var(--amber-2); border: 1px solid var(--gold-dark);
  box-shadow: 0 0 16px rgba(255, 170, 60, .25); animation: rise .25s ease-out;
}

/* карта */
#map { width: 100%; height: 100%; touch-action: manipulation; overflow: hidden; }
.land-glow { opacity: .55; animation: glow-breathe 7s ease-in-out infinite; }
@keyframes glow-breathe { 50% { opacity: .3; } }
.terr { fill: transparent; cursor: pointer; transition: fill-opacity .4s; }
.terr.owned { fill-opacity: .93; }
.terr.flood { animation: flood .9s ease-out; }
@keyframes flood { 0% { fill-opacity: 0; } 35% { fill-opacity: 1; filter: brightness(1.6); } 100% { fill-opacity: .93; } }
.bevel { pointer-events: none; mix-blend-mode: multiply; }
.sheen { pointer-events: none; mix-blend-mode: screen; }
.dim-layer path { fill: rgba(18, 8, 0, .5); pointer-events: none; }
.borders path { fill: none; stroke: #7a4a17; stroke-width: 1.2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
.rim path { stroke: #4a2806; stroke-width: 1.6px; vector-effect: non-scaling-stroke; pointer-events: none; }
.hl-layer path { fill: none; pointer-events: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.hl-opt { stroke: var(--amber-2); stroke-width: 3px; filter: drop-shadow(0 0 4px #ffb13b); animation: opt-pulse 1.1s ease-in-out infinite; }
.hl-src { stroke: #fff; stroke-width: 3.5px; filter: drop-shadow(0 0 5px #fff); }
.hl-fight { stroke: #ff4a3a; stroke-width: 3px; filter: drop-shadow(0 0 5px #ff4a3a); }
@keyframes opt-pulse { 50% { stroke-opacity: .35; } }
.labels { pointer-events: none; }
.terr-val, .terr-name, .cap-nick { text-anchor: middle; font-family: var(--font-num); }
.terr-val { fill: #6b3a0a; font-weight: 700; paint-order: stroke; stroke: rgba(255, 240, 200, .7); stroke-width: .6px; }
.terr-name { fill: #7a4a17; font-family: var(--font); font-weight: 700; opacity: .85; }
.terr-name.on-color { fill: #fff; opacity: .9; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 2px; }
.cap-icon, .swords, .drop { pointer-events: none; }
.cap-nick { fill: #fff; font-family: var(--font); font-weight: 700; paint-order: stroke; stroke: rgba(0, 0, 0, .5); stroke-width: 1.5px; }
.swords { animation: swords-pulse 1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes swords-pulse { 50% { opacity: .75; } }
.atk { pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.atk-line { animation: march .6s linear infinite; }
@keyframes march { to { stroke-dashoffset: -34; } }
.drop-body { animation: drop 2.6s cubic-bezier(.3, .1, .3, 1) both; }
.drop-shadow { animation: drop-shadow 2.6s ease-out both; transform-box: fill-box; transform-origin: center; }
@keyframes drop {
  0% { transform: translateY(calc(var(--u) * -70px)) scale(var(--u)); opacity: 0; }
  12% { opacity: 1; }
  30% { transform: translateY(0) scale(var(--u)); }
  40% { transform: translateY(calc(var(--u) * -10px)) scale(var(--u)); }
  50%, 80% { transform: translateY(0) scale(var(--u)); opacity: 1; }
  100% { transform: translateY(0) scale(var(--u)); opacity: 0; }
}
@keyframes drop-shadow { 0% { transform: scale(.3); opacity: 0; } 30%, 80% { transform: scale(1); opacity: 1; } 100% { opacity: 0; } }

/* HUD: карточки игроков */
.hud { display: flex; gap: 6px; align-items: flex-end; padding: 0 0 calc(8px + var(--safe-b)); transition: opacity .2s; }
.hud.under-sheet { opacity: 0; pointer-events: none; }
.pcard { flex: 1; min-width: 0; border-radius: 10px 10px 8px 8px; overflow: hidden; box-shadow: 0 6px 16px rgba(0, 0, 0, .55); transition: box-shadow .3s, transform .3s; }
.pcard.me { flex: 1.35; }
.pcard.turn { box-shadow: 0 0 0 2px var(--amber-2), 0 0 18px rgba(255, 190, 90, .55); transform: translateY(-2px); }
.pcard.dead { opacity: .4; filter: grayscale(.8); }
.pcard-tab {
  display: flex; align-items: center; gap: 4px; padding: 3px 8px; min-height: 22px;
  background: linear-gradient(rgba(255, 255, 255, .45), transparent 55%), var(--c);
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); font-weight: 700; font-size: 13px;
}
.pcard.me .pcard-tab { font-size: 15px; }
.pcard-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-mark { font-size: 12px; }
.pcard-body {
  display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 4px 6px;
  background: linear-gradient(#2a1a0d, #120b06); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px;
}
.pcard-count { font: 700 13px var(--font-num); color: var(--text-2); display: flex; align-items: center; gap: 2px; }
.pcard-count small { font: 400 10px var(--font); color: var(--text-3); }
.cap-dot { width: 9px; height: 9px; margin-left: 3px; border-radius: 2px; background: linear-gradient(#fff0b8, #d49a2e); box-shadow: 0 0 4px var(--amber); }
/* одометр: у каждой цифры своя лента 0–9 */
.odo { display: flex; gap: 1px; font: 700 16px/1 var(--font-num); }
.pcard.me .odo { font-size: 20px; }
.odo-col {
  height: 1.15em; width: .72em; overflow: hidden; border-radius: 2px; text-align: center; color: #fff4d0;
  background: linear-gradient(#050302, #2a1a0d 45%, #2a1a0d 55%, #050302); box-shadow: inset 0 0 0 1px rgba(255, 210, 140, .12);
}
.odo-strip { display: block; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.odo-strip i { display: block; height: 1.15em; line-height: 1.15em; font-style: normal; }

/* Листок с вопросом */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 0 12px calc(12px + var(--safe-b));
  background: linear-gradient(#3a2412, #1c1209 30%);
  border-top: 1px solid var(--gold-dark);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 210, 140, .2);
  animation: rise .28s ease-out;
  max-height: 80%; overflow: auto;
}
@keyframes rise { from { transform: translateY(40%); opacity: 0 } }
/* лента дуэли «Атакующий ➤ Защитник» */
.duel { display: flex; align-items: stretch; margin: 10px -2px 2px; height: 32px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.duel-side {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px;
  background: linear-gradient(rgba(255, 255, 255, .4), transparent 55%), var(--c);
  color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.duel-side.atk { border-radius: 16px 0 0 16px; }
.duel-side.def { border-radius: 0 16px 16px 0; }
.duel-chev {
  width: 26px; margin: 0 -8px; z-index: 1; flex: none;
  background: linear-gradient(#ffe9b0, #e0952a); clip-path: polygon(0 0, 55% 0, 100% 50%, 55% 100%, 0 100%, 45% 50%);
}
.duel-cap { width: 14px; height: 14px; flex: none; border-radius: 3px; background: linear-gradient(#fff0b8, #d49a2e); box-shadow: 0 0 6px #fff0b8; }

.sheet-tag { font-size: 12px; color: var(--amber); text-transform: uppercase; letter-spacing: .1em; margin: 10px 0 2px; text-align: center; }
.sheet-tag:empty { display: none; }
.q-text {
  font: 700 19px/1.3 var(--font); color: #fff; text-align: center; margin: 8px -12px 12px; padding: 10px 16px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .45) 12%, rgba(0, 0, 0, .45) 88%, transparent);
  text-shadow: 0 1px 2px #000;
}
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt-btn {
  position: relative; font: 700 16px var(--font); color: var(--text); text-align: center;
  min-height: 54px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(#3a2412, #22150a); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 210, 140, .15), 0 3px 0 #0a0603;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .25s, border-color .25s, opacity .25s, color .25s;
}
.opt-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #0a0603; }
.opt-btn:disabled { cursor: default; }
.opt-btn.chosen { border-color: var(--amber); color: var(--amber-2); box-shadow: 0 0 0 1px var(--amber), 0 0 14px rgba(255, 170, 60, .35); }
.opt-btn.gone { opacity: .12; }
.opt-btn.off { opacity: .38; }
.opt-btn.right { opacity: 1; color: #fff; border-color: #8fe57a; background: linear-gradient(#3fae3a, #1f6a1c); box-shadow: 0 0 16px rgba(90, 220, 80, .45); }
.opt-btn.wrong { opacity: 1; border-color: var(--bad); color: #ffb4a8; }
.opt-pct { font: 700 13px var(--font-num); color: var(--amber-2); }
.opt-who { display: flex; gap: 3px; }
.opt-who i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 1px solid #000; box-shadow: 0 0 4px var(--c); }
/* большой красный знак «неверно» поверх своего ошибочного ответа */
.nope {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 6px solid #e0453a; box-shadow: 0 0 12px rgba(224, 69, 58, .7), inset 0 0 6px rgba(0, 0, 0, .4);
  animation: stamp .35s cubic-bezier(.3, 1.6, .5, 1);
}
.nope::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 6px; margin-left: -3px; background: #e0453a; transform: rotate(45deg); }
@keyframes stamp { from { transform: scale(2.2); opacity: 0; } }

.exact-display {
  font: 700 30px var(--font-num); text-align: center; letter-spacing: .06em; color: var(--amber-2);
  padding: 4px; margin-bottom: 8px; border-radius: 10px; background: #0a0603; box-shadow: inset 0 2px 6px #000;
  font-variant-numeric: tabular-nums;
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.key {
  font: 700 22px var(--font-num); color: var(--text); height: 44px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(#3a2412, #22150a); border: 1px solid var(--line); box-shadow: 0 2px 0 #0a0603;
}
.key:active { transform: translateY(1px); }
.key.ok { background: linear-gradient(#ffe08a, #d9831c); color: #2a1500; border-color: #ffe08a; }
.key:disabled { opacity: .4; }

.q-status { text-align: center; color: var(--text-2); margin-top: 8px; }
.q-status:empty { display: none; }
.reveal-list { display: grid; gap: 6px; margin-top: 4px; }
.reveal-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: rgba(0, 0, 0, .35); }
.reveal-row .shield { width: 24px; height: 29px; }
.reveal-row.win { background: rgba(240, 181, 74, .22); font-weight: 700; box-shadow: inset 0 0 0 1px var(--gold-dark); }
.reveal-row .val { margin-left: auto; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.reveal-correct { text-align: center; font: 700 28px var(--font-num); color: #8fe57a; margin: 0 0 8px; text-shadow: 0 0 12px rgba(90, 220, 80, .5); }
.reveal-outcome { text-align: center; font-weight: 700; margin-top: 10px; font-size: 17px; color: var(--amber-2); }
.reveal-fact {
  margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--amber); background: rgba(240, 181, 74, .1);
  border-radius: 0 8px 8px 0; font-size: 14px; color: var(--text-2); text-align: left;
}

/* оценка вопроса */
.rate { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(107, 74, 34, .5); }
.rate-title { width: 100%; text-align: center; font-size: 13px; color: var(--text-3); }
.rate-btn {
  font: 700 13px var(--font); color: var(--text-2); cursor: pointer; padding: 5px 10px; border-radius: 99px;
  display: flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line);
}
.rate-btn.on { color: #2a1500; background: linear-gradient(#ffe08a, #e0952a); border-color: #ffe08a; }

.hints { display: flex; justify-content: center; gap: 24px; margin-top: 10px; padding-bottom: 16px; }
.hint-btn {
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; position: relative;
  border: 1px solid #ffe08a; color: #2a1500;
  background: radial-gradient(circle at 35% 28%, #fff3c4, #f2a93a 45%, #b8650f 80%);
  box-shadow: 0 3px 0 #6b3a06, 0 0 14px rgba(255, 170, 60, .35);
  display: grid; place-items: center; font: 700 14px var(--font);
}
.hint-btn svg { width: 24px; height: 24px; }
.hint-btn small { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: var(--text-2); }
.hint-btn:disabled { filter: grayscale(1) brightness(.6); opacity: .5; }

.toast {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px;
  background: rgba(20, 10, 3, .95); color: var(--amber-2); border: 1px solid var(--gold-dark); font-size: 15px;
  animation: rise .2s ease-out;
}

/* ---------- итоги ---------- */
#scr-end { justify-content: center; }
.end-title {
  font: 400 36px var(--font-title); text-align: center; margin: 0;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 170, 60, .45));
}
.podium { display: grid; gap: 8px; }
.place { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-left: 4px solid var(--c); }
.place .num { font: 700 26px var(--font-num); width: 26px; text-align: center; color: var(--amber-2); }
.place-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place.me { box-shadow: 0 0 0 1px var(--amber), 0 0 22px rgba(255, 170, 60, .3); }
.place .score { margin-left: auto; text-align: right; }
.place .score b { font: 700 20px var(--font-num); color: var(--amber-2); }
.place .score small { display: block; color: var(--text-3); }
.rewards { display: flex; justify-content: center; gap: 22px; font: 700 20px var(--font-num); color: var(--amber-2); }
.rewards span { display: flex; align-items: center; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
