/* Redesign step 1 (2026-10-26, canvas «Ночная таверна» + buttons A «стекло и золото»): one kit for the whole game.
   Dark warm glass windows with a thin gold line, Yeseva One headings, three buttons: gold = main action,
   glass = cancel or secondary, red = only for what cannot be undone. Loaded last, on top of ui3/board3/screens3. */
:root {
  --t-bg: #120a05; --t-win: rgba(22, 13, 7, .94); --t-line: rgba(217, 196, 138, .42); --t-line-hi: #f2cd6b;
  --t-gold: #e8b84a; --t-gold-hi: #fff0b0; --t-cream: #f5ead2; --t-sub: #c2ae86; --t-red: #a83a2a;
  --t-head: 'Yeseva One', serif;
  --t-btn-gold: linear-gradient(#fff0b0, #f0c25e 48%, #d39a34);
  --t-btn-gold-sh: inset 0 0 0 1px #fff6d0, 0 0 0 1px #7a4a14, 0 6px 14px rgba(0, 0, 0, .45);
}

/* ---------- headings ---------- */
.modal h3, #game > .modal-back .modal h3, .fb-win h3, .mo-head b,
.picker-box h2, .rules-box h2, .builder-head h2, .stats-box h2, .legal-box h2 {
  font-family: var(--t-head) !important; font-weight: 400 !important; text-transform: none !important; letter-spacing: .01em !important;
  color: var(--t-gold-hi) !important; text-shadow: 0 2px 0 rgba(0, 0, 0, .6) !important; }
.stats-box h3, .rules-box h3, .legal-box h3, .bld-h3 { font-family: var(--t-head) !important; font-weight: 400 !important; text-transform: none !important; letter-spacing: .01em !important; }
#game > .modal-back .modal h3::after { display: none; }

/* ---------- buttons: glass (default), gold (.primary), red (.danger) ---------- */
.btn:not(.hs-go), #game .modal .btn, .prompt .btn.small.cancel {
  font-family: var(--k-font) !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--t-cream) !important; text-shadow: none !important;
  border: 1px solid var(--t-line) !important; border-radius: 12px !important; background: rgba(255, 255, 255, .05) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35) !important; animation: none !important; }
.btn:not(.hs-go):hover, #game .modal .btn:hover:not(:disabled) { filter: none; transform: none; border-color: var(--t-line-hi) !important; background: rgba(255, 230, 170, .1) !important; }
.btn.primary:not(.hs-go), #game .modal .btn.primary, .st-tabs .btn.primary, .bld-tabs .btn.primary {
  color: #3a1206 !important; border: none !important; background: var(--t-btn-gold) !important; box-shadow: var(--t-btn-gold-sh) !important; }
.btn.primary:not(.hs-go):hover, #game .modal .btn.primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: var(--t-btn-gold-sh), 0 0 22px rgba(255, 200, 90, .45) !important; }
.btn.danger:not(.hs-go), #game .modal .btn.danger { color: #fff3e6 !important; border: none !important; background: linear-gradient(#b8382a, #7d1d12) !important; box-shadow: 0 0 0 1px #3a0a06, 0 6px 14px rgba(0, 0, 0, .45) !important; }
.btn:disabled, #game .modal .btn:disabled { opacity: .45; filter: none !important; cursor: default; }

/* plaques (old wood with diamonds) become the same buttons */
.plq { border: 1px solid var(--t-line) !important; border-radius: 12px !important; background: rgba(255, 255, 255, .05) !important; box-shadow: 0 4px 12px rgba(0, 0, 0, .35) !important;
  text-shadow: none !important; letter-spacing: .08em !important; animation: none !important; }
.plq::before, .plq::after { display: none !important; }
.plq:hover, .plq:active { transform: none !important; filter: none !important; border-color: var(--t-line-hi) !important; background: rgba(255, 230, 170, .1) !important; }
.plq.gold { color: #3a1206 !important; border: none !important; background: var(--t-btn-gold) !important; box-shadow: var(--t-btn-gold-sh) !important; }
.plq.gold:hover { filter: brightness(1.08) !important; box-shadow: var(--t-btn-gold-sh), 0 0 22px rgba(255, 200, 90, .45) !important; }

/* «Как сыграем?»: the gold plaque with the ornate frame (.pl-go) and the divided difficulty strip (.pl-seg) stay as in ui3 — Eugene prefers them (2026-10-27). */

/* ---------- windows: dark warm glass with a thin gold line ---------- */
.modal, #game > .modal-back .modal, .fb-win, #menu.mv .menu-opts, .snd-pop {
  border: 1px solid var(--t-line) !important; border-radius: 18px !important; color: var(--t-cream);
  background: var(--t-win) !important; backdrop-filter: blur(12px); }
