/* Обол v3 · интерфейс 1280×720 (16:9) на UI-ките из img/ui: тёмное дерево, латунь, пергамент. Playfair Display.
 * Кнопки, таблички, вкладки, карточки фиксированного размера по пропорциям картинки (background-size: 100% 100%, без 9-slice и растяжек).
 * Панели: panel.png, 9-slice border-image 80 / 40px round, внутренние отступы 44px. Паз ползунка: slider_track.png, 9-slice по 50px.
 * Сетка: поля 24px; правый верх: иконки; правый низ: главное действие; левый верх: табличка состояния. */
@font-face { font-family: "Playfair"; src: url(fonts/PlayfairDisplay-Regular.ttf) format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair"; src: url(fonts/PlayfairDisplay-Italic.ttf) format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Playfair"; src: url(fonts/PlayfairDisplay-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Playfair"; src: url(fonts/PlayfairDisplay-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #1a120c; --cream: #efe3c8; --cream-2: #d9c9a4; --mute: #b8a67e; --brown: #2b1d14; --brown-2: #6b5640;
  --gold: #d9a441; --gold-hi: #f2cf7a; --glow: #9fe3dc; --lamp: #f2b25c; --rust: #c8573f; --moss: #8fbf6a;
  --font: "Playfair", Georgia, serif; --ease: cubic-bezier(.2, .8, .2, 1); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0a1112; color: var(--cream); overflow: clip; font-family: var(--font); font-size: 15px; -webkit-user-select: none; user-select: none; }
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; overflow: clip; }
#app { position: relative; width: 1280px; height: 720px; flex: none; overflow: hidden; background: #0a1112; transform-origin: center center; box-shadow: 0 0 0 3px var(--ink), 0 40px 120px rgba(0, 0, 0, .7); }
#cv { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; display: block; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > .scr, #ui > .hud { pointer-events: none; }
.scr { position: absolute; inset: 0; }
.scr > *, .scr .pe, .hud .pe, .hud .btn { pointer-events: auto; }
#fade { position: absolute; inset: 0; background: #05090a; opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 70; }
#bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 36; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }

/* ---------- типографика */
h1, h2, h3 { margin: 0; text-wrap: balance; font-family: var(--font); }
h1 { font-weight: 700; font-size: 30px; line-height: 1.05; color: var(--cream); text-shadow: 0 3px 0 var(--ink), 0 0 12px rgba(0, 0, 0, .6); margin-bottom: 8px; }
h2 { font-weight: 600; font-size: 20px; line-height: 1.1; margin: 12px 0 6px; color: var(--gold-hi); text-shadow: 0 2px 0 var(--ink); }
h3 { font-weight: 600; font-size: 16px; line-height: 1.2; margin: 0 0 2px; }
p { margin: 0 0 6px; line-height: 1.35; font-size: 14px; color: var(--cream-2); }
.sub { font-size: 12.5px; color: var(--mute); line-height: 1.35; }
b { font-weight: 700; }
.gold { color: var(--gold-hi); font-weight: 700; white-space: nowrap; }
.bad-t { color: #ff9a80; }
.ico { width: 1em; height: 1em; flex: none; vertical-align: -0.15em; object-fit: contain; }
.ico.prop { width: 1.3em; height: 1.3em; vertical-align: -0.3em; }
.ico.prop.big { width: 38px; height: 38px; }
.ico.prop.tiny { width: 1.1em; height: 1.1em; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.dev { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; gap: 14px; justify-content: center; pointer-events: none; }
.dev button { background: none; border: 0; color: #8c8269; font: inherit; font-size: 10px; cursor: pointer; text-decoration: underline; pointer-events: auto; opacity: .6; }

/* ---------- КНОПКИ: картинка целиком, размер по пропорциям картинки; длинная надпись получает меньший кегль (fitText), кнопка не шире */
.btn { appearance: none; border: 0; background: url(img/ui/btn.png) center / 100% 100% no-repeat; width: 196px; height: 75px; padding: 0 22px 3px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font); font-weight: 600; font-size: 18px; line-height: 1.05; white-space: nowrap; overflow: hidden; cursor: pointer; color: var(--cream); text-shadow: 0 2px 0 var(--ink); flex: none; font-variant-numeric: tabular-nums; }
.btn:hover { background-image: url(img/ui/btn_hover.png); }
.btn:active { background-image: url(img/ui/btn_pressed.png); padding-top: 3px; padding-bottom: 0; }
.btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.btn[disabled] { filter: grayscale(.6) brightness(.7); cursor: not-allowed; pointer-events: none; }
.btn.s { width: 157px; height: 60px; font-size: 15px; padding: 0 16px 2px; }
.btn.xs { width: 120px; height: 46px; font-size: 13.5px; padding: 0 12px 2px; }
.btn.primary { background-image: url(img/ui/btn_primary.png); width: 286px; height: 82px; font-size: 22px; padding: 0 26px 3px; }
.btn.primary:hover { background-image: url(img/ui/btn_primary.png); filter: brightness(1.12) drop-shadow(0 0 10px rgba(255, 200, 110, .55)); }
.btn.primary:active { filter: brightness(.9); }
.btn.primary[disabled] { filter: grayscale(.6) brightness(.7); }
.btn.icon { background-image: url(img/ui/btn_icon.png); width: 56px; height: 56px; padding: 0; }
.btn.icon:hover { background-image: url(img/ui/btn_icon.png); filter: brightness(1.18) drop-shadow(0 0 8px rgba(255, 200, 110, .5)); }
.btn.icon .ico { width: 32px; height: 32px; }
.btn .ico { width: 1.25em; height: 1.25em; }
.btn .sub2 { display: block; font-weight: 400; font-size: 11px; opacity: .85; text-shadow: none; font-style: italic; }
.tab { appearance: none; border: 0; width: 129px; height: 57px; background: url(img/ui/tab.png) center / 100% 100% no-repeat; font: 600 15px var(--font); color: var(--cream-2); cursor: pointer; text-shadow: 0 2px 0 var(--ink); white-space: nowrap; overflow: hidden; padding: 0 10px 2px; }
.tab.on { background-image: url(img/ui/tab_active.png); color: var(--cream); }
.tab:hover { filter: brightness(1.15); }
.tabs { display: flex; gap: 6px; margin-bottom: 6px; }

/* ---------- ПАНЕЛЬ: panel.png, уголки целые */
.panel { position: relative; border: 40px solid transparent; border-image: url(img/ui/panel.png) 80 fill / 40px round; padding: 4px; color: var(--cream); }
.xclose { position: absolute; top: -30px; right: -30px; z-index: 3; }
.shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding-top: 100px; animation: fade .18s var(--ease); }
.pane { width: 640px; max-height: 580px; display: flex; flex-direction: column; }
.pane.mid { width: 680px; }
.pane.wide { width: 780px; }
.scr > .pane.end { position: absolute; left: 24px; top: 132px; width: 600px; }
.scroll { overflow-y: auto; flex: 1; min-height: 0; max-height: 372px; margin: 0 -6px; padding: 2px 6px 8px; scrollbar-width: thin; scrollbar-color: #6b4c2e transparent; }
.foot { padding-top: 8px; display: flex; gap: 10px; align-items: center; }
.lead { margin: 0 0 6px; }
.foot.col { flex-direction: column; align-items: center; gap: 4px; }
.foot.col .btn.s { margin-top: 0; }

/* ---------- карточки: пергамент с булавкой, фиксированный размер (пропорция 1.6) */
.card { width: 330px; height: 206px; background: url(img/ui/card.png) center / 100% 100% no-repeat; padding: 30px 32px 22px; color: var(--brown); display: flex; flex-direction: column; gap: 3px; }
.card p, .card h3, .card .sub { color: var(--brown); margin: 0; }
.card p { font-size: 13px; line-height: 1.28; }
.card .sub { color: var(--brown-2); font-size: 12px; }
.card .price { color: #8a5a10; }
.card .ct { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .btn { margin-top: auto; align-self: flex-end; }
.card .chip { color: var(--brown); background: rgba(255, 255, 255, .35); border-color: #8a6a44; }
.cgrid { display: grid; grid-template-columns: 330px 330px; gap: 4px 14px; justify-content: center; }
.item { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 6px; padding: 7px 12px; border-radius: 10px; background: rgba(10, 6, 3, .5); border: 2px solid #4a3522; color: var(--cream); font: inherit; text-align: left; }
.item h3 { color: var(--cream); }
button.item { cursor: pointer; }
.item.on { border-color: var(--gold); box-shadow: 0 0 10px rgba(217, 164, 65, .4); }
.item.dim, .item[disabled] { opacity: .55; }
.item[disabled] { cursor: not-allowed; }

/* ---------- таблица лидеров на пергаменте */
.parch { position: relative; width: 740px; height: 512px; background: url(img/ui/card.png) center / 100% 100% no-repeat; padding: 62px 70px 46px; color: var(--brown); }
.parch h1, .parch h2 { color: var(--brown); text-shadow: none; }
.parch h1 { font-size: 32px; margin-bottom: 8px; }
.parch h2 { font-size: 20px; margin: 8px 0 10px; }
.parch .sub { color: var(--brown-2); font-size: 13.5px; }
.parch .price { color: #8a5a10; }
.parch .oline { font-size: 16px; }
.parch p { color: var(--brown); }
.pcols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; }
.pcols .tot { margin-top: 10px; }
.parch p.tot { font-size: 14px; }
.parch .mis { margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: rgba(120, 60, 30, .14); font-size: 13px; }
.board { display: grid; gap: 5px; }
.brow { display: grid; grid-template-columns: 22px 86px 1fr 34px 30px; align-items: center; gap: 8px; padding: 11px 10px; font-size: 17px; border-radius: 8px; background: rgba(60, 36, 14, .12); font-weight: 600; color: var(--brown); font-variant-numeric: tabular-nums; }
.brow.me { background: rgba(110, 140, 60, .35); box-shadow: inset 0 0 0 2px #6d8a3c; }
.brow .rk { color: var(--brown-2); }
.brow .bb { height: 8px; border-radius: 4px; background: rgba(60, 36, 14, .25); overflow: hidden; }
.brow .bb i { display: block; height: 100%; background: #6a8a86; }
.brow.me .bb i { background: #6d8a3c; }
.brow b { text-align: right; font-size: 18px; }
.brow .dl { color: #9c3b2e; font-size: 12px; font-weight: 700; }
.board.small .brow { grid-template-columns: 20px 1fr 34px; }
.end .board.small .brow { color: var(--cream); background: rgba(10, 6, 3, .5); }
.end .board.small .brow.me { background: rgba(70, 100, 50, .55); }
.end .board.small .brow .rk { color: var(--mute); }
.oline { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 14px; }
.oline.dim { opacity: .55; }
.price { font-weight: 700; color: var(--gold-hi); white-space: nowrap; }
.meter { height: 9px; border-radius: 5px; background: rgba(40, 24, 8, .3); position: relative; overflow: hidden; margin: 5px 0 3px; border: 1px solid #6b4c2e; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); }

/* ---------- чипы, значки */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; background: rgba(10, 6, 3, .6); color: var(--cream); border: 2px solid #6b4c2e; white-space: nowrap; cursor: default; font-variant-numeric: tabular-nums; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--gold); }
button.chip[disabled] { opacity: .5; border-style: dashed; pointer-events: none; }
.chip.on { background: #6b4c2e; border-color: var(--gold); color: #fff; }
.chip.good { border-color: var(--moss); }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: #3a3028; }
.dots i.on { background: var(--rust); }
.cbadge { display: grid; place-items: center; background: url(img/ui/badge.png) center / contain no-repeat; color: var(--cream); font-weight: 700; text-shadow: 0 2px 0 var(--ink); }

/* ---------- ТАБЛИЧКА: sign.png 590×168, на экране 236×67 */
.sign { background: url(img/ui/sign.png) center / 100% 100% no-repeat; width: 236px; height: 67px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 26px 3px; font-family: var(--font); font-weight: 600; font-size: 17px; color: var(--cream); text-shadow: 0 2px 0 var(--ink); white-space: nowrap; overflow: hidden; border: 0; line-height: 1.1; text-align: center; }
.sign.s { width: 189px; height: 54px; font-size: 15px; padding: 0 22px 2px; }
button.sign { cursor: pointer; }
button.sign:hover { filter: brightness(1.15); }
.sign i { font-style: normal; font-weight: 400; font-size: 12px; color: var(--lamp); }

/* ---------- ПУЗЫРЬ реплики: гладкий ui_bubble2, хвост слева или справа по стороне говорящего. Рваный bubble.png только для крика */
.bubble { position: absolute; pointer-events: auto; cursor: pointer; border-style: solid; border-color: transparent; color: var(--brown); animation: bub-in .22s var(--ease); }
.bubble.side-l { border-width: 30px 30px 60px 60px; border-image: url(img/ui/bubble_l.png) 100 100 200 200 fill / 30px 30px 60px 60px stretch; }
.bubble.side-r { border-width: 30px 60px 60px 30px; border-image: url(img/ui/bubble_r.png) 100 200 200 100 fill / 30px 60px 60px 30px stretch; }
.bubble.side-l p, .bubble.side-l .who { margin-left: -30px; }
.bubble.side-r p, .bubble.side-r .who { margin-right: -30px; }
.bubble.shout { border-width: 30px 30px 65px 85px; border-image: url(img/ui/bubble.png) 60 60 130 170 fill / 30px 30px 65px 85px stretch; }
.bubble.out { opacity: 0; transition: opacity .2s; }
.bubble p { margin: 0; font-size: 16px; line-height: 1.3; color: var(--brown); }
.bubble .who { display: block; font-size: 13px; color: #7a2f1d; margin-bottom: 1px; font-weight: 700; letter-spacing: .02em; }
.bubble .wd { white-space: nowrap; }
.bubble .ch { opacity: 0; }
.bubble .ch.on { opacity: 1; transition: opacity .1s; }
@keyframes bub-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- HUD: img/ui/hud2.png 1243×230 → 454×84 (k 0.3652). Иконка и число в гибких блоках: длинные числа уменьшаются, в край не упираются */
#hud { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 40; pointer-events: none; }
.hb { position: relative; width: 454px; height: 84px; }
.hb-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hb-l, .hb-r { position: absolute; top: 0; height: 84px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.hb-l { left: 12px; width: 116px; }
.hb-r { left: 322px; width: 120px; }
.hb-soul { height: 58px; width: auto; filter: drop-shadow(0 0 7px rgba(150, 240, 228, .55)); animation: hb-float 3.2s ease-in-out infinite; }
.hb-coin { height: 32px; width: auto; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .5)); }
@keyframes hb-float { 50% { transform: translateY(-3px); } }
.hb-n { font-family: var(--font); font-weight: 700; font-size: 31px; line-height: 1; color: var(--cream); text-shadow: 0 2px 0 var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-n[data-l="4"] { font-size: 25px; } .hb-n[data-l="5"], .hb-n[data-l="6"] { font-size: 20px; }
.hb-slot { position: absolute; left: 178px; top: 24px; width: 131px; height: 31px; overflow: hidden; border-radius: 4px; }
.hb-slot .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: linear-gradient(#b8483a 0, #9c3b2e 48%, #7e2d23 100%); box-shadow: inset 0 3px 0 rgba(255, 205, 185, .38), inset 0 -2px 0 rgba(40, 10, 6, .4); transition: width .3s var(--ease); }
.hb-slot .fill.hot { animation: heat .55s infinite alternate; }
@keyframes heat { from { filter: brightness(1); } to { filter: brightness(1.35) saturate(1.2); } }

/* ---------- иконочные кнопки справа сверху: шестерёнка на всех экранах, кроме титула */
#iconbar { position: absolute; right: 24px; top: 20px; display: flex; gap: 8px; z-index: 45; }
.ib { display: flex; flex-direction: column; align-items: center; width: 66px; }
.ib span { margin-top: 1px; font-size: 11px; font-weight: 600; color: var(--cream); text-shadow: 0 1px 0 var(--ink), 0 0 6px #000; white-space: nowrap; }

/* ---------- тосты */
#toasts { position: absolute; left: 0; right: 0; top: 124px; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 50; }
.toast { width: 520px; min-height: 100px; background: url(img/ui/card.png) center / 100% 100% no-repeat; padding: 26px 40px 24px; text-align: center; font-size: 14.5px; font-weight: 600; color: var(--brown); animation: toast-in .2s var(--ease); display: grid; place-items: center; margin: -8px 0; }
.toast.good { color: #2a4a14; }
.toast.bad { color: #7a2418; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- титул и интро */
.title .logo { position: absolute; left: 50%; top: 30px; width: 440px; transform: translateX(-50%); filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); pointer-events: none; }
.title .menu { position: absolute; left: 50%; top: 250px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.intro-card { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: 900px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; }
.intro-card p { font-weight: 600; font-size: 20px; line-height: 1.3; color: var(--cream); margin: 0; }
.intro-card .n { font-size: 12px; color: var(--mute); margin-bottom: 2px; }

/* ---------- Бюро (хаб) */
.daysign { position: absolute; left: 24px; top: 24px; }
.hubsign { position: absolute; transform: translate(-50%, -100%); opacity: 0; transition: opacity .15s; pointer-events: none !important; }
.hubsign.on { opacity: 1; }
.mainact { position: absolute; right: 24px; bottom: 24px; }
.oils { display: grid; gap: 0; }
.oilrow .chip { flex: none; }

/* ---------- карта */
.node { position: absolute; transform: translate(-50%, -100%); }
.node.sel { filter: drop-shadow(0 0 8px var(--gold)) brightness(1.2); }
.node.dim { filter: grayscale(.6) brightness(.75); }
.mappanel { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: 1200px; display: grid; grid-template-columns: 430px 1fr 236px; gap: 18px; align-items: center; border-width: 26px; border-image-width: 26px; padding: 0 10px; }
.mappanel .mc3 { flex-direction: row; justify-content: flex-end; flex-wrap: wrap; }
.mappanel .mc3 .btn.primary { width: 180px; height: 52px; font-size: 16px; }
.mappanel .kv { grid-template-columns: auto auto auto 1fr; }
.mappanel h2 { margin: 0 0 4px; font-size: 21px; }
.mappanel p { font-size: 13px; margin: 0 0 4px; }
.mappanel .kv { display: grid; grid-template-columns: 48px 1fr; gap: 3px 8px; font-size: 13px; color: var(--cream-2); align-items: center; }
.mappanel .kv span { color: var(--mute); }
.mappanel .kv em { font-style: normal; }
.mappanel h3 { margin-bottom: 6px; }
.mappanel .times { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.mc3 { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mc3 .btn.primary { width: 212px; height: 60px; font-size: 18px; padding: 0 20px 2px; }
.mc3 .why { text-align: center; color: #ff9a80; margin: 0; }

/* ---------- аудит: карточка слева, не на героях */
.modal { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; animation: fade .18s var(--ease); }
.modal.dim45 { background: rgba(0, 0, 0, .45); }
.modal.clear { place-items: start; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.mcard { width: 470px; text-align: center; display: grid; gap: 4px; justify-items: center; }
.mcard.left { margin: 118px 0 0 24px; }
.audit h1 { font-size: 32px; }
.audit.bad h1 { color: #ff9a80; }
.audit.good h1 { color: #b9e08e; }
.auditpic { width: 100%; height: 110px; border-radius: 6px; background: url(img/audit_boat.png) 50% 85% / auto 92% no-repeat, url(img/w_fish.jpg) 62% 52% / 260% auto;   /* без рефа Маши: лодка аудита на нашей топи */ border: 3px solid var(--ink); }

/* ---------- настройки */
.setpanel { width: 560px; }
.setpanel h1 { margin-bottom: 12px; }
.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; margin-bottom: 8px; font-weight: 600; font-size: 17px; }
.slider b { font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
.slider input { grid-column: 1 / 3; width: 100%; -webkit-appearance: none; appearance: none; height: 50px; background: transparent; margin: 0; cursor: pointer; }
.slider input::-webkit-slider-runnable-track { height: 50px; border-style: solid; border-color: transparent; border-width: 0 25px; border-image: url(img/ui/slider_track.png) 0 50 fill / 0 25px stretch; }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 42px; height: 42px; margin-top: 4px; background: url(img/ui/slider_knob.png) center / contain no-repeat; border: 0; }
.setbtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; margin-top: 10px; }
.setpanel .xclose { top: -30px; right: -30px; }

/* ---------- путь, развилка, ворота */
.fork { position: absolute; left: 998px; width: 258px; height: 74px; }
.fork { font-size: 16px; }
.fork b { font-size: 1em; font-weight: 700; }
.fork i { font-size: .74em; }
.fork.life { top: 346px; }
.fork.death { top: 438px; }
.fork.dim { filter: grayscale(.55) brightness(.72); }
.chinfo { position: absolute; left: 24px; top: 86px; width: 236px; height: 67px; white-space: normal; font-size: 13px; }
.gatepanel { position: absolute; left: 912px; top: 128px; width: 344px; max-height: 470px; display: flex; flex-direction: column; }
.gatepanel h2 { margin: 0 0 6px; }
.gatepanel .xlist { overflow-y: auto; display: grid; gap: 6px; align-content: start; max-height: 270px; }
.xinfo { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.xrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 3px 6px; border-radius: 10px; background: rgba(10, 6, 3, .45); }
.xrow .xn b { display: block; font-size: 15px; }
.xp, .sp { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 0 5px rgba(159, 227, 220, .4)); }
.counter { position: absolute; left: 792px; top: 290px; width: 464px; z-index: 12; }
.counter h3 { font-size: 17px; }
.ctable { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; padding: 8px; border-radius: 8px; background: rgba(40, 24, 12, .7); border: 2px solid #6b4c2e; margin: 6px 0; }
.cside { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; min-height: 60px; }
.cside.guard { justify-content: flex-end; opacity: .85; border-left: 2px dashed #6b5436; padding-left: 12px; }
.cside.guard::before { content: "стражник"; width: 100%; text-align: right; font-size: 12px; color: var(--mute); }
.coinb { width: 42px; height: 42px; border-radius: 50%; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: default; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .6)); }
.coinb img { width: 100%; height: 100%; object-fit: contain; }
.coinb:disabled { filter: grayscale(.6) brightness(.7); }
.coinb.hot { cursor: pointer; animation: pulse .35s infinite alternate; filter: drop-shadow(0 0 8px var(--rust)); }
@keyframes pulse { to { transform: scale(1.14); } }
.ghand { position: absolute; width: 46px; height: 46px; z-index: 4; filter: drop-shadow(0 3px 0 var(--ink)); }
.ghand .ico { width: 46px; height: 46px; }
.cres { min-height: 46px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cres p { margin: 0; }

/* ---------- HUD ловли */
.hud { position: absolute; inset: 0; }
.hud-state { position: absolute; left: 24px; top: 24px; width: 236px; }
.hud-state .sign b { font-size: 15px; }
.oilbar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.oilbar .ico { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)); }
.oiltrack { position: relative; flex: 1; height: 14px; border-radius: 7px; background: #0a0807; box-shadow: inset 0 0 0 2px #52402c; }
.oiltrack i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: 100%; max-width: calc(100% - 4px); border-radius: 5px; background: var(--lamp); transition: width .2s linear; }
.oiltrack i.low { background: var(--rust); animation: pulse .4s infinite alternate; }
.lmeta { margin-top: 4px; font-size: 12px; color: var(--cream-2); text-shadow: 0 1px 0 var(--ink), 0 0 6px #000; font-variant-numeric: tabular-nums; }
.hud-kit { position: absolute; left: 24px; top: 150px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.hud-kit:empty { display: none; }
.hud .hint { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: 640px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 16px; font-weight: 600; color: var(--cream); background: rgba(14, 9, 5, .72); border: 2px solid #6b4c2e; text-shadow: 0 2px 0 var(--ink); opacity: 0; transition: opacity .15s; text-align: center; }
.hud .hint.on { opacity: 1; }
.has-toast .hud .hint { opacity: 0; }

/* ---------- онбординг */
#tut { position: absolute; inset: 0; z-index: 34; pointer-events: none; }
.tutdim { position: absolute; inset: 0; }
.tutsign { position: absolute; transform: translate(-50%, -100%); width: 342px; height: 97px; padding: 0 40px 6px; font-size: 17px; line-height: 1.15; white-space: normal; animation: bub-in .25s var(--ease); }
.tutsign span { display: block; text-wrap: balance; }
.tutskip { position: absolute; right: 24px; bottom: 24px; pointer-events: auto; }
.tutok { position: absolute; pointer-events: auto; }
.tutghost { position: absolute; left: 0; top: 0; width: 58px; height: 72px; filter: drop-shadow(0 0 10px rgba(150, 240, 230, .7)); }
/* призрачная рука: hp указывает (кончик пальца в левом верхнем углу), hg щиплет и несёт душу */
.tutghost .hp, .tutghost .hg { position: absolute; left: 0; top: 0; width: 58px; height: auto; }
.tutghost .hg, .tutghost.carry .hp { display: none; }
.tutghost.carry .hg { display: block; }
.tutghost .soul { position: absolute; left: -18px; top: 10px; width: 48px; height: 48px; object-fit: contain; opacity: .85; display: none; }
.tutghost.carry .soul { display: block; }

/* ---------- трюм: оверлей. Лодка слева, плащ (cloak_empty) по центру, справа «за борт» и подсказка, внизу кнопки */
.sheet.hold { position: absolute; inset: 0; z-index: 20; animation: fade .18s var(--ease); }
.hold-dim { position: absolute; inset: 0; background: rgba(5, 10, 12, .5); }
.hold-bar { position: absolute; left: 24px; bottom: 20px; display: flex; gap: 8px; align-items: center; }
.hold-info { position: absolute; left: 1040px; top: 346px; width: 216px; height: 190px; padding: 28px 24px 20px; font-size: 12.5px; line-height: 1.3; }
.hold-info .sub { font-size: 11.5px; }
/* карточка души в трюме: построчно; золото на пергаменте — тёмный янтарь, иначе не читается */
.hold-info .hi-name { font-weight: 700; font-size: 16px; margin-bottom: 5px; }
.hold-info .hi-row { margin-bottom: 4px; }
.hold-info .gold, .card .gold, .parch .gold { color: #7a4508; text-shadow: none; }
.overboard { position: absolute; right: 24px; top: 200px; width: 216px; height: 130px; border: 3px dashed var(--rust); border-radius: 12px; color: #f0a48e; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; text-align: center; background: rgba(20, 8, 4, .55); }
.overboard.hot { background: rgba(200, 87, 63, .55); }
.boatpanel { position: absolute; border: 40px solid transparent; border-image: url(img/ui/panel.png) 80 fill / 40px round; padding: 0; }
.boatpanel .gt { position: absolute; left: 6px; right: 6px; top: -4px; display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 17px; padding: 0 4px; }
.boatpanel .gt i { font-style: normal; font-size: 12px; color: var(--mute); font-weight: 400; }
.cloakimg { position: absolute; display: block; height: auto; animation: cloak-in .45s var(--ease); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); }
@keyframes cloak-in { from { transform: translateX(390px); opacity: 0; } to { transform: none; opacity: 1; } }   /* в px: плащ и карманы едут вместе */
/* карманы плаща: рисуются поверх гладкой подкладки cloak_open.png */
.cell.pocket { border-radius: 7px 7px 12px 12px; background: radial-gradient(ellipse at 50% 30%, rgba(52, 32, 18, .78), rgba(22, 13, 7, .92)); box-shadow: inset 0 4px 8px rgba(0, 0, 0, .7), inset 0 0 0 2px rgba(78, 46, 22, .95), 0 1px 0 rgba(255, 210, 150, .14); outline: 1.5px dashed rgba(232, 190, 136, .38); outline-offset: -6px; animation: cloak-in .45s var(--ease); }
.cell.pocket.lock { background: none; box-shadow: none; outline-color: rgba(232, 190, 136, .16); }
.cloaktag { position: absolute; }
.cells, .pieces { position: absolute; inset: 0; pointer-events: none; }
.cell { position: absolute; border-radius: 8px; background: rgba(255, 220, 160, .06); box-shadow: inset 0 0 0 2px rgba(255, 220, 160, .22); }
.cell.lock { background: rgba(6, 4, 2, .72); box-shadow: none; }
.cell.ok { background: rgba(143, 191, 106, .6); }
.cell.no { background: rgba(200, 87, 63, .6); }
.piece { position: absolute; z-index: 2; }
.piece .pc { position: absolute; border-radius: 10px; pointer-events: auto; cursor: grab; box-shadow: inset 0 0 0 3px var(--ink), inset 0 4px 0 rgba(255, 255, 255, .25); opacity: .92; }
.piece .pc.br { border-radius: 0; box-shadow: inset 0 3px 0 var(--ink), inset 0 -3px 0 var(--ink); }
.piece .pc.br.v { box-shadow: inset 3px 0 0 var(--ink), inset -3px 0 0 var(--ink); }
.piece.sel .pc:not(.br) { box-shadow: inset 0 0 0 3px var(--cream), inset 0 4px 0 rgba(255, 255, 255, .25); }
.piece.exposed .pc:not(.br) { box-shadow: inset 0 0 0 3px var(--rust), inset 0 4px 0 rgba(255, 255, 255, .25); }
.piece .face { position: absolute; pointer-events: none; z-index: 2; }
.piece .face img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .5)); }
.piece .cbadge { position: absolute; z-index: 3; width: 26px; height: 26px; font-size: 13px; }
.piece.drag { z-index: 10; opacity: .95; }

@media (prefers-reduced-motion: reduce) { .modal, .sheet.hold, .toast, .bubble, .cloakimg, .shade { animation-duration: 1ms; } .coinb.hot, .oiltrack i.low { animation: none; } }

/* ---------- v4: заказ Аида, книга хлама, Цербер, время смены */
.parch.note { height: auto; min-height: 430px; width: 620px; }
.parch .hardcond { margin: 0 0 6px; padding: 6px 10px; border-radius: 6px; background: rgba(150, 70, 30, .2); font-size: 15px; }
.aidp { color: var(--gold-hi); font-size: 13px; white-space: nowrap; }
.hold-info .aidp b, .xrow .aidp b { font-size: 16px; }
.hold-info .aidp { font-weight: 700; margin-right: 6px; }
.jgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 6px; }
.jcell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border-radius: 10px; background: rgba(10, 6, 3, .5); border: 2px solid #4a3522; text-align: center; min-height: 142px; }
.jcell .jpic { width: 64px; height: 64px; object-fit: contain; filter: grayscale(1) brightness(.4); }
.jcell.have { border-color: var(--gold); }
.jcell.have .jpic { filter: none; }
.jcell b { font-size: 14px; color: var(--cream); }
.jcell .sub { font-size: 11.5px; line-height: 1.2; }
.jcell .jn { position: absolute; right: 8px; top: 6px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--gold-hi); }
img.junk.big { width: 38px; height: 38px; object-fit: contain; }
i.junk.nopic { display: inline-grid; place-items: center; width: 38px; height: 38px; }
.oiltime { font-size: 15px; font-weight: 700; color: var(--cream); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 var(--ink), 0 0 6px #000; }
.oiltime.low { color: #ff8a6a; }
.xrow.slim { padding: 3px 4px; }
.xrow.lead { margin-top: 6px; border-top: 2px dashed #6b5436; padding-top: 6px; }
.gatepanel .total { margin: 4px 0; }
.cerbbtn { margin: 4px auto; width: 100%; }
.cerbbox { display: flex; flex-direction: column; gap: 3px; align-items: stretch; margin: 4px 0; }
.cerbbox .btn { width: 100%; }
.cerbgame { position: absolute; inset: 0; z-index: 12; }
.cgtop { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); width: 420px; text-align: center; }
.head { position: absolute; width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--gold-hi); background: rgba(200, 87, 63, .45); color: var(--cream); font: 700 16px var(--font); cursor: pointer; animation: pulse .35s infinite alternate; box-shadow: 0 0 14px var(--rust); }
.head.done { animation: none; background: rgba(143, 191, 106, .55); border-color: var(--moss); box-shadow: none; pointer-events: none; }
.xrow.lead { grid-template-columns: 1fr auto; }
.parch.note .tot { margin-top: 14px; }
.xlist { overflow-x: hidden; } .cgtop { top: 130px; }

/* v4: интро — кнопки столбиком; родные — полоса счёта */
.intro-card .ibtns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.intro-card p { text-wrap: balance; }
.scr > .pane.end { max-height: 560px; }

/* v4: онбординг первого дня (ob.js): затемнение с вырезом, табличка, рука */
#ob { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.obdim { position: absolute; inset: 0; }
.obsign { position: absolute; width: 400px; height: auto; min-height: 90px; padding: 24px 46px 30px; gap: 8px; font-size: 16px; line-height: 1.2; text-align: center; animation: bub-in .25s var(--ease); }
.obsign span { text-wrap: balance; }
.obsign .obnext { pointer-events: auto; }
.obhand { position: absolute; width: 64px; height: auto; pointer-events: none; filter: drop-shadow(0 0 10px rgba(150, 240, 230, .7)); animation: obpoke 1.1s ease-in-out infinite; }
@keyframes obpoke { 0%, 100% { margin: 0; } 50% { margin: -9px 0 0 -9px; } }
.obskip { pointer-events: auto; background: none; border: 0; padding: 0; margin-top: -2px; font: 600 12px var(--font); color: var(--mute); text-decoration: underline; cursor: pointer; }
.obskip:hover { color: var(--cream); }
.obhand.up { rotate: 180deg; }
.hold-info .aidp, .hold-info .aidp * { color: #5a360c; }   /* «Аид даст» на пергаменте — тёмным, не золотом */
