:root {
  --bg: #14101a; --panel: #211a2b; --accent: #e0457b; --accent2: #7b5cff;
  --text: #f3eef7; --muted: #a99fb5; --ok: #3ecf8e; --warn: #ffb020;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.4;
}
.wrap { max-width: 100%; margin: 0 auto; padding: 16px; }
h1, h2, h3 { margin: 0.4em 0; }
.title { color: var(--accent); }
.panel { background: var(--panel); border-radius: 14px; padding: 16px; margin: 12px 0; }
.muted { color: var(--muted); font-size: 0.9em; }
button {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 16px; font-size: 1em; cursor: pointer; margin: 4px 4px 4px 0;
}
button.sec { background: var(--accent2); }
button.ghost { background: #33283f; }
button:disabled { opacity: 0.4; cursor: default; }
button.wide { width: 100%; }
input {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #3a2f4a;
  background: #180f22; color: var(--text); font-size: 1em; margin: 6px 0;
}
.code { font-size: 2em; letter-spacing: 0.15em; color: var(--accent2); font-weight: 700; }
.card {
  background: linear-gradient(135deg, #2a2036, #3a2a4d);
  border: 1px solid #4a3a5f; border-radius: 14px; padding: 20px; text-align: center; margin: 10px 0;
}
.card .term { font-size: 1.6em; font-weight: 700; }
.card .syn { color: var(--accent2); font-size: 0.95em; margin-top: 6px; font-style: italic; }
.card .def { color: var(--muted); margin-top: 10px; display: none; text-align: left; }
.card.show .def { display: block; }
.pose-frame {
  width: 300px; height: 300px; max-width: 100%; margin: 12px auto 0;
  border: 1px dashed #5a4a6f; border-radius: 10px; background: #1c1526;
  position: relative; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pose-frame img { width: 300px; height: 300px; object-fit: contain; }
.pose-frame .pose-ph {
  position: absolute; padding: 8px; color: var(--muted); font-size: 0.85em;
  text-align: center; white-space: pre-line;
}
.pose-frame img[style*="block"] + .pose-ph { display: none; }
.question { font-size: 1.2em; font-weight: 600; color: var(--accent); }
.plist { list-style: none; padding: 0; margin: 0; }
.plist li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #2f2540; }
.badge { font-size: 0.75em; padding: 2px 8px; border-radius: 20px; background: #33283f; margin-left: 6px; }
.badge.stuck { background: #5a2030; color: #ffb3c3; }
.badge.pen { background: #5a4520; color: var(--warn); }
.badge.task { background: #2a3f5a; color: #9cc7ff; }
.badge.fin { background: #204a35; color: var(--ok); }
.badge.turn { background: #4a3a20; color: #ffd98c; }
.bank { font-weight: 700; color: var(--ok); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.vote-btn { background: #33283f; }
.vote-btn.sel { background: var(--ok); color: #08281a; }
.center { text-align: center; }
.big { font-size: 1.5em; }
a.btnlink { display: inline-block; text-decoration: none; }

/* Баннер связи — фиксирован сверху страницы */
.conn-banner {
  position: sticky; top: 0; z-index: 100;
  background: #5a2030; color: #ffd5de; text-align: center;
  padding: 8px 12px; font-size: 0.9em; font-weight: 600;
}

/* Метка текущей фазы под именем игрока */
.phase-tag {
  display: inline-block; margin: 6px 0 2px; padding: 4px 12px;
  border-radius: 20px; background: var(--accent2); color: #fff;
  font-weight: 700; font-size: 0.95em;
}

/* Карта задания и предупреждение из правил */
.card.task-card { background: linear-gradient(135deg, #2a3f5a, #24304a); border-color: #3a5a7f; }
.warn-box {
  background: #2a2036; border: 1px solid #5a4520; border-left: 4px solid var(--warn);
  border-radius: 10px; padding: 12px 14px; margin: 10px 0; font-size: 0.9em; color: #f3eef7;
}
.warn-box ul { margin: 8px 0 0; padding-left: 18px; }
.warn-box li { margin: 4px 0; }

/* Голосование — иконки игроков */
.vote-icons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.player-icon {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #33283f; border: 2px solid transparent; border-radius: 14px;
  padding: 12px 10px; min-width: 84px; margin: 0;
}
.player-icon .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1.4em; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.player-icon .pname { font-size: 0.9em; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-icon.sel { border-color: var(--ok); background: #204a35; }
.player-icon:disabled { opacity: 0.5; }

.ver { font-size: 0.75em; opacity: 0.6; margin: -6px 0 6px; }

/* Аватары */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.95em;
}
.ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; }
.ava-lg { width: 90px; height: 90px; border-radius: 12px; object-fit: cover; margin: 6px 0; }
.player-icon .avatar, .player-icon .ava { width: 48px; height: 48px; font-size: 1.4em; }

/* Мини-кнопки в списке игроков у ведущего */
button.mini { padding: 6px 8px; font-size: 0.82em; margin: 2px; }
li.phost { flex-wrap: wrap; gap: 6px; }

/* Блок финиша: фото победителя слева + плейсхолдер кубка справа (≈300×600 суммарно) */
.finish-row { display: flex; gap: 12px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.finish-ph {
  width: 150px; height: 300px; border: 1px dashed #5a4a6f; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); background: #1c1526; overflow: hidden; padding: 6px;
}
.finish-ph img { width: 100%; height: 100%; object-fit: cover; }

/* Выбор пола */
.genders { gap: 12px; margin: 4px 0 8px; }
.genders label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.95em; }

/* Крупное фото игрока на его странице (мин. 400×400, адаптивно) */
.me-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.me-photo { flex: 0 0 auto; }
.me-photo .ava, .me-photo .avatar {
  width: min(200px, 40vw); height: min(200px, 40vw);
  border-radius: 14px; font-size: 3em;
}

/* Фото игроков в списке ведущего — вдвое крупнее обычного аватара */
.plist .ava, .plist .avatar { width: 64px; height: 64px; font-size: 1.8em; }
/* Фото ходящего игрока справа от строки «Ход» у ведущего */
.turn-photo { display: inline-flex; align-items: center; gap: 8px; }
.turn-photo .ava, .turn-photo .avatar { width: 48px; height: 48px; }
.me-info { flex: 1 1 220px; min-width: 200px; }

/* «Показать определение» как ссылка-кнопка */
button.linklike {
  background: none; color: var(--accent2); border: 0; padding: 4px 0;
  text-decoration: underline; font-size: 0.95em; cursor: pointer;
}

/* Всплывающее увеличение фото (~50% экрана) */
.zoom-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.zoom-overlay img { width: 50vw; height: 50vh; max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 12px; }

/* Видеочат-виджет: в углу свёрнут, разворачивается на весь экран */
.video-start {
  position: fixed; right: 12px; bottom: 12px; z-index: 150; border-radius: 24px; padding: 10px 16px;
}
.video-widget {
  position: fixed; top: 64px; left: 12px; z-index: 150; width: 300px; height: 230px;
  min-width: 180px; min-height: 140px; max-width: 98vw; max-height: 94vh;
  background: #000; border: 1px solid #4a3a5f; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  resize: both; /* тянется за правый-нижний угол */
}
.video-widget.expanded { top: 2vh; left: 2vw; width: 96vw; height: 92vh; resize: none; }
/* Подсказка-«уголок» для растягивания */
.video-widget::after {
  content: ''; position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px;
  border-right: 2px solid #8a7aa5; border-bottom: 2px solid #8a7aa5; pointer-events: none; opacity: 0.7;
}
.video-widget.expanded::after { display: none; }
.vw-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; background: #211a2b; font-size: 0.85em; }
.vw-bar button { margin: 0 0 0 4px; padding: 2px 8px; }
.vw-frame { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.vw-frame iframe { width: 100%; height: 100%; border: 0; }

/* Своя видео-переговорка (WebRTC) */
.rtc-grid { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; overflow: auto; padding: 4px; align-content: flex-start; }
.rtc-tile { position: relative; background: #000; border-radius: 6px; overflow: hidden; flex: 1 1 46%; min-width: 90px; min-height: 68px; }
.rtc-tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.rtc-name { position: absolute; bottom: 2px; left: 4px; font-size: 0.72em; color: #fff; text-shadow: 0 0 3px #000; }
.rtc-status { position: absolute; top: 3px; left: 4px; right: 4px; font-size: 0.68em; color: #ffd98c; text-shadow: 0 0 3px #000; text-align: center; }
.rtc-controls { display: flex; gap: 6px; justify-content: center; padding: 4px; background: #211a2b; }
.rtc-controls .mini { margin: 0; }
.rtc-msg { color: var(--text); padding: 12px; font-size: 0.85em; text-align: center; }

/* ===== Финансы и Инвестиции ===== */
.wide-wrap { max-width: 100%; }
.colorpick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.color-chip { width: 44px; height: 60px; border-radius: 8px; background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #2a2036; border: 2px solid transparent; padding: 0; }
.color-chip.sel { border-color: var(--ok); }
.color-chip.taken { opacity: 0.3; cursor: not-allowed; }
.dice-view { font-size: 1.3em; margin-top: 8px; min-height: 1.4em; }
.shown-card { max-width: 100%; max-height: 60vh; border-radius: 10px; display: block; margin: 6px auto; cursor: zoom-in; }

/* Поле = 4 полосы-трека, фишки поверх по позиции */
#board { display: flex; flex-direction: column; gap: 6px; }
.track { position: relative; width: 100%; }
.track-img { width: 100%; display: block; border-radius: 6px; }
.pawn { position: absolute; top: 50%; transform: translate(-50%, -50%); height: 78%; width: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)); transition: left 0.3s ease, top 0.3s ease, height 0.2s ease; pointer-events: none; }
.pawn-mini { height: 26px; vertical-align: middle; }

/* Панель на всю ширину окна (колоды/рынок/лог у ведущего) */
.wide-panel { width: 100vw; margin-left: calc(50% - 50vw); border-radius: 0; }

/* Колоды у ведущего: вертикальные карточки без чёрных полей, 3–4+ в ряд */
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.deck { background: #211a2b; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.deck .row { justify-content: center; }
.deck-name { font-weight: 700; font-size: 1.02em; }
.deck-cnt { font-size: 0.82em; margin: 2px 0 6px; }
.deck-back { width: 100%; height: auto; border-radius: 8px; display: block; margin-bottom: 8px; }
.deck.locked { opacity: 0.55; }
/* Открытая карта у ведущего — крупнее, по высоте */
#openCardImg.shown-card { max-height: 80vh; }

/* Быстрый переход к открытой карте / к колоде */
.jump-top { position: fixed; right: 12px; bottom: 108px; z-index: 150; border-radius: 24px; padding: 8px 14px; background: var(--accent2); display: none; }

/* Рынок */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.market-asset { background: #1c1526; border: 1px solid #33283f; border-radius: 10px; padding: 10px; }
.market-asset .m-name { font-weight: 700; text-align: center; min-height: 2.2em; display: flex; align-items: center; justify-content: center; }
.market-asset .m-price { text-align: center; font-size: 1.5em; font-weight: 700; color: var(--ok); margin: 4px 0; }
.market-asset .m-price small { display: block; font-size: 0.5em; color: var(--muted); font-weight: 400; }
.market-asset .m-row { display: flex; gap: 4px; align-items: center; }
.market-asset input { margin: 4px 0; text-align: center; }
/* Рынок у игрока — только результирующая цена */
.market-player { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.market-player .mp { background: #1c1526; border: 1px solid #33283f; border-radius: 10px; padding: 10px; text-align: center; }
.market-player .mp .m-name { font-weight: 700; font-size: 0.9em; min-height: 2.4em; }
.market-player .mp .m-price { font-size: 1.4em; font-weight: 700; color: var(--ok); }

/* Калькулятор */
.calc-toggle { position: fixed; left: 12px; bottom: 12px; z-index: 150; border-radius: 24px; padding: 10px 14px; font-size: 1.1em; }
.calc-panel { position: fixed; right: 12px; bottom: 64px; z-index: 160; width: 232px; background: #211a2b; border: 1px solid #4a3a5f; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); display: flex; flex-direction: column; overflow: hidden; }
.calc-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; background: #180f22; font-size: 0.85em; cursor: move; user-select: none; }
.calc-bar button { margin: 0; padding: 2px 8px; }
.calc-display { width: auto; margin: 8px; text-align: right; font-size: 1.4em; font-variant-numeric: tabular-nums; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 8px 8px; }
.calc-key { margin: 0; padding: 12px 0; background: #33283f; font-size: 1.05em; }
.calc-key.op { background: var(--accent2); }
.calc-key.fn { background: #4a3540; }
.calc-key.eq { background: var(--ok); color: #08281a; }

/* Панель инструментов справа внизу: калькулятор • чат • видеочат в один ряд */
.tools-row { position: fixed; right: 12px; bottom: 12px; z-index: 150; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 96vw; }
.tools-row > button { position: static; margin: 0; }
.tools-row .calc-toggle { order: 1; }
.tools-row .chat-toggle { order: 2; }
.tools-row .video-start { order: 3; }

/* Чат игры */
.chat-toggle { position: fixed; left: 12px; bottom: 60px; z-index: 150; border-radius: 24px; padding: 10px 14px; background: var(--accent2); }
.chat-toggle.has-new { animation: chatpulse 1s infinite; }
@keyframes chatpulse { 50% { background: var(--ok); } }
.chat-panel { position: fixed; right: 12px; bottom: 64px; z-index: 160; width: 300px; height: 380px; max-width: 96vw; max-height: 70vh; background: #211a2b; border: 1px solid #4a3a5f; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); display: flex; flex-direction: column; overflow: hidden; }
.chat-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #180f22; font-size: 0.9em; cursor: move; user-select: none; }
.chat-bar button { margin: 0; padding: 2px 8px; }
.chat-mode { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 0.85em; }
.chat-mode select { margin: 0; }
.chat-list { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { font-size: 0.88em; line-height: 1.35; padding: 5px 8px; border-radius: 8px; background: #2a2036; align-self: flex-start; max-width: 92%; word-break: break-word; }
.chat-msg.mine { background: #204a35; align-self: flex-end; }
.chat-msg.priv { border: 1px dashed var(--warn); }
.chat-who { color: var(--accent2); font-weight: 700; }
.chat-msg.mine .chat-who { color: #9fe3c1; }
.chat-input { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #33283f; }
.chat-input input { margin: 0; }
.chat-input button { margin: 0; padding: 8px 12px; }

/* Бланк учёта */
.sheet-owner { font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.sheet-sec { margin: 10px 0; padding: 10px; background: #1c1526; border: 1px solid #33283f; border-radius: 10px; }
.sheet-sec h4 { margin: 0 0 8px; color: var(--accent2); font-size: 1em; }
.sheet-fields { display: grid; gap: 8px; }
.sheet-fields.g1 { grid-template-columns: 1fr; }
.sheet-fields.g2 { grid-template-columns: repeat(2, 1fr); }
.sheet-fields.g3 { grid-template-columns: repeat(3, 1fr); }
.sheet-field { display: flex; flex-direction: column; }
.sheet-field.wide { grid-column: 1 / -1; }
.sheet-field label { font-size: 0.78em; color: var(--muted); margin-bottom: 2px; }
.sheet-inp { width: 100%; padding: 7px 8px; margin: 0; border-radius: 8px; border: 1px solid #3a2f4a; background: #180f22; color: var(--text); font-size: 0.95em; }
.sheet-inp.ro { background: #241a30; color: #cdbfe0; }
.cash-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cash-val { font-size: 1.8em; font-weight: 700; color: var(--ok); min-width: 120px; }
.cash-row { display: flex; gap: 4px; align-items: center; }
.cash-row .sheet-inp { width: 110px; }
.cash-row button { margin: 0; }
.sheet-table { display: flex; flex-direction: column; gap: 4px; overflow-x: auto; }
.st-row { display: flex; gap: 4px; align-items: center; }
.st-cell { flex: 1 1 0; min-width: 64px; }
/* 22.0-F7: узкая ячейка с кнопкой удаления строки */
.st-del-cell { flex: 0 0 auto; min-width: 0; display: flex; align-items: center; justify-content: center; }
.row-del { background:#3a1420; color:#ffb3b3; border:1px solid #a33; border-radius:6px; padding:2px 7px; font-size:.9em; line-height:1; cursor:pointer; }
.row-del:hover { background:#5a1b2c; }
/* 22.0-F1: две колонки кубиков — ход (красный) и вероятность (синий) */
.dice-cols { display:flex; gap:10px; flex-wrap:wrap; margin-top:6px; }
.dice-col { flex:1 1 0; min-width:160px; border:1px solid #2a2140; border-radius:10px; padding:8px; }
.dice-col-h { font-size:.78em; color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.03em; }
.dice-col-note { font-size:.74em; margin-top:6px; }
.rollbtn.move { background:#c0392b; border-color:#e05244; color:#fff; font-weight:600; width:100%; }
.rollbtn.move:disabled { opacity:.42; cursor:not-allowed; }
.dice-prob .probbtn { background:#1c3d6e; border-color:#2a5aa0; color:#dbe8ff; }
/* 22.0-F5: навигация по бланку — кнопка в панели инструментов (где чат/калькулятор) + всплывающий список */
.nav-toggle { border-radius:24px; padding:10px 14px; background:var(--accent2); order:0; }
.nav-panel { position:fixed; right:12px; bottom:64px; z-index:160; width:240px; max-height:62vh; overflow-y:auto; background:#211a2b; border:1px solid #4a3a5f; border-radius:12px; box-shadow:0 6px 20px rgba(0,0,0,.5); padding:6px; }
.navitem { display:block; width:100%; text-align:left; background:transparent; border:0; color:#d8d0ea; padding:7px 8px; border-radius:6px; cursor:pointer; font-size:.86em; }
.navitem:hover { background:#33264a; }
.navitem.nav-edge { font-weight:600; color:#fff; background:#2a2140; margin-bottom:2px; }
.navitem.nav-edge:hover { background:#3a2d55; }
/* 22.0-F8: онбординг-попап (выбор ранга/профессии) */
.onb-overlay { position:fixed; inset:0; z-index:220; background:rgba(0,0,0,.82); display:flex; align-items:center; justify-content:center; padding:16px; }
.onb-modal { background:#1a1226; border:1px solid #4a3a5f; border-radius:14px; padding:18px; max-width:440px; width:100%; box-shadow:0 10px 40px rgba(0,0,0,.6); }
.onb-modal .big { font-size:1.05em; font-weight:600; margin-top:4px; }
/* 22.0-F10: активная запись */
.recording { background:#7a1420 !important; color:#fff !important; border-color:#a33 !important; }
.st-head .st-cell { font-size: 0.72em; color: var(--muted); text-align: center; padding: 2px; }
.st-row .sheet-inp { padding: 5px 6px; font-size: 0.88em; }

/* Оверлей просмотра чужого бланка (аудит / ведущий) */
.sheet-overlay { position: fixed; inset: 0; z-index: 210; background: rgba(0,0,0,0.85); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 16px; }
.sheet-modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 96vw; margin: auto; }
.sheet-modal-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #180f22; border-radius: 14px 14px 0 0; z-index: 1; }
.sheet-modal-bar span { font-weight: 700; }
.sheet-modal-body { padding: 12px 14px; }
@media (max-width: 560px) { .sheet-fields.g2, .sheet-fields.g3 { grid-template-columns: 1fr; } }
select.sheet-inp { min-width: 0; }
.st-cell { min-width: 88px; }
.st-cell.wide-cell { flex: 2.4 1 22%; min-width: 200px; }
.st-cell input[list] { min-width: 100%; }
/* Бланк на всю ширину экрана */
.sheet-wide { width: 100vw; margin-left: calc(50% - 50vw); padding: 0 10px; }
/* Блок 5 — карточки опционов/шортов */
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt-card { background: #14101a; border: 1px solid #33283f; border-radius: 10px; padding: 10px; }
.opt-card > select.sheet-inp { margin-bottom: 8px; font-weight: 600; }

/* Чекбоксы / прогресс победы */
.sheet-check { width: 18px; height: 18px; margin: 0; accent-color: var(--ok); cursor: pointer; }
.sheet-checkline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.9em; }
.check-field { justify-content: center; }
.block-pd { float: right; font-size: 0.8em; font-weight: 400; color: var(--ok); }
.sheet-field.pas-total .sheet-inp { font-size: 1.4em; font-weight: 700; color: var(--warn); }
.dep-name { font-weight: 600; }
.prog-wrap { display: flex; flex-direction: column; gap: 6px; }
.prog-name { font-size: 0.85em; color: var(--muted); margin-top: 6px; }
.prog-checks { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.pbar { position: relative; height: 22px; background: #14101a; border: 1px solid #33283f; border-radius: 11px; overflow: hidden; }
.pbar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width 0.3s ease, background 0.3s ease; }
.pbar-label { position: relative; z-index: 1; text-align: center; font-size: 0.78em; line-height: 22px; color: #fff; text-shadow: 0 0 3px #000; }
.prog-summary { margin-top: 4px; font-size: 0.82em; color: #cbb; }

/* Баннер победы — вверху, ярко */
.win-banner { position: sticky; top: 0; z-index: 120; background: linear-gradient(90deg, #b8860b, #ffd700, #b8860b); color: #1a1300; text-align: center; padding: 10px 12px; font-weight: 700; font-size: 1.02em; box-shadow: 0 2px 10px rgba(0,0,0,0.5); align-items: center; gap: 10px; }
.win-close { margin: 0; padding: 4px 12px; background: rgba(0,0,0,0.35); color: #fff; border-radius: 8px; font-weight: 700; }
/* Подсветка приближения к цели в сводке ведущего */
.prog-summary .ps-near { color: var(--warn); font-weight: 700; }
.prog-summary .ps-done { color: var(--ok); font-weight: 700; }
.prog-summary { font-size: 0.84em; color: #cbb; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }

/* Таймер */
.timer-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.timer-clock { font-size: 2.4em; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; color: var(--accent2); }
.timer-clock.run { color: var(--ok); }
.timer-clock.warn { color: #ff5a6a; animation: tblink 1s steps(2) infinite; }
@keyframes tblink { 50% { opacity: 0.35; } }
.timer-ctrls { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

/* Лог событий у ведущего */
.evlog { max-height: 240px; overflow: auto; background: #181022; border: 1px solid #33283f; border-radius: 8px; padding: 8px 10px; font-size: 0.85em; }
.evlog div { padding: 2px 0; border-bottom: 1px solid #241a30; color: #d7cbe6; }
.evlog div:first-child { color: #fff; font-weight: 600; }

/* Открытая карта на весь экран — тянем по высоте */
#cardOverlay img { width: auto; height: 96vh; max-width: 96vw; max-height: 96vh; }

/* Плашка «чей ход» и оглашение броска — вверху у всех */
.turn-strip { display: flex; align-items: center; justify-content: center; gap: 8px; background: #2a2036; border: 1px solid #4a3a5f; border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.turn-strip .pawn-mini { height: 24px; }
.turn-strip.me { background: #204a35; border-color: #3ecf8e; }
.event-strip { background: #1b3a2b; color: #cfeede; border-radius: 10px; padding: 8px 12px; margin-top: 8px; text-align: center; font-weight: 600; min-height: 1.2em; }

/* Дубли кнопок под открытой картой у ведущего */
.open-card-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 4px; }

/* Поле на всю ширину окна (использует чёрные поля по бокам), без полос прокрутки */
.board-wrap { width: 100vw; margin-left: calc(50% - 50vw); overflow: hidden; padding: 0 10px; }
#board { margin: 0 auto; }
.board-zoom { display: flex; align-items: center; gap: 8px; margin-top: 8px; justify-content: center; }
.board-zoom .zlabel { font-size: 0.85em; color: var(--muted); }

/* Перетаскивание видеочата за заголовок */
.vw-bar { cursor: move; user-select: none; }
.video-widget.dragging { opacity: 0.92; }

/* ===== Сборка 17 ===== */
/* Настройки партии — ползунки */
.slider-row{ display:flex; flex-direction:column; gap:2px; margin:6px 0; }
.slider-row input[type=range]{ width:100%; max-width:420px; }
/* Статус/уведомления у игрока */
.status-strip{ margin-top:6px; padding:6px 10px; border-radius:8px; background:#3a2b0e; color:#ffd479; font-weight:600; }
.notice-strip{ margin-top:6px; padding:6px 10px; border-radius:8px; background:#0e2a3a; color:#8fd6ff; font-weight:600; }
/* Бейджи у имени игрока (админка) */
.badge.cnt{ background:#20303a; color:#9fd; }
.badge.skip{ background:#3a2b0e; color:#ffd479; }
.badge.fired{ background:#3a1414; color:#ff9b9b; }
/* Строка управления статусами: удалить — крайний правый */
.phost-manage{ align-items:center; gap:6px; margin-top:4px; flex-wrap:wrap; }
.phost-spacer{ flex:1 1 40px; min-width:20px; }
.mini-inp{ width:74px; }
.mini.danger{ border-color:#a33; color:#ffb3b3; }
/* Колоды возможностей у игрока (Item 9) — ≤60% размера у ведущего */
.deckpick{ margin-top:8px; }
.dp-row{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.dp{ width:92px; cursor:pointer; text-align:center; background:#211a2b; border-radius:8px; padding:6px; }
.dp:hover{ outline:2px solid #6cf; }
.dp-back{ width:100%; height:auto; border-radius:6px; display:block; }
.dp-name{ font-size:.72em; margin-top:3px; }
/* ПИФ «Индекс» (Item 8) */
.pif-wrap{ margin-top:8px; }
.pif-name{ font-weight:700; }
/* Лог действий (Item 11) */
.alog-wrap{ margin-top:6px; }
.alog-box{ max-height:260px; overflow-y:auto; overflow-x:hidden; background:#161020; border-radius:8px; padding:8px; font-size:.85em; -webkit-overflow-scrolling:touch; }
.alog-line{ padding:1px 0; border-bottom:1px solid #241a33; }
/* Рынок: открытая карта — левая колонка, данные справа (Item 14) */
.market-layout{ display:flex; gap:12px; align-items:flex-start; margin-top:10px; }
.market-card-col{ flex:0 0 30%; max-width:340px; position:sticky; top:8px; }
.market-card-col img{ max-width:100%; max-height:80vh; border-radius:10px; display:block; }
@media (max-width:720px){ .market-layout{ flex-direction:column; } .market-card-col{ flex-basis:auto; max-width:100%; position:static; } }

/* ===== Сборка 18 (баг-фиксы) ===== */
/* Рынок: плотнее заполнять правую часть (3-4+ в ряд) */
.market-layout .market-grid { flex: 1 1 auto; min-width: 0; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; align-content: start; }
.market-card-col { flex: 0 0 30%; max-width: 360px; }
/* Общее объявление всем (выбор колоды, финансы) */
.announce-banner { display: flex; align-items: center; gap: 10px; background: #123; color: #cfe8ff; border: 1px solid #2a5; border-radius: 10px; padding: 8px 12px; margin: 6px 0; font-weight: 600; }
/* Сообщение аудитору */
.audit-alert { display: flex; align-items: center; gap: 10px; background: #3a1414; color: #ffd0d0; border: 1px solid #a33; border-radius: 10px; padding: 8px 12px; margin: 6px 0; font-weight: 700; }
/* Плашка риска банкротства у игрока */
.bankrupt-plaque { display: flex; align-items: center; gap: 8px; background: #7a0d0d; color: #fff; font-weight: 800; padding: 8px 12px; border-radius: 10px; margin: 6px 0; letter-spacing: 0.5px; animation: bpulse 1.1s ease-in-out infinite; }
.bankrupt-plaque button { animation: none; }
@keyframes bpulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(255,0,0,.5);} 50%{ box-shadow: 0 0 0 6px rgba(255,0,0,0);} }
.badge.bankrupt { background: #7a0d0d; color: #fff; font-weight: 800; }

/* ===== Сборка 21: лицензия ===== */
.owner-strip { text-align: center; color: #ffd479; font-weight: 700; font-size: 0.95em; margin: -4px 0 6px; }
