:root { --safe-top:env(safe-area-inset-top,0px); --safe-bottom:env(safe-area-inset-bottom,0px); --safe-left:0px; --safe-right:0px; --app-height:100dvh; }
#miniNav{position:absolute;top:calc(var(--safe-top) + 12px);left:14px;right:14px;display:flex;align-items:center;justify-content:space-between;pointer-events:none;z-index:4}
#miniNav button{pointer-events:auto;width:44px;height:44px;background:#1d1712;color:var(--hud);border:1px solid #846843;border-radius:8px;font-size:23px;cursor:pointer}
#saveStatus{font:9px/1.3 'IBM Plex Mono',monospace;letter-spacing:.05em;opacity:.55}
#miniNav{display:none}
.mobileBrand{display:none}
.legacyTitle{position:absolute;inset:0}
body.portrait .legacyTitle{inset:auto;left:50%;top:50%;width:1040px;height:600px;transform:translate(-50%,-50%) scale(var(--title-scale));transform-origin:center}
body.portrait .mobileBrand{display:block;font:400 clamp(28px,8vw,36px)/1.1 var(--f-head);letter-spacing:.03em;color:var(--tbg);text-align:center}
body.portrait #top .sub{font-size:12px;line-height:1.2;display:flex;align-items:center;gap:6px}
body.portrait #top .sub .lv{font-size:12px;white-space:nowrap;max-width:140px;overflow:hidden;text-overflow:ellipsis}
body.portrait #top .sub #hDist,body.portrait #top .sub #hRound{display:none}
body.portrait #top .lives span{width:11px;height:11px}
body.portrait #top .sc{line-height:1}
body.portrait #top .sc>b{font-size:23px}
body.portrait .tpart>span.old{font-size:26px!important}
body.portrait .namecard .sub,body.portrait .tip{letter-spacing:0}
body.portrait .gc-name{font-size:clamp(22px,6.5vw,28px)!important;overflow-wrap:normal;white-space:normal}
body.portrait .gc-who{max-width:none;min-height:44px;box-sizing:border-box;width:100%;padding:6px;gap:6px}
body.portrait .gc-who b{font-size:19px}
body.portrait .gc-who .chg{font-size:8px;padding:8px 6px;letter-spacing:0}
body.portrait .verdict .vcrest{position:static;transform:none;width:64px;height:72px;flex-shrink:0}
body.portrait .verdict .otk{width:72px;height:72px;font-size:14px;border-width:2px}
body.portrait .studios .cols{display:flex}
body.portrait #stage{height:var(--app-height)}
body.portrait #miniNav{display:flex}
body.portrait #hud.hidden #miniNav{display:none}
body.portrait #win{top:var(--window-top);margin-top:0;border-radius:12px;}
body.portrait #film{opacity:.62}
body.portrait #film .edge{display:none}
body.portrait #logoTop{display:none}
body.portrait #rcol{inset:0;width:auto;pointer-events:none;gap:0}
body.portrait #rcol>#top{position:absolute;left:68px;right:14px;top:calc(var(--safe-top) + 10px);align-items:flex-start;max-width:calc(100vw - 82px);gap:3px}
body.portrait #top .hgrp{flex-direction:row;gap:8px;flex-wrap:wrap}
body.portrait #top .dim{font-size:9px}
body.portrait #saveStatus{position:absolute;top:43px;right:0;font-size:8px}
body.portrait #rfoot{position:absolute;left:12px;right:12px;bottom:calc(var(--safe-bottom) + 10px);margin:0;align-items:stretch;gap:8px}
body.portrait #copy{display:none}
body.portrait #navArrows{position:static;width:100%;justify-content:space-between;flex-direction:row}
body.portrait #navArrows .dim{display:none}
body.portrait #navArrows .hb{width:calc(50% - 6px);height:44px;border-radius:8px}
body.portrait #navArrows.off{display:none}
body.portrait .bbar{justify-content:center;flex-wrap:nowrap;gap:8px;width:100%}
body.portrait .bbar .hb{flex:1;height:44px!important;padding:0 10px;font-size:10px;min-width:0;white-space:normal;text-align:center;border-radius:8px}
body.portrait .bbar .hb kbd,body.portrait .bc small{display:none}
body.portrait #hud.idle .fade{opacity:1}
body.portrait #tools{display:none}
body.portrait.menu-open #tools{display:flex;position:absolute;top:calc(var(--safe-top) + 62px);left:12px;right:12px;bottom:calc(var(--safe-bottom) + 80px);width:auto;align-items:stretch;padding:18px;box-sizing:border-box;background:rgba(14,10,7,.97);border:1px solid #846843;border-radius:12px;z-index:8;overflow:auto;touch-action:pan-y;opacity:1}
body.portrait.menu-open #tools .hb{height:44px!important;min-height:44px;font-size:12px;justify-content:flex-start}
body.portrait.menu-open #tools .icons{grid-template-columns:repeat(3,1fr);justify-content:stretch}
body.portrait.menu-open #tools .icons .hb{width:auto;justify-content:center}
body.portrait.menu-open #tools .hsep{width:100%}
body.portrait .caption{height:auto;min-height:110px;max-height:52%;padding:20px 18px;gap:12px;flex-direction:column;overflow:auto;touch-action:pan-y;justify-content:center;text-align:center}
body.portrait .caption>span,body.portrait .caption.small>span{font-size:21px;line-height:1.32}
body.portrait .caption br{display:none}
body.portrait .caption .bc{width:100%;justify-content:center}
body.portrait .caption.keys{padding:12px;min-height:100px}
body.portrait .caption.keys>span{font-size:17px}
body.portrait .key{height:44px;width:52px;font-size:22px}
body.portrait .notif{top:18px;left:18px;right:18px;max-width:none;padding:10px 12px;font-size:17px}
body.portrait .chip{font-size:9px;max-width:88%;white-space:normal;text-align:center}
body.portrait .bc,body.portrait .bc2{font-size:18px;letter-spacing:.06em;min-height:44px;padding:12px 16px;box-sizing:border-box;white-space:normal;text-align:center;justify-content:center}
body.portrait .namecard,body.portrait .card,body.portrait .verdict{width:calc(var(--fw) - 20px)!important;min-width:0;max-height:calc(var(--fh) - 24px);padding:24px 18px!important;gap:14px;overflow:auto;touch-action:pan-y}
body.portrait .namecard .head,body.portrait .card .head{font-size:32px!important;text-align:center;white-space:normal!important}
body.portrait .namecard .sub{font-size:19px}
body.portrait .namefield{width:100%;box-sizing:border-box;padding-left:10px;gap:4px}
body.portrait .namefield textarea{font-size:26px}
body.portrait .namefield .dice{width:44px;height:44px;font-size:25px}
body.portrait .tip{font-size:15px;min-height:32px;display:flex;align-items:center}
body.portrait .namecard .eyebrow,body.portrait .card .eyebrow{font-size:10px;letter-spacing:.12em;text-align:center}
body.portrait .card>span[style]{font-size:19px!important;text-align:center}
body.portrait .card>div[style*="display:flex"]{flex-wrap:wrap;justify-content:center;gap:10px!important}
body.portrait .card>div>.bc,body.portrait .card>div>.bc2{flex:1;min-width:120px}
body.portrait .tally{width:100%}
body.portrait .tally div{gap:12px}
body.portrait .tally div span:first-child{font-size:17px}
body.portrait .tally div span:last-child{font-size:13px}
body.portrait .gcard{width:calc(var(--fw) - 16px);height:calc(var(--fh) - 24px);grid-template-columns:1fr;grid-template-rows:minmax(100px,30%) 1fr;padding:10px;overflow:auto;touch-action:pan-y;transform:translate(-50%,-50%)}
body.portrait .gc-art{min-height:100px}
body.portrait .gc-lvl{font-size:32px}
body.portrait .gc-crest{width:60px;height:70px;bottom:6px}
.gc-crest svg{display:block;width:100%;height:auto}
body.portrait .gc-body{padding:14px 8px 8px;gap:6px}
body.portrait .gc-name{font-size:clamp(22px,6.5vw,28px)!important;overflow-wrap:normal;white-space:normal}
body.portrait .gc-epi{font-size:21px}
body.portrait .gc-eyebrow{font-size:10px}
body.portrait .gc-stats{grid-template-columns:80px auto 1fr;gap:6px 8px;margin-top:8px;padding-top:8px}
body.portrait .gc-stats .k,body.portrait .gc-stats .v{font-size:10px}
body.portrait .gc-stats .v{min-width:0;white-space:normal;overflow:visible;overflow-wrap:anywhere;line-height:1.35}
body.portrait .pips i{width:13px;height:13px}
body.portrait .gc-go{gap:8px;margin-top:auto;padding-top:10px}
body.portrait .gc-who{font-size:10px;max-width:none;min-height:44px;width:100%;box-sizing:border-box}
body.portrait .gc-who{display:grid;grid-template-columns:1fr auto}
body.portrait .gc-who b{grid-column:1/-1;grid-row:2;white-space:normal;overflow:visible;overflow-wrap:anywhere}
body.portrait .gc-who .chg{grid-column:2;grid-row:1}
body.portrait .gcard .gc-count{font-size:55px}
body.portrait .title .sq{display:none}
body.portrait .tpart{padding:22px;box-sizing:border-box;gap:16px!important;overflow:auto;touch-action:pan-y;justify-content:safe center!important}
body.portrait .tpart>span.old{font-size:26px!important;text-align:center}
body.portrait .tpart>div[style*="display:flex"]{flex-direction:column;width:100%;gap:14px!important}
body.portrait .tpart .bc,body.portrait .tpart .bc2{width:100%;font-size:20px}
body.portrait .tlogo{transform:scale(.42)!important;flex-shrink:0;}
body.portrait .age{font-size:18px}
body.portrait .verdict>small{font-size:10px;letter-spacing:.12em}
body.portrait .verdict>b{font-size:clamp(18px,calc((var(--fw) - 60px) * .09),34px)!important}
body.portrait .verdict>p{font-size:21px;line-height:1.3}
body.portrait .vcrest{width:82px;height:95px}
body.portrait .vscore .vs-n{font-size:50px}
body.portrait .verdict .otk{position:static;align-self:flex-end;font-size:22px}
body.portrait .vacts{flex-direction:column;gap:12px;width:100%}
body.portrait .vacts>*{width:100%;box-sizing:border-box}
body.portrait .studios{padding:24px;gap:20px}
body.portrait .studios .cols{flex-direction:column;gap:20px}
body.portrait .studios .col{width:100%;gap:8px}
body.portrait .studios .lg{height:70px}
body.portrait .studios .eyebrow{font-size:10px;text-align:center}
body.portrait .end .ruslan{font-size:66px!important}
body.portrait .end .old{font-size:48px!important}
body.portrait .end>div:last-child{left:24px!important;right:24px;bottom:32px!important}
body.portrait .end .mono{font-size:12px!important;white-space:normal;line-height:1.6}
body.portrait #boardZ .board{max-height:calc(var(--app-height) - var(--safe-top) - var(--safe-bottom) - 48px);top:calc(var(--safe-top) + 20px);transform:translateX(-50%);width:calc(100vw - 28px)!important}
body.portrait .br{grid-template-columns:22px 1fr 68px;gap:8px;font-size:11px}
body.portrait .br>span:nth-child(3){display:none}
body.portrait .board .shares{flex-wrap:wrap}
body.portrait #stories{height:var(--app-height);box-sizing:border-box;padding:calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);gap:12px;justify-content:center}
body.portrait .sto-card{height:min(64vh,calc(var(--app-height) - var(--safe-top) - var(--safe-bottom) - 200px));max-width:90vw;flex-shrink:0}
body.portrait .sto-side{width:100%;max-width:390px;display:grid;grid-template-columns:1fr 1fr;gap:8px}
body.portrait .sto-side .hb{height:44px;padding:0 8px;justify-content:center;font-size:9px;white-space:normal;text-align:center}
body.portrait .sto-side .pri{grid-column:1/-1}
body.portrait #toast{max-width:calc(100vw - 48px);font-size:12px}
body.portrait #stHead{top:calc(var(--safe-top) + 20px);left:16px;font-size:9px}
body.portrait #stClose{right:16px;top:calc(var(--safe-top) + 12px);height:44px}
body.portrait #stFoot{bottom:calc(var(--safe-bottom) + 16px);left:16px;right:16px}
.notif.toast{z-index:70!important;position:absolute;left:auto;right:calc(var(--safe-right) + 18px);top:calc(var(--safe-top) + 72px);max-width:min(330px,calc(100vw - 60px));pointer-events:none;transform:none!important;animation:none!important}
body.portrait .notif.toast{left:18px;right:18px;top:calc(var(--safe-top) + 72px);max-width:none}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-delay:0ms!important;transition-duration:.01ms!important}}

/* Подсказки Mini App описывают касания во всех размерах окна. */
.hb kbd,.bc small{display:none}
.hks{width:100%;max-width:640px;box-sizing:border-box}
.hk span:first-child{white-space:normal}
body.portrait .hks{grid-template-columns:1fr;gap:8px}
body.portrait .hk{gap:12px;align-items:flex-start}
body.portrait .hk span:first-child{font-size:11px;flex:0 0 94px;letter-spacing:.03em}
body.portrait .hk span:last-child{font-size:16px;line-height:1.3;text-align:left;min-width:0}

/* Запас для длинной надписи повёрнутого штампа на мобильной карточке. */
body.portrait .verdict .otk{margin-right:12px}
