/* Dice Tavern — оформление. Тёмное дерево, пергамент только для документов, кованые рамки у главного. */
:root {
  --bg: #1C130D; --bg2: #241910; --panel: #2A1D14; --panel2: #33251A; --line: #3A2A1C; --line2: #4A3524;
  --edge: #6B4A2E; --edge2: #8A6A3E;
  --ink: #F3E6C8; --ink2: #E9D7B4; --muted: #CDB894; --muted2: #8A7458; --hi: #FFE2AE;
  --parch: #F3E6C8; --parch2: #EADBB8; --pink: #2B1D12; --pmuted: #5C4733; --pline: #D8C49C;
  --amber: #E8A33D; --amber2: #C98A2B; --rust: #7A3B22; --rust2: #8A3A24; --red: #C2523A; --red2: #E58A6E;
  --green: #4E7A3A; --green2: #6E9A52; --green3: #9CC97A; --blue: #3E5C7A; --teal: #1F3A3A; --teal2: #2E5A5A;
  --serif: 'Alegreya', Georgia, serif; --sans: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --master: 17px; --text: 15px; --small: 13px;
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --nav-h: 64px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .7 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --pgrain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.ts-s { --master: 15.5px; --text: 14px; }
body.ts-l { --master: 19px; --text: 16.5px; --small: 14px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg) var(--grain); color: var(--ink); font-family: var(--sans); font-size: var(--text);
  line-height: 1.35; display: flex; flex-direction: column; overscroll-behavior: none;
  height: var(--tg-viewport-stable-height, 100dvh); -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
a { color: #F0C27A; }
.serif { font-family: var(--serif); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: var(--small); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: lining-nums tabular-nums; }
.ico { width: 22px; height: 22px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 30px; height: 30px; }

/* ------------------------------------------------------------------ каркас */
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg) var(--grain);
  will-change: transform, opacity;
}
.screen.in-right { animation: inRight .26s cubic-bezier(.2,.8,.2,1) both; }
.screen.out-right { animation: outRight .22s ease-in both; z-index: 2; }
.screen.in-fade { animation: inFade .2s ease-out both; }
.screen.out-left { animation: outLeft .26s ease both; }
.screen.in-left { animation: inLeft .24s cubic-bezier(.2,.8,.2,1) both; }
@keyframes inRight { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes outRight { to { transform: translateX(32px); opacity: 0; } }
@keyframes outLeft { to { transform: translateX(-14px); opacity: .0; } }
@keyframes inLeft { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes inFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none !important; } }

