:root {
  --table: #15242a;
  --table-2: #1c3036;
  --felt: #20383f;
  --line: #34515a;
  --ink: #eef0ea;
  --ink-dim: #9fb3b6;
  --brass: #f2b33d;
  --me: #e8654f;
  --opp: #5fb6dc;
  --attack: #c8463b;
  --defense: #3a76b8;
  --versatile: #7b56b0;
  --scheme: #e8901a; /* приём — жёлто-оранжевый, как флажок на картах */
  --paper: #f3efe3;
  --paper-ink: #22201b;
  --radius-card: 10px;
  --card-width: 152px;
  --card-min-height: 228px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Source Sans 3', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--table) radial-gradient(ellipse at 40% 30%, var(--felt), var(--table) 70%) no-repeat fixed;
  color: var(--ink);
  font: 15px/1.45 var(--body);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: 0.01em; }

.btn {
  background: var(--table-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 12px; color: var(--ink);
}
.btn:hover { border-color: var(--ink-dim); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--brass); border-color: var(--brass); color: #1a1406; font-weight: 700; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.small.toolbar-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 32px; min-height: 30px; padding: 5px 7px; }
.toolbar-icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.toolbar-icon-count { font-size: 11px; line-height: 1; }

/* ---------------- лобби ---------------- */
.lobby { max-width: 1060px; margin: 0 auto; padding: 32px 20px 60px; }
.lobby-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.lobby-head h1 { font-size: 46px; line-height: 1; }
.lobby-head p { color: var(--ink-dim); margin: 0; }
.lobby-head.bar { justify-content: space-between; align-items: center; flex-wrap: nowrap; gap: 24px; }
.lobby-head .lobby-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lobby-head .head-actions { display: flex; gap: 10px; flex-shrink: 0; }
.lobby-head .head-actions .btn { padding: 9px 18px; }
.lobby section { margin-bottom: 26px; }
.lobby h2 { font-size: 24px; margin-bottom: 10px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { color: var(--ink-dim); font-size: 13px; }
.field input, .field select, textarea {
  background: var(--table); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-width: 200px;
}
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; max-width: 100%; text-overflow: ellipsis; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239fb3b6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
}
.field select:hover { border-color: var(--ink-dim); }
.field select option { background: var(--table); color: var(--ink); }
.row.bottom { align-items: flex-end; }
.row.bottom .btn { padding-top: 8px; padding-bottom: 8px; }
.field { min-width: 0; max-width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 8px 14px; color: var(--ink-dim); }
.seg button[aria-pressed='true'] { background: var(--brass); color: #1a1406; font-weight: 700; }

.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hero-tile {
  text-align: left; background: var(--table-2); border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.hero-tile[aria-pressed='true'] { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(242, 179, 61, 0.2); }
.hero-tile .hn { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.hero-tile .hs { color: var(--ink-dim); font-size: 13px; }
.hero-tile .warn { color: var(--brass); font-size: 12px; }
.hero-pick { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; height: 640px; }
.hero-pick .hero-grid { overflow-y: auto; align-content: start; min-height: 0; padding: 4px; }
/* тонкий тёмный скроллбар: стандартные свойства (Firefox, Chrome 121+, Safari 18.2+), ::-webkit-scrollbar — для старых Chrome/Safari */
.hero-pick .hero-grid { scrollbar-width: thin; scrollbar-color: #0f1d21 transparent; }
.hero-pick .hero-grid::-webkit-scrollbar { width: 6px; }
.hero-pick .hero-grid::-webkit-scrollbar-track { background: transparent; }
.hero-pick .hero-grid::-webkit-scrollbar-thumb { background: #0f1d21; border-radius: 3px; }
.hero-pick .hero-grid::-webkit-scrollbar-thumb:hover { background: #0a1417; }
.hero-detail {
  display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; padding: 16px;
  background: var(--table-2); border: 1px solid var(--line); border-radius: 8px; color: var(--ink-dim); font-size: 14px;
}
.hero-detail.empty { justify-content: center; text-align: center; }
.hero-detail .hd-name { font-size: 36px; line-height: 1; text-transform: uppercase; color: var(--ink); }
.hero-detail .hd-set { font-size: 13px; margin-top: 2px; }
.hero-detail .hd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-detail .hd-title { min-width: 0; flex: 1 1 auto; }
.hero-detail .hd-name { overflow-wrap: anywhere; }
.hero-detail .hd-pic { flex: 0 0 auto; height: 72px; width: 72px; object-fit: contain; border-radius: 8px; margin: 4px 0; }
.hero-detail .warn { color: var(--brass); font-size: 12px; }
.hero-detail .hd-stats { margin: 0; display: flex; flex-direction: column; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-detail .st { display: flex; gap: 10px; }
.hero-detail dt { flex: 0 0 84px; font-size: 13px; }
.hero-detail dd { margin: 0; color: var(--ink); font-weight: 600; }
.hero-detail .hd-ability { flex: 1; min-height: 0; overflow-y: auto; }
.hero-detail .hd-ability p, .ab-list { margin: 0 0 6px; }
.ab-list { padding-left: 18px; }
.hero-detail button { align-self: flex-start; }

/* ---------------- игра ---------------- */
.game { --sidebar-width: 380px; position: relative; height: 100dvh; overflow: clip; }
body:has(.game) { background: var(--table) url('/game-background.png') center / cover no-repeat fixed; }
body:has(.game), body:has(.game) * { user-select: none; -webkit-user-select: none; }
body:has(.game) .log, body:has(.game) .log * { user-select: text; -webkit-user-select: text; }
body:has(.game) .log button, body:has(.game) .log button * { user-select: none; -webkit-user-select: none; }
.game-tools { position: absolute; top: 12px; left: 12px; z-index: 15; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.game-tools > .btn, .game-tools summary { width: 34px; min-height: 32px; padding: 4px; }
.game-tools .zoom-ctl { position: static; margin-top: 12px; }
.game-turn { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 13px; text-align: right; }
.game-actions { position: relative; }
.game-actions summary { cursor: pointer; list-style: none; }
.game-actions summary::-webkit-details-marker { display: none; }
.game-actions[open] summary { border-color: var(--brass); }
.game-actions-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 15; display: flex; flex-direction: column; gap: 4px; width: 210px; max-width: calc(100vw - 28px); padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--table-2); box-shadow: 0 8px 24px #0006; }
.game-actions-panel .btn.small { justify-content: flex-start; gap: 10px; padding: 9px 10px; width: 100%; text-decoration: none; }
.game-actions-panel .toolbar-icon-count { margin-left: auto; color: var(--ink-dim); }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--brass); display: inline-block; }
.dots i.on { background: var(--brass); }
.dots i.in-progress { position: relative; }
.dots i.in-progress::after { content: ''; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--brass); transform: translate(-50%, -50%); }
.dots.opp i.in-progress::after { background: var(--opp); }

.board-wrap { position: absolute; inset: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 0; min-height: 0; }
.board { width: 100%; height: 100%; max-height: 100%; }
.board .edge { stroke: #4c6c74; stroke-width: 5; stroke-linecap: round; }
.board .space-bg { fill: #2a464d; }
.board .space-num { fill: #b9c7c6; font: 600 13px var(--body); text-anchor: middle; pointer-events: none; }
.board .space.target circle.space-bg { fill: #6b5418; }
.board .space.target { cursor: pointer; }
.board .space.target .ring-hl { stroke: var(--brass); stroke-width: 4; fill: none; animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { from { stroke-opacity: 1; } to { stroke-opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .board .space.target .ring-hl { animation: none; } }
.fog circle { fill: rgba(215, 230, 236, 0.32); stroke: rgba(235, 245, 248, 0.55); stroke-width: 1.5; }
.token { cursor: default; }
.token.target { cursor: pointer; }
.move-control { cursor: pointer; }
.move-control rect, .move-budget-bg { fill: #17262e; stroke: #d8c79b; stroke-width: 1.5; }
.token .move-controls text { font-family: var(--display); font-size: 13px; fill: #f4ead6; text-anchor: middle; }
.move-control:hover rect, .move-control:focus rect { fill: #39505a; stroke: #fff0c9; }
.move-control.disabled { opacity: .4; cursor: default; }
.move-control.disabled:hover rect { fill: #17262e; stroke: #d8c79b; }
.move-budget-bg { stroke: #637b87; }
.token .disc { stroke: #0e1a1e; stroke-width: 3; }
.token.target .disc { stroke: var(--brass); stroke-width: 4; }
.token.in-combat .disc { stroke: #fff; stroke-width: 4; }
.token text { font-family: var(--display); font-weight: 800; text-anchor: middle; pointer-events: none; }
.token .tl { fill: #fff; font-size: 17px; }
.token.sidekick .tl { font-size: 11.5px; }
.token.sidekick .disc { stroke-width: 2; opacity: 0.92; }
.token .hp { fill: #fff; font-size: 12px; }
.token .halo { fill: none; stroke-width: 3; opacity: 0.85; }
.token .crown { fill: #f2c94c; stroke: #0e1a1e; stroke-width: 1.5; stroke-linejoin: round; }
.token .rim { fill: none; }
.token .num { fill: #fff; font-size: 10px; }
.token.target .rim { stroke: var(--brass); }
.token.in-combat .rim { stroke: #fff; }
.token .hp-bg { fill: #0e1a1e; }
.token .combat-role circle { fill: var(--table); stroke: var(--line); stroke-width: 1; }
.token .combat-role text { fill: var(--ink); font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; font-size: 16px; font-weight: 400; }

.side { position: absolute; inset: 0 0 0 auto; width: var(--sidebar-width); display: flex; flex-direction: column; min-height: 0; overflow: auto; pointer-events: none; }
.side :is(button, a, .term, .hero-resource-value, .sisters-spell, .combat, .decision, .game-turn, .pl-hand) { pointer-events: auto; }
.side > * { padding: 10px 14px; }
.side > .sidebar-log[hidden] { display: none; }
.side > .sidebar-player { padding: 0; margin-top: auto; flex-shrink: 0; }
.side > .sidebar-opponent { padding: 0; flex-shrink: 0; }
.sidebar-opponent .character-main { grid-template-rows: auto var(--hud-lift); align-items: end; }
.sidebar-opponent .character-main::before { inset: 0 0 var(--hud-lift); }
.sidebar-opponent .character-main > .character-card-stats { grid-row: 2; }
.sidebar-opponent .character-main > .character-info { grid-row: 1; padding-top: 0; padding-bottom: 8px; display: flex; flex-direction: column-reverse; }
.sidebar-opponent .character-info > .sidebar-rules { margin-top: 0; margin-bottom: 8px; }
.sidebar-opponent .character-info > .sidebar-card-meta { margin-top: 0; margin-bottom: 9px; }
.sidebar-opponent .character-portraits { display: flex; flex-direction: column-reverse; }
.sidebar-opponent .character-helpers { flex-direction: column; align-self: start; }
.sidebar-opponent .character-panel.has-effects .character-main,
.sidebar-opponent .character-panel.has-effects .character-helpers { grid-row: 1; }
.sidebar-opponent .character-effects { grid-row: 2; align-items: end; }
.sidebar-opponent .character-helper-number { top: auto; bottom: 4px; }
.sidebar-opponent .sidebar-player:has(.sidebar-zone) { display: flex; flex-direction: column-reverse; }
.sidebar-player { container-type: inline-size; }
.sidebar-player > .character-panel { margin-left: auto; padding-inline: 12px; }
.sidebar-opponent .character-fighter .character-portrait img { transform: scaleX(-1); }
.side > .play-panel { flex-shrink: 0; }
.character-panel { --portrait-size: 112px; --helper-size: 48px; --health-size: 15px; --hud-lift: 44px; --info-size: 180px; --effect-size: 32px; display: grid; grid-template-columns: minmax(0, auto); gap: 8px; width: fit-content; max-width: 100%; padding: 12px 10px; }
.character-panel.has-helpers { grid-template-columns: var(--helper-size) minmax(0, auto); }
.character-panel.compact { --portrait-size: 96px; --helper-size: 44px; --health-size: 14px; --hud-lift: 36px; --info-size: 164px; }
.character-panel.mini { --portrait-size: 80px; --helper-size: 44px; --health-size: 12px; --hud-lift: 30px; --info-size: 150px; }
.character-main { position: relative; isolation: isolate; align-self: start; grid-column: -2; grid-row: 1; display: grid; width: calc(var(--portrait-size) + var(--info-size) + 8px); max-width: 100%; grid-template-columns: var(--portrait-size) minmax(0, 1fr); grid-template-rows: var(--hud-lift) auto; gap: 0 8px; align-items: start; }
.character-main::before { content: ''; position: absolute; z-index: -1; inset: var(--hud-lift) 0 0; border-radius: 6px; background: var(--table-2); }
.character-panel.has-effects .character-main, .character-panel.has-effects .character-helpers { grid-row: 2; }
.character-effects { grid-column: -2; grid-row: 1; display: flex; flex-wrap: wrap; align-items: start; gap: 6px; padding-left: 0; min-width: 0; max-width: 100%; }
.character-effects.single { padding-left: 0; }
.character-effect { display: block; width: var(--effect-size); height: var(--effect-size); min-height: 0; flex: 0 0 var(--effect-size); padding: 0; border: 0; border-radius: 50%; background: none; overflow: hidden; cursor: pointer; }
.character-effect-art { display: block; width: var(--card-width); pointer-events: none; }
.character-effect-art .card.mini { width: var(--card-width); min-height: var(--card-min-height); }
.character-effect:hover, .character-effect:focus-visible { outline: 1px solid var(--brass); outline-offset: 1px; }
.character-main > .character-portraits { grid-column: 1; grid-row: 1 / 3; align-self: end; }
.sidebar-opponent .character-main > .character-portraits { align-self: start; }
.character-main > .character-card-stats { grid-column: 2; grid-row: 1; align-self: center; gap: 6px; }
.character-main > .character-info { grid-column: 2; grid-row: 2; padding-top: 8px; }
.character-portraits { display: grid; gap: 6px; }
.character-fighter { display: block; padding: 0; border: 0; background: none; }
.character-portrait { position: relative; display: block; width: var(--portrait-size); aspect-ratio: 1; overflow: hidden; border-radius: 5px; background: var(--table-2); }
.character-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.character-placeholder { position: absolute; inset: 15%; display: flex; align-items: center; justify-content: center; color: var(--ink-dim); opacity: .45; }
.character-placeholder svg { width: 100%; height: 100%; max-width: 48px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.character-health { position: absolute; left: 4px; right: 4px; bottom: 4px; display: grid; grid-template-columns: 12px 2ch 6px 2ch; justify-content: center; align-items: center; gap: 1px; height: 23px; border: 1px solid #fff; border-radius: 4px; background: var(--table); color: #fff; font-size: var(--health-size); font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1; }
.character-info { min-width: 0; }
.character-card-stats { gap: 8px; }
.character-card-stats .sidebar-pile { gap: 4px; }
.character-card-stats .sidebar-metric-icon { width: 18px; height: 20px; }
.character-card-stats .sidebar-metric-text { height: 20px; justify-content: center; }
.character-card-stats .sidebar-metric-text > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.character-card-stats .sidebar-metric-text > strong { font-size: 19px; line-height: 20px; }
.character-hand { min-width: 0; }
.character-mechanic { margin-top: 0; min-width: 0; overflow-wrap: anywhere; }
.character-description { font-size: 14px; line-height: 1.4; color: var(--ink-dim); }
.character-description.term { border-bottom: 0; text-decoration: underline dotted; text-underline-offset: 3px; }
.character-description p { margin: 0 0 6px; }
.character-description ul { margin: 0 0 6px; padding-left: 15px; }
.character-panel:has(.hero-mode-popup) .character-main, .character-panel:has(.hero-mode-popup) .character-helpers { grid-row: 2; }
.character-panel:has(.hero-mode-popup) .character-effects { grid-row: 3; }
.hero-mode-popup { position: relative; z-index: 5; grid-column: -2; grid-row: 1; margin-bottom: 12px; width: 100%; box-sizing: border-box; padding: 14px; border: 1px solid var(--brass); border-radius: 16px; background: linear-gradient(145deg, #263a3e, #142629); box-shadow: 0 16px 44px #0007, inset 0 1px 0 #fff1; animation: hero-choice-in .25s ease-out both; pointer-events: auto; }
.hero-mode-popup::after { content: ''; position: absolute; bottom: -7px; left: calc(var(--portrait-size) / 2 - 7px); width: 12px; height: 12px; background: #192d30; border-right: 1px solid var(--brass); border-bottom: 1px solid var(--brass); transform: rotate(45deg); }
.hero-mode-caption { margin-bottom: 12px; color: var(--brass); font-size: 12px; font-weight: 600; line-height: 1.4; }
.hero-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hero-mode-option { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 12px 10px; text-align: left; white-space: normal; border: 1px solid #b6c9be44; border-radius: 10px; background: #ffffff08; color: #f3eee2; transition: background .18s, border-color .18s, transform .18s; }
.hero-mode-option:hover { background: #d9b66c20; border-color: var(--brass); transform: translateY(-3px); }
.hero-mode-option:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.hero-mode-title { font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.hero-mode-description { display: block; margin-top: auto; font-size: 12px; line-height: 1.5; color: #d4ddd5; }
.hero-mode-current { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--brass); }
.character-panel:has(.fighter-move-popup) .character-main, .character-panel:has(.fighter-move-popup) .character-helpers { grid-row: 2; }
.character-panel:has(.fighter-move-popup) .character-effects { grid-row: 3; }
.fighter-move-popup { position: relative; grid-column: -2; grid-row: 1; box-sizing: border-box; padding: 14px; margin-bottom: 12px; border: 1px solid var(--brass); border-radius: 12px; background: linear-gradient(145deg, #263a3e, #142629); box-shadow: 0 10px 30px #0005; pointer-events: auto; }
.fighter-move-popup::after { content: ''; position: absolute; bottom: -7px; left: 30px; width: 12px; height: 12px; transform: rotate(45deg); background: #192d30; border-right: 1px solid var(--brass); border-bottom: 1px solid var(--brass); }
.fighter-move-prompt { margin-bottom: 12px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.fighter-move-popup > button { width: 100%; }
.ability-choosing { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 76px; width: 100%; color: var(--brass); font-size: 26px; }
.ability-choosing span { animation: ability-choice-dot 1.2s ease-in-out infinite; }
.ability-choosing span:nth-child(2) { animation-delay: .16s; }
.ability-choosing span:nth-child(3) { animation-delay: .32s; }
@keyframes ability-choice-dot { 0%, 65%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-7px); } }
@keyframes hero-choice-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .hero-mode-popup, .ability-choosing span { animation: none; } .hero-mode-option { transition: none; } }
.character-panel .sidebar-feature { margin: 0; font-size: 14px; }
.character-panel .hero-resource { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 4px; min-height: 0; padding: 0; text-align: left; }
.character-panel .hero-resource-label { font-size: 14px; }
.character-panel .hero-resource-value { margin: 0; gap: 3px; font-family: var(--body); }
.character-panel .hero-resource.number .hero-resource-value, .character-panel .hero-resource.form .hero-resource-value { font-size: 15px; line-height: 1.3; text-transform: none; }
.character-panel .hero-resource-value small { font-size: 14px; }
.character-info > .sidebar-rules { margin-top: 8px; font-size: 10px; }
.character-helpers { grid-column: 1; grid-row: 1; display: flex; flex-direction: column-reverse; gap: 6px; align-self: end; height: 0; min-height: 0; overflow: visible; }
.character-helpers.many { --helper-size: 44px; }
.character-helper { display: block; width: var(--helper-size); flex-shrink: 0; padding: 0; border: 0; background: none; color: var(--ink); }
.character-portrait.helper { width: var(--helper-size); background: var(--table); }
.character-helper-number { position: absolute; top: 4px; right: 4px; width: 15px; height: 15px; border-radius: 2px; background: var(--paper); color: #000; font-size: 11px; font-weight: 700; line-height: 15px; text-align: center; font-variant-numeric: tabular-nums; }
.character-panel .character-portrait.helper .character-health { left: 3px; right: 3px; bottom: 3px; height: 17px; font-size: 10px; grid-template-columns: 8px 2ch 3px 2ch; gap: 0; }
.character-helper:hover .character-portrait, .character-helper:focus-visible .character-portrait { outline: 1px solid var(--brass); outline-offset: 1px; }
.character-fighter.dead, .character-helper.dead { opacity: .45; }
.hero-syllables { width: 100%; }
.ability-panel-blocks { display: grid; gap: 8px; font-size: 14px; line-height: 1.5; }
.ability-panel-blocks.columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ability-panel-block { min-width: 0; overflow-wrap: anywhere; }
.ability-panel-block p { margin: 0; }
.ability-panel-title { color: var(--brass); font-weight: 600; margin-bottom: 4px; }
.ability-panel-summary { font-size: 14px; line-height: 1.5; }
.ability-panel-items { color: var(--brass); overflow-wrap: anywhere; }
.ability-panel-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; color: var(--brass); font-size: 12px; }
.ability-panel-footer > span { display: inline-flex; align-items: center; gap: 4px; }
.ability-panel-footer > span + span { text-align: right; }
.ability-panel-icon { flex: none; width: 16px; height: 16px; }
.ability-panel-counter-row { display: flex; align-items: center; gap: 24px; }
.ability-panel-counter { display: inline-flex; align-items: center; gap: 8px; color: var(--brass); font-size: 20px; font-variant-numeric: tabular-nums; cursor: help; }
.ability-panel-counter .ability-panel-icon { width: 24px; height: 24px; }
.ability-panel-counter.term { border-bottom: 0; }
.hero-syllables-label { color: var(--brass); font-size: 14px; line-height: 1.5; }
.hero-syllables-dots { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-inline: 8px; height: 10px; }
.hero-syllable { display: grid; place-items: center; width: 10px; height: 10px; }
.hero-syllable::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #9ddcff; }
.hero-syllable.filled::before { width: 10px; height: 10px; }
.hero-syllables.empty-line .hero-syllable::before { background: #879398; }
@container (max-width: 350px) {
  .character-panel.full { --portrait-size: 104px; --helper-size: 44px; --hud-lift: 40px; padding-inline: 8px; }
}
.sidebar-zone { padding: 14px; border-top: 1px solid var(--line); }
.sidebar-zone-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sidebar-zone-head h3 { margin: 0; color: var(--ink-dim); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-piles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sidebar-piles .sidebar-pile { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; text-decoration: none; }
.sidebar-metric-icon { width: 32px; height: 36px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-metric-text { display: flex; flex-direction: column; justify-content: space-between; height: 36px; min-width: 0; }
.sidebar-metric-text > span { font-size: 10px; line-height: 12px; color: var(--ink-dim); text-transform: capitalize; }
.sidebar-metric-text > strong { font-family: var(--display); font-size: 23px; line-height: 24px; font-variant-numeric: tabular-nums; }
.sidebar-piles button.sidebar-pile:hover { color: var(--brass); }
.sidebar-card-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; font-size: 12px; color: var(--ink-dim); }
.sidebar-card-meta:empty { display: none; }
.sidebar-card-meta button, .sidebar-rules { padding: 0; border: 0; background: none; color: var(--ink-dim); font-size: 12px; text-decoration: underline dotted; }
.sidebar-card-meta button:hover, .sidebar-rules:hover { color: var(--brass); }
.sidebar-hero-layout { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 14px; }
.sidebar-main-fighters { display: grid; gap: 12px; }
.sidebar-hero.group .sidebar-hero-layout { display: block; }
.sidebar-hero.group .sidebar-main-fighters { grid-template-columns: repeat(var(--hero-count), minmax(100px, 1fr)); gap: 6px; overflow-x: auto; }
.sidebar-hero.group .sidebar-hero-photo { width: 100%; height: auto; aspect-ratio: 1; }
.sidebar-group-ability .sidebar-feature { margin-top: 0; }
.sidebar-hero-title { display: flex; align-items: baseline; gap: 6px; width: 100%; margin-bottom: 7px; padding: 0; border: 0; background: none; color: var(--me); text-align: left; font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.15; }
.sidebar-hero-title > span:first-child { flex-shrink: 0; font-size: 17px; }
.sidebar-hero-title > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.sidebar-hero-title:hover > span:last-child { text-decoration: underline dotted; }
.sidebar-hero-photo { position: relative; display: block; width: 112px; height: 112px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--table-2); color: var(--ink); }
.sidebar-hero-photo:hover { border-color: var(--me); }
.sidebar-photo-placeholder { position: absolute; inset: 9px 20px 40px; display: flex; align-items: center; justify-content: center; color: var(--ink-dim); opacity: .45; }
.sidebar-photo-placeholder svg { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.sidebar-hero-health { position: absolute; left: 6px; right: 6px; bottom: 6px; display: grid; grid-template-columns: 16px 2ch 8px 2ch; align-items: center; justify-content: center; gap: 2px; height: 28px; border: 1px solid #fff; border-radius: 4px; background: var(--table); color: #fff; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; text-align: center; }
.sidebar-heart { font-size: 16px; }
.sidebar-hero-card.dead { opacity: .45; }
.sidebar-hero-card.dead .sidebar-hero-title > span:last-child { text-decoration: line-through; }
.hero-resource { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 112px; padding: 8px 0; text-align: center; }
.hero-resource-label { color: var(--ink-dim); font-size: 11px; line-height: 1.3; }
.hero-resource-value { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-top: 8px; color: var(--brass); font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; cursor: help; }
.hero-resource.form .hero-resource-value { display: block; font-size: 29px; line-height: 1.15; text-transform: uppercase; }
.hero-resource.number .hero-resource-value { font-size: 48px; line-height: 1; }
.hero-resource-value small { color: var(--ink-dim); font-family: var(--body); font-size: 11px; font-weight: 400; }
.sisters-ability { display: grid; grid-template-columns: minmax(0, 1fr) 86px; align-items: center; gap: 14px; }
.sisters-cauldron { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 14px; min-height: 96px; padding: 8px 12px 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--table-2); color: var(--ink); }
.sisters-cauldron:hover { border-color: var(--brass); }
.sisters-cauldron-label { font-size: 11px; color: var(--ink-dim); text-align: center; }
.sisters-ingredients { display: flex; align-items: center; justify-content: center; gap: 16px; }
.sisters-ingredient { display: flex; align-items: center; gap: 4px; }
.sisters-ingredient .ing { width: 24px; height: 24px; background: var(--paper); border-radius: 50%; }
.sisters-ingredient .ing svg { width: 24px; height: 24px; }
.sisters-ingredient strong { min-width: 1ch; font-family: var(--display); font-size: 25px; font-variant-numeric: tabular-nums; }
.sisters-spells { display: grid; grid-template-columns: repeat(2, 36px); gap: 12px; }
.sisters-spell { display: block; width: 36px; height: 36px; border-radius: 50%; outline: 1px solid var(--line); outline-offset: 2px; cursor: help; }
.sisters-spell.ready { outline-color: var(--brass); }
.sisters-spell:hover, .sisters-spell:focus-visible { outline-color: var(--ink); }
.sidebar-feature { margin-top: 10px; color: var(--brass); font-size: 13px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.sidebar-feature .ing { background: var(--paper); border-radius: 50%; padding: 1px; box-sizing: content-box; }
/* Плашки игроков — полосы над полем (соперник) и под ним (вы), как места за столом */
.pl { grid-column: 1; display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; padding: 6px 14px; background: rgba(0, 0, 0, 0.18); }
.pl.opp { grid-row: 2; border-bottom: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--opp); }
.pl.me { grid-row: 4; border-top: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--me); }
.pl .fighters { margin-top: 0; }
.pl .pn { color: var(--ink-dim); font-size: 14px; }
.pl-head { display: flex; align-items: baseline; gap: 8px; }
.pl-head .who { font-family: var(--display); font-size: 21px; font-weight: 700; }
.pl.me .who { color: var(--me); }
.pl.opp .who { color: var(--opp); }
.pl-meta { color: var(--ink-dim); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.pl-meta button { background: none; border: 0; padding: 0; color: var(--ink-dim); text-decoration: underline dotted; }
.pl-res { font-size: 13px; color: var(--brass); }
.fighters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
.fighters .f { background: var(--table); border-radius: 4px; padding: 1px 7px; }
.fighters .f.dead { text-decoration: line-through; opacity: 0.5; }

.decision { position: relative; width: 100%; max-height: 60vh; overflow: auto; padding: 14px; }
.decision.waiting { color: var(--ink-dim); }
.decision-leaving { pointer-events: none; z-index: 10; border: 1px solid var(--line); border-radius: 6px; background: var(--table-2); box-shadow: 0 8px 24px #0005; }
.decision .prompt { font-weight: 700; margin-bottom: 8px; }
.mouse-shortcut { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; white-space: nowrap; }
.mouse-left-icon { width: 16px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.decision .manual-text { background: var(--paper); color: var(--paper-ink); padding: 8px 10px; border-radius: 6px; margin-bottom: 8px; font-size: 14px; }
.opts { display: flex; flex-direction: column; gap: 5px; max-height: 34vh; overflow: auto; }
.opts button { text-align: left; background: var(--table-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.opts button:hover { border-color: var(--brass); }
.opts button.minor { color: var(--ink-dim); }
.opts button.end-turn { background: #682e38; border-color: #a55b65; color: var(--paper); font-weight: 700; transform-origin: left center; }
.opts button.end-turn:hover { background: #7a3743; border-color: var(--brass); }

.side > .play-panel { display: flex; flex-direction: column; gap: 0; margin: 12px 14px 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--table-2); box-shadow: 0 8px 24px #0005; pointer-events: auto; }
.play-panel > .combat { padding: 10px; }
.combat-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 240ms ease, opacity 240ms ease; opacity: 1; }
.combat-body-inner { min-height: 0; overflow: hidden; }
.combat.folded .combat-body { grid-template-rows: 0fr; opacity: 0; pointer-events: none; visibility: hidden; transition: grid-template-rows 240ms ease, opacity 240ms ease, visibility 0s 240ms; }
.combat .combat-fold { display: inline-flex; align-items: center; justify-content: center; }
.combat.folded .lc-head { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .combat-body, .combat.folded .combat-body { transition: none; } }
.combat-history-nav { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 8px; }
.combat-history-nav button { position: relative; }
.history-new-dot { position: absolute; right: -3px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: #ff4b4b; box-shadow: 0 0 0 2px var(--table); }
.combat .vs { position: relative; display: flex; align-items: stretch; gap: 4px; justify-content: center; }
.combat-placeholder { position: absolute; border: 1px solid var(--line); border-radius: var(--radius-card); pointer-events: none; }
.combat .vs .x { font-family: var(--display); font-size: 26px; color: var(--ink-dim); align-self: center; }
.followup-label { margin: 0 0 8px; padding: 5px 8px; border: 1px solid var(--brass); border-radius: 5px; color: var(--brass); font-weight: 700; text-align: center; }
.combat.followup .vs > .card:first-child, .fly-card.followup .card { box-shadow: 0 0 0 2px var(--brass); }
.combat.followup .vs > .card:first-child .val, .fly-card.followup .val { outline: 3px solid var(--brass); outline-offset: 2px; }
.combat.followup .vs > .card:first-child .tx, .fly-card.followup .tx { opacity: .35; }

.log { flex: 1; overflow: auto; min-height: 120px; font-size: 13px; color: var(--ink-dim); }
.log div { padding: 1px 0; }
.log .turn { color: var(--ink); font-weight: 700; margin-top: 6px; }
.log .priv { color: var(--brass); }

.hand-wrap { position: absolute; bottom: 0; left: 0; right: var(--sidebar-width); min-width: 0; padding: 8px 12px; overflow-x: clip; overflow-y: visible; pointer-events: none; }
.hand { --hand-card-width: var(--card-width); display: grid; grid-template-columns: repeat(var(--hand-intervals), minmax(0, 1fr)) var(--hand-card-width); gap: 0; min-height: var(--card-min-height); align-items: stretch; padding-top: 10px; justify-content: center; width: 80%; max-width: calc(var(--hand-count) * var(--hand-card-width) + (var(--hand-count) - 1) * 8px); margin-inline: auto; isolation: isolate; overflow: visible; }
.hand > .card { pointer-events: auto; width: var(--hand-card-width); flex: 0 0 var(--hand-card-width); }
.hand > .card:hover, .hand > .card:focus-visible { z-index: 1; }
.hand.overlapping { max-width: calc(var(--hand-count) * var(--hand-card-width) - (var(--hand-count) - 1) * 8px); }
.hand:has(> .card:only-child), .hand:has(.empty) { grid-template-columns: minmax(0, 1fr); }
.hand:has(.empty) { max-width: 80%; }
.discard-notice { position: absolute; left: calc((100% - var(--sidebar-width)) / 2); bottom: 20px; z-index: 6; transform: translateX(-50%); transform-origin: center; pointer-events: none; display: flex; flex-direction: column; gap: 2px; width: max-content; max-width: min(540px, calc(100% - var(--sidebar-width) - 32px)); padding: 10px 18px; background: #293f47; border: 1px solid #526e78; border-radius: 8px; color: var(--ink); text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
.discard-notice { filter: opacity(1); transition: filter 120ms ease-out; }
.discard-notice.is-muted { filter: opacity(.25); }
@media (prefers-reduced-motion: reduce) { .discard-notice { transition: none; } }
.discard-notice strong { font-family: var(--display); font-size: 18px; }
.discard-notice span { font-size: 13px; }
.hand .empty { color: var(--ink-dim); align-self: center; }

/* ---------------- карта (игральная) ---------------- */
.card {
  position: relative; width: var(--card-width); min-height: var(--card-min-height); flex: 0 0 var(--card-width);
  background: var(--paper); color: var(--paper-ink); border-radius: var(--radius-card);
  border: 3px solid var(--c, #777); padding: 26px 8px 22px; font-size: 11.5px; line-height: 1.3; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.card.attack { --c: var(--attack); }
.card.defense { --c: var(--defense); }
.card.versatile { --c: var(--versatile); }
.card.scheme { --c: var(--scheme); }
.card .val {
  position: absolute; top: -3px; left: -3px; width: 34px; height: 34px; border-radius: var(--radius-card) 0 10px 0;
  background: var(--c); color: #fff; font: 800 24px/34px var(--display); text-align: center;
}
.card .val.vs { background: linear-gradient(135deg, var(--attack) 50%, var(--defense) 50%); }
.card .nm { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.05; margin: -20px 0 4px 34px; min-height: 30px; }
.card .who { font-size: 10.5px; color: #6a6355; margin-bottom: 3px; }
.card .tx b { font-weight: 700; }
.card .bst {
  position: absolute; bottom: 4px; right: 6px; font: 700 13px var(--display); color: #6a6355;
}
.card .sym { position: absolute; bottom: 3px; left: 6px; font-size: 14px; }
.card .man { position: absolute; top: 3px; right: 5px; font-size: 10px; color: #a33; }
.card.back { background: repeating-linear-gradient(45deg, #2d4a52, #2d4a52 6px, #26404a 6px, #26404a 12px); border-color: #4c6c74; min-height: var(--card-min-height); }
button.card { cursor: default; }
button.card.playable { cursor: pointer; box-shadow: 0 0 0 2px rgba(255, 244, 207, 0.9), 0 0 12px 2px rgba(242, 179, 61, 0.65), 0 0 22px 4px rgba(242, 179, 61, 0.25); transform: translateY(-6px); }
button.card.playable:hover { transform: translateY(-10px); }
.card.mini { font-size: 10.5px; }

/* ---------------- модалка, тост ---------------- */
.modal { position: fixed; inset: 0; background: rgba(5, 10, 12, 0.7); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--table-2); border: 1px solid var(--line); border-radius: 10px; max-width: 860px; width: 100%; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.modal-body { overflow-y: auto; min-height: 0; padding: 20px 22px; }
.modal-body > h2:first-child { position: sticky; top: -20px; z-index: 1; background: var(--table-2); margin: -20px -22px 10px; padding: 20px 52px 8px 22px; }
.modal-close { position: absolute; top: 8px; right: 10px; z-index: 2; background: none; border: 0; font-size: 26px; color: var(--ink-dim); }
.modal h2 { font-size: 26px; margin-bottom: 10px; }
.cards-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.md { max-width: 75ch; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; font-size: 21px; }
.md p, .md li { color: var(--ink); }
.analysis-item { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
.analysis-item .q { color: var(--ink-dim); font-size: 13px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #3a1d1a; border: 1px solid var(--me); padding: 8px 14px; border-radius: 6px; z-index: 30; max-width: 90vw; }
.toast[hidden] { display: none; }
.winner { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--brass); }
.thinking { color: var(--opp); }
.deck-row { display: grid; grid-template-columns: 2.4fr 0.4fr 1fr 5fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.deck-row .t { font-weight: 700; }
.share { background: var(--table); border: 1px dashed var(--line); padding: 10px 12px; border-radius: 6px; word-break: break-all; }

@media (max-width: 900px) {
  .lobby-head.bar { flex-direction: column; align-items: stretch; gap: 14px; }
  .lobby-head .head-actions { flex-wrap: wrap; }
  .lobby-head .head-actions .btn { flex: 1 1 auto; }
  .hero-pick { grid-template-columns: 1fr; height: auto; }
  .hero-pick .hero-grid { max-height: 320px; }
  .hero-detail { min-height: 380px; }
  .game { --sidebar-width: min(380px, 45vw); }
  .pl { padding: 6px 10px; gap: 4px 12px; }
  .side { border: 0; }
  .decision { max-height: 60vh; }
  .log { max-height: 40vh; }
  .deck-row { grid-template-columns: 1fr 1fr; }
}

/* ---------------- подсказка ---------------- */
.prompt-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.prompt-row .prompt { flex: 1; }
.hint-btn { flex: none; border-color: var(--brass); color: var(--brass); }
.hint-box { background: rgba(242, 179, 61, 0.12); border-left: 3px solid var(--brass); padding: 7px 10px; border-radius: 4px; margin: 0 0 8px; font-size: 14px; }
.opts button.advised { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }

/* ---------------- карты в логе ---------------- */
.card-ref { color: var(--ink); text-decoration: underline dotted var(--ink-dim); text-underline-offset: 2px; cursor: help; }
.card-ref:hover, .card-ref:focus-visible { color: var(--brass); }
.card-ref .card-qty { color: var(--ink-dim); font-size: .85em; font-weight: 400; }
.card-tip { position: fixed; z-index: 40; display: flex; gap: 8px; pointer-events: none; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5)); }
.card-tip[hidden] { display: none; }
.card-tip .tip-hero { font: 700 13px var(--display); color: var(--ink); background: var(--table-2); border-radius: 4px; padding: 1px 6px; margin-bottom: 4px; display: inline-block; }
.card-tip .card { font-size: 12px; }

.board .passage circle { fill: #3d2a55; stroke: #c9a8f0; stroke-width: 1.5; }
.board .passage text { fill: #e6d6fa; font: 700 11px var(--body); text-anchor: middle; pointer-events: none; }

/* ---------------- последний бой ---------------- */
.combat.last { background: rgba(255, 255, 255, 0.03); }
.lc-head { position: relative; display: flex; align-items: center; height: 22px; padding-right: 26px; color: var(--ink-dim); font-size: 13px; margin-bottom: 4px; }
.lc-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-close { position: absolute; top: 0; right: 0; width: 22px; height: 22px; background: none; border: 0; color: var(--ink-dim); font-size: 22px; line-height: 1; padding: 0; }
.lc-close:hover { color: var(--ink); }
.lc-result { text-align: center; margin-top: 8px; font-weight: 700; }
.lc-boosts { text-align: center; color: var(--ink-dim); font-size: 13px; margin-top: 2px; }

/* ---------------- рука соперника ---------------- */
.reveal-box {
  position: fixed; z-index: 25; left: 16px; top: 64px; width: max-content; max-width: min(760px, calc(100vw - 32px));
  background: var(--table-2); border: 1px solid var(--brass); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.reveal-box[hidden] { display: none; }
.reveal-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.reveal-head span { color: var(--ink-dim); font-size: 13px; flex: 1; }
.reveal-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.reveal-note { color: var(--ink-dim); font-size: 12px; margin-top: 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brass); text-decoration: underline dotted; font-size: 12px; }

/* ---------------- карточка бойца ---------------- */
.fighters button.f { border: 0; color: var(--ink); font: inherit; cursor: pointer; }
.fighters button.f:hover { outline: 1px solid var(--ink-dim); }
.token.info { cursor: pointer; }
.fi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.fi-grid div { background: var(--table); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.fi-grid span { color: var(--ink-dim); font-size: 12px; }

/* Летящая в сброс карта */
.fly-card { position: fixed; z-index: 60; pointer-events: none; transform-origin: center; }
.fly-card .card { width: var(--card-width); height: 100%; margin: 0; box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.pl-meta [data-discard] { display: inline-block; }

.back-btn { margin-top: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.decision.waiting .back-btn { margin: 0 0 8px; }

/* Реванш */
.rematch { margin: 10px 0 12px; }
.rematch.offer { background: rgba(242, 179, 61, 0.12); border-left: 3px solid var(--brass); padding: 8px 10px; border-radius: 4px; }
.rematch.waiting { color: var(--ink-dim); }
.rematch-note { font-size: 12px; color: var(--ink-dim); margin-top: 4px; }

/* Подсказка по особым клеткам поля */
.space-tip { position: fixed; z-index: 55; max-width: 300px; background: #0f1d21; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; line-height: 1.4; box-shadow: 0 8px 22px rgba(0,0,0,.45); pointer-events: none; }
.space-tip .sp-head { font-family: var(--display); font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.space-tip .sp-line + .sp-line { margin-top: 5px; }
.space-tip .zdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 2px; vertical-align: 0; }
.board .space.special { cursor: help; }
.board .space.special.target { cursor: pointer; }

/* Сколько таких карт ещё в колоде — ярлычок над картой в руке */
.card .dk { position: absolute; top: -21px; right: 6px; background: #0f1d21; color: var(--ink); border: 1px solid var(--line);
  border-radius: 9px; padding: 0 7px; font: 600 11px/18px var(--body); white-space: nowrap; }
.card .dk.none { color: var(--ink-dim); }
.hand { padding-top: 22px; }

/* Часы */
.timer-note { color: var(--ink-dim); font-size: 13px; margin: 6px 0 0; }
.clock { font-variant-numeric: tabular-nums; color: var(--ink-dim); padding: 0 6px; border-radius: 4px; }
.clock.running { color: var(--ink); background: rgba(255, 255, 255, 0.08); font-weight: 700; }
.clock.low { color: #ffb04a; }
.clock.low.running { animation: clock-pulse 1s ease-in-out infinite alternate; }
.clock.out { color: #ff6b5e; font-weight: 700; }
@keyframes clock-pulse { from { opacity: 1; } to { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .clock.low.running { animation: none; } }

/* Длинные названия карт (русское издание) переносятся, а не обрезаются */
.card .nm { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.card .nm.long { font-size: 13px; }
.card .nm.xlong { font-size: 11.5px; }
.card.mini .nm.long { font-size: 10.5px; }
.card.mini .nm.xlong { font-size: 9.5px; }

/* Значки ингредиентов Вещих сестёр */
.ing { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -0.28em; }
.ing svg { width: 100%; height: 100%; display: block; }
.card .sym .ing { width: 20px; height: 20px; vertical-align: -4px; }
/* на тёмном фоне — светлая подложка, чтобы фиолетовая мышь и красная лапка не терялись */
.pl-res .ing, .log .ing, .decision .ing, .space-tip .ing, .modal .ing:not(.card .ing) { background: #efe8d6; border-radius: 50%; padding: 1px; box-sizing: content-box; }

/* количество таких карт в колоде героя */
.card .qt { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: #6c6457; font-weight: 600; }
/* действия соперника в его ход */
.dots.opp i { border-color: var(--opp); }
.dots.opp i.on { background: var(--opp); }
/* боец, который сейчас перемещается */
.token .move-ring { fill: none; stroke: var(--brass); stroke-width: 3; stroke-dasharray: 6 5; animation: spin 3s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
/* наведение на атаку: атакующий и цель */
.token.hl-atk .disc { stroke: #f2c94c; stroke-width: 6; }
.token.hl-tgt .disc { stroke: #ff5a4f; stroke-width: 6; }
.token.hl-atk .rim, .token.hl-tgt .rim { stroke-width: 6; }
.token.hl-atk .rim { stroke: #f2c94c; }
.token.hl-tgt .rim { stroke: #ff5a4f; }
/* термины с подсказкой (несчастья Пандоры, чары Титании) — в логе и в панели игрока */
.term { border-bottom: 1px dotted currentColor; cursor: help; }
.term:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .token .move-ring { animation: none; } }
.card.mini .qt { font-size: 9.5px; }
.board .space.hl-atk > circle:not(.space-bg):not(.ring-hl) { stroke: #f2c94c; }
.board .space.hl-tgt > circle:not(.space-bg):not(.ring-hl) { stroke: #ff5a4f; }
.board .space.hl-atk { filter: drop-shadow(0 0 6px #f2c94c) drop-shadow(0 0 11px #f2c94c); }
.board .space.hl-tgt { filter: drop-shadow(0 0 6px #ff5a4f) drop-shadow(0 0 11px #ff5a4f); }

/* поиск героя по первым буквам */
.hero-tile.dim { opacity: .28; }
.hero-tile.match { outline: 2px solid var(--brass); outline-offset: 1px; }
.hero-search { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 70; background: #0f1d21; color: var(--ink);
  border: 1px solid var(--brass); border-radius: 999px; padding: 6px 16px; font-size: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.45); white-space: nowrap; }
.hero-search b { color: var(--brass); }
.hero-search .hs-hint { color: var(--ink-dim); font-size: 13px; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); }
.hero-search kbd { font: 600 11px var(--body); color: var(--ink); background: var(--table-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
@media (max-width: 640px) { .hero-search .hs-hint { display: none; } }

/* выбор карт в панели решения (приёмы, сброс, колода, рука соперника) */
.decision .pick-cards { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; max-height: 360px; overflow-y: auto; padding: 2px; }
.decision .pick-cards .card { cursor: pointer; }
/* колода: кончается / пуста */
.deck-cnt { background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
span.deck-cnt { cursor: default; text-decoration: none; }
.deck-cnt.deck-low, .hand-cnt.hand-near { color: #f2b33d; }
.deck-cnt.deck-empty, .hand-cnt.hand-full { color: #ff6b5f; font-weight: 700; }
.tipped { position: relative; }
.tipped:hover::after, .tipped:focus::after, .ui-tip { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; width: max-content; max-width: 280px;
  background: #0f1d21; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); white-space: normal; font-weight: 400; text-align: left; }
.ui-tip { position: fixed; z-index: 80; max-width: min(280px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: hidden; overflow-wrap: anywhere; pointer-events: none; }
.ui-tip[hidden] { display: none; }
.deck-view .card .dk { position: static; display: inline-block; margin-top: 4px; }
/* подсказка по бойцу */
.space-tip .sp-head small { font-weight: 400; color: var(--ink-dim); margin-left: 6px; font-size: 14px; }
.space-tip .sp-sep { height: 1px; background: var(--line); margin: 7px 0; }
/* всплывающие изменения здоровья */
.hp-float { font-family: var(--display); font-weight: 800; font-size: 20px; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: #0e1a1e; stroke-width: 4px; }
.hp-float.dmg { fill: #ff5a4f; }
.hp-float.heal { fill: #4fd88a; }

/* дополнительное условие карты выполнено */
.card.cond-on { box-shadow: 0 0 0 2px #3ecf8e, 0 0 14px 2px rgba(62,207,142,.55); }
.card.cond-on.playable { box-shadow: 0 0 0 2px #3ecf8e, 0 0 16px 3px rgba(62,207,142,.6), 0 0 22px 4px rgba(242,201,76,.35); }
.card .cnd { position: absolute; top: -21px; left: 6px; width: 19px; height: 19px; font-size: 12px; font-weight: 700; color: #fff; background: #1f9d63; border-radius: 50%; text-align: center; line-height: 19px; }
.card.mini .cnd { display: none; }

/* окно бойца: «×N» и остаток в колоде у мини-карт */
.fi-cards .card.mini .qt { display: block; left: 8px; transform: none; }
.fi-cards { row-gap: 30px; padding-top: 22px; }
.fi-cards .card .dk { font-size: 10.5px; }

/* страница «Участники» */
.member-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member-row .share { margin: 0; font-size: 13px; word-break: break-all; }
@media (max-width: 720px) { .member-row { grid-template-columns: 1fr; } }

/* ---------------- предпросмотр поля (лобби, приглашение) ---------------- */
.lobby section.setup { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 24px; align-items: start; }
.setup-fields { min-width: 0; }
.map-preview { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.mp-frame {
  position: relative; display: block; width: 100%; aspect-ratio: 1040 / 700; padding: 0; overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: 12px;
  background: radial-gradient(ellipse at 45% 35%, #24414a, #122026 75%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.mp-frame:hover, .mp-frame:focus-visible { border-color: rgba(242, 179, 61, 0.7); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(242, 179, 61, 0.14); transform: translateY(-1px); }
.mp-layer { position: absolute; inset: 0; padding: 8px; opacity: 0; transition: opacity 0.3s ease; }
.mp-layer.on { opacity: 1; }
.mp-layer.mp-wait { background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%) -100% 0 / 200% 100%; animation: mp-shimmer 1.2s linear infinite; }
@keyframes mp-shimmer { to { background-position: 100% 0; } }
.map-svg.mini { width: 100%; height: 100%; display: block; pointer-events: none; }
.map-svg.mini .edge { stroke: #4c6c74; stroke-width: 9; stroke-linecap: round; }
.map-svg.mini .space-bg { fill: #2a464d; }
.map-svg.mini .passage circle { fill: #3d2a55; stroke: #c9a8f0; stroke-width: 3; }
.map-svg.mini .passage text { display: none; }
.map-svg .start-mark { pointer-events: none; }
.map-svg .start-mark text { fill: #fff; font-family: var(--display); font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, 0.35); stroke-width: 2px; }
.mp-zoom {
  position: absolute; right: 8px; bottom: 8px; font-size: 12px; color: var(--ink); background: rgba(15, 29, 33, 0.85);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; opacity: 0; transform: translateY(3px); transition: opacity 0.2s, transform 0.2s;
}
.mp-frame:hover .mp-zoom, .mp-frame:focus-visible .mp-zoom { opacity: 1; transform: none; }
.map-preview figcaption { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--ink-dim); padding: 0 2px; }
.mp-cap { display: flex; flex-direction: column; gap: 1px; }
.mp-cap b { color: var(--ink); font-family: var(--display); font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-cap span { white-space: nowrap; }
.mp-legend { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.mp-legend i {
  font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font: 700 12px var(--display); box-shadow: 0 0 0 2px #0e1a1e;
}
.mp-legend i:not(:first-child) { margin-left: 8px; }
.modal-box.wide { max-width: min(1180px, 96vw); }
.mp-big-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; padding-right: 30px; }
.mp-big-head h2 { margin: 0; }
.mp-sub { color: var(--ink-dim); }
.mp-big { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 45% 35%, #24414a, #122026 75%); }
.mp-big .board { display: block; width: 100%; height: auto; max-height: 72vh; }
.mp-big-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-dim); font-size: 13px; margin: 10px 2px 0; }
@media (max-width: 760px) {
  .lobby section.setup { grid-template-columns: minmax(0, 1fr); }
  .map-preview { max-width: 520px; }
}
@media (prefers-reduced-motion: reduce) { .mp-layer, .mp-frame, .mp-zoom { transition: none; } .mp-layer.mp-wait { animation: none; } }
.setup #name { width: 210px; min-width: 0; }
.setup #map { width: 260px; min-width: 0; }

/* ---------------- масштаб поля ---------------- */
.board-wrap { touch-action: none; user-select: none; -webkit-user-select: none; }
.board-wrap.panning, .board-wrap.panning * { cursor: grabbing !important; }
.zoom-ctl {
  position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; overflow: hidden; z-index: 2;
  background: rgba(15, 29, 33, 0.88); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.zoom-ctl button { width: 34px; height: 32px; border: 0; background: transparent; color: var(--ink); font: 600 18px/1 var(--body); }
.zoom-ctl button + button { border-top: 1px solid var(--line); }
.zoom-ctl button:hover:not(:disabled) { background: rgba(242, 179, 61, 0.15); color: var(--brass); }
.zoom-ctl button:disabled { color: var(--ink-dim); opacity: 0.45; cursor: default; }

/* значок тумана на клетке; переносимый туман пульсирует */
.fog-badge circle { fill: #1d3a44; stroke: #cfe4ea; stroke-width: 1.5; }
.fog-badge path { fill: #e8f3f6; }
.fog-badge.moving circle { stroke: var(--brass); stroke-width: 3; animation: fog-pulse 1.1s ease-in-out infinite alternate; }
@keyframes fog-pulse { from { stroke-opacity: 1; } to { stroke-opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .fog-badge.moving circle { animation: none; } }

/* код приглашения */
.invite-code { font: 600 16px/1.4 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .02em; color: var(--brass); user-select: all; }
.join-field input { width: 340px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.join-inline { margin: 22px 0; }
.join-inline h2 { font-size: 22px; margin-bottom: 8px; }

/* ступени на картах Цири и Теслы */
.card .tier, .deck-row .tier { display: block; margin-top: 2px; padding: 0 3px; border-radius: 3px; }
.card .tier.on { background: rgba(242, 179, 61, 0.32); box-shadow: inset 2px 0 0 #c98a12; }
.card .tier.off { opacity: 0.45; }

/* просмотр завершённой партии */
.replay-bar {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center;
  background: rgba(15, 29, 33, 0.92); border: 1px solid var(--brass); border-radius: 12px; padding: 6px 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); max-width: calc(100% - 20px);
}
.replay-bar button { min-width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--table-2); color: var(--ink); font: 600 15px/1 var(--body); }
.replay-bar button:hover:not(:disabled) { border-color: var(--brass); color: var(--brass); }
.replay-bar button:disabled { opacity: 0.35; cursor: default; }
.replay-bar .rp-label { font: 600 14px var(--body); color: var(--ink); padding: 0 8px; white-space: nowrap; }
.replay-bar .rp-range { flex: 1 0 100%; accent-color: var(--brass); margin: 2px 0 0; }
.replay-bar .rp-exit { border-color: transparent; background: transparent; color: var(--ink-dim); margin-left: 6px; }
.replay-info .rp-hint { font-size: 12px; color: var(--ink-dim); }
.log [data-li] { cursor: pointer; border-radius: 4px; }
.log [data-li]:hover { background: rgba(242, 179, 61, 0.12); }
.decision .replay-open { margin-top: 8px; }

/* особые связи поля */
.one-way path { fill: #f07a2e; stroke: #3a1a08; stroke-width: 1.5; }
.high-ground rect { fill: #1d1406; stroke: #f2b33d; stroke-width: 1.5; }
.high-ground path { fill: none; stroke: #f2b33d; stroke-width: 2; }
.high-ground text { fill: #f2b33d; font: 700 12px var(--body); text-anchor: middle; }

/* дальность атаки при наведении на бойца */
.board.ranging .space .space-bg { transition: fill 0.15s; }
.board.ranging.mine .space.in-range .space-bg { fill: #6b5418; stroke: #f2c94c; stroke-width: 3; stroke-dasharray: 6 4; }
.board.ranging.theirs .space.in-range .space-bg { fill: #6a2a24; stroke: #ff7a6f; stroke-width: 3; stroke-dasharray: 6 4; }
.board.ranging .token.reachable { filter: drop-shadow(0 0 4px #ff5a4f) drop-shadow(0 0 8px #ff5a4f); }
.board.ranging.theirs .token.reachable { filter: drop-shadow(0 0 4px #f2c94c) drop-shadow(0 0 8px #f2c94c); }

/* сворачиваемый лог */
.side > .log-head { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 0; font-size: 12px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.04em; border-top: 1px solid var(--line); }
.log-head .link-btn { text-transform: none; letter-spacing: 0; }
.log.collapsed { flex: 0 0 auto; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log.collapsed div { overflow: hidden; text-overflow: ellipsis; }
.card .lck { position: absolute; top: -21px; left: 28px; width: 19px; height: 19px; font-size: 11px; background: #3d2a55; border-radius: 50%; text-align: center; line-height: 19px; }

/* свой выпадающий список полей */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mp-pick { position: relative; width: 300px; max-width: 100%; }
.mp-list { min-width: 300px; }
.mp-btn {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  background: var(--table); border: 1px solid var(--line); border-radius: 6px; padding: 8px 34px 8px 10px; position: relative;
}
.mp-btn:hover, .mp-btn[aria-expanded="true"] { border-color: var(--ink-dim); }
.mp-cur { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-sub { color: var(--ink-dim); font-size: 12px; white-space: nowrap; margin-left: auto; }
.mp-caret { position: absolute; right: 12px; top: 50%; width: 12px; height: 8px; margin-top: -4px; transition: transform 0.15s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239fb3b6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px 8px; }
.mp-btn[aria-expanded="true"] .mp-caret { transform: rotate(180deg); }
.mp-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: #10201f; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  max-height: min(380px, 60vh); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #0b1517 transparent;
}
.mp-list li { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; outline: none; }
.mp-list li small { margin-left: auto; color: var(--ink-dim); font-size: 12px; white-space: nowrap; }
.mp-list li:hover, .mp-list li:focus { background: rgba(242, 179, 61, 0.14); }
.mp-list li[aria-selected="true"] { color: var(--brass); font-weight: 600; }
.mp-list li[aria-selected="true"]::before { content: '✓'; margin-right: -2px; }
@media (max-width: 640px) { .mp-pick { width: 100%; } }
.spect-badge { font-size: 13px; color: var(--brass); border: 1px solid rgba(242, 179, 61, 0.5); border-radius: 999px; padding: 1px 9px; }
.spect-hand { display: flex; align-items: center; padding: 10px 14px; font-size: 13px; }

.sandbox-panel { position:absolute; top:48px; left:64px; z-index:5; display:flex; flex-direction:column; gap:6px; }
/* название поля в углу доски */
.board-status { position: absolute; left: 64px; top: 12px; z-index: 2; display: flex; align-items: stretch; gap: 6px; max-width: calc(100% - var(--sidebar-width) - 80px); }
.turn-dots { display: flex; align-items: center; min-width: 0; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(15, 29, 33, 0.78); flex-shrink: 0; }
.turn-dots .dots { flex-shrink: 0; }
.map-tag {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 10px; font-size: 12px; color: var(--ink-dim); background: rgba(15, 29, 33, 0.78);
  border: 1px solid var(--line); border-radius: 8px; cursor: help;
}
.map-tag:hover { color: var(--ink); }

/* просмотр завершённой партии: высоты рядов не зависят от шага, чтобы поле и полоса промотки не прыгали */
.pl-hand { flex: 1 0 100%; }
.pl-hand-head { background: none; border: 0; padding: 2px 0; color: var(--ink-dim); font: 600 13px var(--body); cursor: pointer; }
.pl-hand-head:hover { color: var(--brass); }
.pl-hand-cards { display: flex; gap: 8px; min-height: calc(var(--card-min-height) + 4px); overflow-x: scroll; overflow-y: hidden; align-items: flex-start; padding: 2px 0 0; }
.pl-hand-cards .card { flex: 0 0 auto; }
.pl-hand-cards .empty { color: var(--ink-dim); align-self: center; }
.game.replaying .pl { min-height: 74px; }
.game.replaying .hand-wrap { min-height: calc(var(--card-min-height) + 38px); box-sizing: border-box; }
.replay-bar .rp-label { display: inline-block; width: 170px; text-align: center; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }

/* окно «Рука соперника»: заголовок — ручка для перетаскивания; свёрнутое — плашка */
.reveal-head { cursor: grab; user-select: none; touch-action: none; }
.reveal-head:active { cursor: grabbing; }
.reveal-head .lc-close { position: static; flex: none; }
.reveal-box.folded .reveal-cards, .reveal-box.folded .reveal-note { display: none; }
.reveal-box.folded .reveal-head { margin-bottom: 0; }

/* Available fighters for placement or movement effects. */
.board .token.transfer-target { filter: drop-shadow(0 0 6px #f2c94c) drop-shadow(0 0 11px #f2c94c); }
.board .token.transfer-target .rim, .board .token.transfer-target .disc { stroke: #f2c94c; stroke-width: 6; }

.card-choice-popup { --card-choice-arrow: 50%; position: relative; margin: 14px 0 4px; padding: 14px; border: 1px solid var(--brass); border-radius: 12px; background: linear-gradient(145deg, #263a3e, #142629); box-shadow: 0 10px 28px #0005; pointer-events: auto; text-align: left; }
.card-choice-popup::before { content: ''; position: absolute; top: -7px; left: calc(var(--card-choice-arrow) - 7px); width: 12px; height: 12px; transform: rotate(45deg); background: #263a3e; border-top: 1px solid var(--brass); border-left: 1px solid var(--brass); }
.card-choice-question { margin-bottom: 12px; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.card-choice-options { display: grid; gap: 8px; }
.card-choice-button { min-height: 42px; padding: 10px 12px; border: 1px solid #d9b66c66; border-radius: 8px; background: #ffffff08; color: var(--ink); font-size: 14px; line-height: 1.4; white-space: normal; text-align: center; }
.card-choice-button:hover { background: #d9b66c22; border-color: var(--brass); }
.card-choice-button:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.card-choice-binary, .card-choice-delta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card-choice-binary .card-choice-button { font-size: 28px; }
.card-choice-binary .positive { color: #9cdb9b; }
.card-choice-binary .negative { color: #f0a093; }
.card-choice-delta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-choice-number { display: grid; gap: 12px; }
.card-choice-number output { text-align: center; color: var(--brass); font: 700 32px var(--display); font-variant-numeric: tabular-nums; }
.card-choice-number input { width: 100%; min-height: 30px; margin: 0; accent-color: var(--brass); cursor: pointer; }
.card-choice-source { outline: 2px solid var(--brass); outline-offset: 2px; }
.card-choice-fallback { padding: 12px; }
.card-choice-fallback > .card { margin: 0 auto; }

.card-choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 380px; overflow-y: auto; margin-top: 12px; }
.card-choice-cards .card.mini { width: 100%; }

.fi-deck { margin-top: 24px; }
.fi-tabs { display: flex; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.fi-tabs button { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--ink-dim); font-size: 15px; }
.fi-tabs button[aria-selected="true"] { color: var(--brass); border-color: var(--brass); background: #d9b66c16; }
.fi-tabs button span { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.fi-tabs button:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.fi-card-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 18px; align-items: stretch; }
.fi-card-gallery[hidden] { display: none; }
.fi-card-gallery .card { width: 100%; min-height: 300px; padding: 36px 14px 40px; font-size: 14px; line-height: 1.45; box-shadow: 0 6px 14px #0004; }
.fi-card-gallery .card .nm { font-size: 19px; min-height: 40px; margin-top: -28px; }
.fi-card-gallery .card .who { font-size: 12px; margin-bottom: 12px; }
.fi-card-gallery .card .tx { margin-bottom: 8px; }
.fi-card-gallery .card .bst { bottom: 10px; right: 12px; font-size: 15px; }
.fi-empty { grid-column: 1 / -1; color: var(--ink-dim); }

.hero-text-choice { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left; }

.hero-choice-heading { display: flex; align-items: center; gap: 10px; }
.hero-choice-ingredients { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px; box-shadow: 0 0 0 2px #ffffff22, 0 2px 6px #0004; }
.hero-text-choice:disabled { opacity: .4; cursor: not-allowed; background: #ffffff04; border-color: #ffffff18; }
.hero-text-choice:disabled:hover { background: #ffffff04; border-color: #ffffff18; }

.card-choice-binary kbd { display: block; font: 12px var(--body); color: var(--ink-dim); }
