/* Продвинутая партия (05.10): панель героя, бросок d20, мини-игры, картинки мастера, итоги хода.
   Только токены темы (themes.js): --gold, --surface, --surface-2, --text, --text-2, --text-3, --border,
   --ok, --rose, --warn — у всех 13 тем свои значения, отдельной палитры здесь нет. */

/* --- «Новая партия»: переключатель ------------------------------------------------------------ */
.adv-new { margin-top: 22px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius, 14px);
  background: color-mix(in srgb, var(--surface) 82%, transparent); }
.adv-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.adv-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.adv-switch-knob { flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--surface-2);
  border: 1px solid var(--border-strong, var(--border)); position: relative; transition: background .2s; }
.adv-switch-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-2); transition: transform .2s, background .2s; }
.adv-switch input:checked + .adv-switch-knob { background: color-mix(in srgb, var(--gold) 45%, var(--surface-2)); }
.adv-switch input:checked + .adv-switch-knob::after { transform: translateX(18px); background: var(--gold); }
.adv-switch input:focus-visible + .adv-switch-knob { outline: 2px solid var(--gold); outline-offset: 2px; }
.adv-switch-text { display: flex; flex-direction: column; gap: 2px; }
.adv-switch-text b { font-size: 1rem; color: var(--text); }
.adv-switch-sub { font-size: .86rem; color: var(--text-2); }
.adv-new-opts { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.adv-new-label { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.adv-check { display: flex; gap: 10px; align-items: center; font-size: .92rem; color: var(--text-2); margin-top: 6px; }
.adv-check input { width: 18px; height: 18px; accent-color: var(--gold); }
.adv-price { margin-top: 4px; }

/* --- Панель героя ----------------------------------------------------------------------------- */
/* z-index 1 (было 5, 22.10): полоса героя ниже поля ввода (.igra-input-bar, 2) и ниже липкой панели партии (30): при встрече она уходит под них, а не закрывает «Что вы делаете?».
   is-loose - места мало (клавиатура, низкий экран): полоса не липнет, едет с лентой (adv-ui.js placeSticky). */
.adv-panel.is-loose { position: static; }
.adv-panel { position: sticky; top: 8px; z-index: 1; margin: 6px 0 14px; border: 1px solid var(--border);
  border-radius: var(--radius, 14px); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 22px rgba(0,0,0,.18); }
.adv-panel.is-docked { border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: transparent; }
.adv-panel-head { all: unset; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  width: 100%; padding: 10px 14px; cursor: pointer; }
.adv-panel-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: inherit; }
.adv-lvl { font-weight: 700; color: var(--gold); font-size: .95rem; white-space: nowrap; }
.adv-ac { font-size: .82rem; color: var(--text-2); white-space: nowrap; }
/* Окно «Мастер» в начатой продвинутой партии (29.10): мастера не меняют, строка - надпись без выбора и без галочки */
.adv-master-fixed { cursor: default; }
.adv-master-fixed:hover { background: inherit; }
.adv-npc-cap { display: flex; align-items: center; gap: .4rem; list-style: none; margin: .35rem 0 0; font-size: .82rem; color: var(--text-2); }
.adv-bar { position: relative; flex: 1 1 110px; min-width: 96px; height: 18px; border-radius: 9px; overflow: hidden;
  background: color-mix(in srgb, var(--text) 10%, transparent); }
.adv-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; transition: width .5s ease; }
.adv-bar span { position: relative; display: block; text-align: center; font-size: .74rem; line-height: 18px; color: var(--text);
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.adv-bar.is-hp i { background: linear-gradient(90deg, #b8323a, #e0545b); }
.adv-bar.is-xp i { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 70%, #000), var(--gold)); }
.adv-bar.is-foe { flex: 1 1 90px; height: 14px; }
.adv-bar.is-foe span { line-height: 14px; font-size: .68rem; }
.adv-bar.is-foe i { background: linear-gradient(90deg, #6d2a2a, #a84444); }
.adv-badge { font-size: .72rem; padding: 2px 8px; border-radius: 999px; font-weight: 600; letter-spacing: .03em; }
.adv-badge.is-fight { background: color-mix(in srgb, #c0392b 25%, transparent); color: var(--text); border: 1px solid #c0392b; }
.adv-badge.is-down { background: color-mix(in srgb, var(--text-3) 30%, transparent); color: var(--text); }
.adv-panel-body { display: none; padding: 0 14px 14px; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.adv-panel.is-open .adv-panel-body { display: grid; max-height: min(calc(100vh - 260px), 520px); overflow: auto; }
.adv-sec h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 6px 0 8px; }
.adv-item, .adv-skill, .adv-enemy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 6px 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 70%, transparent); font-size: .9rem; }
.adv-item b, .adv-skill b, .adv-enemy b { color: var(--text); font-weight: 600; }
.adv-item small, .adv-skill small, .adv-enemy small { color: var(--text-2); font-size: .8rem; }
.adv-item.is-on b::after { content: " ◆"; color: var(--gold); font-size: .7em; }
.adv-enemy { align-items: center; }
.adv-enemy.is-dead { opacity: .45; text-decoration: line-through; }
.adv-type { font-size: .68rem; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2);
  text-transform: uppercase; letter-spacing: .04em; }
.adv-type.t-оружие { color: #e8a87c; } .adv-type.t-броня { color: #8fb3d9; } .adv-type.t-расходник { color: #8fd19e; }
.adv-type.t-квест { color: var(--gold); }
.adv-empty { font-size: .86rem; color: var(--text-3); margin: 0; }
.adv-log p { margin: 0 0 4px; font-size: .82rem; color: var(--text-2); }

/* --- Итоги хода под пузырём мастера ----------------------------------------------------------- */
.adv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -10px; }
.adv-chip { font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text-2); }
.adv-chip.is-ok { border-color: color-mix(in srgb, var(--ok, #4caf50) 70%, transparent); color: var(--text); }
.adv-chip.is-fail { border-color: color-mix(in srgb, var(--rose, #e05555) 70%, transparent); color: var(--text); }
.adv-chip.is-item, .adv-chip.is-xp, .adv-chip.is-skill { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
/* шкала опыта программы (05.10 вечер): новый уровень и награда уровня — заметнее обычной строки */
.adv-chip.is-reward { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.adv-chip.is-levelup { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--text); font-weight: 600; }
.adv-levelup { border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 10px; padding: 4px 10px 8px;
  background: color-mix(in srgb, var(--gold) 9%, transparent); }
.adv-levelup h3 { color: var(--gold); }
.adv-levelup p { margin: 0; font-size: .88rem; color: var(--text-2, var(--text)); }
.adv-meta { font-size: .8rem; color: var(--text-3); margin: 6px 0 0; }
.adv-chip.is-wait { font-style: italic; animation: adv-pulse 1.2s ease-in-out infinite; }
@keyframes adv-pulse { 50% { opacity: .5; } }

/* --- Картинка мастера ------------------------------------------------------------------------- */
.adv-figure { margin: 0; align-self: flex-start; max-width: min(100%, 420px); border-radius: var(--radius, 14px); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); box-shadow: 0 8px 26px rgba(0,0,0,.25); }
.adv-figure img { display: block; width: 100%; height: auto; cursor: zoom-in; aspect-ratio: 1 / 1; object-fit: cover; }
.adv-figure figcaption { font-size: .8rem; color: var(--text-2); padding: 6px 10px; font-style: italic; }
.adv-figure.is-big { max-width: 100%; }
/* плашка «Картинка готова ↓»: деталь пришла, а игрок читает выше (21.10) */
.adv-ready-pill { position: fixed; left: 50%; transform: translateX(-50%); z-index: 40; padding: 7px 14px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--border-strong)); background: var(--surface-2); color: var(--text);
  font: 600 .82rem var(--pt-ui, inherit); box-shadow: 0 4px 16px rgba(0,0,0,.35); cursor: pointer; }
.adv-ready-pill:hover, .adv-ready-pill:focus-visible { border-color: var(--gold); outline: none; }
.adv-figure.is-big img { cursor: zoom-out; }
/* Сцена (z-image) над рассказом: без подписи. Пока рисуется, место под неё занято квадратом - текст не прыгает, когда картинка
   приходит; деталь (GPT, ~70 с) под рассказом ждёт тонкой полосой с подписью «Мастер рисует…» */
.adv-figure.is-scene { margin-bottom: 2px; }
.adv-figure.is-wait { width: min(100%, 420px); }
.adv-figure.is-wait .adv-figure-ph { background: color-mix(in srgb, var(--text-2) 14%, transparent); animation: adv-pulse 1.4s ease-in-out infinite; }
.adv-figure.is-wait.is-scene .adv-figure-ph { aspect-ratio: 1 / 1; }
.adv-figure.is-wait.is-detail .adv-figure-ph { height: 44px; }
.adv-figure.is-wait figcaption { font-style: italic; }

/* --- Бросок d20 -------------------------------------------------------------------------------- */
.adv-roll { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: adv-in .18s ease-out; pointer-events: none; padding: 16px; text-align: center; }
.adv-roll.is-out { opacity: 0; transition: opacity .25s; }
.adv-roll-cap { color: #fff; font-size: 1.05rem; max-width: 30ch; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.adv-die { position: relative; width: 132px; height: 132px; color: var(--gold); transition: transform .08s linear;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.adv-die svg { width: 100%; height: 100%; }
.adv-die-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.6rem;
  font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.adv-roll-res { min-height: 1.4em; color: #fff; font-size: 1rem; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.adv-roll.is-ok .adv-die { color: #6fd38a; } .adv-roll.is-fail .adv-die { color: #ef6b6b; }
.adv-roll.is-crit .adv-die { animation: adv-crit .6s ease-out; }
@keyframes adv-crit { 30% { transform: scale(1.25); } }
@keyframes adv-in { from { opacity: 0; } }

/* --- Мини-игры --------------------------------------------------------------------------------- */
.adv-mg { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: 90vh; overflow: auto;
  width: min(92vw, 460px); padding: 20px; border: 1px solid var(--border); border-radius: var(--radius, 14px);
  background: var(--surface); color: var(--text); }
.adv-mg::backdrop { background: rgba(0,0,0,.55); }
.adv-mg-title { margin: 0 0 10px; }
.adv-mg-body { display: flex; flex-direction: column; gap: 12px; }
.adv-mg-lead { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.adv-mg-q { margin: 0; font-size: 1.05rem; line-height: 1.45; }
.adv-mg-input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong, var(--border));
  background: var(--surface-2); color: var(--text); }
.adv-mg-choices { display: flex; flex-direction: column; gap: 8px; }
.adv-mg-choice { text-align: left; justify-content: flex-start; }
.adv-mg-choice.is-picked { outline: 2px solid var(--gold); }
.adv-mg-bar { position: relative; height: 34px; border-radius: 10px; background: var(--surface-2); overflow: hidden;
  border: 1px solid var(--border); }
.adv-mg-zone { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--gold) 55%, transparent);
  border-left: 2px solid var(--gold); border-right: 2px solid var(--gold); }
.adv-mg-mark { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: var(--text);
  box-shadow: 0 0 10px var(--text); }
.adv-mg-bar.is-ok { border-color: #6fd38a; } .adv-mg-bar.is-fail { border-color: #ef6b6b; }
.adv-mg-go { min-height: 48px; font-size: 1.05rem; }
.adv-mg-note { margin: 0; color: var(--text-2); font-size: .9rem; min-height: 1.2em; }

@media (max-width: 560px) {
  .adv-panel { top: 4px; margin: 4px 0 10px; }
  .adv-panel-head { padding: 8px 10px; gap: 6px 8px; }
  .adv-bar { flex-basis: 84px; min-width: 76px; }
  .adv-ac { display: none; }
  .adv-die { width: 112px; height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .adv-bar i, .adv-die { transition: none; }
  .adv-chip.is-wait, .adv-roll, .adv-roll.is-crit .adv-die, .adv-figure.is-wait .adv-figure-ph { animation: none; }
}

/* Мастера продвинутой партии: карточки с образом (22.10, владелец: «красивые мастера»). Основа - .igra-model-item
   (рамка, заливка выбранного, наведение и правки 13 тем в themes.css действуют сами), здесь - раскладка и образ.
   Цвет текста только токены темы; образ лежит своей картинкой, поэтому контраст подписей от неё не зависит.
   Выбор не двигает разметку: рамка выбранной рисуется box-shadow, а не толщиной, картинка меняет только яркость. */
.adv-mcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 2px 0 6px; }
@media (min-width: 900px) { .adv-mcards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.adv-mcard { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; min-height: 0; }
.adv-mcard-art { position: relative; display: block; flex: none; aspect-ratio: 4 / 3; overflow: hidden; background: #0b0a10; }
.adv-mcard-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%;
  filter: saturate(.78) brightness(.86); transition: filter .2s ease, transform .35s ease; }
.adv-mcard:hover .adv-mcard-img, .adv-mcard:focus-visible .adv-mcard-img { filter: saturate(.95) brightness(.98); transform: scale(1.03); }
.adv-mcard[aria-checked="true"] .adv-mcard-img { filter: none; }
.adv-mcard-art::after { content: ""; position: absolute; inset: auto 0 0 0; height: 38%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.45)); }
.adv-mcard .adv-mcard-tick { position: absolute; top: 8px; right: 8px; bottom: auto; width: 24px; height: 24px; font-size: .84rem; z-index: 1;
  background: rgba(8,8,12,.6); border-color: rgba(255,255,255,.55); color: #fff; }
.adv-mcard[aria-checked="true"] .adv-mcard-tick { color: var(--on-gold, #1a1206); }
.adv-mcard-body { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 9px 12px 12px; min-width: 0; flex: 1; }
.adv-mcard-body .igra-model-rec { align-self: flex-start; }
.adv-mcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.adv-mcard-name { font-size: 1.06rem; font-weight: 700; color: var(--text); line-height: 1.2; overflow-wrap: anywhere; }
.adv-mcard-note { font-size: .8rem; line-height: 1.35; color: var(--text-2); overflow-wrap: anywhere; }
.adv-mcard-note:empty { display: none; }
/* цена: число и капля, капля цвета акцента темы */
.adv-ink { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.adv-ink b { font-weight: 800; }
.adv-ink .ink-drop { flex: none; color: var(--gold-t, var(--gold)); }
.adv-mcard-price { flex: none; font-size: 1rem; color: var(--text); }
.adv-mcard-price .ink-drop { width: 15px; height: 15px; }
/* окно «Мастер» в партии: образ слева, как миниатюра */
.adv-mthumb { flex: none; align-self: center; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: #0b0a10;
  border: 1px solid color-mix(in srgb, var(--border-strong) 80%, transparent); }
.adv-mthumb-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%; }
.igra-model-item[aria-checked="true"] .adv-mthumb { border-color: var(--gold); }
.igra-model-price.adv-ink { font-size: .86rem; color: var(--text); }
/* «Картинки хода: +10 (капля) за ход»: строка у переключателя и под списком мастеров, пояснение за кружком «!» */
.adv-imgcost { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.adv-imgcost .adv-ink { color: var(--text); }
.adv-imgcost-li { grid-column: 1 / -1; display: flex; padding: 2px 4px 0; font-size: .86rem; color: var(--text-2); }
/* «Кубик, инвентарь, бои» — общее у всех мастеров продвинутой партии: одна строка над списком (app.js, renderModelList) */
.adv-masters-common { margin: 0 0 8px; padding: 0 4px; font-size: .86rem; color: var(--text-2); }
.adv-check-text { cursor: pointer; }
@media (max-width: 520px) {
  /* телефон: одна колонка, образ слева квадратом, текст справа - подписи не режутся, прокрутки вбок нет */
  .adv-mcards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .adv-mcard { flex-direction: row; }
  .adv-mcard-art { width: 104px; aspect-ratio: auto; align-self: stretch; min-height: 104px; }
  .adv-mcard .adv-mcard-tick { top: 6px; right: 6px; width: 22px; height: 22px; font-size: .78rem; }
  .adv-mcard-body { padding: 8px 12px 10px; justify-content: center; }
}
/* Кнопка «Начать · N (капля) за ход» (22.10): число меняется при выборе мастера и картинок, а кнопки стоят на месте - ширина с запасом под «35» */
#startGameBtn.is-priced { white-space: nowrap; font-variant-numeric: tabular-nums; }
#startGameBtn .adv-start-price { color: inherit; }
#startGameBtn .adv-start-price .ink-drop { color: currentColor; width: 14px; height: 14px; }
#startPriceInfo { align-self: center; }
@media (min-width: 521px) { #startGameBtn.is-priced { min-width: 15rem; justify-content: center; } }
#startGameBtn .adv-start-label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#startGameBtn .adv-start-label .adv-ink { gap: 3px; }

/* Картинки хода раздельно (22.10): две строки-переключателя «Сцена +5» и «Деталь +5» в форме новой партии и в меню у поля ввода */
.adv-imgrows { display: block; }
.adv-imgrows[hidden] { display: none; }
.adv-imgrow { margin-top: 8px; }
.adv-imgrow .ink-price, .adv-imgrow .adv-ink { color: var(--text); }
.adv-imgmenu {
  position: fixed; z-index: 80; width: 250px; max-width: calc(100vw - 16px); box-sizing: border-box;
  padding: 10px 12px 12px 14px; border-radius: var(--radius-sm, 12px); color: var(--text);
  border: 1px solid var(--pt-frame, var(--border-strong)); background-color: var(--bg);
  background-image: var(--pt-sheen), linear-gradient(165deg, var(--surface-2, var(--surface)), var(--surface));
  box-shadow: 0 12px 34px -8px rgba(0,0,0,.7), 0 0 24px -10px var(--pt-glow), inset 0 1px 0 var(--pt-edge);
  font-family: var(--pt-ui);
}
.adv-imgmenu-title { margin: 0 0 2px; font-weight: 700; font-size: .84rem; color: var(--text-2); }
.adv-imgmenu .adv-imgrow { margin-top: 10px; }

/* --- «На сцене» (28.10): scenecards.js. Цвета только токены темы. Подложки сплошные: замер контраста (kontrast_sostoyaniya, экраны
   partiya-na-stsene*) нашёл, что на полупрозрачной панели над задником темы --text-2 и --text-3 не дотягивают до 4,5:1; полоса
   здоровья - тонкая, число стоит рядом на подложке карточки, а не поверх красной заливки --- */
.adv-badge.is-scene { background: var(--surface-2); color: var(--text); border: 1px solid var(--text-2); }
.adv-scene { --r-common: #9aa1ab; --r-unc: #3fb36b; --r-rare: #4f8fee; --r-epic: #a76df2; --r-leg: #f0902a; --r-story: #e8c24c;
  padding: 6px 8px 8px; border-radius: 10px; background: var(--surface); }
.adv-scene h3 { color: var(--text); }
.sc-list { display: flex; flex-direction: column; gap: 8px; }
.sc-card { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border: 1px solid var(--text-2); border-radius: 10px;
  background: var(--surface-2); color: var(--text); cursor: pointer; }
.sc-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.sc-card.is-enemy { border-color: #c0392b; }
.sc-card.is-dead { border-style: dashed; }
.sc-card.is-dead .sc-name { text-decoration: line-through; }
.sc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sc-name { color: var(--text); font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.sc-badge { font-size: .72rem; padding: 1px 8px; border-radius: 999px; font-weight: 600; background: var(--surface); color: var(--text); border: 1px solid var(--text-2); }
.sc-badge.is-foe { border-color: #c0392b; }
.sc-desc { margin: 0; font-size: .8rem; line-height: 1.35; color: var(--text); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-card.is-open .sc-desc { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.sc-hp { display: flex; align-items: center; gap: 8px; }
.sc-hp-bar { position: relative; flex: 1 1 auto; height: 6px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--text) 18%, var(--surface-2)); }
.sc-hp-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: #d9534f; }
.sc-card.is-enemy .sc-hp-bar i { background: #a84444; }
.sc-hp-n { flex: 0 0 auto; font-size: .76rem; font-variant-numeric: tabular-nums; color: var(--text); }
.sc-items { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.sc-cell { --c: var(--r-common); box-sizing: border-box; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--c); border-radius: 5px; background: var(--surface); color: var(--text);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.sc-cell.r-unc { --c: var(--r-unc); } .sc-cell.r-rare { --c: var(--r-rare); } .sc-cell.r-epic { --c: var(--r-epic); }
.sc-cell.r-leg { --c: var(--r-leg); } .sc-cell.r-story { --c: var(--r-story); }
/* «Добавить к себе» (этап 3): в раскрытой карточке; сплошной фон, без opacity на состояниях (занято - пунктир) */
.sc-act { display: none; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.sc-card.is-open .sc-act { display: flex; }
.sc-add { min-height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--text-2); background: var(--surface); color: var(--text); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.sc-add[aria-busy="true"] { border-style: dashed; cursor: default; }
.sc-add-msg { font-size: .76rem; color: var(--text); overflow-wrap: anywhere; }
.sc-add-msg:empty { display: none; }
.psh-advwrap { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

/* --- Герой погиб (29.10, adv-ui.js renderDeath) ----------------------------------------------------------------------
   Окно: тёмная карточка игры (dialog.avatar-gen) с тёмно-красным краем; причина и две кнопки. Полоса: на месте поля ввода (само поле скрыто),
   высота как у капсулы ввода (min-height), чтобы лента и низ экрана не прыгали, когда поле сменяется полосой. */
.igra-input-bar.is-dead .igra-composer, #screen-game .igra-input-bar.is-dead .igra-composer { display: none; }   /* второй селектор - против ekran.css (телефон) */
.adv-death { display: flex; align-items: center; gap: 12px; box-sizing: border-box; min-height: 76px; padding: 12px 14px; border-radius: 22px;
  border: 1px solid color-mix(in srgb, #c0392b 55%, var(--border-strong, var(--border))); color: var(--text);
  background: linear-gradient(170deg, color-mix(in srgb, #c0392b 14%, var(--surface)), var(--surface)), var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.adv-death[hidden] { display: none; }
.adv-death-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.adv-death-text b { font-size: 1rem; }
.adv-death-text span { font-size: .86rem; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.adv-death .btn { flex: none; }
dialog.adv-death-dialog { border-color: color-mix(in srgb, #c0392b 60%, var(--border-strong, var(--border))); text-align: center; }
.adv-death-eyebrow { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3, var(--text-2)); }
.adv-death-title { margin: 0 0 12px; font-size: 1.6rem; line-height: 1.2; color: var(--text); }
.adv-death-reason { margin: 0 0 20px; color: var(--text-2); font-style: italic; overflow-wrap: anywhere; }
.adv-death-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 420px) { .adv-death { flex-direction: column; align-items: stretch; text-align: center; } .adv-death .btn { width: 100%; } }

/* --- Подсказки (30.10, hints-ui.js): точка, метка «новый», облачко. Всё поверх и в углу: соседей не двигает ------------------------------ */
.adv-lvl.has-dot, .adv-badge.has-dot, .psh-lvl.has-dot, .psh-inv.has-dot { position: relative; }   /* .ainv-toggle уже absolute: position ему не трогаем */
.rs-dot { position: absolute; top: -4px; right: -4px; z-index: 3; box-sizing: border-box; width: 12px; height: 12px; border-radius: 50%;
  background: #e5484d; border: 2px solid var(--surface, #14141f); pointer-events: none; }
.rs-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #e5484d; opacity: .55; animation: rs-pulse 1.9s ease-out infinite; }
.rs-dot.is-urgent { width: 15px; height: 15px; top: -5px; right: -5px; }
/* у «Ур. N» точка стояла на тексте (на 320 и 360 перекрывала «Ур. 2» на 26 %, линейка 29.10): уголок выше текста и правее, размер и поток те же */
.adv-lvl > .rs-dot, .psh-lvl > .rs-dot { top: -11px; right: -7px; }
.rs-dot.is-urgent::before { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 9px/1 system-ui, sans-serif; }
@media (max-width: 700px) { #screen-game .adv-panel .ainv-toggle.has-dot { position: relative; top: auto; right: auto; } }   /* на телефоне сумка в потоке полосы (ekran.css: static), точке нужен свой угол */
@keyframes rs-pulse { 0% { transform: scale(.7); opacity: .65; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rs-dot::after { animation: none; opacity: .35; } }
.sc-card { position: relative; }
.rs-new { position: absolute; top: -8px; right: 10px; z-index: 2; padding: 1px 8px; border-radius: 999px; background: #e5484d; color: #fff; font-size: .68rem; font-weight: 700; line-height: 1.5; letter-spacing: .02em; pointer-events: none; }
.adv-chip.is-link { cursor: pointer; font: inherit; font-size: .8rem; color: var(--text); background: transparent; text-decoration: underline dotted; text-underline-offset: 3px; }
.adv-chip.is-link:hover, .adv-chip.is-link:focus-visible { background: color-mix(in srgb, var(--gold) 14%, transparent); }
#advInv.is-ping .ainv-frame { animation: rs-ping 1.1s ease-out 1; }
@keyframes rs-ping { 0% { filter: drop-shadow(0 0 0 rgba(229,72,77,0)); } 30% { filter: drop-shadow(0 0 14px rgba(229,72,77,.9)); } 100% { filter: drop-shadow(0 6px 24px rgba(0,0,0,.6)); } }
@media (prefers-reduced-motion: reduce) { #advInv.is-ping .ainv-frame { animation: none; outline: 2px solid #e5484d; } }
.rs-bubble { position: fixed; z-index: 90; display: flex; align-items: flex-start; gap: 8px; box-sizing: border-box; width: max-content; max-width: min(250px, calc(100vw - 16px));
  padding: 8px 10px; border-radius: 12px; background: #1b1b2b; color: #eceaf8; border: 1px solid #5a5a8a; box-shadow: 0 6px 20px rgba(0,0,0,.5);
  font-size: .8rem; line-height: 1.3; pointer-events: none; opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }
.rs-bubble.is-in { opacity: 1; transform: none; }
.rs-bubble-i { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #a9a2ff; color: #a9a2ff; font-size: .7rem; font-weight: 700; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .rs-bubble { transition: none; } }

/* --- Возможности партии (30.10) -------------------------------------------------------------------------------------------------------- */
.adv-cap-row { display: flex; align-items: center; gap: 8px; min-height: 38px; flex-wrap: nowrap; }
.adv-cap-row .igra-switch { flex: 1 1 auto; min-width: 0; }
.adv-cap-row.is-locked { color: var(--text-2); }
.adv-cap-lock { flex: none; width: 20px; text-align: center; font-size: .85rem; }
.adv-cap-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 3px 0; }
.adv-cap-name { font-weight: 600; }
.adv-cap-sub { font-size: .78rem; color: var(--text-2); overflow-wrap: anywhere; }
.adv-caps-new { display: flex; flex-direction: column; }

/* --- Рисунки темы вместо пустых мест панели и экрана гибели (advart.js) -------------------------------------------------------------- */
.adv-art-svg { display: block; width: 100%; height: 100%; }
.adv-death-art { position: relative; width: min(210px, 62%); aspect-ratio: 1; margin: 0 auto 8px; }
.adv-death-art .adv-art-svg { position: absolute; inset: 0; }
.adv-death-art .adv-art-svg:first-child { opacity: .5; filter: saturate(.55); }
dialog.adv-death-dialog { color: var(--a-tx, var(--text)); border: 2px solid var(--a-bd, #5a5a8a); border-radius: 18px;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--a-g, #534AB7) 38%, var(--a-bg, #0f0f1a)), var(--a-bg, #0f0f1a) 72%);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--a-bd, #5a5a8a) 45%, transparent), 0 18px 60px rgba(0,0,0,.65); }
dialog.adv-death-dialog::backdrop { background: rgba(4, 3, 8, .78); }
dialog.adv-death-dialog .adv-death-eyebrow { color: var(--a-tx3, var(--text-2)); }
dialog.adv-death-dialog .adv-death-title { color: var(--a-val, var(--text)); letter-spacing: .03em; }
dialog.adv-death-dialog .adv-death-reason { color: var(--a-tx2, var(--text-2)); }
.adv-death-msg { margin: 10px 0 0; min-height: 0; color: #ff9a9a; font-size: .85rem; }
.adv-death-msg:empty { display: none; }
.adv-death-btns { display: flex; flex: none; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 420px) { .adv-death-btns { flex-direction: column; } .adv-death-btns .btn { width: 100%; } }