.top { flex-shrink: 0; padding: calc(var(--safe-top) + 12px) 16px 8px; }
.top h1 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 30px; line-height: 1.05; color: var(--hi); }
.top .sub { font-size: var(--small); color: var(--muted); margin-top: 3px; }
.top .h-row { display: flex; align-items: baseline; gap: 10px; }
.top.compact h1 { font-size: 21px; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 20px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { display: none; }
.bottom {
  flex-shrink: 0; padding: 10px 16px calc(var(--safe-bottom) + 12px); display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(to bottom, rgba(28,19,13,0), var(--bg) 18px);
}
.bottom .pair { display: flex; gap: 10px; }
.bottom .pair > * { flex: 1; }
.note { font-size: 12.5px; color: var(--muted2); text-align: center; }

/* нижние вкладки */
#tabs {
  flex-shrink: 0; height: calc(var(--nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: #1A110B;
  transition: transform .2s ease;
}
#tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #B8A27E; font-size: 12px; }
#tabs button.on { color: var(--amber); font-weight: 700; }
#tabs button svg { width: 23px; height: 23px; }
#tabs button:active svg { transform: scale(.9); }

/* ------------------------------------------------------------------ кнопки */
.btn {
  min-height: 52px; border-radius: 14px; padding: 8px 16px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-weight: 700; font-size: 16.5px; text-align: center; line-height: 1.15;
  transition: transform .08s ease, filter .15s ease, background .15s ease; user-select: none;
}
.scroll > .btn, .bottom > .btn, .card > .btn, .sh-actions .btn, .stage-card > .btn { width: 100%; }
.btn:active:not(:disabled) { transform: scale(.97); filter: brightness(1.08); }
.btn small { font-size: 12.5px; font-weight: 500; opacity: .85; margin-top: 2px; }
.btn-main { background: var(--amber); color: var(--pink); box-shadow: 0 2px 0 #9A6418, 0 6px 16px rgba(232,163,61,.18); }
.btn-main:disabled { background: #6A4E2A; color: #2B1D12; box-shadow: none; opacity: .7; }
.btn-rust { background: var(--rust); color: var(--ink); }
.btn-ghost { border: 1px solid var(--edge); color: var(--ink); background: rgba(0,0,0,.12); }
.btn-ghost.light { border-color: #A88B63; color: var(--pink); background: transparent; }
.btn-small { min-height: 40px; border-radius: 10px; font-size: 14.5px; padding: 6px 12px; }
.btn.danger { color: var(--red2); border-color: #6B2E22; }
.btn .sp { display: inline-flex; gap: 6px; align-items: center; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(43,29,18,.35);
  border-top-color: var(--pink); animation: spin .7s linear infinite;
}
.btn-ghost.loading::after { border-color: rgba(243,230,200,.25); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.forged { position: relative; border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px #B79C74, 0 6px 18px rgba(0,0,0,.45); }
.rivet { position: absolute; width: 8px; height: 8px; border-radius: 4px; background: radial-gradient(circle at 35% 35%, #E9C890, #8A6A3E 60%, #4A3524); pointer-events: none; }
.rivet.tl { top: -5px; left: -5px; } .rivet.tr { top: -5px; right: -5px; } .rivet.bl { bottom: -5px; left: -5px; } .rivet.br { bottom: -5px; right: -5px; }
.link { color: var(--hi); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--edge); background: var(--panel); }
.icon-btn:active { transform: scale(.94); }

/* ------------------------------------------------------------------ поверхности */
.parch { background-color: var(--parch); background-image: var(--pgrain); color: var(--pink); }
.card { background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 14px; }
.card.dashed { border-style: dashed; background: transparent; }
.pcard { border-radius: 14px; padding: 12px 14px; }
.wood { background-color: #2E2016; background-image: var(--grain), repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 38px, rgba(0,0,0,.10) 38px 40px, rgba(0,0,0,0) 40px 97px, rgba(255,226,174,.03) 97px 99px); }
.section { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; gap: 10px; }
.section h2 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 20px; color: var(--hi); }
.section .aside { font-size: 13px; color: var(--muted); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted2); }
.parch .kicker { color: var(--rust); }
.badge { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.badge.free { background: var(--green); color: var(--ink); }
.badge.paid { background: var(--amber); color: var(--pink); }
.badge.out { border: 1px solid #8A7458; color: var(--muted); }
.badge.red { background: var(--rust2); color: var(--ink); }
.badge.dark { background: #2B1D12; color: var(--hi); }
.parch .badge.out { border-color: #A88B63; color: var(--pmuted); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; }
.pill.green { background: var(--green); color: var(--ink); }
.pill.soft { background: rgba(0,0,0,.08); color: var(--pmuted); font-weight: 500; }
.pill.amber { background: #EED29A; color: #6B4A1E; font-weight: 500; }

.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--edge); background: rgba(0,0,0,.12);
  color: var(--ink); font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: transform .08s ease, background .15s ease;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--amber); border-color: var(--amber); color: var(--pink); }
.parch .chip { border-color: #A88B63; color: var(--pink); background: transparent; }
.parch .chip.on { background: var(--amber); border-color: var(--amber); }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); }
.seg button { flex: 1; min-height: 40px; border-radius: 10px; font-weight: 700; font-size: 14.5px; color: var(--muted); padding: 4px 6px; line-height: 1.1; }
.seg button.on { background: var(--amber); color: var(--pink); }
.seg button small { display: block; font-size: 12px; font-weight: 500; }
.progress { display: flex; gap: 5px; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line2); }
.progress span.on { background: var(--amber); }
.bar { height: 6px; border-radius: 3px; background: #4A3524; overflow: hidden; }
.parch .bar { background: #D8C49C; }
.bar > i { display: block; height: 100%; background: var(--green2); border-radius: 3px; transition: width .5s ease; }
.bar > i.low { background: var(--red); }
.bar > i.amber { background: var(--amber); }
.hint {
  background: #1F3436; border: 1px solid #3E6B6B; border-radius: 14px; padding: 12px 14px; color: #DDEBE6; font-size: 14.5px;
}
.hint b { color: #FFFFFF; }
.hint .h { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }

/* поля */
.field {
  width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--edge); background: #1F150E; color: var(--ink);
  padding: 10px 14px; font-family: var(--serif); font-size: 19px; font-weight: 700; outline: none;
}
.field:focus { border-color: var(--amber); }
.field::placeholder { color: #7D6A50; font-weight: 500; }
textarea.field { font-family: var(--sans); font-size: 15px; font-weight: 500; resize: none; }

/* аватары */
.ava { position: relative; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #FFE8C2; overflow: hidden; }
.ava > i { display: block; width: 66%; height: 66%; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ava.letter { font-family: var(--serif); font-weight: 800; }
.ava.dash { border: 2px dashed #8A6A3E; background: transparent !important; color: #A88B63; }
.ava.ring { box-shadow: 0 0 0 2px var(--amber); }
.stack { display: flex; }
.stack .ava { border: 2px solid var(--parch); margin-left: -8px; }
.stack .ava:first-child { margin-left: 0; }

/* ------------------------------------------------------------------ шторка снизу */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-wrap .shade { position: absolute; inset: 0; background: rgba(8,5,3,.55); animation: inFade .2s ease both; }
.sheet {
  position: relative; max-height: 86%; display: flex; flex-direction: column; border-radius: 20px 20px 0 0;
  background: var(--panel) var(--grain); border-top: 1px solid var(--edge); box-shadow: 0 -10px 30px rgba(0,0,0,.5);
  animation: sheetUp .26s cubic-bezier(.2,.8,.2,1) both; padding-bottom: var(--safe-bottom);
}
.sheet.parch { background-color: var(--parch); background-image: var(--pgrain); border-top-color: #B79C74; }
.sheet.closing { animation: sheetDown .2s ease-in both; }
.sheet-wrap.closing .shade { animation: outFade .2s ease both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes outFade { to { opacity: 0; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #6B4A2E; margin: 8px auto 4px; flex-shrink: 0; }
.sheet .sh-head { padding: 6px 18px 4px; display: flex; align-items: center; gap: 12px; }
.sheet .sh-head h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 21px; color: var(--hi); }
.sheet.parch .sh-head h3 { color: var(--pink); }
.sheet .sh-body { overflow-y: auto; padding: 6px 18px 16px; }
.sheet .sh-actions { padding: 6px 18px 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.sheet .sh-actions > * { flex: 1 1 40%; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.opt:last-child { border-bottom: 0; }
.opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #8A7458; flex-shrink: 0; }
.opt.on .radio { border-color: var(--amber); box-shadow: inset 0 0 0 5px var(--panel), inset 0 0 0 12px var(--amber); }
.opt b { display: block; }
.opt small { color: var(--muted); font-size: 13px; }

/* тост */
#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 90px); z-index: 80; padding: 12px 16px; border-radius: 14px;
  background: #3A2A1C; border: 1px solid var(--edge); color: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.5);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: all .2s ease; font-size: 14.5px;
}
#toast.on { transform: none; opacity: 1; }
#toast.good { border-color: var(--green); }

/* ------------------------------------------------------------------ меню и вкладки */
.logo-row { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + 10px) 16px 6px; flex-shrink: 0; }
.logo-row .name { flex: 1; font-family: var(--serif); font-weight: 800; font-size: 24px; color: var(--hi); }
.me-btn { width: 44px; height: 44px; border-radius: 22px; border: 2px solid var(--amber); padding: 0; }
.continue { border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.continue .t { font-family: var(--serif); font-weight: 800; font-size: 19px; line-height: 1.15; }
.continue .s { font-size: 13.5px; color: var(--pmuted); }
.continue .myturn { color: var(--rust); font-weight: 700; }
.adv {
  width: 100%; min-height: 76px; border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--panel); border: 1px solid var(--edge); margin-bottom: 10px; transition: transform .1s ease;
}
.adv:active { transform: scale(.985); }
.adv.soon { background: transparent; border-style: dashed; }
.adv .cover { width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--hi); }
.adv .t { font-family: var(--serif); font-weight: 800; font-size: 17px; color: var(--hi); display: block; line-height: 1.15; }
.adv.soon .t { color: #CDB894; }
.adv .m { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }
.adv.soon .m { color: #8A7458; }
.table-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); text-align: left; margin-bottom: 8px; }

/* Зал героев */
.hero-card { border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.hero-card .head { display: flex; align-items: center; gap: 12px; }
.hero-card .nm { font-family: var(--serif); font-weight: 800; font-size: 20px; line-height: 1.1; }
.hero-card .cl { font-size: 14px; }
.parch .cl { color: var(--pmuted); }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stats4 > div { border-radius: 10px; background: var(--parch2); text-align: center; padding: 6px 2px; }
.stats4 b { display: block; font-family: var(--serif); font-size: 21px; line-height: 1.05; }
.stats4 span { font-size: 12.5px; color: var(--pmuted); }
.fallen { background: var(--panel); border: 1px solid var(--edge); }
.fallen .epi { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--hi); line-height: 1.35; }
.kv3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv3 span { display: block; font-size: 12.5px; color: var(--muted2); }
.kv3 b { font-size: 14.5px; }
.chron { border-top: 1px solid var(--line2); padding-top: 8px; font-size: 14px; }
.chron div { margin: 3px 0; }
.mini-hero { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; margin-bottom: 10px; text-align: left; }

/* магазин */
.free-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); }
.sub-card { border-radius: 16px; padding: 14px 16px; border: 3px solid var(--amber); display: flex; flex-direction: column; gap: 6px; }
.sub-card .title { display: flex; align-items: baseline; justify-content: space-between; }
.sub-card .title b { font-family: var(--serif); font-weight: 800; font-size: 22px; }
.sub-card .title span { font-family: var(--serif); font-weight: 800; font-size: 22px; color: var(--rust); }
.check-li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check-li svg { flex-shrink: 0; margin-top: 2px; }
.pack-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack { position: relative; border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); padding: 12px; text-align: center; }
.pack b { display: block; font-family: var(--serif); font-size: 30px; color: var(--hi); line-height: 1; }
.pack .stars { color: var(--amber); font-weight: 700; margin-top: 8px; }
.pack .off { position: absolute; top: -8px; right: 8px; }
.dice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dice-card { border-radius: 12px; border: 1px solid var(--edge); background: var(--panel); padding: 10px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dice-card .stars { color: var(--amber); font-weight: 700; font-size: 14px; }

/* оформление */
.preview-stage { position: relative; height: 180px; display: flex; align-items: center; justify-content: space-around; border-top: 2px solid #3A2A1C; border-bottom: 2px solid #3A2A1C; }
.preview-stage .tag { position: absolute; bottom: 10px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: #1C130D; color: var(--ink); border: 1px solid var(--edge); }
.cos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cos-grid.two { grid-template-columns: 1fr 1fr; }
.cos {
  border-radius: 12px; border: 1px solid var(--edge); background: var(--panel); padding: 8px 4px 6px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; text-align: center; min-height: 104px; justify-content: space-between;
}
.cos .n { font-size: 13px; font-weight: 700; line-height: 1.1; }
.cos .p { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 8px; }
.cos .p.free { color: var(--muted); }
.cos .p.price { background: var(--amber); color: var(--pink); }
.cos .p.ach { border: 1px solid #8A7458; color: var(--muted); }
.cos .p.sel { background: var(--green); color: var(--ink); }
.cos .p.try { background: var(--amber); color: var(--pink); }
.cos.selected { border: 2px solid var(--green2); }
.cos.trying { border: 2px solid var(--amber); }
.cos.locked { opacity: .78; }
.cos.locked .ava { background: transparent !important; border: 2px dashed #6B4A2E; }

/* настройки */
.group-label { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted2); margin: 18px 4px 6px; }
.list { border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); overflow: hidden; }
.list > * { width: 100%; min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15.5px; }
.list > *:last-child { border-bottom: 0; }
.list .v { margin-left: auto; color: var(--muted); font-size: 14.5px; display: flex; align-items: center; gap: 6px; text-align: right; }
.list .danger { color: var(--red2); }
.toggle { margin-left: auto; width: 46px; height: 28px; border-radius: 14px; background: #4A3524; position: relative; flex-shrink: 0; transition: background .15s ease; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #8A7458; transition: all .18s ease; }
.toggle.on { background: var(--amber); }
.toggle.on::after { left: 21px; background: #2B1D12; }
.profile-head { display: flex; align-items: center; gap: 14px; padding: 4px 2px 6px; }
.legal { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ------------------------------------------------------------------ создание героя */
.c-head { display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-top) + 6px) 16px 4px; }
.c-head .lbl { flex: 1; font-size: 14px; color: var(--muted); }
.c-title { margin: 12px 0 10px; font-family: var(--serif); font-weight: 800; font-size: 27px; color: var(--hi); line-height: 1.1; }
.race-big { border-radius: 16px; overflow: hidden; border: 3px solid var(--amber); margin-bottom: 10px; }
.race-big .art { position: relative; height: 120px; }
.race-big .ok { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 14px; background: var(--amber); display: flex; align-items: center; justify-content: center; }
.race-big .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.race-big h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 23px; }
.trait { font-size: 14.5px; line-height: 1.3; }
.trait b { font-weight: 700; }
.race-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--edge); margin-bottom: 8px; text-align: left; }
.race-row .t { font-family: var(--serif); font-weight: 800; font-size: 18px; color: var(--hi); display: block; }
.race-row .m { font-size: 13.5px; color: var(--muted); }
.race-row .asi { color: var(--amber); font-weight: 700; font-size: 13px; white-space: nowrap; }
.class-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.class-tile { min-height: 116px; border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.class-tile.on { background: var(--parch); color: var(--pink); border: 3px solid var(--amber); }
.class-tile .t { font-family: var(--serif); font-weight: 800; font-size: 19px; color: var(--hi); }
.class-tile.on .t { color: var(--pink); }
.class-tile .r { font-size: 13.5px; color: var(--muted); }
.class-tile.on .r { color: var(--pmuted); }
.class-tile .d { font-size: 13px; color: var(--muted); }
.class-tile.on .d { color: var(--pmuted); }
.class-detail { border-radius: 16px; padding: 14px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.class-detail h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 21px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 14.5px; }
.kv span { color: var(--pmuted); }
.lvls { border-top: 1px dashed #B79C74; padding-top: 8px; font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.ab-row { display: flex; align-items: center; gap: 8px; min-height: 56px; border-radius: 12px; padding: 6px 12px; margin-bottom: 8px; }
.ab-row.key { box-shadow: 0 0 0 2px var(--amber); }
.ab-row .nm { width: 108px; font-weight: 700; font-size: 15.5px; line-height: 1.1; }
.ab-row .nm small { display: block; font-size: 12px; color: var(--rust); font-weight: 700; }
.step-btn { width: 36px; height: 36px; border-radius: 18px; border: 1px solid #A88B63; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--pink); background: rgba(255,255,255,.25); }
.step-btn:disabled { opacity: .35; }
.ab-row .val { width: 30px; text-align: center; font-weight: 700; font-size: 17px; }
.ab-row .race { width: 34px; text-align: center; color: var(--green); font-weight: 700; font-size: 14px; }
.ab-row .tot { margin-left: auto; text-align: right; line-height: 1; }
.ab-row .tot b { display: block; font-family: var(--serif); font-size: 21px; }
.ab-row .tot span { font-size: 12.5px; color: var(--pmuted); }
.ab-cols { display: flex; font-size: 12.5px; color: var(--muted2); padding: 0 12px 6px; }
.budget { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: #241910; margin: 10px 0 8px; }
.budget b { font-family: var(--serif); font-size: 22px; color: var(--green3); }
.budget b.over { color: var(--red2); }
.checklist { border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); overflow: hidden; }
.checklist > button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.checklist > button:last-child { border-bottom: 0; }
.checklist .box { width: 22px; height: 22px; border-radius: 5px; border: 2px solid #8A7458; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.checklist .on .box { background: var(--amber); border-color: var(--amber); }
.checklist .locked { opacity: .6; }
.checklist .locked .box { background: #8A7458; border-color: #8A7458; }
.checklist .t { flex: 1; min-width: 0; }
.checklist .t small { display: block; color: var(--muted); font-size: 13px; }
.checklist .r { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 10px; white-space: nowrap; border: 1px solid #8A7458; color: var(--muted); }
.tag.damage { background: #8A3A24; color: var(--ink); border-color: #8A3A24; }
.tag.heal { background: var(--green); color: var(--ink); border-color: var(--green); }
.radio-card { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); margin-bottom: 8px; text-align: left; }
.radio-card.on { border: 2px solid var(--amber); }
.radio-card .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #8A7458; flex-shrink: 0; }
.radio-card.on .radio { border-color: var(--amber); box-shadow: inset 0 0 0 4px var(--panel), inset 0 0 0 11px var(--amber); }
.radio-card .big { margin-left: auto; text-align: center; line-height: 1; }
.radio-card .big b { font-family: var(--serif); font-size: 22px; display: block; }
.radio-card .big span { font-size: 12px; color: var(--muted); }
.spell-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spell-tile { border-radius: 12px; border: 1px solid var(--edge); background: var(--panel); padding: 8px 10px; text-align: left; min-height: 58px; }
.spell-tile.on { background: var(--parch); color: var(--pink); border: 2px solid var(--amber); }
.spell-tile b { display: block; font-size: 15px; line-height: 1.15; }
.spell-tile small { font-size: 12.5px; color: var(--muted); }
.spell-tile.on small { color: var(--pmuted); }
.spell-tile.fixed { border-style: dashed; background: transparent; }
.qa { display: grid; grid-template-columns: 128px 1fr; gap: 6px 12px; font-size: 15px; }
.qa span { color: var(--muted); }
.qa button { text-align: left; color: var(--ink); border-bottom: 1px dashed #6B4A2E; padding-bottom: 2px; }
.story-card { border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.story-card p { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.4; }
.story-chip { display: inline-block; background: #E6D3AB; border-radius: 10px; padding: 4px 10px; font-size: 13.5px; margin: 0 6px 6px 0; }
.stat-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat-boxes > div { border-radius: 12px; border: 1px solid var(--edge); background: var(--panel); text-align: center; padding: 8px 2px; }
.stat-boxes b { display: block; font-family: var(--serif); font-size: 22px; color: var(--hi); line-height: 1.05; }
.stat-boxes span { font-size: 12px; color: var(--muted); line-height: 1.1; display: block; }
.ab6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 6px 0; }
.ab6 > div { text-align: center; border-radius: 8px; background: var(--parch2); padding: 4px 0; }
.ab6 span { display: block; font-size: 11px; font-weight: 700; color: var(--pmuted); }
.ab6 b { font-family: var(--serif); font-size: 17px; }
.ab6 small { display: block; font-size: 11px; color: var(--pmuted); }
.sum-card { border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.sum-card ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.4; }
.sum-card h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 19px; }

/* ------------------------------------------------------------------ стол */
.table-screen { background: var(--bg); }
.scene-art { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--safe-top) + 150px); overflow: hidden; pointer-events: none; }
.scene-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(28,19,13,.55), rgba(28,19,13,0) 35%, rgba(28,19,13,.25) 70%, var(--bg)); }
.t-head { position: relative; z-index: 2; padding: calc(var(--safe-top) - var(--tg-content-safe-area-inset-top, 0px)) 12px 0; flex-shrink: 0; }
.t-title { min-height: max(48px, var(--tg-content-safe-area-inset-top, 0px)); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.12; padding: 0 84px; }
.t-title b { font-family: var(--serif); font-weight: 800; font-size: 17px; color: var(--hi); text-shadow: 0 1px 6px #000; }
.t-title span { font-size: 13px; color: var(--ink2); text-shadow: 0 1px 4px #000; }
.t-title .own-back { position: absolute; left: 12px; top: calc(var(--safe-top) - var(--tg-content-safe-area-inset-top, 0px) + 6px); }
.band { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px; flex-shrink: 0; min-height: 60px; }
.band .enemies { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; }
.band .enemies::-webkit-scrollbar { display: none; }
.enemy {
  height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 4px; border-radius: 22px; background: rgba(28,19,13,.82);
  border: 1px solid #8A3A24; flex-shrink: 0; transition: opacity .3s ease;
}
.enemy.down { opacity: .45; border-color: #4A3524; }
.enemy .tok { width: 34px; height: 34px; border-radius: 17px; background: #4A2418; color: #E9D7B4; display: flex; align-items: center; justify-content: center; }
.enemy .tok i { width: 24px; height: 24px; display: block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.enemy b { font-size: 13px; line-height: 1; display: block; margin-bottom: 4px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enemy .bar { width: 52px; height: 4px; }
.enemy .bar > i { background: var(--red); }
.round-btn { width: 44px; height: 44px; border-radius: 22px; background: rgba(28,19,13,.82); border: 1px solid var(--edge); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.place-band { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 6px 12px; min-height: 40px; }
.feed { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 8px;
  background: radial-gradient(120% 60% at 0% 100%, rgba(232,163,61,.07), rgba(232,163,61,0) 60%), radial-gradient(120% 60% at 100% 100%, rgba(232,163,61,.07), rgba(232,163,61,0) 60%); }
.feed::-webkit-scrollbar { display: none; }
.earlier { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 10px; border: 1px dashed var(--line2); color: var(--muted); font-size: 14px; text-align: left; width: 100%; }
.rollline { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: rgba(42,29,20,.75); color: var(--ink2); text-align: left; width: 100%; font-size: 14px; line-height: 1.3; animation: rise .3s ease both; }
.rollline .d20 { flex-shrink: 0; }
.rollline b.ok { color: var(--green3); } .rollline b.bad { color: var(--red2); }
.rollline.mine { box-shadow: inset 2px 0 0 var(--amber); }
.master {
  border-radius: 6px; padding: 14px 16px; color: var(--pink); display: flex; flex-direction: column; gap: 8px; margin-top: 4px;
  animation: rise .35s ease both;
}
.master .who { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 800; font-size: 15px; color: var(--rust); }
.master p { margin: 0; font-family: var(--serif); font-size: var(--master); line-height: 1.42; white-space: pre-wrap; }
.master.old { padding: 10px 12px; opacity: .85; }
.master.old p { font-size: 15px; }
.bubble-me { align-self: flex-end; max-width: 85%; background: #3A2A1C; border: 1px solid var(--line2); border-radius: 14px 14px 4px 14px; padding: 8px 12px; font-size: 15px; animation: rise .25s ease both; }
.bubble-me .nm { font-size: 12px; color: var(--muted2); font-weight: 700; display: block; }
.ev-line { font-size: 13.5px; color: var(--muted); text-align: center; padding: 2px 10px; }
.thinking { align-self: flex-start; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 6px 2px; }
.thinking i { width: 7px; height: 7px; border-radius: 4px; background: var(--amber); animation: blink 1.2s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .2s; } .thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.howto { border-radius: 12px; border: 1px dashed var(--edge); padding: 10px 12px; font-size: 14px; color: var(--ink2); }
.howto b { color: var(--hi); display: block; margin-bottom: 2px; }

.dock { position: relative; z-index: 3; flex-shrink: 0; border-top: 2px solid var(--edge); box-shadow: 0 -8px 20px rgba(0,0,0,.4); padding: 10px 12px calc(var(--safe-bottom) + 10px); display: flex; flex-direction: column; gap: 8px; }
.partybar { display: flex; gap: 6px; }
.seat {
  flex: 1; min-width: 0; height: 56px; border-radius: 12px; border: 1px solid var(--edge); background: #241910; padding: 4px 2px 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; position: relative; transition: box-shadow .25s ease;
}
.seat.turn { box-shadow: 0 0 0 2px var(--amber), 0 0 16px rgba(232,163,61,.55); animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 2px var(--amber), 0 0 24px rgba(232,163,61,.75); } }
.seat .hp { font-size: 13px; font-weight: 700; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.seat .bar { width: 34px; height: 4px; }
.seat .cond { position: absolute; top: 1px; right: 6px; width: 16px; height: 16px; border-radius: 8px; background: var(--rust2); font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.seat.down { opacity: .55; }
.seat.lvl::before { content: ""; position: absolute; top: 3px; left: 6px; width: 8px; height: 8px; border-radius: 4px; background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.tool-btn { width: 50px; flex: 0 0 50px; height: 56px; border-radius: 12px; border: 1px solid var(--edge); background: #2B1D12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--ink2); }
.tool-btn:active { transform: scale(.95); }
.tool-btn .dot { position: absolute; }
.actions-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px; padding: 0 12px; }
.actions-row::-webkit-scrollbar { display: none; }
.act {
  flex-shrink: 0; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 22px;
  border: 1px solid #A88B63; background: #3A2A1C; color: var(--ink); white-space: nowrap; font-size: 15px; font-weight: 700;
  transition: transform .08s ease;
}
.act:active { transform: scale(.96); }
.act .w { font-size: 13px; color: var(--muted); font-weight: 500; }
.act .p { font-size: 15px; color: var(--amber); font-weight: 700; }
.act.idea { background: transparent; border-color: var(--edge); font-weight: 500; }
.act.level { background: var(--amber); color: var(--pink); border-color: var(--amber); }
.composer { display: flex; gap: 8px; align-items: center; }
.composer input { flex: 1; min-width: 0; height: 48px; border-radius: 24px; border: 1px solid var(--edge); background: #1F150E; padding: 0 16px; font-size: 16px; color: var(--ink); outline: none; }
.composer input:focus { border-color: var(--amber); }
.composer input::placeholder { color: #8A7458; }
.send {
  width: 52px; height: 52px; border-radius: 26px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #FFD58A, #E8A33D 55%, #B8741E); box-shadow: 0 0 0 2px #6B4A2E, 0 0 0 4px #E9C890, 0 4px 14px rgba(232,163,61,.4);
  transition: transform .1s ease;
}
.send:active { transform: scale(.92) rotate(-12deg); }
.send:disabled { filter: grayscale(.6) brightness(.7); }
.send.arrow { background: var(--amber); box-shadow: none; }
.dock.typing .partybar { display: none; }
.mode-btns { display: flex; gap: 10px; }
.mode-btns > * { flex: 1; }
.myturn-banner { text-align: center; font-size: 13.5px; color: var(--muted); }
.myturn-banner b { color: var(--hi); }

/* панели режимов */
.panel { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.town-top { position: relative; margin: 0 -12px; height: calc(var(--safe-top) + 176px); overflow: hidden; }
.town-top .ttl { position: absolute; left: 16px; right: 70px; top: calc(var(--safe-top) + 8px); }
.town-top .ttl b { font-family: var(--serif); font-weight: 800; font-size: 28px; color: var(--hi); text-shadow: 0 2px 10px #000; line-height: 1.05; display: block; }
.town-top .ttl span { font-size: 14px; color: var(--ink2); text-shadow: 0 1px 4px #000; }
.rank-card { border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.rank-card .h { display: flex; justify-content: space-between; align-items: baseline; }
.rank-card .h b { font-family: var(--serif); font-weight: 800; font-size: 18px; color: var(--hi); }
.board-btn { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 14px; background: var(--amber); color: var(--pink); text-align: left; box-shadow: 0 2px 0 #9A6418; }
.board-btn b { font-family: var(--serif); font-weight: 800; font-size: 18px; display: block; }
.board-btn:active { transform: scale(.985); }
.tiles3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 92px; }
.tile b { font-family: var(--serif); font-weight: 800; font-size: 16.5px; color: var(--hi); }
.tile span { font-size: 13px; color: var(--muted); line-height: 1.2; }
.tile:active { transform: scale(.97); }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.res { border-radius: 12px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; text-align: left; min-height: 62px; }
.res b { display: block; font-size: 14.5px; line-height: 1.15; }
.res span { font-size: 13px; color: var(--pmuted); }
.res .ava .shopdot { position: absolute; }
.shop-dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 7px; background: var(--amber); border: 2px solid var(--parch); }
.rumor { border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); padding: 12px 14px; display: flex; gap: 10px; font-size: 14.5px; }
.pot { border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pot .heroes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pot .heroes > div { border-radius: 10px; background: var(--parch2); text-align: center; padding: 4px; }
.pot .heroes > div.me { background: #EED29A; }
.pot .heroes > div.zero { background: #8A3A24; color: var(--ink); }
.pot .heroes b { display: block; font-family: var(--serif); font-size: 19px; }
.pot .heroes span { font-size: 12.5px; }
.stage-steps { display: grid; gap: 6px; }
.stage-steps .lbl { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.stage-steps .lbl span { color: var(--muted2); }
.stage-steps .lbl span.done, .stage-steps .lbl span.cur { color: var(--ink); }
.stage-steps .seg4 { display: grid; gap: 6px; }
.stage-steps .seg4 i { height: 5px; border-radius: 3px; background: var(--line2); }
.stage-steps .seg4 i.done { background: var(--green2); } .stage-steps .seg4 i.cur { background: var(--amber); } .stage-steps .seg4 i.fail { background: var(--red); }
.result-card { border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.stage-card { border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.stage-card h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 21px; }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.whobtn { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border: 1px solid #C9B288; background: var(--parch2); min-height: 48px; text-align: left; }
.whobtn.on { border: 2px solid var(--pink); box-shadow: 0 0 0 1px var(--amber); background: #EED29A; }
.whobtn b { flex: 1; font-size: 15px; }
.whobtn .bn { font-weight: 800; font-family: var(--serif); font-size: 17px; }
.whobtn:disabled { opacity: .6; }
.approach { min-height: 34px; padding: 4px 12px; border-radius: 16px; border: 1px solid #A88B63; font-size: 14px; font-weight: 700; color: var(--pink); background: transparent; }
.approach.on { background: var(--pink); color: var(--hi); }
.approach.own { border-style: dashed; font-weight: 500; color: var(--pmuted); }
.floors { display: flex; gap: 8px; align-items: center; }
.floors i { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; font-family: var(--serif); font-size: 18px; border: 1px solid var(--edge); color: var(--muted2); }
.floors i.done { background: var(--green); color: var(--ink); border-color: var(--green); }
.floors i.cur { background: var(--amber); color: var(--pink); border-color: var(--amber); }
.floors i.boss { border: 2px solid var(--red); color: var(--red2); }
.room { width: 100%; border-radius: 14px; padding: 10px 12px; display: flex; gap: 12px; text-align: left; align-items: flex-start; }
.room.done { background: var(--panel); border: 1px solid var(--line2); opacity: .7; }
.room .door { width: 48px; height: 56px; border-radius: 24px 24px 6px 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.room h4 { margin: 0; font-size: 17px; font-family: var(--serif); font-weight: 800; display: flex; gap: 8px; align-items: center; }
.room p { margin: 2px 0; font-size: 14px; line-height: 1.3; }
.room .det { font-size: 13.5px; font-weight: 700; }
.npc-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); }
.npc-card b { font-size: 16px; display: block; }
.att { text-align: right; font-size: 13px; font-weight: 700; }
.att .meter { display: flex; gap: 3px; margin-top: 4px; justify-content: flex-end; }
.att .meter i { width: 18px; height: 5px; border-radius: 3px; background: #4A3524; }
.att .meter i.r { background: var(--red); } .att .meter i.a { background: var(--amber); } .att .meter i.g { background: var(--green2); }
.att.hostile { color: var(--red2); } .att.indifferent { color: var(--amber); } .att.friendly { color: var(--green3); }

/* ------------------------------------------------------------------ бросок кубика */
.roll-screen { align-items: center; text-align: center; padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 14px); background: radial-gradient(60% 40% at 50% 30%, #2E2016, var(--bg)); }
.roll-screen .ctx { font-size: 13.5px; color: var(--muted); }
.roll-screen h2 { margin: 4px 0 2px; font-family: var(--serif); font-weight: 800; font-size: 25px; color: var(--hi); line-height: 1.15; }
.die-wrap { position: relative; width: 210px; height: 210px; margin: 14px auto 6px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle, rgba(232,163,61,.12), rgba(232,163,61,0) 65%); }
.die { width: 190px; height: 190px; position: relative; }
.die svg { width: 100%; height: 100%; }
.die .face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 800; font-size: 54px; color: var(--hi); padding-top: 14px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.die.rolling { animation: tumble .55s linear infinite; }
.die.landed { animation: land .45s cubic-bezier(.2,1.6,.4,1) both; }
.die.idle { animation: bob 2.2s ease-in-out infinite; }
@keyframes tumble { 0% { transform: rotate(0) scale(1); } 25% { transform: rotate(90deg) scale(.92); } 50% { transform: rotate(180deg) scale(1.02); } 75% { transform: rotate(270deg) scale(.94); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes land { 0% { transform: scale(1.25) rotate(-20deg); } 100% { transform: none; } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.die.crit .face { color: #FFF3CF; text-shadow: 0 0 18px #E8A33D; }
.die.fumble .face { color: #E58A6E; }
.sum { font-family: var(--serif); font-weight: 800; font-size: 30px; color: var(--ink); }
.verdict { display: inline-block; margin: 6px 0 8px; padding: 6px 14px; border-radius: 14px; font-weight: 700; font-size: 15.5px; }
.verdict.ok { background: #8CC06A; color: #1C2A12; } .verdict.bad { background: #C2523A; color: #FFF0E6; }
.breakdown { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.breakdown span { font-size: 13px; padding: 5px 10px; border-radius: 12px; background: #2E2016; border: 1px solid var(--line2); color: var(--ink2); }
.tap-hint { font-weight: 700; color: var(--hi); font-size: 17px; margin-top: 6px; }
.tap-hint small { display: block; font-weight: 500; color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.big-die-btn { width: 150px; height: 150px; border-radius: 50%; background: #241910; box-shadow: 0 0 0 5px var(--amber), inset 0 0 0 8px #1C130D; display: flex; align-items: center; justify-content: center; margin: 22px auto 10px; }
.big-die-btn:active { transform: scale(.95); }

/* итоги */
.big-ico { width: 120px; height: 120px; border-radius: 60px; border: 3px solid var(--amber); display: flex; align-items: center; justify-content: center; margin: 4px auto 14px; background: #2A1D14; }
.results-title { font-family: var(--serif); font-weight: 800; font-size: 34px; color: var(--hi); text-align: center; margin: 0; }
.xp-row { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.xp-row b { width: 72px; font-size: 15px; }
.xp-row .bar { flex: 1; height: 8px; }
.xp-row .v { font-size: 13px; color: var(--pmuted); min-width: 90px; text-align: right; }
.boxes3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.boxes3 > div { border-radius: 14px; text-align: center; padding: 10px 4px; }
.boxes3 b { display: block; font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.boxes3 span { font-size: 13px; color: var(--pmuted); }
.lvl-banner { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--amber); color: var(--pink); text-align: left; }
.lvl-banner .n { width: 34px; height: 34px; border-radius: 17px; background: var(--pink); color: var(--amber); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 800; font-size: 18px; }

/* лист, рюкзак, дневник */
.sheet-top { padding: calc(var(--safe-top) + 6px) 12px 10px; background: #1A110B; flex-shrink: 0; }
.sheet-top .hd { display: flex; align-items: center; gap: 14px; }
.sheet-top .nm { font-family: var(--serif); font-weight: 800; font-size: 26px; color: var(--hi); line-height: 1.05; }
.stat4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.stat4 > div { border-radius: 12px; border: 1px solid var(--edge); text-align: center; padding: 6px 2px; }
.stat4 b { display: block; font-family: var(--serif); font-size: 21px; line-height: 1.1; }
.stat4 span { font-size: 12.5px; color: var(--muted); line-height: 1.1; display: block; }
.tabs-line { display: flex; gap: 2px; border-bottom: 1px solid #C9B288; overflow-x: auto; padding: 0 8px; flex-shrink: 0; }
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line button { padding: 14px 10px 12px; font-size: 15px; color: var(--pmuted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs-line button.on { color: var(--pink); font-weight: 700; border-bottom-color: var(--rust); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 24px; }
.ab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ab-grid > button { border-radius: 12px; border: 1px solid #C9B288; background: #F7EDD5; padding: 6px 4px; text-align: center; }
.ab-grid span { display: block; font-size: 12.5px; font-weight: 700; color: var(--pmuted); letter-spacing: .04em; }
.ab-grid b { display: block; font-family: var(--serif); font-size: 26px; line-height: 1.05; }
.ab-grid small { font-size: 12px; color: var(--pmuted); }
.p-section { font-family: var(--serif); font-weight: 800; font-size: 19px; color: var(--rust); margin: 14px 0 6px; }
.p-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid #C9B288; background: #F7EDD5; margin-bottom: 6px; text-align: left; }
.p-item b { display: block; font-size: 16px; }
.p-item small { font-size: 13px; color: var(--pmuted); }
.p-item .hit { font-family: var(--serif); font-weight: 800; font-size: 19px; color: var(--rust); }
.p-item .dmg { font-weight: 700; font-size: 15px; min-width: 52px; text-align: right; }
.skill-row { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid #E2D2AE; font-size: 15px; }
.skill-row .dot { width: 10px; height: 10px; border-radius: 5px; border: 1.5px solid #8A7458; }
.skill-row .dot.on { background: var(--rust); border-color: var(--rust); }
.skill-row .dot.x2 { box-shadow: 0 0 0 2px #F3E6C8, 0 0 0 3.5px var(--rust); }
.skill-row b { margin-left: auto; font-variant-numeric: lining-nums tabular-nums; }
.slots4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { border-radius: 12px; border: 2px solid var(--edge2); padding: 6px 4px; text-align: center; min-height: 86px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(0,0,0,.15); }
.slot span { font-size: 12px; color: var(--muted2); }
.slot b { font-size: 13.5px; line-height: 1.1; }
.slot.empty b { color: var(--muted2); font-weight: 500; }
.bag { border-radius: 18px; padding: 10px; background: #5A3E26; box-shadow: inset 0 0 0 2px #6B4A2E; flex: 1; min-height: 0; overflow-y: auto; }
.bag-inner { border: 2px dashed #8A6A3E; border-radius: 12px; padding: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cell { aspect-ratio: 1; border-radius: 10px; background: #F3E6C8; display: flex; align-items: center; justify-content: center; position: relative; border: 2px solid transparent; color: #2B1D12; }
.cell.empty { background: transparent; border: 1.5px dashed #8A6A3E; }
.cell.on { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.cell .q { position: absolute; right: 5px; bottom: 3px; font-size: 12px; font-weight: 800; }
.cell i { width: 64%; height: 64%; display: block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.cell:active:not(.empty) { transform: scale(.95); }
.item-panel { border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.item-panel h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 21px; }
.quest { border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.quest h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 20px; }
.quest .e { display: flex; gap: 10px; font-size: 15px; line-height: 1.3; }
.quest .e i { width: 10px; height: 10px; border-radius: 5px; background: var(--green); margin-top: 5px; flex-shrink: 0; }
.quest .e i.open { background: transparent; border: 2px solid var(--amber); }
.done-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); margin-bottom: 8px; }

/* доска контрактов */
.board { border-radius: 16px; padding: 10px; background: #4A3220; box-shadow: inset 0 0 0 4px #3A2616, inset 0 0 30px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.leaf { position: relative; border-radius: 6px; padding: 14px 14px 12px; text-align: left; width: 100%; box-shadow: 0 6px 14px rgba(0,0,0,.35); transition: transform .15s ease; }
.leaf.on { box-shadow: 0 0 0 3px var(--amber), 0 8px 20px rgba(0,0,0,.45); }
.leaf .pin { position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; border-radius: 6px; transform: translateX(-50%); box-shadow: 0 2px 2px rgba(0,0,0,.4); }
.leaf h3 { margin: 4px 0; font-family: var(--serif); font-weight: 800; font-size: 20px; line-height: 1.15; }
.leaf .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.leaf .left { margin-left: auto; font-size: 13.5px; color: var(--pmuted); }
.leaf .desc { font-size: 15px; line-height: 1.35; margin: 4px 0; }
.leaf .kvs { display: grid; grid-template-columns: auto 1fr; gap: 1px 12px; font-size: 14px; }
.leaf .kvs span { color: var(--pmuted); }
.leaf .rew { display: flex; align-items: baseline; gap: 10px; border-top: 1px dashed #B79C74; padding-top: 8px; margin-top: 6px; }
.leaf .rew b { font-family: var(--serif); font-weight: 800; font-size: 22px; }
.leaf .rew span { font-size: 13.5px; color: var(--pmuted); }
.leaf:nth-child(2n) { transform: rotate(-.6deg); } .leaf:nth-child(3n) { transform: rotate(.5deg); }
.leaf.on { transform: none; }
.stag { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 8px; border: 1px solid #A88B63; }
.stag.combat, .stag.boss { background: #8A3A24; color: var(--ink); border-color: #8A3A24; }
.diff { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 8px; color: var(--ink); }
.diff.easy { background: var(--green); } .diff.medium { background: var(--amber); color: var(--pink); } .diff.hard { background: #8A3A24; }

/* торговец */
.shop-head { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-top) + 6px) 12px 8px; flex-shrink: 0; }
.ware { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); margin-bottom: 8px; text-align: left; }
.ware.on { border: 2px solid var(--amber); }
.ware .ic { width: 40px; height: 40px; border-radius: 10px; background: #33251A; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink2); }
.ware .ic i { width: 26px; height: 26px; display: block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ware b { display: block; font-size: 15.5px; }
.ware small { font-size: 13px; color: var(--muted); }
.ware .pr { margin-left: auto; color: var(--amber); font-weight: 700; white-space: nowrap; }
.cmp { border-radius: 14px; padding: 12px 14px; }
.cmp h4 { margin: 0 0 8px; font-family: var(--serif); font-weight: 800; font-size: 17px; }
.cmp .cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-size: 14px; }
.cmp .after { color: var(--green); font-weight: 700; }

/* добыча */
.pile { border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.pile h3 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 19px; display: inline; }
.pile .it { display: flex; align-items: center; gap: 10px; border-top: 1px solid #D8C49C; padding-top: 8px; }
.pile .it b { display: block; font-size: 15.5px; }
.pile .it small { font-size: 13px; color: var(--pmuted); }
.to-btn { margin-left: auto; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid #A88B63; background: #EAD9B4; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--pink); flex-shrink: 0; }
.to-btn .d { width: 14px; height: 14px; border-radius: 7px; }
.pile.dark { background: var(--panel); border: 1px solid var(--edge); color: var(--ink); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.trio button { border-radius: 10px; border: 1px solid var(--edge); padding: 6px 4px; text-align: center; font-weight: 700; font-size: 14px; }
.trio small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }

/* привал */
.camp-top { position: relative; height: calc(var(--safe-top) + 170px); overflow: hidden; flex-shrink: 0; }
.camp-top .ttl { position: absolute; top: calc(var(--safe-top) + 8px); left: 16px; }
.camp-top .ttl b { font-family: var(--serif); font-weight: 800; font-size: 28px; color: var(--hi); display: block; }
.rest-hero { border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.rest-hero .r1 { display: flex; align-items: center; gap: 10px; }
.rest-hero .hpcol { flex: 1; }
.rest-hero .hpcol b { font-size: 16px; }
.rest-hero .stepper { display: flex; align-items: center; gap: 8px; }
.rest-hero .stepper .v { text-align: center; line-height: 1.05; min-width: 52px; }
.rest-hero .stepper .v b { font-size: 16px; }
.rest-hero .stepper .v small { display: block; font-size: 11.5px; color: var(--pmuted); }
.rest-hero .note2 { font-size: 13.5px; color: var(--rust); }
.full { color: var(--green); font-weight: 700; font-size: 14px; }

/* обмен */
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade-col { border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); padding: 10px; min-height: 180px; display: flex; flex-direction: column; gap: 8px; }
.trade-item { border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; text-align: left; }
.add-slot { border-radius: 10px; border: 1px dashed var(--edge); padding: 8px; color: var(--muted); font-size: 14px; text-align: center; }
.bag-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bag-row button { aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--pink); border: 1px solid #C9B288; }
.bag-row i { width: 60%; height: 60%; display: block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }

/* лобби */
.seats { border-radius: 16px; padding: 12px; background: #5A3E26; display: flex; flex-direction: column; gap: 8px; box-shadow: inset 0 0 0 2px #6B4A2E; }
.seat-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; min-height: 52px; }
.seat-row.empty { border: 1px dashed #A88B63; color: var(--ink2); }
.seat-row b { display: block; font-size: 16px; }
.seat-row small { font-size: 13px; }
.seat-row.empty .ava { border: 1px dashed #A88B63; background: transparent !important; color: #E9D7B4; }

/* обучение */
.tut-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + 12px) 16px 10px; flex-shrink: 0; }
.tut-head .progress { flex: 1; max-width: 140px; }
.tut-scene { height: 150px; flex-shrink: 0; overflow: hidden; position: relative; }
.tut-scene svg { display: block; width: 100%; height: 100%; }
.formula { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.formula span { min-width: 50px; padding: 6px 12px; border-radius: 10px; background: var(--parch); color: var(--pink); text-align: center; font-weight: 800; font-size: 17px; line-height: 1.1; }
.formula span small { display: block; font-size: 12px; font-weight: 500; }
.formula span.dc { background: var(--amber); }
.formula i { font-style: normal; font-weight: 700; font-size: 20px; color: var(--muted); }
.rat-zone { position: relative; height: 100%; }
.rat { position: absolute; bottom: 14px; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--ink); text-shadow: 0 1px 3px #000; }
.rat .box { width: 92px; height: 82px; border-radius: 12px; border: 2px dashed transparent; display: flex; align-items: flex-end; justify-content: center; }
.rat.on .box { border-color: #9FD6E0; }
.rat.down { opacity: .35; }
.order-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.order-chips span { padding: 6px 12px; border-radius: 14px; background: #33251A; color: var(--ink); font-weight: 700; }
.order-chips span.cur { background: var(--amber); color: var(--pink); }
.trophy-list { display: flex; flex-direction: column; gap: 10px; }
.trophy-list > div { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.trophy-list .ic { width: 40px; height: 40px; border-radius: 10px; background: #2B1D12; color: var(--amber); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.trophy-list b { display: block; font-size: 16px; }
.trophy-list span { font-size: 13.5px; color: var(--pmuted); }

/* первый вход */
.welcome-art { height: calc(var(--safe-top) + min(250px, 30vh)); overflow: hidden; flex-shrink: 0; position: relative; }
.welcome-art svg, .town-top svg, .camp-top svg, .scene-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.welcome-art .flame { transform-origin: 196px 112px; animation: flick 2.6s ease-in-out infinite; }
@keyframes flick { 0%, 100% { transform: scale(1) skewX(0); } 30% { transform: scale(1.04, .96) skewX(2deg); } 60% { transform: scale(.97, 1.05) skewX(-2deg); } }
.pillar { display: flex; align-items: center; gap: 12px; }
.pillar .ic { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--edge); background: #2A1D14; display: flex; align-items: center; justify-content: center; color: var(--amber); flex-shrink: 0; }
.pillar b { display: block; font-size: 16.5px; }
.pillar span { font-size: 14px; color: var(--muted); }
.lang-switch { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); }
.lang-switch button { padding: 6px 12px; border-radius: 14px; color: var(--muted); }
.lang-switch button.on { background: #33251A; color: var(--ink); font-weight: 700; }

.empty-state { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty-state b { display: block; font-family: var(--serif); font-size: 20px; color: var(--hi); margin-bottom: 6px; }
.spinner-page { display: flex; align-items: center; justify-content: center; flex: 1; }
.spinner-page i { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(232,163,61,.25); border-top-color: var(--amber); animation: spin .8s linear infinite; }
.flash-good { animation: flashGood .8s ease; }
@keyframes flashGood { 30% { box-shadow: 0 0 0 3px var(--green2); } }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.mask { display: block; width: 100%; height: 100%; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.big-ico svg { width: 60px; height: 60px; }
.feed > * { flex-shrink: 0; }
.town-top { margin: 0 -12px 2px; }
.seat { max-width: 78px; }
.partybar .sep { flex: 1 1 0; min-width: 4px; }
.feed { padding-top: 0; }

/* закреплённые шапки стола: бой и контракт */
.table-head { position: relative; z-index: 4; flex-shrink: 0; }
.combat-head { position: relative; overflow: hidden; background: #1A110B; border-bottom: 1px solid #3A2A1C; box-shadow: 0 6px 16px rgba(0,0,0,.45);
  padding-top: calc(var(--safe-top) - var(--tg-content-safe-area-inset-top, 0px)); }
.combat-head .art { position: absolute; inset: 0; opacity: .55; }
.combat-head .art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.combat-head::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(26,17,11,.1), rgba(26,17,11,.88)); }
.combat-head > .t-title, .combat-head > .band { position: relative; z-index: 2; }
.combat-head .band { min-height: 0; padding: 2px 12px 10px; }
.contract-head { position: relative; background: #1A110B; border-bottom: 1px solid #3A2A1C; box-shadow: 0 6px 16px rgba(0,0,0,.4); padding: calc(var(--safe-top) + 6px) 16px 10px; }
.contract-head .ttl { padding-right: 52px; }
.contract-head .ttl b { display: block; font-family: var(--serif); font-weight: 800; font-size: 22px; line-height: 1.1; color: var(--hi); }
.contract-head .ttl span { font-size: 13.5px; color: var(--muted); }
.contract-head .stage-steps { margin-top: 8px; }
.roll-screen .rsub { font-size: 14.5px; color: var(--ink2); }
.sheet-top { color: var(--ink); }
.sheet-top .stat4 > div { background: #241910; }
.sheet-top .stat4 b, .sheet-top .num { color: var(--hi); }
.sheet-top .bar { background: #3A2A1C; }
.contract-head .ttl > span { font-size: 13.5px; color: var(--muted); }
.contract-head .score { text-align: right; min-width: 92px; }
.contract-head .score b { display: block; font-family: var(--serif); font-weight: 800; font-size: 22px; color: var(--hi); line-height: 1.1; }
.contract-head .score span { font-size: 12.5px; color: var(--muted); }
html, body, button, input { font-variant-numeric: lining-nums; }
.seat .hp { font-variant-numeric: lining-nums tabular-nums; }
.card.parch { background-color: var(--parch); background-image: var(--pgrain); color: var(--pink); border-color: #C9B288; }
.stage-steps .lbl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