.modal, #game > .modal-back .modal, .fb-win, .snd-pop { box-shadow: 0 24px 60px rgba(0, 0, 0, .7) !important; }
#menu.mv .menu-opts { box-shadow: 0 0 0 100vmax rgba(6, 3, 1, .6), 0 24px 60px rgba(0, 0, 0, .7) !important; }
#game .modal .row-btns { background: none !important; }
.mo-close { color: var(--t-cream) !important; background: rgba(0, 0, 0, .3) !important; border: 1px solid var(--t-line) !important; }
.pick-opt { background: rgba(255, 255, 255, .05) !important; border-radius: 14px !important; box-shadow: inset 0 0 0 1px var(--t-line), 0 6px 14px rgba(0, 0, 0, .45) !important; }
.pick-opt:hover { box-shadow: inset 0 0 0 1px var(--t-line-hi), 0 0 22px rgba(232, 184, 90, .35) !important; }
.stats-box, .rules-box, .picker-box, .legal-box, .bld { border-radius: 18px; background: var(--t-win) !important; box-shadow: inset 0 0 0 1px var(--t-line), 0 24px 60px rgba(0, 0, 0, .6) !important; }
.kpi { border-radius: 12px !important; background: rgba(255, 255, 255, .04) !important; box-shadow: inset 0 0 0 1px rgba(217, 196, 138, .3) !important; }

/* ---------- fields: dark, cream text, gold ring on focus ---------- */
.modal input[type=text], .modal input[type=email], .modal input[type=password], .modal textarea, .modal select,
.fb-win input, .fb-win textarea, .menu-opts input[type=text], .menu-opts select, .stats-box input[type=text], #game .modal input[type=text] {
  box-sizing: border-box; border-radius: 10px !important; border: 1px solid rgba(217, 196, 138, .35) !important; background: rgba(0, 0, 0, .35) !important;
  color: var(--t-cream) !important; font: 600 16px var(--k-font) !important; padding: 8px 12px; box-shadow: none !important; }
.modal input:focus, .modal textarea:focus, .modal select:focus, .fb-win input:focus, .fb-win textarea:focus, .menu-opts input:focus, .menu-opts select:focus, .stats-box input:focus {
  outline: none; border-color: var(--t-line-hi) !important; box-shadow: 0 0 0 3px rgba(242, 205, 107, .22) !important; }
