/* Живые элементы интерфейса поверх цельной сцены исходного макета. */
:root{--cut:polygon(13px 0,calc(100% - 13px) 0,100% 13px,100% calc(100% - 13px),calc(100% - 13px) 100%,13px 100%,0 calc(100% - 13px),0 13px)}
body{background:#04171d}.bastion-app{max-width:none;padding:0}.topbar{position:absolute;top:var(--безопасно-сверху,0px);left:0;right:0;max-width:none;z-index:5;padding:14px 22px;pointer-events:none}.topbar>*{pointer-events:auto}.topbar .collection{visibility:hidden}.topbar .icon{background:none;border:0;color:#e9d7ae;font-size:32px;filter:drop-shadow(0 2px 2px #000)}
.lobby{position:relative;isolation:isolate;max-width:none;min-height:calc(100svh - var(--безопасно-сверху,0px));display:flex;flex-direction:column;overflow:hidden;background:#06262b}.scene-art{position:absolute;inset:0;z-index:-2}.scene-art img{width:100%;height:100%;object-fit:cover;object-position:50% 38%}.scene-art:after{content:'';position:absolute;inset:0;background:linear-gradient(#001c2544,transparent 26%,transparent 58%,#021a20bb 85%,#02161b)}
.title{padding:22px 50px 0;text-align:center;position:relative}.title h1{font-size:clamp(48px,8.8vw,100px);font-variant:small-caps;letter-spacing:.025em;font-weight:500;line-height:.85;color:#f7edcd;text-shadow:0 3px 3px #09201f,0 0 35px #0009;margin:5px 0 12px}.title h1 span{font-size:.21em;letter-spacing:.7em;margin-top:13px;padding-left:.7em}.crest{display:flex;align-items:center;justify-content:center;gap:12px;color:#dbc69d;font:30px Georgia;line-height:1}.crest:before,.crest:after{content:'';height:1px;width:60px;background:linear-gradient(90deg,transparent,#dfcead)}.crest:after{transform:scaleX(-1)}
.profile{justify-content:center;gap:10px;margin:14px 0 0;padding:0 15px}.profile strong,.captain{min-height:40px;border:1px solid #aa9e7777;background:linear-gradient(120deg,#072829f0,#08252ddd);box-shadow:inset 0 0 0 2px #132f30,0 3px 7px #0006;border-radius:9px;padding:5px 12px;color:#f5e5bb}.profile strong{font:21px Georgia;display:flex;align-items:center}.profile .captain{display:flex;flex:0 1 auto;gap:8px;align-items:center;max-width:190px}.captain .avatar{width:27px;height:27px;font-size:16px}.captain b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}
.lobby-scene{position:relative;flex:1;min-height:210px}.scene-help{position:absolute;right:20px;bottom:24px;min-width:44px;border:1px solid #cfbf89;background:#052328a8;border-radius:50%;font:23px Georgia;color:#eddfbc}.island-route{position:absolute;left:17%;right:20%;bottom:12px;height:75px;display:flex;justify-content:space-between;align-items:center}.island-route:before{content:'';position:absolute;inset:22px 10px;border-bottom:2px dashed #e4dfca88;transform:rotate(13deg);pointer-events:none}.island-node{position:relative;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:1px solid #dfd6ac;border-radius:50%;font:23px Georgia;color:#f9f0d9;background:radial-gradient(#134345,#051b22);box-shadow:0 2px 8px #0009}.island-node:nth-child(2){top:15px}.island-node:nth-child(3){top:28px}.island-node.current{box-shadow:0 0 0 3px #e8c47b33,0 0 20px #e4b45988;border-color:#ffe5a2}.island-node:disabled{opacity:.65;color:#cfc7b2}
.lobby-body{width:min(92%,760px);margin:18px auto 0;padding:0}.mission{position:relative;text-align:center;padding:19px 20px 15px;border:1px solid #b7af86;border-radius:0;background:radial-gradient(ellipse at 90% 25%,#35605a55,transparent 50%),linear-gradient(120deg,#082e30ee,#041e22f5);box-shadow:inset 0 0 0 3px #173b3b,inset 0 0 0 4px #5a6e5a88,0 8px 20px #0007;clip-path:var(--cut)}.mission:before{content:'✥';position:absolute;font:190px Georgia;right:-20px;top:-48px;color:#63807722;pointer-events:none}.mission h2{font-size:clamp(31px,5.6vw,52px);margin:9px 0 5px;line-height:1.05;color:#f3ecd6;text-shadow:0 3px 2px #0006}.mission .eyebrow{font:11px Georgia;letter-spacing:2px;color:#edcc83}.mission-meta{font:16px Georgia;color:#d4d6be!important;margin:0 0 8px}.mission #mission-tip{display:none}.difficulty{margin:8px auto 0;gap:4px;max-width:440px}.difficulty button{background:transparent;border:0;border-bottom:1px solid #6b827566;border-radius:0;color:#afc2b7;font:12px Georgia;min-height:35px}.difficulty [aria-pressed=true]{background:linear-gradient(transparent,#b8944433);border-color:#d5ad62;color:#f8df9b}.sea-divider{display:flex;align-items:center;gap:15px;justify-content:center;color:#7ea999;font:28px Georgia;line-height:1;margin:5px auto}.sea-divider:before,.sea-divider:after{content:'';height:1px;background:linear-gradient(90deg,transparent,#be9f60);width:30%}.sea-divider:after{transform:scaleX(-1)}
.primary{position:relative;min-height:56px;justify-content:center;text-transform:uppercase;letter-spacing:1px;font:700 clamp(17px,3vw,26px) Georgia;color:#291d0b;border:1px solid #ffdf8c;clip-path:var(--cut);border-radius:0;padding:14px 22px;background:radial-gradient(ellipse at 10% 20%,#fff0b566,transparent 50%),repeating-linear-gradient(115deg,#dda73518 0 1px,transparent 1px 4px),linear-gradient(120deg,#a47323,#ecc361 35%,#d5a345 70%,#8c611e);box-shadow:inset 0 0 0 3px #57370f,inset 0 0 0 4px #f3d085,inset 0 0 15px #f6d389,0 3px 15px #0007;text-shadow:0 1px #ffe3a888}.primary:before,.primary:after{content:'✧';position:absolute;left:17px;font:24px Georgia;color:#493419}.primary:after{left:auto;right:17px}.primary:disabled{opacity:.58}.island-picker{width:100%;margin:9px 0 0;font:20px Georgia;min-height:51px;background:linear-gradient(100deg,#052624d9,#092f30e8);border:1px solid #b6bd96;border-radius:10px;box-shadow:inset 0 0 0 2px #082120}.island-picker>span{font-size:25px;margin-right:13px;color:#ddcfaa}
.lobby-nav{margin:15px calc((100vw - 100%)/-2) 0;padding:8px max(4vw,calc((100vw - 760px)/2));display:grid;gap:0;border-top:2px solid #8d9d8666;background:linear-gradient(#031b1c99,#021518f0)}.lobby-nav button{position:relative;font:clamp(13px,2.8vw,18px) Georgia;min-height:75px;padding:5px;gap:3px;color:#b4bdaa}.lobby-nav span{font-size:32px;color:#d2c7a2}.lobby-nav img{width:42px;height:38px;object-fit:contain;justify-self:center}.lobby-nav .active{color:#fae0a6;background:radial-gradient(ellipse at 50% 100%,#d1a74b33,transparent 75%)}.lobby-nav .active:after{content:'';position:absolute;bottom:0;left:12%;right:12%;height:2px;background:#e4bd6b}.lobby-nav .active span{color:#f5d086}#continue{margin:0 0 10px;font-size:16px;background:linear-gradient(#214946,#0c3338);color:#e6d4a8;border-color:#ceb377;text-transform:none}
@media(min-width:900px){.title{padding-top:35px}.lobby-scene{min-height:250px}.lobby-body{width:min(62%,770px)}.mission{padding:22px 34px 20px}.profile{margin-top:18px}.island-route{left:25%;right:27%;bottom:5px}.lobby-nav button{min-height:84px}}
@media(max-width:500px){.title{padding-top:28px}.title h1{font-size:55px}.crest{font-size:24px}.profile{margin-top:5px}.lobby-body{margin-top:12px}.mission{padding:14px 11px 12px}.lobby-scene{min-height:200px}.mission .eyebrow{font-size:9px;letter-spacing:1.5px}.mission-meta{font-size:14px}.mission h2{font-size:33px}.sea-divider{font-size:22px;margin:4px auto}.lobby-nav{margin-top:11px}.lobby-nav button{min-height:68px}.scene-help{bottom:0;right:12px}.primary{min-height:53px}.lobby .title h1 span{margin-top:11px}.island-picker{font-size:19px;min-height:47px}.island-route{bottom:8px}}
@media(max-height:700px) and (orientation:portrait){.lobby-scene{min-height:140px}.title{padding-top:24px}.title h1{font-size:48px}.mission h2{font-size:29px}.lobby-nav button{min-height:60px}.lobby .profile{margin-top:0}}

/* Бой: остров без полей, обрамлённые морской эмалью панели. */
.in-battle .topbar{position:relative;height:43px;padding:0 16px;max-width:none;background:#04232a}.in-battle .topbar .icon{font-size:25px;height:42px}.in-battle .collection{visibility:visible;font:14px Georgia;letter-spacing:2px;color:#e0cc9c}.battle-heading{display:none}.hud{position:relative;z-index:2;margin:0;padding:8px 13px;max-width:none;border-width:1px 0;border-radius:0;background:linear-gradient(#06252d,#02191e);gap:9px;box-shadow:inset 0 -3px #152f32}.hud>div{display:flex;align-items:center;gap:9px;justify-content:center;border-right:1px solid #bfa46444}.hud small{font:10px Georgia;color:#b4c1b9;letter-spacing:1px}.hud b{font-size:24px;color:#f2ead5}.hud>div:first-child:before{content:'⬟';font-size:27px;color:#efbb56;text-shadow:1px 2px #69491f}.hud>div:nth-child(2):before{content:'◉';font-size:29px;color:#e9bf5b;text-shadow:1px 2px #664510}.battle-layout{max-width:none;margin:0;grid-template-columns:minmax(0,1fr) 340px;gap:0;align-items:stretch}.field-column{position:relative;min-width:0;width:100%;margin:0;background:linear-gradient(#0b5360,#063740)}.field-wrap{border:0;border-radius:0;width:100%;max-width:none;box-shadow:none}.field-caption{background:#072b2df0;padding:5px 15px;color:#d7d6be;font:13px Georgia}.tutorial{display:none}.command{border-radius:0;outline:0;border:1px solid #286175;padding:22px;gap:18px;box-shadow:inset 0 0 0 4px #061f29,inset 0 0 0 5px #205766;background:radial-gradient(ellipse at 90% 25%,#124251aa,transparent 50%),linear-gradient(#031c24,#062935)}.command .tower-panel{order:0}.command .wave-preview{order:1}.command .compact-selection{order:0}.command .spells{order:2}.command #launch{order:3}.command .quiet{order:4}.panel-intro{gap:8px}.panel-intro img{width:46%;height:140px;object-fit:contain;filter:drop-shadow(0 7px 6px #000a)}.panel-intro h2{font-size:28px}.panel-intro .eyebrow{font-size:10px}.tower-panel p{font:15px/1.4 Georgia;color:#d7d8c6}.tower-panel h2{color:#f6edcf}.stats{padding:15px 0}.stats b{font:23px Georgia}.stats small{font:12px Georgia;color:#c0ceca}.upgrade-button,.sell-button{padding:13px 10px;text-align:center;border:1px solid #9ab3a4;border-radius:0;font:18px Georgia;background:linear-gradient(120deg,#0e3b40,#05212b);box-shadow:inset 0 0 0 3px #0a1e26,inset 0 0 0 4px #41717a;clip-path:var(--cut);min-height:51px}.upgrade-button{background:linear-gradient(120deg,#68521f,#b18a36,#695022);color:#fff0bd;border-color:#e9ce82}.upgrade-button small{font:12px Georgia;margin-top:6px;color:#ebdba9}.sell-button{font-size:16px;color:#d3ddd2;margin-top:8px}.wave-preview{padding:14px 0;border-top:1px solid #315b61;border-bottom:1px solid #315b61}.wave-preview .eyebrow{font:20px Georgia;letter-spacing:0;text-transform:none;color:#e5d4a6}.enemy-chip{font:13px Georgia;padding:6px 9px}.enemy-chip img{width:35px;height:38px}.spells button{clip-path:var(--cut);gap:8px;padding:5px;border-color:#7d9e9e}.spell-icon{display:block;flex:0 0 52px;width:52px;height:57px}.spell-icon img{width:100%;height:100%;object-fit:cover;mask-image:radial-gradient(ellipse,#000 45%,transparent 74%)}.spells b{font:16px Georgia;color:#f4edda}.spells small{font:12px Georgia;color:#b8c8c3}.command .primary{font-size:20px}.tower-choice{border-radius:0;clip-path:var(--cut);min-height:95px}.tower-choice b{font:12px Georgia}.tower-choice img{width:80px;height:75px}.compact-selection{padding:0 0 8px}.compact-selection img{width:75px;height:77px}.compact-selection b{font-size:23px}.compact-selection small{font:12px Georgia}.compact-selection button{border-radius:0;font:14px Georgia;min-height:45px;background:linear-gradient(#6b542a,#44321c);color:#f4dca6}
@media(min-width:1000px){.battle-layout{grid-template-columns:minmax(0,1fr) minmax(330px,29vw)}.field-wrap{max-width:calc(100dvh - 106px);margin:auto}.field-column{background-image:linear-gradient(#063f48bb,#043642bb),url('img/бастион/island-a-v1.webp');background-size:cover;background-position:center}.command{max-height:calc(100dvh - 105px);overflow:auto}.command .primary{margin-top:auto}.in-battle .hud{padding-right:30vw}.in-battle .topbar{padding-right:30vw}.command .tower-panel{min-height:0}.command .quiet{display:none}}
@media(max-width:999px) and (orientation:portrait){.battle-layout{display:flex;flex-direction:column;gap:0}.field-wrap{width:100%;aspect-ratio:1}.command{width:100%;padding:13px 16px;gap:9px;display:grid;grid-template-columns:1fr 1fr}.command>#tower-panel{display:none}.compact-selection{display:flex;grid-column:1/-1}.command .wave-preview{grid-column:1/-1;padding:0 0 7px}.wave-preview>div{margin:3px 0 0}.wave-preview .eyebrow{font:12px Georgia}.enemy-chip{font:12px Georgia;padding:2px 7px}.enemy-chip img{width:23px;height:23px}.spells{grid-column:1}.command #launch{grid-column:2;font-size:15px;min-height:58px;padding:10px 15px}.command #launch:before,.command #launch:after{display:none}.command .quiet{display:none}.spell-icon{width:35px;flex-basis:35px;height:41px}.spells button{gap:3px;padding:3px}.spells b{font-size:12px}.spells small{font-size:9px}.hud small{display:none}.hud b{font-size:21px}.hud>div{gap:5px}.hud>div:first-child:before,.hud>div:nth-child(2):before{font-size:20px}.hud .icon{min-width:36px;width:36px;height:40px}.field-caption{min-height:25px;font-size:11px}.in-battle .topbar{height:37px}.in-battle .topbar .icon{height:37px;min-height:37px;font-size:21px}.in-battle .collection{font-size:11px}.compact-selection[hidden]{display:none}}
@media(orientation:landscape) and (max-height:600px){.battle-layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:0}.field-wrap{max-width:calc(100dvh - 94px);margin:auto}.command{max-height:calc(100dvh - 94px);overflow:auto;padding:12px;gap:9px}.command>#tower-panel{display:none}.compact-selection{display:flex}.compact-selection img{width:56px;height:57px}.compact-selection b{font-size:18px}.compact-selection small{font-size:10px}.spells button{padding:3px}.spell-icon{width:39px;flex-basis:39px;height:43px}.spells b{font-size:13px}.command #launch{font-size:15px}.hud b{font-size:22px}.hud small{display:none}.field-caption{display:none}}

/* Мастерская: большой предмет и две ветви в композиции макета. */
dialog[data-mode="arsenal"],dialog[data-mode="tower"]{width:min(760px,100%);max-height:100dvh;height:100dvh;margin:0 auto;border-radius:0;padding:30px 30px 25px;background:linear-gradient(#03151b22,#031b21 95%),url('img/бастион/workshop-scene-v3.webp') center top/cover;border:1px solid #8d9e88;overflow:auto;isolation:isolate}dialog[data-mode="arsenal"] h2,dialog[data-mode="tower"] h2{text-align:center;font-variant:small-caps;letter-spacing:2px;font-size:38px;color:#f5e8c6;margin:0 25px 10px}dialog[data-mode="arsenal"] .workshop-subtitle{text-align:center;font:17px Georgia;color:#e1d8bf}.workshop-hero{height:clamp(200px,35dvh,410px);display:flex;justify-content:center;align-items:end;position:relative}.workshop-hero img{height:100%;width:75%;object-fit:contain;filter:drop-shadow(0 15px 12px #000b)}.workshop-hero.mortar img{visibility:hidden}.workshop-title{text-align:center;font:30px Georgia;color:#f1e8d2;margin:12px 0 4px}.workshop-description{text-align:center;font:15px/1.4 Georgia;color:#d5d8cb}.arsenal-grid{display:flex;justify-content:center;gap:4px;background:#02191fe6;padding:7px;border:1px solid #607f7966;margin:14px 0}.arsenal-card{width:16.666%;border:1px solid transparent;border-radius:0;padding:4px;background:transparent;min-height:78px}.arsenal-card img{height:57px;width:100%}.arsenal-card b{font:10px Georgia}.arsenal-card small{display:none}.arsenal-card[aria-pressed=true]{background:radial-gradient(#b7984244,transparent);border-color:#cbb375}.branches{grid-template-columns:1fr 1fr;gap:13px;margin:19px 0}.branches article{position:relative;border:1px solid #ada275;clip-path:var(--cut);border-radius:0;padding:0 0 12px;background:linear-gradient(#092a30,#03191eea);text-align:center;overflow:hidden}.branches article img{display:block;width:100%;height:100px;object-fit:cover;mask-image:linear-gradient(#000 65%,transparent)}.branches article h3{font:20px Georgia;text-transform:uppercase;color:#f5e7bf;margin:0 5px 8px}.branches article p{font:14px Georgia;line-height:1.4;margin:0 8px;color:#cecfb9}.workshop-preparation{background:#031b20ed;padding:14px;border:1px solid #627969}.workshop-preparation h3{text-align:center;font:20px Georgia;margin:0 0 10px;color:#e9d7ac}.preparation{grid-template-columns:repeat(4,1fr);gap:5px}.preparation button{font:12px Georgia;text-align:center;padding:9px 3px;border-radius:0;min-height:70px}.preparation small{font:10px Georgia;line-height:1.3}.workshop-footnote{text-align:center;font:13px Georgia;color:#b2c7c1;margin:13px 0}dialog[data-mode="tower"] .tower-detail-hero{height:220px;width:230px}dialog[data-mode="tower"] .branches article{padding:18px 8px}.map-card{border-radius:0;clip-path:var(--cut);background:linear-gradient(#123d42,#041f27)}.map-card.selected{box-shadow:inset 0 0 14px #c99f4433}.notice{z-index:15;background:#082930ed;font:14px Georgia;border-radius:3px}
@media(max-width:500px){dialog[data-mode="arsenal"],dialog[data-mode="tower"]{padding:22px 15px 18px}.workshop-hero{height:255px}dialog[data-mode="arsenal"] h2,dialog[data-mode="tower"] h2{font-size:29px}.branches article h3{font-size:16px}.branches article img{height:82px}.branches article p{font-size:12px}.arsenal-card{min-height:66px}.arsenal-card img{height:45px}.workshop-title{font-size:30px}.preparation{grid-template-columns:1fr 1fr}.preparation button{min-height:59px}.workshop-description{font-size:13px}.notice{font-size:12px}}

/* Завершающая компоновка: без растягивания строк панели и обрезанного маяка. */
.command{align-content:start;grid-auto-rows:max-content}.command #launch{margin-top:5px}.command .spells{min-height:70px}.mission:before{content:'✥';font-size:120px;top:0;opacity:.45}.scene-help{width:38px;min-width:38px;min-height:38px;height:38px;font-size:20px}
@media(min-width:900px){.scene-art img{content:url('img/бастион/lobby-wide-v3.webp');object-position:center center}.lobby-body{width:min(60%,770px)}.lobby-scene{min-height:250px}}
@media(max-width:500px){.profile strong{font-size:18px}.profile .captain{max-width:155px}.captain b{font-size:10px}.profile{gap:8px}.island-node{width:39px;height:39px;min-height:39px;font-size:21px}.workshop-hero{height:210px}.workshop-description{padding:0 6px}.arsenal-card{padding:2px}.arsenal-card b{font-size:9px}.command .spells{min-height:52px}}
dialog[data-mode="arsenal"]:not([data-preview="mortar"]){background-image:linear-gradient(#031e22bb,#031b21f5),url('img/бастион/lobby-scene-v3.webp')}

.in-battle{position:relative}.battle-heading{display:block;position:absolute;top:1px;right:63px;z-index:6;margin:0}.battle-heading>div{display:none}.battle-heading #game-help{border:0;background:none;color:#d6c79e;height:39px;min-height:39px}.field-column{background-image:none;background-color:#06333c}@media(min-width:1000px){.battle-heading{right:calc(30vw + 51px)}}

@media(max-width:999px) and (orientation:portrait){
 .hud{grid-template-columns:repeat(3,minmax(0,1fr)) 34px 34px;gap:4px;padding:6px 8px}.hud b{font-size:19px;white-space:nowrap}.hud>div:first-child b{font-size:17px}.hud>div{gap:4px}.hud>div:first-child:before,.hud>div:nth-child(2):before{font-size:16px}.hud .icon{width:34px;min-width:34px}
 .command .wave-preview{grid-column:1;border-bottom:0;padding:4px 0;align-self:center}.command #launch{order:1;grid-column:2;font-size:15px;min-height:60px;margin:0;align-self:center}.command .spells{grid-column:1/-1;min-height:58px}.spells button{padding:5px;gap:6px}.spell-icon{width:45px;flex-basis:45px;height:46px}.spells b{font-size:15px}.spells small{font-size:11px}
}
.command .primary:before,.command .primary:after{display:none}.command .primary{font-size:18px;padding-inline:12px}.field-caption .text-button{min-height:28px;padding:3px 0}
@media(min-width:1000px){.field-wrap{max-width:calc(100dvh - 143px)}.field-caption{min-height:37px}}
@media(max-width:999px) and (orientation:portrait){.command .primary{font-size:15px}}
