@import url('https://fonts.googleapis.com/css2?family=Tektur:wght@400..900&family=Zen+Dots&display=swap');

body {
  margin: 0;
  font-family: 'Tektur', sans-serif;
  background: linear-gradient(135deg, #1e1e2f, #2c2c3e);
  color: #fff;
}

.container {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
}

h1 {
  text-align: center;
  font-family: 'Tektur', cursive;
  font-size: 36px;
  margin-bottom: 30px;
}

.section {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  max-width: 100%;
}

.section h2 {
  margin-bottom: 15px;
  font-weight: 400;
}

input {
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 14px;
  font-family: 'Tektur', sans-serif;
}

input::placeholder {
  color: rgba(255,255,255,0.6);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* ===================== */
/* BUTTONS (main style)  */
/* ===================== */

.btn {
  display: inline-block;
  padding: 12px 15px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
  font-family: 'Tektur', sans-serif;
  background: #4a6cf7;
  color: white;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  transform: scale(1.03);
  background: #3557d6;
}

/* ===================== */
/* DELETE BUTTON         */
/* ===================== */

.delete-btn {
  background: #b30000;
  color: white;
}

.delete-btn:hover {
  background: #ff1a1a;
}

.block {
  background: rgba(255,255,255,0.05);
  padding: 15px;
  border-radius: 10px;
}

.block h3 {
  margin-top: 0;
  font-weight: 400;
  color: #ccc;
}

.item {
  padding: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.item:last-child {
  border-bottom: none;
}

.next-turn-btn {
  width: 100%;
  padding: 20px;
  margin-top: 20px;

  background: #4a6cf7;
  color: white;

  font-size: 18px;
  border: none;
  border-radius: 12px;

  cursor: pointer;
  transition: 0.2s;

  font-family: 'Tektur', sans-serif;
}

.next-turn-btn:hover {
  background: #5878f8;
  transform: scale(1.02);
}

.avatar-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 10px;
}

.stat-box { display: flex; flex-direction: column; align-items: center; }

/* Фиксируем сетку, чтобы она не сжималась при открытии описания */
.edit-layout-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

.character-grid {
    display: grid;
    /* Колонки сами становятся одной, если окно узкое — блоки не сжимаются в кашу */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    flex: 1 1 850px;
    max-width: 850px;
    min-width: 0;
}

/* Правая панель скиллов теперь не "крадет" место, а встает рядом */
.skill-details-panel {
    flex: 1 1 400px;
    min-width: 300px;
    max-width: 400px;
    background: rgba(30, 30, 47, 0.98);
    border: 1px solid #4a6cf7;
    padding: 20px;
    border-radius: 12px;
    display: none;
}

.skill-details-panel.active {
    display: block;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.skill-desc-area {
    width: 100%;
    min-height: 300px;
    background: #1e1e2f;
    border: 1px solid #555;
    color: #eee;
    padding: 10px;
    border-radius: 8px;
    font-family: 'Tektur', sans-serif;
    resize: none;
    margin-top: 10px;
    box-sizing: border-box;
}

.skill-dmg-input {
    color: #ff5252 !important;
    font-size: 18px !important;
    font-weight: bold;
}

/* ===================================================== */
/* === Блоки характеристик (как лист персонажа)      === */
/* ===================================================== */
.ab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 14px; align-items: start; }
.ab-grid.ab-row-layout { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); margin-top: 20px; }
.ab-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ab-block {
    background: rgba(0,0,0,0.35);
    border: 2px solid #4a4a5e;
    border-radius: 12px;
    padding: 8px 10px 8px 10px;
    min-width: 0;
}
.ab-title {
    text-align: center; font-size: 13px; font-weight: bold; color: #eee; letter-spacing: 1.5px;
    border-bottom: 2px solid #4a4a5e; padding-bottom: 6px; margin-bottom: 10px;
}
.ab-top { display: flex; align-items: flex-start; justify-content: center; margin-bottom: 8px; }
.ab-mod-wrap, .ab-score { display: flex; flex-direction: column; align-items: center; }
.ab-mod {
    width: 58px; height: 58px; border-radius: 50%;
    border: 3px solid #cfd2dc; box-sizing: border-box; background: #1e1e2f;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: bold; color: #fff;
}
.ab-score { margin-left: -6px; margin-top: 9px; position: relative; z-index: 1; }
.ab-score input, .ab-score strong {
    width: 44px; box-sizing: border-box; margin: 0; padding: 6px 0; text-align: center;
    background: #1e1e2f; border: 2px solid #cfd2dc; border-radius: 6px;
    color: #fff; font-weight: bold; font-size: 16px; display: block;
}
.ab-cap { font-size: 8px; color: #888; letter-spacing: 0.5px; margin-top: 3px; }
.ab-line {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; padding: 4px 0;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.ab-line.ab-save { font-weight: bold; border-top: 2px solid #4a4a5e; }
.ab-line.ab-save + .ab-line { border-top: 2px solid #4a4a5e; }
.ab-dot {
    width: 13px; height: 13px; flex: 0 0 13px; box-sizing: border-box;
    border-radius: 50%; border: 2px solid #6a6a7e; background: transparent;
    transition: background 0.15s, box-shadow 0.15s;
}
/* 1 нажатие — владение: белая */
.ab-dot.lvl-1 { background: #fff; border-color: #fff; }
/* 2 нажатия — компетентность: белая со свечением вокруг */
.ab-dot.lvl-2 {
    background: #fff; border-color: #fff;
    box-shadow: 0 0 0 2px #1e1e2f, 0 0 0 4px #fff, 0 0 10px 4px rgba(255,255,255,0.55);
}
.ab-editable .ab-dot { cursor: pointer; }
.ab-editable .ab-dot:hover { border-color: #fff; }
.ab-bonus {
    width: 30px; flex: 0 0 30px; text-align: center; color: #fff; font-weight: bold;
    border-bottom: 1px solid #6a6a7e; padding-bottom: 1px;
}
.ab-name { color: #ddd; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.ab-line { min-width: 0; }
.ab-prof-block .ab-prof-val {
    width: 64px; margin: 0 auto 4px auto; padding: 6px 0; box-sizing: border-box;
    text-align: center; font-size: 24px; font-weight: bold; color: #fff;
    border: 2px solid #cfd2dc; border-radius: 8px; background: #1e1e2f;
}

/* =====================================================================
   Шапка карточки:  [аватар] [ блок панелей до правого края ]
                    [ имя, уровень, HP, кнопки — на всю ширину ]
   Блок панелей: дайсы | статы | оружие — одной высоты в ряду.
   Если в ряд не помещается (узкая карточка Мастера), оружие само
   переносится вниз на всю ширину блока. Ничего не наезжает.
   ===================================================================== */
.card-head {
    display: grid; grid-template-columns: 200px 1fr;
    grid-template-areas: "avatar panels" "info info";
    column-gap: 16px; row-gap: 8px; align-items: start; margin-bottom: 10px;
}
.card-head-avatar { grid-area: avatar; }
.card-head-info { grid-area: info; min-width: 0; }

.card-panels {
    grid-area: panels; min-width: 0;
    display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px;
}
.card-panels > * { box-sizing: border-box; min-width: 0; }
.card-panels .dice-panel      { flex: 1 1 230px; }
.card-panels .so-stats-panel  { flex: 0 0 auto; }
.card-panels .so-weapons-panel { flex: 1 1 300px; }

.dice-panel, .stat-overlay.so {
    background: #2c2c3e; border: 1px solid #3c3c52; border-radius: 12px;
    padding: 10px 12px; box-shadow: 0 0 14px rgba(0,0,0,0.4);
}
.so-wtitle, .so-stat label, .so-wname {
    display: block; font-size: 9px; color: #aaa; text-transform: uppercase;
    text-align: center; margin-bottom: 2px; letter-spacing: 0.5px; font-family: 'Tektur', sans-serif;
}
.dice-panel > .so-wtitle, .so-weapons-panel > .so-wtitle { font-size: 11px; margin-bottom: 8px; }
.so-val, .so-wval {
    display: block; background: #1e1e2f; border: 1px solid #555; border-radius: 5px;
    text-align: center; font-weight: bold; font-size: 15px; padding: 5px 0; color: #ffffff;
}

/* Статы → пассивные */
.stat-overlay.so { display: flex; flex-direction: column; gap: 6px; }
.so-stats { display: grid; grid-template-columns: repeat(3, 54px); gap: 5px 6px; }
.so-block { border-top: 1px solid #444; padding-top: 5px; }

/* Оружие: столько в ряд, сколько влезает; ячейки тянутся (до 160px) и центруются */
.so-wgrid {
    flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 6px 8px;
}
.so-weapon { flex: 1 1 96px; max-width: 160px; min-width: 0; }
.so-wname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Цвета листа игрока */
.so.so-player, .dice-panel.so-player { border-color: #ffffff; background: rgba(44,44,62,0.95); }
.so.so-player .so-stat label, .so-player .so-wtitle { color: #ffffff; font-family: 'Zen Dots', sans-serif; }

/* Панель бросков дайсов (кнопки растягиваются на ширину панели) */
.dp-modes { display: flex; gap: 6px; margin-bottom: 8px; }
.dp-mode, .dp-die {
    font-family: 'Tektur', sans-serif; cursor: pointer; color: #fff;
    background: #1e1e2f; border: 1px solid #555; border-radius: 6px; transition: 0.15s;
}
.dp-mode { flex: 1; font-size: 13px; padding: 6px 0; color: #aaa; }
.dp-mode.on { background: #4a6cf7; border-color: #4a6cf7; color: #fff; box-shadow: 0 0 8px rgba(74,108,247,0.6); }
.dp-dice { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dp-die { font-size: 17px; font-weight: bold; padding: 11px 0; }
.dp-die:hover { background: #4a6cf7; border-color: #4a6cf7; }

/* === Всплывающие описания эффектов === */
.fx-tip-wrap { position: relative; cursor: help; border-bottom: 1px dotted currentColor; }
.fx-tip {
    display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 600;
    width: 300px; background: #1a1a2e; border: 1px solid #ff4444; border-radius: 8px;
    padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    font-size: 13px; font-weight: normal; color: #eee; text-align: left; white-space: normal;
    font-family: 'Tektur', sans-serif; line-height: 1.4;
}
.fx-tip-wrap:hover .fx-tip { display: block !important; }
.fx-tip-title { display: block; font-weight: bold; font-size: 15px; margin-bottom: 2px; }
.fx-tip-meta  { display: block; font-size: 11px; color: #999; margin-bottom: 6px; }
.fx-tip-dmg   { display: block; color: #ff5252; font-weight: bold; margin-bottom: 6px; }
.fx-tip-desc  { display: block; }

/* === Меню скилла: формула и счётчик кубов === */
.dmg-preview {
    background: rgba(0,0,0,0.3); border: 1px solid #333; border-radius: 8px;
    padding: 8px 10px; margin-bottom: 10px; font-size: 13px;
}
.dmg-formula { font-size: 17px; color: #ff5252; font-weight: bold; }
.dmg-range { color: #aaa; font-size: 12px; font-weight: normal; margin-left: 8px; }
.dmg-none { color: #888; font-size: 12px; }
.dice-count-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dice-chip {
    font-size: 11px; padding: 2px 7px; border-radius: 6px;
    background: #1e1e2f; border: 1px solid #333; color: #555;
}
.dice-chip.on { color: #fff; border-color: #ffffff; background: rgba(153, 169, 241, 0.15); }

.dmg-hit { color: #7791fb; font-size: 15px; }
.dmg-input-wrap { position: relative; }
.var-help {
    display: none; position: absolute; left: 0; top: calc(100% - 4px); z-index: 700;
    background: #1e1e2f; color: #eee; border: 1px solid #4a6cf7; border-radius: 10px;
    padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.6); font-size: 13px; width: 300px;
}
.dmg-input-wrap.show-vars .var-help { display: block; }
.var-help-title { font-size: 10px; color: #aaa; letter-spacing: 0.5px; margin: 0 0 5px 0; text-transform: uppercase; }
.var-help-title span { text-transform: none; color: #777; }
.var-help-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.var-help-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.var-chip {
    background: #2c2c3e; border: 1px solid #555; border-radius: 5px; padding: 3px 5px;
    color: #fff; font-size: 11px; text-align: center; cursor: pointer; user-select: none; transition: 0.15s;
}
.var-chip b { color: #7791fb; }
.var-chip:hover { background: #4a6cf7; border-color: #4a6cf7; }
.var-chip:hover b { color: #fff; }
.var-die { min-width: 30px; font-weight: bold; }
.var-slash { min-width: 24px; font-weight: bold; color: #7791fb; }

/* === Карточки бросков (слева снизу) === */
#diceTray {
    position: fixed; left: 16px; bottom: 16px; z-index: 99998;
    display: flex; flex-direction: column; gap: 8px;
}
.dice-card {
    width: 380px; box-sizing: border-box;
    background: #0f0f22; border: 1px solid #3a3a5a; border-radius: 10px;
    padding: 12px 18px; color: #fff; font-family: 'Tektur', sans-serif;
    box-shadow: 0 6px 24px rgba(0,0,0,0.6); cursor: pointer;
    animation: diceIn 0.25s ease-out; transition: opacity 0.4s;
}
.dice-card.dc-fade { opacity: 0; }
.dc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dc-sub { border-top: 1px solid #2a2a44; margin-top: 8px; padding-top: 6px; }
.dc-title { font-size: 14px; font-weight: bold; letter-spacing: 1px; }
.dc-name { color: #888; font-weight: normal; font-size: 12px; letter-spacing: 0; }
.dc-o { color: #ffffff; }
.dc-label { font-size: 11px; color: #7791fb; letter-spacing: 1px; font-weight: bold; }
.dc-note { color: #ffd36e; }
.dc-rolls { font-size: 24px; margin-top: 6px; word-break: break-word; }
.dc-sub .dc-rolls { font-size: 20px; margin-top: 2px; }
.dc-formula { font-size: 12px; color: #888; margin-top: 2px; }
.dc-total { font-size: 46px; font-weight: bold; min-width: 50px; text-align: right; }
.dc-sub .dc-total { font-size: 36px; }
@keyframes diceIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* === Чекбоксы (глобальное input{width:100%} их растягивает) === */
input.chk { width: auto; margin: 0 6px 0 0; padding: 0; vertical-align: middle; }

/* === Окно настроек кампании: служебные классы (без PHP внутри style) === */
.cs-overlay { display: none; }
.cs-overlay.open { display: flex; }
.cfx-details { display: none; }
.cfx-details.open { display: block; }
.cfx-item.cfx-neg { border-left-color: #ff4444; }
.cfx-item.cfx-pos { border-left-color: #4a6cf7; }
.cfx-neg .cfx-name { color: #ff4444; }
.cfx-pos .cfx-name { color: #4a6cf7; }
.cfx-field {
    width: 100%; padding: 8px; background: #1e1e2f; border: 1px solid #555;
    color: white; border-radius: 4px; box-sizing: border-box;
}
.is-invisible { visibility: hidden; }

/* Отступ между кнопками сверху и карточками персонажей */
.top-gap { clear: both; height: 18px; }
/* === Быстрая правка на карточке: HP, врем. HP, изменение скорости === */
.quick-row {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px;
    margin: 0 0 10px 0;
}
.quick-row label {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 10px; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px;
}
.quick-row input {
    width: 120px; margin: 0; padding: 6px 8px; box-sizing: border-box;
    background: #1e1e2f; border: 1px solid #555; border-radius: 6px; color: #fff; font-weight: bold;
}
.quick-row .quick-turns input { width: 60px; }

/* Кнопка "Скрыть?" / "Скрыто" */
.hide-btn { background: #35354a; color: #ddd; }
.hide-btn:hover { background: #45455f; }
.hide-btn.is-hidden-on { background: #ffffff; color: #1e1e2f; font-weight: bold; }
.hide-btn.is-hidden-on:hover { background: #e2e2ea; }

/* Выбор кампании в редакторе (перенос персонажа) */
.camp-select {
    width: 100%; margin-bottom: 10px; padding: 6px; box-sizing: border-box;
    background: rgba(255,255,255,0.1); border: none; border-radius: 8px;
    color: #fff; font-family: 'Tektur', sans-serif; font-size: 14px;
}
.camp-select option { background: #2c2c3e; color: #fff; }

/* Блоки "+ ..." сворачиваются по клику на заголовок */
.add-block h4 { cursor: pointer; user-select: none; }
.add-block h4::before { content: '▾ '; font-size: 11px; }
.add-block.collapsed h4 { margin-bottom: 0; }
.add-block.collapsed h4::before { content: '▸ '; }
.add-block.collapsed > *:not(h4) { display: none; }

/* Подсказка переменных: тег, значение и что он означает */
.var-chip.var-named {
    display: grid; grid-template-columns: auto 1fr; gap: 0 5px; text-align: left; padding: 4px 6px;
}
.var-tag { font-family: monospace; color: #7791fb; }
.var-chip.var-named b { text-align: right; }
.var-title { grid-column: 1 / -1; font-size: 10px; color: #aaa; }
.var-chip.var-named:hover .var-tag, .var-chip.var-named:hover .var-title { color: #fff; }
/* === Сворачиваемые списки (ресурсы, скиллы, инвентарь, эффекты) === */
h3.sec-toggle { cursor: pointer; user-select: none; }
h3.sec-toggle::before { content: '▾ '; font-size: 12px; opacity: 0.8; }
h3.sec-toggle.sec-closed::before { content: '▸ '; }

/* === Скилл на других: выбор целей === */
.skill-targets {
    display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center;
    margin: 4px 0 8px 0; padding: 6px 8px; font-size: 13px;
    background: rgba(0,0,0,0.25); border: 1px solid #3c3c52; border-radius: 8px;
}
.skill-targets .st-title { font-size: 11px; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px; }
.skill-targets.need-target { border-color: #ff4444; box-shadow: 0 0 10px rgba(255,68,68,0.5); }
.skill-stat-input { color: #7791fb !important; font-size: 16px !important; }

/* ===================================================== */
/* === ТЕЛЕФОНЫ И УЗКИЕ ЭКРАНЫ                      === */
/* ===================================================== */
@media (max-width: 820px) {
    body { zoom: 1 !important; }
    .container { margin: 10px auto !important; padding: 10px !important; max-width: 100% !important; }
    h1 { font-size: 24px; margin-bottom: 16px; }
    .section { padding: 12px; }
    .btn { padding: 10px 12px; font-size: 15px; }

    /* Шапка карточки: всё в одну колонку */
    .card-head {
        grid-template-columns: 1fr;
        grid-template-areas: "avatar" "panels" "info";
        column-gap: 0; row-gap: 10px;
    }
    .card-head-avatar { text-align: center; }
    .avatar-img { width: 150px !important; height: 150px !important; }
    .card-panels { flex-direction: column; }
    .card-panels > * { width: 100% !important; flex: 0 0 auto !important; }
    .so-wgrid { flex: 0 0 auto; }

    /* Кнопки не разъезжаются из-за float, а переносятся по строкам */
    .container a.btn, .container button.btn { float: none !important; margin-right: 8px !important; margin-bottom: 8px !important; }
    h3 { line-height: 1.6; }
    .so-stats { grid-template-columns: repeat(3, 1fr); }
    .so-wgrid { justify-content: flex-start; }
    .so-weapon { max-width: none; }
    .dp-dice { grid-template-columns: repeat(4, 1fr); }

    /* Редактор: одна колонка вместо трёх, ничего не вылезает за экран */
    .edit-layout-wrapper { flex-direction: column; min-width: 0; }
    .character-grid { grid-template-columns: minmax(0, 1fr); flex: 1 1 auto; width: 100%; min-width: 0; }
    .skill-details-panel { flex: 1 1 auto; min-width: 0; width: 100%; box-sizing: border-box; }
    .block, .block form, .block > div { min-width: 0; }
    input, select, textarea { max-width: 100%; box-sizing: border-box; }
    .cost-row, .weapon-row, .quick-row { flex-wrap: wrap; }
    .cost-row > *, .weapon-row > *, .cost-row input, .cost-row select, .weapon-row input { min-width: 0; }
    .player-header-stats { flex-wrap: wrap; gap: 10px 16px; }
    .section { overflow-x: hidden; }
    .ab-grid { grid-template-columns: 1fr; }
    .ab-grid.ab-row-layout { grid-template-columns: repeat(2, 1fr); }

    /* Быстрая правка: поля в два ряда на всю ширину */
    .quick-row label { flex: 1 1 46%; }
    .quick-row input, .quick-row .quick-turns input { width: 100%; }
    .quick-row .btn { flex: 1 1 100%; }

    /* Карточки бросков и окна */
    #diceTray { left: 8px; right: 8px; bottom: 8px; }
    .dice-card { width: 100%; padding: 10px 12px; }
    .dc-total { font-size: 34px; }
    .dc-sub .dc-total { font-size: 28px; }
    .cs-box { width: 100%; max-width: 100%; padding: 14px; }
    .cs-overlay { padding: 12px 8px; }
    .var-help { width: calc(100vw - 60px); max-width: 320px; }
    .fx-tip { width: calc(100vw - 80px); max-width: 300px; }

    /* Плашка аккаунта не перекрывает заголовок */
    #userBadge { position: static !important; margin: 8px; justify-content: center; }
}

@media (max-width: 520px) {
    .ab-grid.ab-row-layout { grid-template-columns: 1fr; }
    .quick-row label { flex: 1 1 100%; }
    .so-stats { grid-template-columns: repeat(3, 1fr); }
    h1 { font-size: 20px; }
}
/* Скилл, у которого кончились использования */
.btn.skill-out { background: #3a3a4a !important; color: #888; cursor: not-allowed; }
.btn.skill-out:hover { transform: none; background: #3a3a4a !important; }

@media (max-width: 820px) {
    /* Главная: кнопки ролей друг под другом, а не в один ряд */
    body.choice-page, html.choice-page { overflow: auto !important; height: auto !important; }
    .choice-container {
        flex-direction: column; height: auto !important; width: auto !important;
        padding: 12px; gap: 12px;
    }
    .choice-btn { height: auto; min-height: 140px; font-size: 22px; padding: 14px; }
    .choice-icon, .choice-icon2 {
        width: auto !important; max-width: 55%; max-height: 14vh; margin-top: 10px;
    }

    /* Выбор персонажа у игрока */
    .campaign-wrapper { margin: 10px auto !important; padding: 0 12px !important; }
    .campaign-btn { padding: 16px !important; font-size: 16px !important; letter-spacing: 1px !important; }
    .char-list { grid-template-columns: 1fr !important; }
}

/* === Реакции игроков === */
.react-rule {
    font-size: 12px; color: #aaa; line-height: 1.5; margin: 0 0 8px 0;
    border-left: 3px solid #ffd36e; padding-left: 8px;
}
.react-area {
    width: 100%; box-sizing: border-box; min-height: 90px; margin-bottom: 8px;
    background: #1e1e2f; border: 1px solid #555; border-radius: 8px; color: #eee;
    padding: 10px; font-family: 'Tektur', sans-serif; font-size: 14px; resize: vertical;
}
.react-saved {
    background: rgba(0,0,0,0.25); border: 1px solid #555; border-left: 3px solid #4a6cf7;
    border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.react-saved.react-sent { border-left-color: #00c853; }
.react-status {
    display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    font-size: 11px; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.react-text { font-size: 14px; color: #eee; line-height: 1.5; word-break: break-word; }

/* Реакции у Мастера */
.react-box { border: 1px solid #ffd36e; }
.react-card {
    background: rgba(0,0,0,0.25); border: 1px solid #3c3c52; border-left: 3px solid #ffd36e;
    border-radius: 8px; padding: 10px 12px; margin-bottom: 10px;
    display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.react-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; width: 100%; }
.react-from { color: #ffd36e; font-weight: bold; font-size: 16px; }
.react-time { color: #888; font-size: 12px; }

/* Строки ресурсов/оружия: при нехватке места переносятся, а не сжимаются */
.block .weapon-row, .block .cost-row { flex-wrap: wrap; }
.block input, .block select { min-width: 0; }

/* Связь физ. ресурса с предметом инвентаря */
.phys-link {
    flex: 1.2; min-width: 0; padding: 4px; box-sizing: border-box;
    background: #1e1e2f; border: 1px solid #555; border-radius: 6px;
    color: #7791fb; font-family: 'Tektur', sans-serif; font-size: 12px;
}
.phys-link option { background: #2c2c3e; color: #fff; }