.modal select option, .menu-opts select option { background: #1c110a; color: var(--t-cream); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--t-gold); }

/* phones: window buttons wrap instead of pushing the window past the screen edge */
.modal .row-btns { flex-wrap: wrap; }
@media (max-width: 760px) {
  .modal, .fb-win { max-width: calc(100vw - 20px) !important; box-sizing: border-box; }
  .btn:not(.hs-go), #game .modal .btn { letter-spacing: .03em; }
  .modal .row-btns .btn { flex: 1 1 auto; }
}

/* ---------- empty deck: fatigue sign (canvas «Усталость Б») — skull and «−N» on the deck spot ---------- */
#board .pile.deck-empty .card-back, #board .pile.deck-empty::before { display: none !important; }
#board .pile .fatigue { position: absolute; left: 0; top: 0; width: 100%; height: 100%; min-height: 120px; box-sizing: border-box; border-radius: 10px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; pointer-events: none;
  background: radial-gradient(circle, rgba(150, 30, 20, .55), rgba(40, 8, 4, .8)); box-shadow: inset 0 0 0 2px #c8402f, 0 0 18px rgba(220, 60, 40, .5); }
#board .pile .fatigue svg { width: 38%; height: auto; fill: none; stroke: #ffd2c4; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#board .pile .fatigue b { font: 900 30px/1 var(--k-font); color: #ff9a84; text-shadow: 0 2px 0 #3a0a06; }
#board .pile .fatigue small { font: 700 11px var(--k-font); letter-spacing: .1em; text-transform: uppercase; color: #f3d0c0; }
#board .pile.fatigue-hit .fatigue { animation: fatigue-hit .7s ease-out; }
@keyframes fatigue-hit { 0% { scale: 1; } 30% { scale: 1.12; box-shadow: inset 0 0 0 2px #ff7a5a, 0 0 40px rgba(255, 80, 50, .9); } 100% { scale: 1; } }
/* phone: the deck spot is tiny, so the sign is a big round badge over it; the opponent's empty deck is shown too (normally hidden) */
#stage.port #board .pile.opp-pile.deck.deck-empty { visibility: visible; }
#stage.port #board .pile.deck-empty .lbl { display: none; }
#stage.port #board .pile .fatigue { width: 150px; height: 150px; min-height: 0; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; gap: 0; }
#stage.port #board .pile .fatigue svg { width: 34%; }
#stage.port #board .pile .fatigue b { font-size: 62px; }
#stage.port #board .pile .fatigue small { display: none; }
#board .pile.deck-empty .count { display: none !important; }

/* ---------- buttons with their own classes, brought into the kit (QA UI note on step 1) ---------- */
/* feedback window: «Отправить» is the main action (gold), «Отмена» glass */
.fb-btn { border: none !important; border-radius: 12px !important; color: #3a1206 !important; letter-spacing: .08em; background: var(--t-btn-gold) !important; box-shadow: var(--t-btn-gold-sh) !important; }
.fb-btn.quiet { color: var(--t-cream) !important; border: 1px solid var(--t-line) !important; background: rgba(255, 255, 255, .05) !important; box-shadow: 0 4px 12px rgba(0, 0, 0, .35) !important; }
.fb-btn:hover { filter: brightness(1.08); } .fb-btn.quiet:hover { filter: none; border-color: var(--t-line-hi) !important; background: rgba(255, 230, 170, .1) !important; }
/* end screen: glass buttons, gold «Реванш» */
.over3 .ov-btn { border: 1px solid var(--t-line) !important; border-radius: 12px !important; background: rgba(255, 255, 255, .05) !important; box-shadow: 0 4px 12px rgba(0, 0, 0, .35) !important; text-shadow: none; }
.over3 .ov-btn:hover { transform: none; filter: none; border-color: var(--t-line-hi) !important; background: rgba(255, 230, 170, .1) !important; box-shadow: 0 4px 12px rgba(0, 0, 0, .35) !important; }
.over3 .ov-btn.gold { border: none !important; color: #3a1206 !important; text-shadow: none; background: var(--t-btn-gold) !important; box-shadow: var(--t-btn-gold-sh) !important; }
.ov4-play { aspect-ratio: auto; height: 60px; border-radius: 14px; background: var(--t-btn-gold) !important; box-shadow: var(--t-btn-gold-sh), 0 0 26px rgba(255, 200, 90, .35); filter: none !important; animation: none !important; }
.ov4-play span { inset: 0 !important; color: #3a1206 !important; text-shadow: none !important; font-size: 24px !important; }
.ov4-play:hover { transform: none !important; filter: brightness(1.08) !important; }
.ov4-ib-c { background: rgba(22, 13, 7, .85) !important; box-shadow: inset 0 0 0 1px var(--t-line), 0 6px 14px rgba(0, 0, 0, .55) !important; color: var(--t-line-hi) !important; }
.ov4-ib:hover .ov4-ib-c { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--t-line-hi), 0 0 18px rgba(255, 210, 110, .35) !important; }
/* Leader abilities in the game and the emote wheel: glass rows instead of wood */
.power { background: rgba(22, 13, 7, .88) !important; border-radius: 10px !important; box-shadow: inset 0 0 0 1px var(--t-line), 0 4px 10px rgba(0, 0, 0, .45) !important; }
.power.ready { box-shadow: inset 0 0 0 1px var(--t-line-hi), 0 0 14px rgba(255, 200, 90, .3) !important; }
.emote-wheel .em-mute { background: rgba(255, 255, 255, .05) !important; border-color: var(--t-line) !important; color: var(--t-cream) !important; }

/* ---------- QA UI red notes on step 1 ---------- */
/* read-only link and code fields (Друзья, Поделиться колодой, invites): dark like every field */
.link input, .modal input:not([type]), .fb-win input:not([type]) {
  box-sizing: border-box; min-height: 40px; border-radius: 10px !important; border: 1px solid rgba(217, 196, 138, .35) !important; background: rgba(0, 0, 0, .35) !important;
  color: var(--t-cream) !important; font: 600 15px var(--k-font) !important; padding: 8px 12px !important; box-shadow: none !important; }
.link input:focus { outline: none; border-color: var(--t-line-hi) !important; }
/* windows are dark: native checkboxes, selects and scrollbars follow */
.modal, .fb-win, #menu.mv .menu-opts, .snd-pop, .link { color-scheme: dark; }
/* phone settings: the window and its lists never get wider than the screen */
#menu.mv .menu-opts { box-sizing: border-box; max-width: calc(100vw - 20px) !important; }
#menu.mv .menu-opts select, #menu.mv .menu-opts input[type=text] { max-width: 100%; min-width: 0; }
#menu.mv .menu-opts label { flex-wrap: wrap; max-width: 100%; }
#menu.mv .menu-opts * { overflow-wrap: anywhere; }
/* end screen: player plates in glass, the winner with a gold line */
.over3 .ov-plate, .over3 .ov-fighter.op .ov-plate { background: rgba(22, 13, 7, .92) !important; border-radius: 12px !important; box-shadow: inset 0 0 0 1px var(--t-line), 0 8px 18px rgba(0, 0, 0, .55) !important; }
.ov4-plate { background: rgba(22, 13, 7, .92) !important; border-radius: 12px !important; box-shadow: inset 0 0 0 1px var(--t-line), 0 8px 18px rgba(0, 0, 0, .55) !important; }
.ov4-fighter.won .ov4-plate { box-shadow: inset 0 0 0 1.5px var(--t-line-hi), 0 0 22px rgba(255, 200, 90, .35) !important; }
.link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .link input { flex: 1 1 180px; min-width: 0; width: auto; }
#stage.port #board .pile.opp-pile .fatigue { top: 150%; }

/* ---------- Оборона (canvas «Оборона А»): blow arrow, result on each defender, gold arrow and shield on hover ---------- */
#board .def-guide { position: absolute; left: 0; top: 0; z-index: 40; pointer-events: none; overflow: visible; }
#board .def-guide .dg-blow { fill: none; stroke: #ff5a3a; stroke-width: 6; stroke-dasharray: 14 10; opacity: .7; animation: dg-march 1s linear infinite; }
#board .def-guide .dg-save { fill: none; stroke: #f2cd6b; stroke-width: 7; filter: drop-shadow(0 0 6px rgba(255, 200, 90, .8)); }
@keyframes dg-march { to { stroke-dashoffset: -24; } }
#board .dg-tag { position: absolute; z-index: 41; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap; padding: 3px 12px; border-radius: 999px; font: 900 20px var(--k-font); }
#board .dg-blow-tag { color: #fff; background: radial-gradient(circle at 40% 30%, #ff8a7a, #c22f20 60%, #6a0c06); box-shadow: 0 0 0 2px #160c06, 0 0 16px rgba(255, 80, 50, .7); }
#board .dg-res { color: #fff0b0; background: rgba(22, 13, 7, .92); box-shadow: inset 0 0 0 1px var(--t-line-hi), 0 4px 10px rgba(0, 0, 0, .6); }
#board .dg-res.dies { color: #ffb09a; box-shadow: inset 0 0 0 1px #c8402f, 0 4px 10px rgba(0, 0, 0, .6); }
#board .dg-shield { position: absolute; z-index: 42; width: 54px; height: 60px; transform: translate(-50%, -50%); pointer-events: none; animation: dg-pop .25s ease-out; }
#board .dg-shield svg { width: 100%; height: 100%; fill: #f2cd6b; stroke: #160c06; stroke-width: 1.4; filter: drop-shadow(0 0 10px rgba(255, 200, 90, .8)); }
@keyframes dg-pop { from { transform: translate(-50%, -30%) scale(.5); opacity: 0; } }
#board .card.dg-pick { box-shadow: 0 0 0 4px #f2cd6b, 0 0 30px rgba(255, 200, 90, .8) !important; }
/* «Отмена» in a game question is a refusal, not something irreversible: glass, not red (QA UI note) */
html body #game .prompt .btn.small.cancel { color: var(--t-cream) !important; text-shadow: none; background: rgba(22, 13, 7, .9) !important; border: 1px solid var(--t-line-hi) !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .55) !important; animation: none !important; }
/* phones: the «−N» sits beside the Leader (not on the round plate above it); the result sits on the card's lower edge, not on the Place under it */
#stage.port #board .dg-blow-tag { font-size: 30px; }
#stage.port #board .dg-res { font-size: 22px; padding: 2px 8px; }

/* ---------- Выбор соперника, вариант Б (canvas «Соперник Б»): difficulty inside the opponent card, «В бой» centred, «Назад» in the corner; fits 1280×720 without scrolling ---------- */
#heroes .hero-select .hs-info .hs-level { justify-content: flex-start; margin: 12px 0 0; max-width: none; flex-direction: column; align-items: stretch; gap: 6px; }
#heroes .hs-info .hs-level > span { font: 800 13px var(--k-font); letter-spacing: .14em; text-transform: uppercase; color: #d9c48a; }
#heroes .hs-info .hs-level { display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px; gap: 4px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(217, 196, 138, .25); }
#heroes .hs-info .hs-level > span { grid-column: 1 / -1; padding: 2px 4px 0; }
#heroes .hs-info .hs-lv { border-radius: 9px; padding: 8px 6px; line-height: 1.1; }
#heroes .hs-info .hs-lv small { display: block; font-size: 12px; }
#heroes .hero-select.with-level .hs-main { min-height: 0 !important; padding-top: 22px; padding-bottom: 22px; }
#heroes .hs-bar { position: static !important; background: none !important; justify-content: center !important; margin: 10px 0 0 !important; padding: 0 0 calc(10px + env(safe-area-inset-bottom)) !important; }
#heroes .hs-bar [data-back] { position: fixed; left: 18px; top: calc(14px + env(safe-area-inset-top)); z-index: 7; height: 44px; padding: 0 16px !important; font-size: 16px !important; }
#heroes .hs-bar .hs-go { min-width: 300px; height: 60px; font-size: 24px !important; }
@media (max-height: 960px) {
  #heroes .hero-select { padding-top: 8px !important; }
  #heroes .hs-title { font-size: 28px !important; margin: 2px 0 !important; }
  #heroes .hero-select .hs-main { padding-top: 12px !important; padding-bottom: 12px !important; }
  #heroes .hero-select .hs-chosen { margin: 2px 0 6px !important; }
  #heroes .hs-roster { margin-top: 8px !important; gap: 6px 18px !important; }
  #heroes .hs-medal .m { width: 56px !important; height: 56px !important; }
  #heroes .hs-bar { margin-top: 6px !important; }
  #heroes .hs-bar .hs-go { height: 52px; font-size: 22px !important; }
  #heroes .hero-select .hs-name { font-size: 30px !important; }
  #heroes .hero-select.with-level .hs-keys, #heroes .hero-select .hs-more { display: none !important; }
  #heroes .hero-select .hs-style { font-size: 16px !important; margin: 4px 0 !important; }
  #heroes .hero-select .hs-plain { margin: 4px 0 !important; font-size: 16px !important; }
  #heroes .hero-select .hs-row { margin: 6px 0 !important; }
#heroes .hero-select .hs-main { min-height: 0 !important; }
  #heroes .hs-medal .m { width: 64px !important; height: 64px !important; }
}
@media (max-width: 760px) {
  #heroes .hs-info .hs-level { grid-template-columns: repeat(2, 1fr); }
  #heroes .hs-bar { position: sticky !important; bottom: 0; background: linear-gradient(transparent, rgba(8, 4, 2, .95) 40%) !important; padding-top: 14px !important; }
  #heroes .hs-bar .hs-go { min-width: 0; flex: 1; max-width: 340px; }
  #heroes .hero-select.with-level .hs-portrait { width: 100% !important; height: 170px !important; aspect-ratio: auto !important; background-size: cover !important; }
  #heroes .hero-select { padding-top: 58px !important; }
  #heroes .hero-select.with-level .hs-port-name { display: none; }
}
#heroes .hs-info .hs-lv-help { grid-column: 1 / -1; text-align: left; margin: 2px 4px 2px; font: 600 14px var(--k-font); color: #c2ae86; }


/* ---------- step 3: window parts shared by the screens rebuilt from the canvas ---------- */
.win-k { display: flex; flex-direction: column; gap: 12px; text-align: left; padding: 22px 26px 24px !important; }
.win-k > label { display: flex; flex-direction: column; gap: 6px; font: 700 15px var(--k-font); color: #d8c8a2; }
.win-k .st-note { margin: 0; font-size: 15px; line-height: 1.4; color: var(--t-sub); }
.win-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.win-head h3 { margin: 0 !important; font-size: 28px !important; }
.win-x { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--t-line); background: rgba(0, 0, 0, .3); }
.win-x svg { width: 16px; height: 16px; fill: none; stroke: var(--t-cream); stroke-width: 2.5; stroke-linecap: round; }
.win-x:hover { border-color: var(--t-line-hi); }
.k-tabs { display: flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(217, 196, 138, .25); }
.k-tabs button { flex: 1; min-height: 40px; border: none; border-radius: 9px; cursor: pointer; background: none; font: 800 16px var(--k-font); color: #d8c8a2; }
.k-tabs button.on { background: linear-gradient(#fff0b0, #e9b24e); color: #3a1206; }
.k-wide { width: 100%; min-height: 50px; font-size: 17px !important; }
.login-box .login-msg { margin: 0; min-height: 18px; color: #ffb09a; font-size: 15px; }
.win-k input[type=email], .win-k input[type=password] { width: 100%; min-height: 48px; }
.k-sec { font: 800 12px var(--k-font); letter-spacing: .14em; text-transform: uppercase; color: #d9c48a; }
/* «Друзья» (canvas): list rows as cards, then the invitation block */
.friends-box .fr-list { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow: auto; }
.friends-box .fr-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(217, 196, 138, .18); }
.friends-box .fr-row b { flex: 1; font-size: 18px; }
.friends-box .fr-st { font-size: 14px; color: var(--t-sub); }
.friends-box .fr-st.on { color: #9fe0a6; } .friends-box .fr-st.play { color: #f2cd6b; }
.friends-box .fr-addbox { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.friends-box .fr-btns { display: flex; gap: 10px; flex-wrap: wrap; } .friends-box .fr-btns .btn { min-height: 46px; } .friends-box .fr-btns .primary { flex: 1; }
.friends-box .fr-code { display: flex; gap: 10px; } .friends-box .fr-code.hidden { display: none; } .friends-box .fr-code input { flex: 1; min-width: 0; }
.friends-box .fr-mycode { color: var(--t-cream); letter-spacing: .08em; }
.friends-box.watch-only .fr-addbox { display: none; }
/* «Настройки» (canvas): sections, one row per setting, switches instead of checkboxes */
#menu.mv .menu-opts { width: min(620px, 94vw); padding: 22px 26px !important; display: flex; flex-direction: column; gap: 6px; }
#menu.mv .menu-opts .mo-head b { font-size: 28px !important; }
#menu.mv .menu-opts .k-sec { margin-top: 8px; }
#menu.mv .menu-opts .k-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; margin: 0; font: 700 17px var(--k-font); color: var(--t-cream); cursor: pointer; }
#menu.mv .menu-opts .k-row > span small { display: block; font-weight: 600; font-size: 14px; color: var(--t-sub); }
#menu.mv .menu-opts .k-row select, #menu.mv .menu-opts .k-row input[type=text] { width: auto; max-width: 56%; min-height: 40px; }
#menu.mv .menu-opts .k-vols { display: flex; flex-direction: column; padding-left: 14px; border-left: 2px solid rgba(217, 196, 138, .2); }
#menu.mv .menu-opts .k-vols .k-row { min-height: 36px; font-size: 16px; font-weight: 600; }
#menu.mv .menu-opts .k-sub { font: 700 13px var(--k-font); color: var(--t-sub); }
#menu.mv .menu-opts input[type=range] { width: 200px; max-width: 50%; accent-color: var(--t-line-hi); }
.k-tog { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 48px; height: 28px; margin: 0; border-radius: 14px; cursor: pointer; background: rgba(255, 255, 255, .14); transition: background .2s; }
.k-tog::after { content: ''; position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: #d8c8a2; transition: left .2s, background .2s; }
.k-tog:checked { background: var(--t-line-hi); } .k-tog:checked::after { left: 24px; background: #3a1206; }
.k-tog:focus-visible { outline: 2px solid var(--t-gold-hi); outline-offset: 2px; }
#menu.mv .menu-opts .mo-test.hidden { display: none; }
@media (max-width: 760px) { #menu.mv .menu-opts .k-row select { max-width: 60%; } #menu.mv .menu-opts input[type=range] { width: 140px; } }
#menu.mv .menu-opts .k-block { display: block; padding: 4px 0; }
#menu.mv .menu-opts .k-blabel { display: block; margin: 0 0 6px; font: 700 17px var(--k-font); color: var(--t-cream); }
#menu.mv .menu-opts .k-blabel small { display: block; font-weight: 600; font-size: 14px; color: var(--t-sub); }
#menu.mv .menu-opts .k-block select { display: block; width: 100%; max-width: 100%; min-height: 40px; }
/* «Написать разработчику» (canvas): ✕ in the title, four tiles with icons, one hint line for the chosen kind */
.fb-win { display: flex; flex-direction: column; gap: 12px; padding: 22px 26px 24px !important; }
.fb-win .fb-kinds { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fb-win .fb-kind { display: flex !important; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px !important; border-radius: 12px !important; cursor: pointer;
  border: 1px solid rgba(217, 196, 138, .25) !important; background: rgba(255, 255, 255, .03) !important; box-shadow: none !important; font: 800 16px var(--k-font); color: var(--t-cream); text-align: center; }
.fb-win .fb-kind input { position: absolute; opacity: 0; pointer-events: none; }
.fb-win .fb-kind svg { width: 26px; height: 26px; fill: none; stroke: var(--t-line-hi); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fb-win .fb-kind small { display: none; }
.fb-win .fb-kind:has(input:checked) { border-color: var(--t-line-hi) !important; background: rgba(242, 205, 107, .12) !important; box-shadow: 0 0 0 1px var(--t-line-hi) !important; }
.fb-win .fb-hint { margin: 0; font-size: 15px; color: var(--t-sub); min-height: 1.3em; }
.fb-win textarea { min-height: 130px; resize: vertical; }
@media (max-width: 760px) { .fb-win .fb-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* «Поделиться колодой» (canvas) */
.share-deck .sd-deck { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(217, 196, 138, .2); }
.share-deck .sd-deck i { width: 56px; height: 56px; flex: none; border-radius: 50%; background: #2a1c12 center 30% / cover no-repeat; border: 2px solid var(--t-line-hi); }
.share-deck .sd-deck b { display: block; font-size: 20px; } .share-deck .sd-deck small { font-size: 15px; color: var(--t-sub); }
.share-deck .sd-or { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--t-sub); } .share-deck .sd-or span { flex: 1; height: 1px; background: rgba(217, 196, 138, .25); }
.share-deck .sd-code { display: flex; gap: 10px; align-items: stretch; }
.share-deck .sd-code b { flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; padding: 0 14px; border-radius: 10px; border: 1px dashed rgba(217, 196, 138, .5); background: rgba(0, 0, 0, .35);
  font: 700 14px var(--k-font); letter-spacing: .06em; color: #fff3cf; overflow-wrap: anywhere; user-select: all; }
/* «Статистика и профиль» (canvas): tabs as pills that scroll sideways on phones; avatars folded */
.st-tabs { display: flex !important; flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tabs .btn { flex: none; border-radius: 999px !important; scroll-snap-align: start; white-space: nowrap; }
.pf-looks .lk-fold summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.pf-looks .lk-fold summary::-webkit-details-marker { display: none; }
.pf-looks .lk-fold summary h3 { margin: 0 !important; }
.pf-looks .lk-cur { width: 44px; height: 44px; border-radius: 50%; background: #2a1c12 center 30% / cover; border: 2px solid var(--t-line-hi); }
.pf-looks .lk-open { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--t-line); font: 700 15px var(--k-font); color: var(--t-cream); }
.pf-looks .lk-fold[open] .lk-open { border-color: var(--t-line-hi); }
.pf-looks .lk-fold .lk-avas { margin-top: 10px; }
@media (max-width: 760px) {
  .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .pf-head { display: grid !important; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: start; } .pf-name { display: flex; flex-wrap: wrap; gap: 6px; } .pf-name input { min-width: 0; flex: 1 1 120px; }
  .pf-ava { width: 88px !important; height: 88px !important; }
}

/* ---------- step 2: our own confirm / prompt windows (js/ui/dialog.js, canvas «Подтверждение «Сдаться?»») ---------- */
.k-dialog { display: grid; place-items: center; background: rgba(6, 3, 1, .62) !important; backdrop-filter: blur(3px); animation: fadein .15s; }
.k-dialog .modal { margin: 0; text-align: left; }
.k-dlg-head { display: flex; align-items: center; gap: 16px; }
.k-dlg-head h3 { margin: 0 !important; font-size: 28px !important; }
.k-dlg-ico { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(157, 42, 28, .25); border: 1px solid rgba(232, 120, 100, .5); }
.k-dlg-ico svg { width: 26px; height: 26px; fill: none; stroke: #f3e6c8; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.k-dlg-text { margin: 0; font: 600 17px/1.45 var(--k-font); color: var(--t-cream); }
.k-dlg-input { width: 100%; box-sizing: border-box; min-height: 48px; }
.k-dlg-btns { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.k-dlg-btns .btn { min-height: 50px; padding: 0 24px !important; font-size: 17px !important; }
@media (max-width: 760px) { .k-dlg-btns .btn { flex: 1 1 auto; } }

/* ---------- step 4: newcomer tips at the edge of the board (canvas «Подсказка новичку»), never over the cards ---------- */
#game > .tip-card.tip-edge { position: fixed; left: 50%; top: 7vh; transform: translateX(-50%); width: min(560px, 44vw); z-index: 320; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  border-radius: 14px; background: rgba(22, 13, 7, .95) !important; border: 1px solid var(--t-line-hi); box-shadow: 0 0 24px rgba(255, 200, 90, .28), 0 10px 24px rgba(0, 0, 0, .6) !important;
  font-family: var(--k-font); color: var(--t-cream); animation: tip-in .35s cubic-bezier(.2, .8, .3, 1); transition: opacity .3s, transform .3s; }
#game > .tip-card.tip-edge.out { opacity: 0; transform: translate(-50%, -12px); }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, -16px); } }
.tip-edge .tip-top { display: flex; align-items: center; gap: 10px; }
.tip-edge .tip-n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--t-line-hi); color: #3a1206; font-weight: 900; font-size: 15px; }
.tip-edge .tip-top b { font-size: 18px; color: #fff3cf; }
.tip-edge p { margin: 0; font-size: 15px; line-height: 1.35; }
.tip-edge .tip-btns { display: flex; justify-content: space-between; align-items: center; margin: 0; }
.tip-edge .tip-link { border: none; background: none; padding: 4px 0; cursor: pointer; color: #d9c48a; font: 700 15px var(--k-font); text-decoration: underline; text-underline-offset: 3px; }
.tip-edge .tip-off { position: absolute; right: 14px; top: 12px; font-size: 13px; color: var(--t-sub); }
.tip-edge .tip-of { font-size: 13px; color: var(--t-sub); }
@media (max-width: 760px) {
  #game > .tip-card.tip-edge { left: 8px; right: 8px; top: calc(54px + env(safe-area-inset-top)); bottom: auto; width: auto; transform: none; padding: 10px 12px; }
  #game > .tip-card.tip-edge.out { transform: translateY(-12px); }
  .tip-edge .tip-off { position: static; }
  .tip-edge p { font-size: 14px; }
}
@media (max-width: 760px) { @keyframes tip-in-m { from { opacity: 0; transform: translateY(-12px); } } #game > .tip-card.tip-edge { animation-name: tip-in-m; } }
/* the game menu opens over the field, not over «Завершить ход» and the log in the right column (QA note) */
#stage.land .opts-pop { right: 330px; top: 60px; background: rgba(22, 13, 7, .96) !important; border: 1px solid var(--t-line) !important; border-radius: 16px !important; grid-template-columns: 1fr 1fr; width: 560px; }
#stage.land .opts-pop .btn { font-size: 16px !important; padding: 10px 14px !important; }
#stage.land .opts-pop #btn-menu { grid-column: 1 / -1; }

/* ---------- «Колода компьютера», variant B (Eugene 2026-10-27): the card with the whole painting fills the height, Leaders in a column on the left, «В бой» under the card; phones: Leaders in a row on top, no big painting, difficulty and «В бой» on the first screen ---------- */
/* shared: card fills the height (undo the compact tweaks of 9b18dde) */
#heroes .hero-select.with-level { display: flex !important; flex-direction: column; height: 100vh; box-sizing: border-box; padding: 10px 18px 10px !important; max-width: none !important; min-height: 0 !important; }
#heroes .hero-select.with-level .hs-step, #heroes .hero-select.with-level .hs-title, #heroes .hero-select.with-level .hs-chosen { flex: none; }
#heroes .hero-select.with-level .hs-title { font-size: 26px !important; margin: 0 !important; }
#heroes .hero-select.with-level .hs-keys, #heroes .hero-select.with-level .hs-more { display: none !important; }
@media (max-width: 760px) {
  #heroes .hero-select { height: auto; min-height: 100vh; padding: 56px 10px 0 !important; }
  #heroes .hero-select .hs-roster { order: 3; flex-wrap: nowrap !important; overflow-x: auto; justify-content: flex-start !important; gap: 10px !important; padding: 4px 2px 6px; margin: 6px 0 0 !important; }
  #heroes .hero-select .hs-medal { flex: none; width: 44px !important; font-size: 10px; line-height: 1.1; overflow-wrap: anywhere; }
  #heroes .hero-select .hs-medal .m { width: 40px !important; height: 40px !important; }
  #heroes .hero-select .hs-medal .tag { display: none; }
  #heroes .hero-select .hs-main { order: 4; }
  #heroes .hero-select .hs-portrait { display: none !important; }
  #heroes .hero-select .hs-plain, #heroes .hero-select .hs-style { display: none !important; }
  #heroes .hero-select .hs-name { font-size: 26px !important; }
  #heroes .hero-select .hs-bar { order: 9; position: sticky !important; bottom: 0; margin: 8px -10px 0 !important; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)) !important; background: rgba(14, 8, 4, .96) !important; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #heroes .hero-select { padding-top: 6px !important; }
  #heroes .hero-select .hs-step, #heroes .hero-select .hs-chosen { display: none !important; }
  #heroes .hero-select .hs-plain, #heroes .hero-select .hs-style, #heroes .hero-select .hs-row { display: none !important; }
  #heroes .hero-select .hs-medal .m { width: 40px !important; height: 40px !important; }
  #heroes .hero-select .hs-bar .hs-go { height: 44px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #heroes .hero-select .hs-title { font-size: 20px !important; margin-left: 120px !important; text-align: left !important; }
  #heroes .hero-select .hs-roster { flex-wrap: nowrap !important; overflow-x: auto; justify-content: flex-start !important; gap: 8px !important; margin: 4px 0 0 !important; padding: 0 !important; background: none !important; flex: none; }
  #heroes .hero-select .hs-medal { flex: none; width: 86px !important; font-size: 11px !important; }
  #heroes .hero-select .hs-medal .m { width: 36px !important; height: 36px !important; }
  #heroes .hero-select .hs-name { font-size: 22px !important; margin: 0 !important; }
  #heroes .hero-select .hs-sub { display: none !important; }
  #heroes .hero-select .hs-info .hs-level { margin-top: 6px !important; }
  #heroes .hero-select .hs-main { padding-top: 8px !important; padding-bottom: 8px !important; }
  #heroes .hero-select .hs-bar { margin-top: 4px !important; }
}
/* B: Leaders in a column on the left; the card fills the rest; the go button under the card */
@media (min-width: 761px) and (min-height: 501px) {
  #heroes .hero-select.with-level { display: grid !important; grid-template-columns: 112px 1fr; grid-template-rows: auto auto 1fr auto; column-gap: 16px; }
  #heroes .hero-select.with-level .hs-step, #heroes .hero-select.with-level .hs-title, #heroes .hero-select.with-level .hs-chosen { grid-column: 1 / -1; justify-self: center; }
  #heroes .hero-select.with-level .hs-roster { grid-column: 1; grid-row: 3 / 5; display: flex !important; flex-direction: column; flex-wrap: nowrap !important; overflow-y: auto; gap: 4px !important; margin: 8px 0 0 !important; justify-content: flex-start !important; }
  #heroes .hero-select.with-level .hs-medal { width: 100px !important; font-size: 12px; }
  #heroes .hero-select.with-level .hs-medal .m { width: 50px !important; height: 50px !important; }
  #heroes .hero-select.with-level .hs-main { grid-column: 2; grid-row: 3; min-height: 0 !important; margin: 8px 0 0; padding: 18px 28px 18px 0 !important; }
  #heroes .hero-select.with-level .hs-portrait.art { width: 60% !important; background-position: center 18% !important; }
  #heroes .hero-select.with-level .hs-info { margin-left: 50%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; padding: 0 0 0 26px !important; }
  #heroes .hero-select.with-level .hs-bar { grid-column: 2; grid-row: 4; margin: 10px 0 0 !important; padding: 0 !important; }
  #heroes .hero-select.with-level .hs-bar .hs-go { min-width: 340px; height: 56px; }
}
@media (min-width: 761px) and (min-height: 501px) { #heroes .hero-select.with-level .hs-step { grid-row: 1; } #heroes .hero-select.with-level .hs-title { grid-row: 2; } #heroes .hero-select.with-level .hs-chosen { display: none !important; } }
/* QA notes on step 3: Настройки fit 768 px high; phone touch targets 44 px; the deck code on phones in fewer lines */
@media (max-height: 820px) { #menu.mv .menu-opts { gap: 2px; padding-top: 16px !important; padding-bottom: 16px !important; } #menu.mv .menu-opts .k-row { min-height: 40px; } #menu.mv .menu-opts .k-vols .k-row { min-height: 32px; } #menu.mv .menu-opts .k-sec { margin-top: 4px; } }
@media (max-width: 760px) {
  .win-x, #menu.mv .menu-opts .mo-close { width: 44px !important; height: 44px !important; }
  #menu.mv .menu-opts .k-row, #menu.mv .menu-opts .k-vols .k-row { min-height: 44px; }
  .share-deck .sd-code b { font-size: 12px; letter-spacing: 0; }
}
@media (max-width: 760px) { #heroes .hero-select .hs-roster { gap: 3px !important; } #heroes .hero-select .hs-medal { width: 40px !important; } #heroes .hero-select .hs-medal .m { width: 38px !important; height: 38px !important; } }
/* phone held sideways: one column, Leaders in a row, the painting as a narrow strip */
@media (max-height: 500px) and (orientation: landscape) {
  #heroes .hero-select, #heroes .hero-select.with-level { display: flex !important; flex-direction: column; height: 100vh; box-sizing: border-box; padding: 6px 10px 6px !important; }
  #heroes .hero-select .hs-roster { order: 3; flex-wrap: nowrap !important; justify-content: center !important; gap: 2px !important; overflow-x: auto; flex: none; }
  #heroes .hero-select .hs-medal { width: 78px !important; }
  #heroes .hero-select .hs-main { order: 2; flex: 1; min-height: 0 !important; margin: 4px 0 0 !important; padding: 8px 14px 8px 0 !important; }
  #heroes .hero-select .hs-portrait.art { width: 44% !important; }
  #heroes .hero-select .hs-info { margin-left: 38% !important; }
  #heroes .hero-select .hs-plain, #heroes .hero-select .hs-style, #heroes .hero-select .hs-keys, #heroes .hero-select .hs-more { display: none !important; }
  #heroes .hero-select .hs-title { order: 1; margin-left: 120px !important; text-align: left !important; font-size: 20px !important; }
  #heroes .hero-select .hs-bar { order: 4; flex: none; margin: 4px 0 0 !important; padding: 0 !important; position: static !important; background: none !important; }
  #heroes .hero-select .hs-bar .hs-go { height: 44px; min-width: 260px; }
}
@media (max-height: 500px) and (orientation: landscape) { #heroes .hero-select.with-level .hs-title, #heroes .hero-select .hs-title { padding-left: 130px; margin-left: 0 !important; text-align: left !important; } }
@media (max-width: 760px) { #heroes .hero-select .hs-medal { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; } }

/* ---------- menu and window background: the tavern hall with the fireplace (Eugene 2026-10-27) ---------- */
.mv-art { background-image: url('../assets/ui/menu_hall.webp') !important; background-position: 70% center !important; }
.mv-art.leader-art { background-position: 70% center !important; }
#scene::before { background-image: url('../assets/ui/menu_hall.webp') !important; background-position: 60% center !important; }
@media (max-width: 760px) { .mv-art { background: #120a05 url('../assets/ui/menu_hall.webp') 72% top / auto 62vh no-repeat !important; } }
