/* HexIsles — Картографическая. Карта на первом месте.
   Десктоп: карта + одна информативная панель справа.
   Мобильный: карта на весь экран, HUD поверх, нижняя навигация, без скролла. */

:root {
  color-scheme: dark;
  --ink: #111f29;
  --ink-2: #172832;
  --ink-3: #203740;
  --sea: #24434b;
  --paper: #f1e8d4;
  --paper-dim: #b8b7a7;
  --sand: #d8b57b;
  --sand-bright: #f0cb8b;
  --rust: #d77f61;
  --sage: #8db59b;
  --muted: #90a29f;
  --line: rgba(231, 220, 193, .13);
  --line-strong: rgba(231, 220, 193, .25);
  --panel: linear-gradient(148deg, rgba(32, 51, 59, .92), rgba(22, 38, 46, .94));
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 11px;
  --radius-sm: 8px;
  --side-w: 348px;
  --topbar-h: 54px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--ink); }
body {
  margin: 0; min-height: 100vh; color: var(--paper); font-family: var(--font-body);
  background: radial-gradient(ellipse at 74% 1%, rgba(46, 91, 91, .30), transparent 35%),
              radial-gradient(ellipse at 12% 100%, rgba(95, 72, 52, .18), transparent 32%),
              linear-gradient(145deg, #101d27 0%, #13242d 55%, #152931 100%);
  -webkit-font-smoothing: antialiased;
}
body.in-game { height: var(--app-viewport-height, 100dvh); overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--sand-bright); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

#app-shell { width: 100%; min-height: 100vh; }
body.in-game #app-shell { height: var(--app-viewport-height, 100dvh); }

/* ─────────── Общие детали ─────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(218, 184, 128, .47); border-radius: 11px; background: linear-gradient(145deg, rgba(218, 184, 128, .13), rgba(67, 105, 100, .16)); }
.brand-mark svg { width: 24px; height: 24px; fill: none; stroke: var(--sand); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-copy strong { color: #f1e6d0; font-size: 12px; letter-spacing: .18em; line-height: 1.1; }
.brand-copy small { color: #96aaa4; font-family: var(--font-display); font-size: 10px; font-style: italic; overflow: hidden; max-width: 150px; text-overflow: ellipsis; white-space: nowrap; }
.section-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--sand); font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; color: #8b9d9b; font-size: 10px; white-space: nowrap; }
.status-led { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #d7a16f; box-shadow: 0 0 0 3px rgba(215, 161, 111, .11); }
.is-online .status-led { background: #7eb69a; box-shadow: 0 0 0 3px rgba(126, 182, 154, .13), 0 0 12px rgba(126, 182, 154, .4); }
.is-online { color: #a3c7b1; }
.is-connecting .status-led { animation: led-pulse 1.25s ease-in-out infinite; }
@keyframes led-pulse { 50% { opacity: .35; } }

.text-field { width: 100%; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid rgba(208, 211, 189, .18); border-radius: 9px; outline: none; color: #e9e2d2; background: rgba(10, 23, 30, .38); transition: border-color .18s, background .18s; }
.text-field:focus { border-color: rgba(218, 184, 128, .68); background: rgba(10, 23, 30, .55); }
.select-field { appearance: none; padding-right: 32px; 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 5 5 5-5' stroke='%23c6b78f' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field-label { display: block; margin-bottom: 7px; color: #d9d8c8; font-size: 11px; font-weight: 700; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 14px; }
.field-error { margin: 8px 0 0; color: #e89b82; font-size: 10px; }

.primary-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 47px; margin-top: 15px; padding: 0 15px; border: 1px solid #edc88c; border-radius: 10px; color: #1c2c31; background: linear-gradient(105deg, #e6c187, #f0d29c); box-shadow: 0 8px 20px rgba(12, 20, 24, .15); font-size: 12px; font-weight: 800; transition: transform .16s, filter .16s; }
.primary-button:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 13px; border: 1px solid rgba(218, 184, 128, .35); border-radius: 9px; color: #e6d7b9; background: rgba(218, 184, 128, .06); font-size: 10px; font-weight: 750; white-space: nowrap; }
.secondary-button:hover { background: rgba(218, 184, 128, .14); }

.action-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 38px; padding: 9px 11px; border: 1px solid rgba(218, 184, 128, .21); border-radius: 9px; color: #e4dec9; background: rgba(218, 184, 128, .055); text-align: center; font-size: 10.5px; font-weight: 700; transition: border-color .16s, background .16s, transform .16s; }
.action-button:hover:not(:disabled) { border-color: rgba(218, 184, 128, .53); background: rgba(218, 184, 128, .12); transform: translateY(-1px); }
.action-primary { border-color: rgba(228, 195, 139, .75); color: #203039; background: linear-gradient(100deg, #d9b77d, #efcf97); }
.action-primary:hover:not(:disabled) { color: #1b3037; background: linear-gradient(100deg, #e7c992, #f6dca7); }
.action-muted { color: #d3d6c7; border-color: rgba(218, 220, 201, .15); background: rgba(255, 255, 255, .025); }
.action-end-turn { color: #e6b4a0; border-color: rgba(215, 127, 97, .32); background: rgba(215, 127, 97, .09); }
.action-end-turn:hover:not(:disabled) { border-color: rgba(215, 127, 97, .6); background: rgba(215, 127, 97, .16); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-strong); border-radius: 9px; color: #bdc4b6; background: rgba(255, 255, 255, .025); font-size: 17px; }
.icon-button:hover:not(:disabled) { border-color: rgba(218, 184, 128, .5); color: var(--sand-bright); }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 24px; width: max-content; max-width: min(540px, calc(100vw - 28px)); padding: 12px 16px; border: 1px solid rgba(218, 184, 128, .35); border-radius: 11px; color: #eee2c9; background: rgba(20, 39, 45, .97); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-color: rgba(215, 127, 97, .5); color: #f4c0a8; }

/* ─────────── Стартовый экран ─────────── */
.start-screen { display: flex; flex-direction: column; min-height: 100vh; }
.landing-topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 30px; border-bottom: 1px solid var(--line); }
.landing-layout { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 470px); gap: clamp(30px, 5vw, 80px); align-items: center; padding: clamp(28px, 4.5vw, 60px) clamp(18px, 4vw, 60px) 40px; }
.landing-story { width: 100%; max-width: 650px; justify-self: center; }
.setup-card { width: 100%; max-width: 470px; justify-self: center; }
.landing-map-art { width: min(100%, 620px); margin: 0 0 18px; border-radius: 18px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .12)); }
.landing-map-art svg { display: block; width: 100%; height: auto; }
.landing-story h1 { margin: 12px 0 14px; color: #f1e8d6; font-family: var(--font-display); font-size: clamp(40px, 4.6vw, 66px); font-weight: 400; letter-spacing: -.05em; line-height: 1; }
.landing-story h1 em { color: var(--sand); font-style: normal; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--sand); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.eyebrow-line { width: 25px; height: 1px; background: var(--sand); }
.landing-lede { max-width: 470px; margin: 0; color: #aebbb3; font-family: var(--font-display); font-size: 15px; line-height: 1.6; }
.landing-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 640px; margin: 26px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; }
.landing-features li { display: flex; gap: 9px; align-items: flex-start; }
.feature-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid rgba(218, 184, 128, .22); border-radius: 9px; background: rgba(218, 184, 128, .055); font-size: 16px; }
.landing-features b { display: block; color: #e3e0cf; font-size: 11px; }
.landing-features small { display: block; margin-top: 4px; color: #829894; font-size: 10px; line-height: 1.4; }
.landing-hint { margin-top: 22px; color: #7e938d; font-family: var(--font-display); font-size: 12px; font-style: italic; }
.setup-card { padding: 24px 26px 22px; border: 1px solid rgba(224, 200, 158, .2); border-radius: var(--radius-xl); background: linear-gradient(147deg, rgba(32, 52, 60, .97), rgba(23, 39, 47, .98)); box-shadow: 0 25px 70px rgba(0, 0, 0, .24); }
.setup-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.setup-heading h2 { margin: 7px 0 4px; color: #f0e5d0; font-family: var(--font-display); font-size: 28px; font-weight: 400; }
.setup-heading p { margin: 0; color: #9aaca5; font-size: 11px; }
#new-game-form > .field-label { margin-top: 16px; }
.opponents-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.field-note { color: #7f9892; font-size: 9px; }
.bot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bot-card { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 62px; padding: 8px; border: 1px solid rgba(209, 215, 194, .12); border-radius: 11px; background: rgba(9, 21, 28, .23); transition: border-color .18s, background .18s; }
.bot-card.is-selected { border-color: rgba(218, 184, 128, .52); background: linear-gradient(120deg, rgba(218, 184, 128, .09), rgba(218, 184, 128, .025)); }
.bot-card-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px; background: rgba(129, 172, 136, .11); font-size: 17px; }
.bot-card-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bot-card-name { color: #e6e4d5; font-size: 11px; font-weight: 700; }
.bot-card-description { color: #819590; font-size: 9px; line-height: 1.25; }
.bot-count-control { display: grid; grid-template-columns: 26px 18px 26px; align-items: center; gap: 2px; flex: 0 0 auto; margin-left: auto; }
.bot-count-button { display: grid; place-items: center; width: 26px; height: 28px; padding: 0; border: 1px solid rgba(209, 215, 194, .18); border-radius: 7px; color: #e7ddc7; background: rgba(6, 18, 24, .44); font-size: 16px; line-height: 1; cursor: pointer; }
.bot-count-button:disabled { opacity: .3; cursor: not-allowed; }
.bot-count { color: var(--sand-bright); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.lobby-option { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(130, 168, 158, .22); border-radius: 10px; background: rgba(62, 105, 103, .09); cursor: pointer; }
.lobby-option input { position: absolute; opacity: 0; }
.lobby-option b { color: #dbdfcf; font-size: 10px; }
.lobby-option small { display: block; margin-top: 2px; color: #879c95; font-size: 9px; }
.lobby-option-check { margin-left: auto; color: var(--sand); opacity: 0; }
.lobby-option:has(input:checked) { border-color: rgba(141, 181, 155, .55); background: rgba(62, 105, 103, .2); }
.lobby-option:has(input:checked) .lobby-option-check { opacity: 1; }
.rules-details { margin-top: 12px; border: 1px solid rgba(209, 215, 194, .12); border-radius: 10px; background: rgba(6, 18, 24, .14); }
.rules-details summary { display: flex; align-items: center; gap: 9px; padding: 11px 12px; list-style: none; cursor: pointer; }
.rules-details summary::-webkit-details-marker { display: none; }
.summary-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; color: var(--sand); background: rgba(218, 184, 128, .11); font-size: 14px; }
.rules-details summary b { color: #dedecf; font-size: 10px; }
.rules-details summary small { display: block; margin-top: 2px; color: #7d928c; font-size: 9px; }
.summary-chevron { margin-left: auto; color: #8ca19a; transition: transform .2s; }
.rules-details[open] .summary-chevron { transform: rotate(180deg); }
.rules-list { padding: 0 12px 8px; }
.switch-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; border-top: 1px solid rgba(209, 215, 194, .08); cursor: pointer; }
.switch-row b { color: #c9d2c4; font-size: 10px; }
.switch-row small { display: block; margin-top: 2px; color: #7c918a; font-size: 9px; }
.switch-row input { position: absolute; right: 0; width: 31px; height: 18px; margin: 0; opacity: 0; }
.switch-ui { position: relative; width: 31px; height: 18px; flex: 0 0 auto; margin-left: auto; border: 1px solid rgba(213, 213, 188, .2); border-radius: 99px; background: rgba(4, 14, 20, .45); transition: .18s; }
.switch-ui::after { position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; content: ""; border-radius: 50%; background: #7c918a; transition: .18s; }
.switch-row input:checked + .switch-ui { border-color: rgba(141, 181, 155, .7); background: rgba(104, 160, 133, .25); }
.switch-row input:checked + .switch-ui::after { left: 16px; background: var(--sage); }
.blight-level-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 9px 0 10px; border-top: 1px solid rgba(209, 215, 194, .08); }
.blight-level-row > label b { display: block; color: #c9d2c4; font-size: 10px; }
.blight-level-row > label small { display: block; margin-top: 3px; color: #7c918a; font-size: 9px; }
.blight-level-control { display: flex; align-items: center; gap: 10px; }
.blight-level-control input[type="range"] { flex: 1; min-width: 0; accent-color: var(--sage); }
.blight-level-control output { width: 38px; color: var(--sand-bright); font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.blight-level-row.is-disabled { opacity: .42; }
.blight-level-row.is-disabled input { cursor: not-allowed; }

.form-note { margin: 9px 0 0; color: #7e938d; font-size: 9px; }
.join-divider { display: flex; align-items: center; gap: 9px; margin: 18px 0 12px; color: #718782; font-size: 8px; letter-spacing: .16em; }
.join-divider span { height: 1px; flex: 1; background: var(--line); }
.join-row { display: flex; gap: 8px; }
.room-code-input { text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.landing-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 14px 30px; border-top: 1px solid var(--line); color: #708781; font-size: 9px; }

/* ─────────── Игровой экран: каркас ─────────── */
.game-screen { display: flex; flex-direction: column; height: var(--app-viewport-height, 100dvh); overflow: hidden; }
.game-topbar { display: flex; align-items: center; gap: 10px; min-height: var(--topbar-h); padding: 6px 14px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow: hidden; }
.metric-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 0 10px; border: 1px solid rgba(218, 184, 128, .19); border-radius: 7px; color: #d7c9a9; background: rgba(218, 184, 128, .06); font-size: 9.5px; font-weight: 650; white-space: nowrap; }
.phase-chip { color: #a4b4aa; }
.turn-chip { color: #9bb6a6; border-color: rgba(141, 181, 155, .2); background: rgba(141, 181, 155, .065); }
.turn-chip.is-your-turn { color: #192e32; border-color: var(--sage); background: var(--sage); }
.room-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 29px; padding: 0 8px; border: 1px solid rgba(218, 184, 128, .22); border-radius: 8px; color: #a4b4aa; background: rgba(218, 184, 128, .045); white-space: nowrap; }
.room-pill b { color: var(--sand-bright); font-size: 11px; letter-spacing: .12em; }
.copy-room-btn { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; color: #91a49d; background: rgba(255, 255, 255, .05); font-size: 12px; }
.topbar-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.leave-button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid rgba(218, 184, 128, .2); border-radius: 9px; color: #c1c8ba; background: rgba(255, 255, 255, .025); font-size: 10px; }
.leave-button span { color: var(--sand); }

.game-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 10px; padding: 10px; min-height: 0; }

/* ─────────── Карта ─────────── */
.map-stage { position: relative; min-width: 0; min-height: 0; border: 1px solid rgba(133, 181, 168, .17); border-radius: 15px; overflow: hidden; background: radial-gradient(ellipse at 50% 44%, #2d555b 0%, #24454d 48%, #1b343e 100%); isolation: isolate; }
.map-canvas { position: absolute; inset: 0; }
#game-map { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; user-select: none; cursor: grab; }
#game-map.is-panning { cursor: grabbing; }
.map-instruction { position: absolute; z-index: 6; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: min(92%, 520px); padding: 8px 11px; border: 1px solid rgba(240, 209, 150, .45); border-radius: 9px; color: #f1e4c5; background: rgba(17, 36, 42, .92); box-shadow: 0 7px 22px rgba(0, 0, 0, .25); font-size: 10px; }
.map-instruction .instruction-icon { color: var(--sand); }
.map-instruction #cancel-map-mode { display: grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; padding: 0; border: 1px solid rgba(240, 209, 150, .21); border-radius: 5px; color: #dfc18d; background: rgba(240, 209, 150, .07); font-size: 14px; }

/* Кубики: мини-карточка в углу карты + большой бросок */
.dice-card { position: absolute; z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 11px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--dice-accent, #7fc8e0) 55%, transparent); background: rgba(13, 29, 36, .92); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 26px var(--dice-glow, transparent); }
.dice-mini { top: 12px; left: 12px; flex-direction: row; align-items: center; gap: 7px; padding: 6px 9px; }
.dice-big { pointer-events: none; z-index: 9; }
.dice-faces { display: flex; gap: 6px; }
.dice-face { display: grid; width: 34px; height: 34px; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 4px; border-radius: 8px; background: #f3ead3; box-shadow: inset 0 -2px 0 rgba(31, 42, 46, .18), 0 1px 2px rgba(0, 0, 0, .3); }
.dice-mini .dice-face { width: 21px; height: 21px; padding: 2.5px; border-radius: 5px; }
.dice-face i { align-self: center; justify-self: center; width: 5.5px; height: 5.5px; border-radius: 50%; background: #24333c; }
.dice-mini .dice-face i { width: 3.5px; height: 3.5px; }
.dice-total { color: var(--dice-accent, #7fc8e0); font-weight: 900; font-size: 14px; line-height: 1; }
.dice-mini .dice-total { font-size: 12px; }
.dice-label { color: #ffb09a; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.dice-card.is-seven { border-color: rgba(233, 136, 115, .7); }
.dice-card.is-rolling { animation: dice-shake .42s linear infinite; }
@keyframes dice-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) translateY(-1.5px); } 75% { transform: rotate(8deg) translateY(-1px); } }

/* Игроки поверх карты (мобильный) */
.players-overlay { position: absolute; z-index: 5; top: 10px; left: 10px; right: 10px; display: none; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.players-overlay::-webkit-scrollbar { display: none; }
.overlay-player { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 4px 6px; border: 1px solid rgba(220, 222, 201, .14); border-radius: 8px; background: rgba(15, 34, 41, .88); backdrop-filter: blur(6px); font-size: 9px; white-space: nowrap; }
.overlay-player.is-active { border-color: rgba(240, 209, 150, .55); }
.overlay-dot { width: 7px; height: 7px; border-radius: 50%; }
.overlay-player b { color: #e6e4d5; font-weight: 700; max-width: 62px; overflow: hidden; text-overflow: ellipsis; }
.overlay-player .ovp { color: var(--sand-bright); font-weight: 800; }
.overlay-player small { color: #82968e; }
.overlay-awards { display: inline-flex; align-items: center; gap: 2px; margin-left: 1px; }
.overlay-award { color: var(--sand-bright); font-size: 10px; line-height: 1; }

/* ─────────── Нотификации (нижний левый угол карты) ─────────── */
.floating-events { position: absolute; z-index: 7; left: 12px; bottom: 62px; display: flex; flex-direction: column; gap: 6px; max-width: min(330px, 46%); pointer-events: none; }
.float-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 11px; border: 1px solid rgba(218, 184, 128, .35); border-radius: 10px; color: #eadfc6; background: rgba(19, 39, 44, .94); box-shadow: 0 8px 23px rgba(0, 0, 0, .22); font-size: 10px; line-height: 1.45; animation: float-in .22s ease-out; transition: opacity .4s, transform .4s; }
.float-item.is-leaving { opacity: 0; transform: translateY(8px); }
.float-item.is-success { border-color: rgba(141, 181, 155, .55); }
.float-item.is-danger { border-color: rgba(215, 127, 97, .5); }
.float-item.is-chat { border-color: rgba(140, 170, 210, .4); background: rgba(24, 40, 52, .95); }
.float-ava { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; border-radius: 6px; font-size: 9px; font-weight: 800; color: var(--ink); }
@keyframes float-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: translateX(0); } }

/* ─────────── Карточки обмена (верхняя треть / центр карты) ─────────── */
.trade-layer { position: absolute; z-index: 8; left: 50%; top: 42%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 24px)); }
.trade-card { padding: 11px 12px 10px; border: 1px solid rgba(141, 181, 155, .4); border-radius: 12px; background: rgba(17, 36, 42, .96); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); animation: float-in .22s ease-out; }
.trade-card.is-mine { border-color: rgba(218, 184, 128, .4); }
.trade-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.trade-ava { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px; color: var(--ink); font-size: 10px; font-weight: 800; }
.trade-title { flex: 1; min-width: 0; color: #e6e4d5; font-size: 10.5px; font-weight: 700; }
.trade-title small { display: block; margin-top: 2px; color: #8da09a; font-size: 9px; font-weight: 500; }
.trade-time { color: var(--sand-bright); font-size: 10px; font-weight: 800; white-space: nowrap; }
.offer-deal { display: flex; align-items: center; gap: 8px; }
.offer-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.offer-side-label { color: #7d928c; font-size: 7.5px; font-weight: 800; letter-spacing: .1em; }
.offer-resources { display: flex; flex-wrap: wrap; gap: 4px; }
.offer-resource { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid rgba(220, 222, 201, .14); border-radius: 6px; background: rgba(9, 21, 28, .35); font-size: 9.5px; }
.offer-resource b { color: var(--sand-bright); }
.offer-resource small { color: #c4d0c0; }
.offer-exchange-arrow { color: var(--sand); font-size: 14px; flex: 0 0 auto; }
.trade-countdown { height: 4px; margin: 9px 0 8px; overflow: hidden; border-radius: 99px; background: rgba(216, 220, 199, .1); }
.trade-countdown i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--sage), var(--sand-bright)); transition: width .2s linear; }
.trade-countdown.is-urgent i { background: linear-gradient(90deg, #d77f61, #f0a281); }
.trade-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.trade-controls .trade-reject, .trade-controls > .action-button:only-child { grid-column: 2; }
.trade-note { margin-top: 7px; color: #8da09a; font-size: 9px; }

/* ─────────── Док ресурсов (низ карты) ─────────── */
.resource-dock { position: absolute; z-index: 6; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; max-width: min(calc(100% - 340px), 500px); padding: 5px 6px; border: 1px solid rgba(224, 200, 158, .18); border-radius: 12px; background: rgba(15, 32, 39, .88); backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); overflow-x: auto; scrollbar-width: none; }
.resource-dock::-webkit-scrollbar { display: none; }
.dock-chip { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; padding: 3px 7px; border-radius: 8px; background: rgba(255, 255, 255, .04); font-size: 10.5px; white-space: nowrap; }
.dock-chip .dock-emoji { font-size: 12.5px; }
.dock-chip b { color: #eee6d2; font-size: 12px; font-weight: 800; }
.dock-chip.is-zero { opacity: .45; }
.dock-total { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-left: 2px; padding: 4px 8px; border-radius: 8px; background: rgba(218, 184, 128, .14); color: var(--sand-bright); font-size: 11px; font-weight: 800; }
.dock-total small { color: #a4b4aa; font-size: 8px; letter-spacing: .08em; }
.dock-pieces { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; margin-left: 3px; padding-left: 7px; border-left: 1px solid rgba(224, 200, 158, .2); }
.dock-piece { display: inline-flex; align-items: center; gap: 2px; color: #d8ddc9; font-size: 10px; font-weight: 800; white-space: nowrap; }

/* ─────────── Хаб действий на карте (правый нижний угол) ─────────── */
.action-hub { position: absolute; z-index: 8; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; max-width: min(300px, 78%); }
.hub-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid rgba(224, 200, 158, .38); border-radius: 12px; color: #eadfc6; background: rgba(15, 33, 40, .93); backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(0, 0, 0, .32); font-size: 11.5px; font-weight: 800; transition: filter .15s, transform .15s, border-color .15s; }
.hub-btn:hover { filter: brightness(1.08); transform: translateY(-1px); border-color: rgba(240, 209, 150, .6); }
.hub-ico { font-size: 16px; line-height: 1; }
.hub-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.hub-label { line-height: 1.15; white-space: nowrap; }
.hub-sub { color: #a7b5ab; font-size: 9px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.hub-btn.is-build.is-active { border-color: rgba(239, 208, 151, .85); background: rgba(218, 184, 128, .16); box-shadow: 0 0 0 1px rgba(239, 208, 151, .45), 0 8px 24px rgba(0, 0, 0, .32); }
.hub-btn.is-primary { min-height: 47px; padding: 0 18px; border-color: #edc88c; color: #1c2c31; background: linear-gradient(105deg, #e6c187, #f0d29c); font-size: 12.5px; }
.hub-btn.is-primary .hub-sub { color: rgba(28, 44, 49, .72); }
.hub-btn.is-primary.is-end { border-color: rgba(215, 127, 97, .6); color: #2c1b16; background: linear-gradient(105deg, #e2a184, #f0b89c); }
.hub-btn.is-icon-only { display: grid; place-items: center; width: 48px; min-width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 14px; }
.hub-btn.is-icon-only .hub-text { display: none; }
.hub-btn.is-icon-only .hub-ico { font-size: 23px; }
.hub-decision-card { width: min(300px, calc(100vw - 28px)); padding: 10px; border: 1px solid rgba(240, 209, 150, .48); border-radius: 13px; background: rgba(13, 30, 37, .97); box-shadow: 0 12px 35px rgba(0, 0, 0, .4); }
.hub-decision-title { margin-bottom: 7px; color: var(--sand-bright); font-size: 10px; font-weight: 850; line-height: 1.35; }
.hub-victim-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.hub-victim-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 34px; padding: 5px 8px; border: 1px solid rgba(218, 184, 128, .25); border-radius: 9px; color: #eae3d1; background: rgba(218, 184, 128, .07); font-size: 10px; font-weight: 750; }
.hub-victim-btn:hover { border-color: var(--sand-bright); background: rgba(218, 184, 128, .15); }
.hub-victim-avatar { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 auto; border-radius: 7px; color: #13252b; background: var(--sage); font-size: 9px; font-weight: 900; }
.hub-victim-copy { white-space: nowrap; }
.hub-victim-score { color: #9fb2a6; font-size: 8px; white-space: nowrap; }
.hub-popover { width: min(300px, 76vw); padding: 11px 12px 12px; border: 1px solid rgba(224, 200, 158, .35); border-radius: 14px; background: rgba(14, 31, 38, .97); box-shadow: 0 18px 50px rgba(0, 0, 0, .42); }
.hub-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.hub-popover-close { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line-strong); border-radius: 7px; color: #bdc4b6; background: transparent; font-size: 13px; }
.hub-popover-note { margin: 0 0 8px; color: #8da09a; font-size: 9px; line-height: 1.4; }
.hub-popover .bank-trade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 40vh; overflow-y: auto; scrollbar-width: thin; }
.hub-popover .action-choice-grid { max-height: 40vh; overflow-y: auto; scrollbar-width: thin; }

/* ─────────── Правая панель ─────────── */
.side-panel { position: relative; display: flex; flex-direction: column; min-height: 0; border: 1px solid rgba(224, 200, 158, .16); border-radius: var(--radius-lg); background: var(--panel); box-shadow: 0 10px 30px rgba(0, 0, 0, .08); overflow: hidden; }
.sheet-close { display: none; }
.side-scroll { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(218, 184, 128, .23) transparent; }
.side-block { padding: 13px 14px 11px; border-bottom: 1px solid var(--line); }
.side-block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.player-count { display: inline-grid; place-items: center; min-width: 32px; height: 23px; padding: 0 6px; border: 1px solid rgba(218, 184, 128, .2); border-radius: 6px; color: var(--sand); background: rgba(218, 184, 128, .07); font-size: 9.5px; font-weight: 700; }
.score-target { margin-left: auto; color: #7f9690; font-size: 9px; }
.score-target b { color: var(--sand-bright); }
.players-list { display: flex; flex-direction: column; gap: 7px; }
.player-card { position: relative; padding: 8px 9px; border: 1px solid rgba(220, 222, 201, .1); border-radius: 10px; background: rgba(7, 18, 24, .19); transition: border-color .2s, background .2s; }
.player-card.is-active { border-color: rgba(218, 184, 128, .43); background: linear-gradient(115deg, rgba(218, 184, 128, .08), rgba(218, 184, 128, .02)); box-shadow: inset 2px 0 var(--sand); }
.player-card.is-me:not(.is-active) { border-color: rgba(141, 181, 155, .3); }
.player-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.player-avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border: 1px solid color-mix(in srgb, var(--player-color) 55%, transparent); border-radius: 8px; color: var(--player-color); background: color-mix(in srgb, var(--player-color) 14%, #13232a); font-size: 9.5px; font-weight: 800; }
.player-identity { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.player-name { display: flex; align-items: center; gap: 5px; overflow: hidden; color: #e0e1d3; font-size: 11px; font-weight: 750; white-space: nowrap; }
.player-name .p-name-text { overflow: hidden; text-overflow: ellipsis; }
.player-tag { padding: 2px 4px; border-radius: 3px; color: #95aaa2; background: rgba(141, 181, 155, .09); font-size: 7px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; flex: 0 0 auto; }
.tag-you { color: #9bc7af; background: rgba(141, 181, 155, .13); }
.tag-turn { color: #2b312b; background: var(--sand); }
.tag-off { color: #c79e79; background: rgba(199, 158, 121, .12); }
.player-score { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 30px; flex: 0 0 auto; }
.player-score strong { color: var(--sand-bright); font-family: var(--font-display); font-size: 18px; font-weight: 400; line-height: 1; }
.player-score small { color: #778e88; font-size: 6.5px; letter-spacing: .13em; }
.score-track { height: 3px; margin: 8px 0 7px; overflow: hidden; border-radius: 99px; background: rgba(216, 220, 199, .09); }
.score-track-fill { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.player-meta { display: flex; align-items: center; gap: 9px; }
.player-meta span { display: inline-flex; align-items: center; gap: 3px; color: #82968e; font-size: 9px; white-space: nowrap; }
.player-meta b { color: #c4ccbc; font-size: 9px; }
.badge-flag { padding: 2px 5px; border: 1px solid rgba(218, 184, 128, .22); border-radius: 5px; color: #e0c58f !important; background: rgba(218, 184, 128, .07); font-size: 8px !important; font-weight: 750; opacity: .98; }

.side-tabs { display: flex; gap: 4px; padding: 9px 12px 0; }
.side-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 0 8px; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; color: #8ca19a; background: transparent; font-size: 10px; font-weight: 750; }
.side-tab.is-active { color: #e9e1ce; border-color: var(--line); background: rgba(255, 255, 255, .03); }
.journal-badge { color: var(--sand-bright); }
.tab-pane { display: flex; flex-direction: column; min-height: 0; margin: 0 12px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 0 10px 10px 10px; background: rgba(7, 18, 24, .14); flex: 1; }
.tab-pane[hidden] { display: none; }
.action-content { display: flex; flex-direction: column; gap: 12px; }
.action-section-heading h3 { margin: 0; color: #e0dece; font-family: var(--font-display); font-size: 14.5px; font-weight: 400; }
.action-section-heading p { margin: 4px 0 0; color: #819791; font-size: 9px; line-height: 1.4; }
.action-hint { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid rgba(218, 184, 128, .17); border-radius: 10px; background: rgba(218, 184, 128, .045); }
.hint-mark { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto; border: 1px solid rgba(218, 184, 128, .2); border-radius: 8px; color: var(--sand); background: rgba(218, 184, 128, .07); font-size: 14px; }
.hint-copy b { display: block; color: #e0ddcb; font-size: 10px; }
.hint-copy p { margin: 4px 0 0; color: #8da09a; font-size: 9px; line-height: 1.5; }
.turn-hero-card { padding: 14px 12px; border: 1px solid rgba(218, 184, 128, .22); border-radius: 12px; background: radial-gradient(ellipse at 50% 0, rgba(218, 184, 128, .105), transparent 70%), rgba(8, 20, 26, .2); text-align: center; }
.turn-card-kicker { display: block; color: var(--sand); font-size: 8px; font-weight: 850; letter-spacing: .16em; }
.turn-card-dice { display: block; margin: 7px 0 2px; color: var(--sand-bright); font-size: 28px; }
.turn-hero-card h3 { margin: 3px 0 6px; color: #e6e2d2; font-family: var(--font-display); font-size: 17px; font-weight: 400; }
.turn-hero-card p { margin: 0 auto 11px; max-width: 230px; color: #8fa29a; font-size: 9px; line-height: 1.5; }

.cost-mark { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px; border-radius: 5px; background: rgba(141, 181, 155, .1); color: #d5e0bd; font-size: 9px; }
.cost-mark b { font-weight: 800; }
.cost-mark.clay { color: #e2a388; background: rgba(215, 127, 97, .12); }
.cost-mark.grain { color: #e5ca83; background: rgba(218, 184, 128, .12); }
.cost-mark.wool { color: #c6db9e; background: rgba(141, 181, 155, .12); }
.cost-mark.ore { color: #acc9d0; background: rgba(104, 173, 188, .12); }
.cost-mark.wood { color: #b5d4b0; }

.bank-trade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.bank-trade-card { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px; padding: 7px 9px; border: 1px solid rgba(220, 222, 201, .11); border-radius: 9px; background: rgba(8, 20, 26, .18); font-size: 10px; transition: .16s; }
.bank-trade-card:hover:not(:disabled) { border-color: rgba(218, 184, 128, .4); background: rgba(218, 184, 128, .05); }
.bank-trade-rate { color: #7d928c; font-size: 8.5px; font-weight: 800; }
.bank-trade-flow { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.action-choice-grid { display: flex; flex-direction: column; gap: 6px; }
.action-choice-button { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 10px; border: 1px solid rgba(218, 184, 128, .18); border-radius: 9px; background: rgba(218, 184, 128, .04); text-align: left; font-size: 10px; }
.action-choice-button:hover { border-color: rgba(218, 184, 128, .5); background: rgba(218, 184, 128, .09); }
.action-choice-mark { color: var(--sand); flex: 0 0 auto; }
.charter-tray { display: flex; flex-wrap: wrap; gap: 5px; }
.charter-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 4px 8px; border: 1px solid rgba(220, 222, 201, .14); border-radius: 7px; color: #b7c1b4; background: rgba(8, 20, 26, .2); font-size: 9px; }
.charter-chip.is-playable { color: #f0d39d; border-color: rgba(218, 184, 128, .4); background: rgba(218, 184, 128, .09); }
.empty-cards { margin: 8px 0 0; color: #748982; font-family: var(--font-display); font-size: 10.5px; font-style: italic; }
.trade-banner { padding: 11px; border: 1px solid rgba(141, 181, 155, .34); border-radius: 11px; background: rgba(82, 125, 104, .09); }
.trade-banner h3 { margin: 0; color: #deead9; font-family: var(--font-display); font-size: 15px; font-weight: 400; }
.trade-banner p { margin: 6px 0 9px; color: #afc1b3; font-size: 10px; line-height: 1.45; }
.loading-state { display: flex; align-items: center; gap: 9px; padding: 16px 0; color: #8fa39a; font-size: 10px; }
.loading-ring { width: 14px; height: 14px; border: 1.5px solid rgba(218, 184, 128, .18); border-top-color: var(--sand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Журнал */
.game-log { flex: 1; min-height: 90px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(218, 184, 128, .23) transparent; }
.log-entry { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding: 6px 1px; border-bottom: 1px solid rgba(226, 224, 201, .055); color: #adbaac; font-size: 9.5px; line-height: 1.45; }
.log-entry:last-child { border-bottom: 0; }
.log-turn { color: #778f86; font-size: 7px; font-weight: 800; letter-spacing: .07em; padding-top: 2px; }
.log-message { overflow-wrap: anywhere; }
.log-success .log-message { color: #a8cfb2; }
.log-danger .log-message { color: #e0a38c; }
.empty-log { margin: 14px 0; color: #73877f; font-family: var(--font-display); font-size: 11px; font-style: italic; }
.chat-form { display: flex; gap: 7px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.chat-form .text-field { height: 34px; font-size: 10px; }
.chat-send { display: grid; place-items: center; width: 36px; flex: 0 0 auto; border: 1px solid rgba(218, 184, 128, .31); border-radius: 8px; color: var(--sand); background: rgba(218, 184, 128, .07); font-size: 15px; }

/* Инфо-блок: цель, моды, цены, правила */
.side-info { flex: 0 0 auto; padding: 11px 14px 13px; border-top: 1px solid var(--line); background: rgba(10, 22, 28, .5); }
.side-panel[data-active-tab="journal"] .side-info, .side-panel[data-active-tab="players"] .side-info { display: none; }
.side-panel[data-active-tab="journal"] .side-players { display: none; }
.info-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-bottom: 9px; }
.info-cell { display: flex; flex-direction: column; gap: 4px; }
.info-kicker { color: #7f9690; font-size: 7.5px; font-weight: 800; letter-spacing: .14em; }
.goal-value { color: var(--sand-bright); font-size: 12px; font-weight: 700; }
.mods-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.mod-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border: 1px solid rgba(141, 181, 155, .25); border-radius: 6px; color: #a9c4b4; background: rgba(141, 181, 155, .08); font-size: 8.5px; font-weight: 700; }
.costs-block { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.costs-kicker { color: #7f9690; font-size: 7.5px; font-weight: 800; letter-spacing: .14em; margin-bottom: 2px; }
.costs-row { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #c9d2c4; }
.costs-row .cr-name { flex: 1; display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.costs-row .cr-cost { display: inline-flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.rules-button { min-height: 36px; }

/* ─────────── Диалоги ─────────── */
.dialog-layer { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; }
.dialog-scrim { position: absolute; inset: 0; border: 0; background: rgba(6, 14, 19, .66); backdrop-filter: blur(3px); }
.dialog-card { position: relative; z-index: 1; width: min(560px, calc(100vw - 24px)); max-height: min(86dvh, 720px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(224, 200, 158, .25); border-radius: 16px; background: linear-gradient(147deg, rgba(32, 52, 60, .99), rgba(21, 37, 45, .99)); box-shadow: 0 30px 90px rgba(0, 0, 0, .5); }
.dialog-header { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.dialog-header-copy { flex: 1; min-width: 0; }
.dialog-header h2 { margin: 5px 0 4px; color: #f0e5d0; font-family: var(--font-display); font-size: 20px; font-weight: 400; }
.dialog-header p { margin: 0; color: #9aaca5; font-size: 10px; line-height: 1.45; }
.dialog-close { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 8px; color: #bdc4b6; background: transparent; font-size: 15px; }
.dialog-body { flex: 1; overflow-y: auto; padding: 14px 16px; scrollbar-width: thin; scrollbar-color: rgba(218, 184, 128, .23) transparent; }
.dialog-footer { padding: 12px 16px 15px; border-top: 1px solid var(--line); }
.dialog-note { margin: 0 0 9px; color: #8da09a; font-size: 9.5px; }
.dialog-footer-buttons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.dialog-footer-buttons .action-button { min-width: 0; }
.dialog-footer-buttons .action-muted { grid-column: 1; }
.dialog-footer-buttons .action-primary { grid-column: 2; }
.dialog-footer-buttons > .action-button:only-child { grid-column: 2; }
.quantity-list { display: flex; flex-direction: column; gap: 7px; }
.quantity-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px 20px 28px; align-items: center; gap: 4px; padding: 6px 7px; border: 1px solid rgba(220, 222, 201, .1); border-radius: 9px; background: rgba(8, 20, 26, .2); }
.quantity-resource { display: inline-flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; font-size: 10px; color: #e0e1d3; font-weight: 700; }
.quantity-resource .q-emoji { font-size: 15px; }
.quantity-have { color: #91a8a0; font-size: 7.5px; white-space: nowrap; }
.quantity-step { display: grid; place-items: center; width: 28px; height: 28px; min-width: 28px; padding: 0; border: 1px solid rgba(218, 184, 128, .25); border-radius: 7px; color: var(--sand-bright); background: rgba(218, 184, 128, .06); font-size: 15px; font-weight: 800; }
.quantity-value { min-width: 20px; text-align: center; color: var(--sand-bright); font-size: 13px; font-weight: 800; }
.selection-meter { display: flex; align-items: center; gap: 10px; margin-top: 11px; }
.selection-meter-label { color: #aab9ab; font-size: 9.5px; }
.selection-meter-track { flex: 1; height: 5px; border-radius: 99px; background: rgba(216, 220, 199, .1); overflow: hidden; }
.selection-meter-track i { display: block; height: 100%; background: var(--sage); border-radius: 99px; transition: width .2s; }
.trade-compose-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trade-compose-label { color: var(--sand); font-size: 9px; font-weight: 800; letter-spacing: .12em; margin-bottom: 7px; }
.rules-article { display: flex; flex-direction: column; gap: 12px; font-size: 10.5px; line-height: 1.55; color: #c4ccbc; }
.rules-article h3 { margin: 0; color: #e9e1ce; font-family: var(--font-display); font-size: 14px; font-weight: 400; }
.rules-article ul { margin: 4px 0 0; padding-left: 16px; }
.rules-article li { margin-bottom: 3px; }
.rules-article b { color: #eadfc6; }
.rules-cost-table { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

/* ─────────── Мобильная раскладка ─────────── */
@media (max-width: 1099px) {
  body.in-game { overflow: hidden; }
  .game-topbar { gap: 6px; padding: 5px 9px; min-height: 46px; }
  .brand-copy, .phase-chip, .connection-status { display: none; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .room-pill { min-height: 27px; padding: 0 6px; }
  .metric-chip { min-height: 27px; padding: 0 8px; font-size: 9px; }
  .leave-button { padding: 0 9px; min-height: 30px; font-size: 9px; }
  .icon-button { width: 30px; height: 30px; font-size: 15px; }

  .game-body { display: flex; flex-direction: column; gap: 0; padding: 0; }
  .map-stage { flex: 1; border: 0; border-radius: 0; }

  /* Панель = нижний лист */
  .side-panel { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: min(74dvh, calc(var(--app-viewport-height, 100dvh) - 24px)); height: auto; border-radius: 18px 18px 0 0; border: 1px solid rgba(224, 200, 158, .22); border-bottom: 0; transform: translateY(105%); transition: transform .28s cubic-bezier(.22, .9, .3, 1); box-shadow: 0 -20px 60px rgba(0, 0, 0, .45); padding-bottom: env(safe-area-inset-bottom); }
  .side-panel.is-open { transform: translateY(0); }
  .side-panel::before { content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 42px; height: 4px; border-radius: 99px; background: rgba(231, 220, 193, .25); }
  .sheet-close { display: grid; place-items: center; position: absolute; top: 8px; right: 10px; z-index: 2; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; color: #bdc4b6; background: rgba(255, 255, 255, .04); font-size: 15px; }
  .side-scroll { max-height: calc(min(74dvh, var(--app-viewport-height, 100dvh)) - 96px); }
  .side-block { padding: 20px 14px 11px; }
  .side-block.side-players { display: none; }  /* на мобильном игроки — вкладка */
  .side-tabs { padding: 12px 12px 0; }
  .tab-pane { margin: 0 12px 12px; }
  .side-info { padding-bottom: 12px; }
  .rules-button { display: none; } /* правила доступны через нижнюю навигацию */

  .map-instruction { top: 31px; bottom: auto; left: 90px; right: 7px; transform: none; max-width: none; min-height: 25px; padding: 4px 6px; gap: 4px; font-size: 8.5px; line-height: 1.25; }
  .players-overlay { display: flex; top: 4px; left: 6px; right: 6px; gap: 4px; }
  .overlay-player { min-height: 21px; padding: 2px 4px; gap: 3px; font-size: 7.7px; }
  .overlay-award { font-size: 9px; }
  .dice-mini { top: 31px; left: 6px; gap: 4px; padding: 3px 5px; border-radius: 8px; }
  .dice-mini .dice-face { width: 17px; height: 17px; padding: 1.5px; }
  .dice-mini .dice-face i { width: 3px; height: 3px; }
  .dice-mini .dice-total { font-size: 10px; }
  .resource-dock { bottom: 50px; left: 6px; right: 6px; transform: none; max-width: none; gap: 2px; padding: 3px; border-radius: 9px; }
  .dock-chip { gap: 2px; padding: 2px 4px; font-size: 8.8px; }
  .dock-chip .dock-emoji { font-size: 11px; }
  .dock-chip b { font-size: 10px; }
  .dock-total { gap: 2px; margin-left: 0; padding: 3px 5px; font-size: 9px; }
  .dock-pieces { gap: 3px; margin-left: 0; padding-left: 4px; }
  .dock-piece { gap: 1px; font-size: 9px; }
  .floating-events { left: 8px; bottom: 91px; max-width: min(250px, 58%); }
  .trade-layer { left: 8px; right: 8px; top: 66px; bottom: auto; transform: none; width: auto; }
  .action-hub { right: 8px; bottom: 86px; max-width: min(280px, 82%); gap: 5px; }
  .hub-btn.is-icon-only { width: 43px; min-width: 43px; height: 43px; min-height: 43px; border-radius: 12px; }
  .hub-btn.is-icon-only .hub-ico { font-size: 21px; }
  .hub-decision-card { width: min(280px, calc(100vw - 16px)); padding: 8px; }
  .hub-victim-btn { min-height: 31px; padding: 4px 6px; font-size: 9px; }
  .hub-popover { width: min(300px, calc(100vw - 92px)); }

  .mobile-nav { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-strong); background: rgba(13, 28, 35, .97); backdrop-filter: blur(12px); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 48px; padding: 4px 4px 3px; border: 0; color: #93a89f; background: transparent; font-size: 14px; }
  .mobile-nav button small { font-size: 8.5px; font-weight: 700; letter-spacing: .04em; }
  .mobile-nav button:active { color: var(--sand-bright); background: rgba(218, 184, 128, .07); }

  .trade-compose-columns { grid-template-columns: 1fr; }
  .dialog-layer { align-items: flex-end; }
  .dialog-card { width: 100%; max-height: min(88dvh, var(--app-viewport-height, 100dvh)); border-radius: 18px 18px 0 0; border-bottom: 0; }
}

@media (min-width: 1100px) {
  .tab-mobile-only { display: none; }
  .mobile-nav { display: none; }
  .side-panel.is-open { /* no-op on desktop */ }
}

@media (max-width: 640px) {
  .landing-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 12px 12px 22px; align-items: start; }
  .landing-story { max-width: 440px; margin: 0 auto; }
  .landing-map-art { width: min(100%, 380px); margin: 0 auto 7px; }
  .landing-map-art svg { max-height: 104px; }
  .landing-story h1, .landing-lede, .landing-features, .landing-hint { display: none; }
  .landing-story .eyebrow { justify-content: center; margin: 0 0 2px; font-size: 8px; letter-spacing: .13em; }
  .setup-card { padding: 18px 16px 16px; }
  .setup-heading { padding-bottom: 12px; }
  .setup-heading h2 { font-size: 25px; }
  .bot-card { gap: 6px; padding: 7px 6px; min-height: 58px; }
  .bot-card-icon { width: 27px; height: 27px; font-size: 15px; }
  .bot-count-control { grid-template-columns: 23px 15px 23px; gap: 1px; }
  .bot-count-button { width: 23px; height: 26px; }
  .bot-card-name { font-size: 10px; }
  .bot-card-description { font-size: 8px; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-topbar, .landing-footer { padding-left: 16px; padding-right: 16px; }
}

/* ─────────── SVG-карта ─────────── */
.sea-grid-rect { opacity: .6; }
.hex-tile { cursor: pointer; outline: none; }
.hex-shadow { fill: rgba(7, 20, 25, .52); stroke: rgba(11, 25, 29, .38); stroke-width: 1; }
.hex-coast { fill: #d0c29a; stroke: rgba(243, 225, 182, .8); stroke-width: 1.8; }
.hex-fill { fill: var(--tile, #557c63); stroke: rgba(255, 240, 198, .35); stroke-width: 1; transition: filter .15s, stroke .15s; }
.terrain-forest { --tile: #3f7050; }
.terrain-hills { --tile: #a86a48; }
.terrain-fields { --tile: #c2a349; }
.terrain-pasture { --tile: #739c62; }
.terrain-mountains { --tile: #718b93; }
.terrain-wasteland { --tile: #96886c; }
.terrain-ruins { --tile: #84749a; }
.terrain-unknown { --tile: #203a42; }
.hex-tile:not(.is-hidden):hover .hex-fill { filter: brightness(1.09); stroke: rgba(255, 240, 198, .8); }
.hex-tile.is-target .hex-fill { stroke: #f0d195; stroke-width: 2; filter: none; }
.hex-coast, .hex-fill, .hex-shadow { vector-effect: non-scaling-stroke; }
/* Понятные значки и подписи секторов */
.terrain-icon { font-size: 21px; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.terrain-label { display: none; }
.terrain-fields .terrain-icon, .terrain-hills .terrain-icon { filter: drop-shadow(0 1px 1px rgba(30, 20, 5, .35)); }
.number-token { fill: #f3e8cf; stroke: #ab9873; stroke-width: 1.4; filter: drop-shadow(0 1px 1px rgba(20, 31, 30, .25)); }
.token-hot { fill: #f2d7bd; stroke: #b85f4e; stroke-width: 1.8; }
.number-text { fill: #31413c; font-family: var(--font-display); font-size: 15px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.number-hot { fill: #b8493f; }
.number-pips circle { fill: #806644; opacity: .94; }
.pips-hot circle { fill: #ab5a4d; opacity: 1; }
.unknown-specks circle { fill: #b1c6b0; opacity: .55; }
.unknown-mark { fill: #d6c59d; font-family: var(--font-display); font-size: 30px; font-weight: 400; text-anchor: middle; opacity: .85; }
/* На телефонах может быть много допустимых целей разбойника. Не анимируем
   каждый SVG-гекс и не применяем GaussianBlur к каждому кольцу: это вызывает
   постоянную перерисовку большой области карты. Достаточно статичного контура. */
.target-hex-underlay { fill: rgba(13, 26, 31, .10); stroke: rgba(13, 26, 31, .94); stroke-width: 9; stroke-linejoin: round; pointer-events: none; filter: none; }
.target-hex-ring { fill: rgba(255, 223, 157, .20); stroke: #fff0b8; stroke-width: 5.5; stroke-dasharray: none; stroke-linejoin: round; stroke-linecap: round; filter: none; pointer-events: none; animation: none; }
@keyframes target-breathe { 50% { opacity: .53; } }
.blight-overlay { fill: rgba(67, 25, 36, .46); stroke: rgba(203, 85, 80, .78); stroke-width: 2; stroke-dasharray: 5 3; pointer-events: none; }
.blight-advanced { fill: rgba(51, 15, 25, .67); stroke: #ed6e5c; stroke-width: 2.5; }
.blight-mark { fill: #ffe0bc; stroke: #492630; stroke-width: .75px; paint-order: stroke; font-family: var(--font-body); font-size: 10px; font-weight: 850; text-anchor: middle; pointer-events: none; }
.raider-medallion { fill: #1a2528; stroke: #e7c98c; stroke-width: 1.6; }
.raider-flag { font-size: 12px; text-anchor: middle; pointer-events: none; }
.map-edge { fill: none; cursor: pointer; }
.edge-guide-shadow { stroke: rgba(9, 22, 25, .37); stroke-width: 5.5; stroke-linecap: round; }
.edge-guide { stroke: rgba(218, 225, 199, .23); stroke-width: 2.2; stroke-linecap: round; }
.route-outline { stroke: rgba(10, 24, 28, .75); stroke-width: 9.5; stroke-linecap: round; }
.route-line { stroke-width: 6; stroke-linecap: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.route-cap { stroke: rgba(255, 255, 255, .65); stroke-width: .6; }
.edge-target-halo { stroke: rgba(244, 211, 151, .35); stroke-width: 13; stroke-linecap: round; filter: url(#soft-glow); }
.edge-target-hit { stroke: #f1d096; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 4; animation: target-breathe 1.9s ease-in-out infinite; }
.map-edge.is-target:hover .edge-target-hit { stroke-width: 8; }
.map-vertex { cursor: pointer; }
.vertex-dot { fill: rgba(237, 224, 190, .25); stroke: rgba(31, 51, 48, .45); stroke-width: .8; }
.vertex-target-ring { fill: rgba(240, 209, 150, .25); stroke: #f1d296; stroke-width: 2.2; filter: url(#soft-glow); animation: target-breathe 1.9s ease-in-out infinite; }
.vertex-target-hit { fill: rgba(240, 209, 150, .035); stroke: rgba(240, 209, 150, .13); stroke-width: 1; }
.building-shadow { fill: rgba(9, 24, 28, .45); }
.building-body, .building-tower { stroke: rgba(21, 35, 36, .77); stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.building-roof, .building-detail { filter: drop-shadow(0 1px 0 rgba(16, 31, 31, .3)); }
.building-door { stroke: rgba(31, 48, 46, .55); stroke-width: .7; }
.building-glint { opacity: .9; }
.port-badge { pointer-events: none; }
.port-badge-plate { fill: rgba(16, 36, 43, .92); stroke: rgba(240, 209, 150, .5); stroke-width: .8; }
.port-badge-text { fill: #f0d195; font-family: var(--font-body); font-size: 7.5px; font-weight: 800; text-anchor: middle; }
.production-flash { fill: rgba(255, 232, 169, .15); stroke: #ffdf97; stroke-width: 3; filter: url(#soft-glow); animation: production-flash 1.8s ease-out forwards; pointer-events: none; }
@keyframes production-flash { 0% { opacity: .95; stroke-width: 4; } 100% { opacity: 0; stroke-width: 1; } }




/* Tactical hex targeting: gold = move raider, green = cleanse, coral = spread blight. */
.target-hex-ring.target-ring-raider { fill: rgba(255, 223, 157, .24); stroke: #fff0b8; stroke-width: 5.5; }
.target-hex-ring.target-ring-purify { fill: rgba(91, 220, 151, .23); stroke: #e0ffea; stroke-width: 6.2; stroke-dasharray: 8 2.5; }
.target-hex-ring.target-ring-corrupt { fill: rgba(249, 96, 100, .28); stroke: #ffd3cb; stroke-width: 6.2; stroke-dasharray: 3 2; }
.raider-forbidden-outline { fill: rgba(117, 22, 31, .12); stroke: #ff5261; stroke-width: 6.5; stroke-linejoin: round; pointer-events: none; vector-effect: non-scaling-stroke; }
.raider-forbidden-badge-bg { fill: #7b1823; stroke: #ffe1df; stroke-width: 1.5; }
.raider-forbidden-badge-mark { fill: #fff; font: 900 17px sans-serif; text-anchor: middle; pointer-events: none; }
.hex-action-badge-bg { fill: #173329; stroke: #e2fff0; stroke-width: 1.3; }
.hex-action-badge.is-corrupt .hex-action-badge-bg { fill: #6f2025; }
.hex-action-badge-mark { fill: #fff; font: 900 13px sans-serif; text-anchor: middle; pointer-events: none; }
.blight-action-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.blight-action-button { display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line, rgba(226,208,165,.24)); border-radius: 12px; background: var(--panel-soft, rgba(255,255,255,.04)); color: inherit; text-align: left; cursor: pointer; }
.blight-action-button:hover, .blight-action-button:focus-visible { border-color: var(--gold, #d8b57b); background: rgba(216,181,123,.09); }
.blight-action-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(216,181,123,.12); font-size: 19px; }
.blight-action-copy { display: grid; gap: 3px; min-width: 0; }
.blight-action-copy b { font-size: 13px; }
.blight-action-copy small { font-size: 11px; line-height: 1.35; color: var(--muted, #a9b0a6); }
.blight-action-copy .blight-action-note { font-size: 10px; }
.blight-payment-choices { display: grid; gap: 8px; padding: 12px 0; }
.blight-payment-choices .action-button { width: 100%; }
.blight-payment-cancel { width: 100%; }

.bot-difficulty-note { display: block; min-height: 2.5em; margin-top: 5px; line-height: 1.35; }
