/* Морские Владыки v14 · Живое море · cohesive ornamental UI */
:root{
 --ink:#4d3020;--ink-soft:#75563d;--wood:#321e12;--wood2:#614025;--gold:#e7c584;--gold-dark:#8d5a2c;--paper:#f3e1c1;--paper-light:#fff2d4;
 --sea:#06334a;--nav-h:72px;--top-h:64px;--chrome-font:Georgia,'Times New Roman',serif;
 color-scheme:light; font-family:Arial,'Trebuchet MS',sans-serif;
}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:transparent}
button,input,select,textarea{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.48;cursor:not-allowed}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #ebc36e;outline-offset:2px}
button:hover:not(:disabled){filter:brightness(1.09)}
.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}.icon{width:23px;height:23px;display:inline-block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
[hidden]{display:none!important}
.game-shell{position:relative;height:100dvh;width:100%;max-width:1600px;margin:auto;isolation:isolate;overflow:hidden;background:transparent}
.topbar{position:absolute;z-index:40;inset:0 0 auto;height:calc(var(--top-h) + env(safe-area-inset-top));display:flex;align-items:center;gap:6px;padding:calc(env(safe-area-inset-top) + 5px) 9px 7px;background:#2a190e url('../img/ui/wood.webp') repeat;border-bottom:3px ridge #c9994d;box-shadow:0 3px 12px #000b,inset 0 2px 0 #e3b97761;color:#fff1c9}
.brand{display:flex;align-items:center;gap:6px;min-width:0;margin-right:auto;text-shadow:0 2px 1px #000;font-family:var(--chrome-font);font-size:clamp(13px,2.2vw,20px);font-weight:700;line-height:.98;letter-spacing:-.02em;white-space:nowrap;color:#f9dda0}
.brand-wheel{width:32px;height:32px;border:2px solid #d5a85f;background:radial-gradient(#66431f,#271910);box-shadow:0 0 0 1px #1a0f0a,inset 0 0 4px #f6db8966;border-radius:50%;display:flex;align-items:center;justify-content:center}
.brand-wheel .icon{width:28px;height:28px;color:#f6d18c;stroke-width:1.35}
.balance{height:39px;display:flex;gap:4px;align-items:center;flex:none;padding:3px 8px 3px 4px;border:1px solid #dfab66;box-shadow:inset 0 0 0 2px #332110,0 2px 6px #0008;background:linear-gradient(#32200f,#120e0a);border-radius:8px;color:#f7e1af;white-space:nowrap;font:700 15px var(--chrome-font)}
.d-coin{display:grid;place-items:center;width:27px;height:27px;background:radial-gradient(circle at 35% 24%,#ffeea7,#d9a33c 53%,#8c4a13 88%);color:#784116;font:700 18px var(--chrome-font);border:2px solid #ffd97e;border-radius:50%;box-shadow:0 1px 3px #000}.d-text{font-size:11px;color:#dab373}
.top-action{min-height:38px;min-width:37px;display:grid;place-items:center;position:relative;flex:none;border:1px solid #be9156;color:#ebc785;border-radius:7px;background:linear-gradient(#452b18,#1d120a);box-shadow:inset 0 1px #eec77b50,0 2px 4px #0007;padding:5px}
.top-action .icon{width:24px;height:24px}.lang-toggle{font:700 12px Georgia,serif}.unread{position:absolute;right:-5px;top:-5px;min-width:19px;height:19px;padding:1px 4px;border:1px solid #ffcb80;border-radius:18px;background:#b42b22;color:#fff;font:700 12px/16px Arial;text-align:center}
#sea{position:absolute;inset:calc(var(--top-h) + env(safe-area-inset-top)) 0 calc(var(--nav-h) + env(safe-area-inset-bottom));overflow:hidden;background:#06506a url('../img/ui/world_mobile.webp') center top / cover no-repeat}
#sea::before{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,#fff7cc16,transparent 26%,#001e3c14 70%,#07233245);z-index:1}
.sea-sunlight{position:absolute;inset:0;pointer-events:none;background:linear-gradient(100deg,transparent 20%,#c2f9ff08 49%,transparent 70%);background-size:220% 100%;animation:sea-glimmer 20s linear infinite alternate;mix-blend-mode:screen}
@keyframes sea-glimmer{from{background-position:0 0}to{background-position:100% 0}}
#map{position:absolute;inset:0;width:100%;height:100%;z-index:2;touch-action:none}
.mapcontrols{position:absolute;z-index:5;top:15px;right:12px;display:flex;flex-direction:column;gap:9px}
.mapcontrols button{display:grid;place-items:center;width:43px;height:43px;color:#f9deb0;font:700 25px/1 Georgia;border:2px solid #c89b5e;border-radius:50%;background:radial-gradient(#53331b,#1d140e);box-shadow:inset 0 0 0 2px #68411c,0 4px 9px #00142285}
.mapcontrols .icon{width:22px;height:22px}
.nav{position:absolute;z-index:30;inset:auto 0 0;height:calc(var(--nav-h) + env(safe-area-inset-bottom));display:flex;align-items:stretch;justify-content:space-around;padding:5px 7px calc(6px + env(safe-area-inset-bottom));gap:2px;background:#2b1a10 url('../img/ui/wood.webp') repeat;border-top:3px ridge #ce9b56;box-shadow:0 -4px 14px #001b28b0}
.nav button{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;padding:3px 0;background:transparent;border:1px solid transparent;border-radius:7px;color:#e7bf79;text-shadow:0 2px 2px #080402}
.nav button .icon{width:27px;height:27px;stroke-width:1.55}.nav button small{font:700 10px/1.13 var(--chrome-font);color:#f2e1c1;white-space:nowrap}
.nav button.active{background:linear-gradient(#77502c,#39200f);border-color:#efb85d;box-shadow:inset 0 0 0 1px #f6c7735c,0 0 12px #f7be6e3d}
.nav button.active .icon,.nav button.active small{color:#ffe1a5}

.ship-poster{position:relative;isolation:isolate;min-width:0;min-height:240px;overflow:hidden;border:3px ridge #bb8a51;border-radius:11px;background:linear-gradient(#7ba8b8aa,#07385233),url('../img/ui/world_landscape.webp') center 51% / cover;box-shadow:inset 0 0 15px #081d29b2,0 3px 7px #0004}
.ship-poster.compact{min-height:164px;height:164px}.ship-picture-sea{position:absolute;inset:0;background:linear-gradient(180deg,transparent 45%,#031b2fc4)}
.ship-illustration{position:absolute;left:3%;top:4%;width:94%;height:79%;object-fit:contain;filter:drop-shadow(1px 8px 6px #001b27bb)}
.ship-art-label{position:absolute;z-index:4;top:7px;left:7px;max-width:75%;border:1px solid #f3cf83c1;border-radius:5px;background:#082332bc;color:#ffebba;padding:4px 5px;font:700 9px Arial;letter-spacing:.07em}
.ship-stat-chips{position:absolute;z-index:4;bottom:7px;left:5px;right:5px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.ship-stat-chips span{display:flex;gap:3px;align-items:center;justify-content:center;min-width:0;border:1px solid #e5bd74a1;border-radius:5px;background:#071c2ee9;box-shadow:inset 0 1px #ffffff1c;color:#fff5d9;padding:5px 2px;font:700 11px/1.2 Georgia;white-space:nowrap}
.ship-stat-chips i{font-style:normal;color:#f1ba70}.ship-poster.compact .ship-illustration{height:73%;top:5%}.ship-poster.compact .ship-art-label{font-size:8px}.ship-poster.compact .ship-stat-chips{grid-template-columns:repeat(2,minmax(0,1fr))}.ship-poster.compact .ship-stat-chips span{font-size:9px;padding:3px 0}
.ship-summary{min-width:0;display:flex;flex-direction:column;gap:8px;padding:3px 0}.ship-summary-title{font:700 15px/1.2 var(--chrome-font);color:#552b17}.ship-summary-line{display:flex;gap:6px;flex-wrap:wrap;justify-content:space-between;font:600 11px/1.55 Arial}.ship-summary-line span{white-space:nowrap}
.progress{height:10px;background:#564a31;border-radius:20px;border:1px solid #81663d;overflow:hidden;box-shadow:inset 0 1px 3px #0013}.progress span{height:100%;display:block;background:linear-gradient(#a5e371,#34843c)}
.pirate-mini{display:grid;grid-template-columns:110px 1fr;gap:10px;align-items:center}.pirate-mini img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:8px;background:#0b5570}.pirate-mini p{margin:7px 0;font-size:13px;line-height:1.5}

/* Parchment full-screen content panels */
.sheet{position:absolute;z-index:20;top:calc(var(--top-h) + env(safe-area-inset-top));bottom:calc(var(--nav-h) + env(safe-area-inset-bottom));left:0;right:0;overflow:auto;scrollbar-width:thin;padding:14px 13px 30px;color:#3e2717;background:#eed8b3 url('../img/ui/parchment.webp') repeat;border-top:2px solid #bb8c4b;box-shadow:0 -5px 18px #0007}
.sheet[hidden]{display:none}.grab{display:none}.sheet h2{font:700 23px/1.15 var(--chrome-font);margin:0 0 13px;color:#5e321c;text-shadow:0 1px #ffe8ae}
.sheet h3{font:700 18px/1.2 var(--chrome-font);color:#5b321d;margin:15px 0 9px}
.sheet p{margin:6px 0 10px;font:13px/1.55 Arial;color:#5d4d38}
.section-head{display:flex;gap:10px;align-items:center;justify-content:space-between}.section-head>span{font-size:12px;color:#7a5e38}
.sheet .row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.sheet .boxlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:9px}
.sheet .item{display:block;text-align:left;min-width:0;padding:11px 12px;border:1px solid #bd9161;border-radius:10px;background:linear-gradient(#fff2d8b8,#e7cca48f);color:#3e291b;box-shadow:inset 0 1px #fff,0 2px 4px #70513224}
.sheet .item b{display:block;font:700 15px/1.35 var(--chrome-font)}.sheet .item small{display:block;font:12px/1.5 Arial;color:#6c5136}.sheet .item .row{margin-top:8px}
.sheet .item button{font-size:12px}
.sheet .local{padding:11px 10px;border:1px solid #c69e68;border-radius:8px;background:#f8eed9;font-size:12px;color:#523d2e;line-height:1.8;margin:8px 0}
.woodbtn{border:1px solid #b99253;border-bottom-color:#613817;border-radius:8px;background:linear-gradient(#266785,#124159 52%,#073047);color:#ffedc7;font:700 13px/1.18 var(--chrome-font);min-height:42px;min-width:0;padding:9px 12px;text-shadow:0 1px 2px #001c28;box-shadow:inset 0 1px 0 #aee5eb5e,inset 0 0 0 2px #001d2845,0 3px 5px #3a240f61}
.woodbtn.danger{background:linear-gradient(#b34a35,#7a1d16);border-color:#e4b46d}.woodbtn.gold{background:linear-gradient(#9c6a3c,#593315);border-color:#d9ae69}.woodbtn.secondary{background:linear-gradient(#faefdb,#e2c69f);color:#5a3922;text-shadow:none;border-color:#a97c50}
.action-unit{position:relative;display:inline-flex;flex:1 1 auto;min-width:0;align-items:stretch}.action-unit>.woodbtn{flex:1;min-width:0;padding-right:24px}
.action-info{position:absolute;right:2px;top:2px;display:grid;place-items:center;min-width:20px;height:20px;padding:0 3px;border:1px solid #8a572d;border-radius:50%;color:#51301a;background:#f3d59d;box-shadow:0 2px 4px #0005;font:700 11px Georgia}
.helpLink{border:1px solid #a97743;background:#ead4ad;border-radius:50%;width:23px;height:23px;line-height:20px;font:bold 11px Georgia;color:#65401e}
/* Ship detail card */
.sheet .ship-profile{position:relative;margin:13px 0 18px;padding:11px 10px 12px;background:#f2e4ca url('../img/ui/parchment.webp') repeat;border:3px ridge #a9713b;border-radius:15px;box-shadow:0 8px 20px #4a341e57,inset 0 0 0 3px #ffe8b2}
.ship-profile:before{content:'';position:absolute;inset:5px;pointer-events:none;border:1px solid #c5a477;border-radius:9px}
.ship-profile-heading{display:flex;justify-content:space-between;align-items:center;gap:9px;padding:5px 7px 12px;text-align:center}
.ship-profile h3,.sheet .ship-profile h3{margin:0;font:700 19px/1.25 var(--chrome-font);color:#4d2d1b}
.ship-state{border:1px solid #9e7445;border-radius:17px;background:#dce7d7;color:#225b3a;font:bold 10px Arial;padding:5px 8px;white-space:nowrap}
.ship-profile-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:11px}
.ship-side{min-width:0;display:flex;flex-direction:column;gap:12px}.ship-extra{font:12px/1.7 Arial;color:#65432d;border-top:1px solid #bb956d;padding-top:9px}.ship-extra>div{margin:3px 0}.ship-extra b{color:#643618}
.ship-command-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0 0}.ship-command-row>.action-unit{min-width:0;width:100%}
.ship-command-row .woodbtn{min-height:49px;padding-left:3px;padding-right:20px;font-size:13px}.advanced-actions{margin-top:12px;border-top:1px solid #c6a579;padding:7px 0}.advanced-actions summary{font:700 14px/2 var(--chrome-font);color:#684323;cursor:pointer}.advanced-actions .row{padding:8px 0}
.ship-fleet-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(205px,1fr));gap:10px}.fleet-ship{min-width:0;padding:5px 7px;border:2px solid #9c6d39;border-radius:10px;background:linear-gradient(#fff2d9,#e6cba6);color:#422819;box-shadow:inset 0 0 0 1px #ffe5b5,0 4px 7px #4c342a3c}.fleet-ship.current{border-color:#d2943c;box-shadow:0 0 0 2px #c89852}.fleet-ship-thumb{height:80px;border-radius:7px;background:#0b465d url("../img/ocean.webp") center/auto 125% no-repeat;overflow:hidden}.fleet-ship-thumb img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(1px 3px 4px #0009)}.fleet-ship-text{min-width:0}.fleet-ship-text b{display:block;font:700 15px/1.35 var(--chrome-font)}.fleet-ship-text small{display:block;font:11px/1.5 Arial;color:#79583c}
.island-hero{width:100%;height:200px;overflow:hidden;border:3px ridge #bb8c5a;border-radius:10px;background:#0b6680;margin:6px 0 12px;box-shadow:0 2px 7px #2a1a1161}.island-hero img{width:100%;height:100%;object-fit:cover;object-position:center 35%}
.tag{display:inline-block;padding:4px 7px;margin:2px;border-radius:15px;border:1px solid #d2a96f;background:#f8e3b8;color:#58371d;font:700 11px Arial}
/* Forms, settings, event log */
#overlay{position:fixed;z-index:100;inset:0;background:#041b29c9;display:flex;align-items:center;justify-content:center;padding:12px 10px calc(12px + env(safe-area-inset-bottom));backdrop-filter:blur(4px)}
.dialog{--dialog-padding:clamp(14px,3vw,24px);display:flex;flex-direction:column;width:min(490px,100%);max-height:min(90dvh,780px);overflow:hidden;color:#53331e;border:3px ridge #ab7744;border-radius:16px;background:#f4e5c5 url('../img/ui/parchment.webp');box-shadow:0 18px 70px #000b,inset 0 0 0 3px #f9dca7}
.dialog .head{display:flex;flex:none;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #c6a475;padding:var(--dialog-padding) 0 10px;margin-inline:var(--dialog-padding)}
.dialog-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding:12px var(--dialog-padding) var(--dialog-padding)}
.dialog h2{font:700 22px Georgia,serif;color:#613716;margin:0}.dialog h3{font:700 17px Georgia;margin:12px 0 6px}.dialog .head>button{width:35px;height:35px;border:1px solid #a47443;background:#58351d;border-radius:7px;color:#ffe6ad;font-size:22px}.dialog p,.dialog li{font:13px/1.65 Arial}.dialog .row{display:flex;gap:8px;flex-wrap:wrap;margin:11px 0}.dialog .row>button{flex:1}
.dialog label{display:block;font:700 13px/1.5 Arial;margin:12px 0 9px}.dialog input:not([type=checkbox]):not([type=range]),.dialog select{width:100%;display:block;border:1px solid #b58d58;border-radius:7px;background:#fff9ea;color:#4f311f;padding:10px 11px;min-height:44px;margin-top:5px}.dialog input[type=checkbox]{width:19px;height:19px;vertical-align:middle;accent-color:#1e7285}.dialog input[type=range]{display:block;width:100%;accent-color:#0b6984}.dialog .feed{border-bottom:1px solid #cab18d;padding:11px 0;font:13px/1.5 Arial}.dialog .feed small{display:block;color:#887051;margin-top:4px}.dialog a{color:#13759a}
#toast{position:fixed;z-index:120;bottom:calc(var(--nav-h) + 15px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:none;max-width:min(420px,92%);min-width:220px;padding:12px 15px;border-radius:9px;border:1px solid #d7a05e;box-shadow:0 6px 20px #000a;background:#192c31;color:#ffe2b3;font:13px/1.4 Arial;text-align:center}#toast.visible{display:block}
/* v14 integrated section-specific components */
.section-banner{position:relative;height:150px;border:2px solid #ae7c45;border-radius:9px;overflow:hidden;margin:0 0 12px;background:#18718d}.section-banner img{display:block;width:100%;height:100%;object-fit:cover}.section-banner .section-banner-title{position:absolute;left:0;bottom:0;right:0;padding:10px 14px;color:#ffe6af;text-align:center;font:700 21px Georgia;text-shadow:0 2px 3px #000;background:linear-gradient(transparent,#0e221fdc)}
.local-resources{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;background:#fff1d7;border:1px solid #c4a57a;border-radius:8px;padding:7px;margin:11px 0}.resource-pill{display:flex;flex-direction:column;align-items:center;gap:3px;border-right:1px solid #dac29c;font:700 11px Arial}.resource-pill:last-child{border:0}.resource-pill strong{font:700 14px Georgia}.resource-pill i{font-style:normal;font-size:20px}
.building-row{display:grid;grid-template-columns:66px minmax(0,1fr) auto;gap:10px;align-items:center;min-height:70px;padding:6px 7px;border-bottom:1px solid #c7a778}.building-row img{width:66px;height:55px;object-fit:cover;border:1px solid #b98951;border-radius:5px}.building-row b{font:700 15px Georgia}.building-row small{display:block;font:11px/1.4 Arial;color:#755638}.building-row .woodbtn{min-height:36px;min-width:38px;padding:5px 9px}
.service-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.service-tile{min-width:0;border:2px ridge #a77746;border-radius:9px;background:#eed4ab;overflow:hidden;padding-bottom:9px;text-align:center}.service-tile>img{width:100%;height:112px;object-fit:cover}.service-tile h3{margin:7px 0!important}.service-tile p{font-size:11px;margin:5px 8px 9px}.service-tile button{max-width:90%}
.captain-panel{display:grid;grid-template-columns:104px minmax(0,1fr);gap:10px;border:1px solid #ba8d59;background:#fbeaca;border-radius:10px;padding:9px;margin:12px 0}.captain-panel>img{width:104px;height:116px;object-fit:cover;object-position:center top;border:2px ridge #b68c52;border-radius:7px}.captain-panel b{font:700 16px Georgia}.captain-panel small{display:block;font:12px/1.45 Arial;color:#70502d}.captain-bonus{display:inline-flex;gap:3px;padding:4px 6px;margin:4px 4px 0 0;color:#fffaf0;background:var(--maritime-green);border:1px solid #81946c;border-radius:6px;font:700 11px Arial}
.shop-card{border:2px ridge #b17a41;border-radius:12px;background:linear-gradient(#fff2d8,#e9cda0);padding:14px;display:flex;gap:10px;align-items:center;justify-content:space-between;margin-bottom:8px}.shop-card b{font:700 18px Georgia}.shop-card small{display:block;color:#745335;font:12px/1.6 Arial}.shop-card .woodbtn{white-space:nowrap}
.zero-box{text-align:center;border:1px dashed #c39e70;padding:19px;border-radius:10px;color:#765338;font:13px/1.5 Arial;background:#fff0d3}
@media(min-width:760px){:root{--top-h:68px;--nav-h:75px}#sea{background-image:url('../img/ui/world_landscape.webp');background-position:center 30%}.topbar{padding-left:18px;padding-right:18px;gap:12px}.brand{font-size:22px}.brand-wheel{width:40px;height:40px}.brand-wheel .icon{width:36px;height:36px}.top-action{width:44px;height:44px}.balance{padding:5px 12px;font-size:18px}.nav{justify-content:center;gap:12px}.nav button{max-width:145px}.nav button .icon{width:30px;height:30px}.nav button small{font-size:12px}.sheet{left:auto;right:10px;top:calc(var(--top-h) + 12px + env(safe-area-inset-top));bottom:calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));width:min(485px,44vw);border:3px ridge #c39958;border-radius:14px;padding:17px;box-shadow:0 12px 25px #001927a8}.ship-profile-layout{grid-template-columns:1fr}.ship-poster{min-height:230px}.sheet .boxlist{grid-template-columns:1fr 1fr}}
@media(max-width:440px){:root{--top-h:59px;--nav-h:67px}.topbar{gap:4px;padding-left:7px;padding-right:7px}.brand{font-size:13px;gap:4px}.brand-wheel{width:26px;height:26px;border-width:1px}.brand-wheel .icon{width:23px;height:23px}.balance{height:33px;font-size:13px;padding:2px 5px;gap:3px}.d-coin{width:23px;height:23px;font-size:14px}.top-action{min-width:32px;min-height:34px;padding:3px}.top-action .icon{width:21px;height:21px}.nav{gap:0;padding-left:4px;padding-right:4px}.nav button .icon{width:24px;height:24px}.nav button small{font-size:9px}.sheet{padding:13px 9px 22px}.sheet .ship-profile{padding:8px}.ship-profile-layout{grid-template-columns:1fr}.ship-poster:not(.compact){height:242px;min-height:242px}.ship-side{gap:6px}.ship-profile-heading h3{font-size:17px}.ship-command-row{grid-template-columns:repeat(3,minmax(0,1fr))}.ship-command-row .woodbtn{font-size:12px}.ship-poster.compact{height:165px}.mapcontrols{right:9px;top:11px}.mapcontrols button{width:40px;height:40px}}
@media(max-width:359px){.brand{margin-right:auto}.top-action.extra{min-width:28px}.topbar{gap:3px}.nav button small{font-size:8px}}
@media(prefers-reduced-motion:reduce){.sea-sunlight{animation:none}*{scroll-behavior:auto!important}}

/* v15 — art-led, fully immersive sections and vector-controlled navigation */
:root{--top-h:68px;--nav-h:86px;--chrome-font:Georgia,'Palatino Linotype',serif;--display:#f8e8c6}
body{font-family:'Segoe UI',Candara,'Trebuchet MS',sans-serif;font-size:15px}
#sea{background-image:linear-gradient(180deg,rgba(1,33,58,.16),rgba(0,11,32,.27)),url('../img/ocean_only.jpg')!important;background-position:50% 47%;background-size:cover}
#sea::before{background:radial-gradient(ellipse at 77% 10%,#fff3c526,transparent 38%),linear-gradient(0deg,#01273a42,transparent 48%);mix-blend-mode:screen}
.sea-sunlight{background:repeating-linear-gradient(103deg,transparent 0 110px,#b4ffff06 115px 124px,transparent 132px 215px);background-size:250% 100%;animation:sea-glimmer 17s ease-in-out infinite alternate}
.sea-wind-lines{z-index:1;position:absolute;inset:0;pointer-events:none;opacity:.45;background:repeating-linear-gradient(169deg,transparent 0 78px,#cbfbff0b 84px 87px,transparent 94px 215px);background-size:240% 180%;animation:sea-wind 14s linear infinite}
@keyframes sea-wind{0%{background-position:-60% 0}100%{background-position:140% -90%}}
@keyframes crest-glint{0%,100%{opacity:.18;filter:brightness(.9)}50%{opacity:.83;filter:brightness(1.35)}}
@keyframes float-art{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-7px) rotate(1deg)}}
@keyframes gold-sweep{0%{transform:translateX(-165%) rotate(26deg)}100%{transform:translateX(350%) rotate(26deg)}}
@keyframes worker-shift{0%{transform:translateX(-24px)}50%{transform:translateX(28px)}100%{transform:translateX(-24px)}}
@keyframes ambient-move{0%{transform:translate(-16px,9px) scale(.85);opacity:.3}50%{transform:translate(20px,-22px) scale(1.2);opacity:.8}100%{transform:translate(65px,-48px) scale(.7);opacity:0}}
.topbar,.nav{background-image:linear-gradient(180deg,#0a0c11a6,#160e05a1),url('../img/ui/wood.webp');background-size:auto,auto}
.topbar{height:calc(var(--top-h) + env(safe-area-inset-top));border-bottom:2px solid #c7964a;padding:calc(env(safe-area-inset-top) + 6px) 15px 6px;gap:10px}
.brand{font-size:clamp(15px,2vw,24px);font-weight:600;letter-spacing:.015em;text-shadow:0 2px 6px #000}
.brand-name{line-height:1.02;color:#ffdf9f}.balance{font-size:clamp(14px,1.35vw,19px);height:45px}
.top-action{width:44px;height:44px;min-width:40px;border-radius:10px;border:1px solid #cba55c;box-shadow:inset 0 1px 1px #f8d68d69,0 5px 12px #0008}
.top-action:hover,.top-action:focus-visible{box-shadow:inset 0 0 12px #ffd97c88,0 0 15px #ffcf7980;transform:translateY(-2px)}
.nav{height:calc(var(--nav-h) + env(safe-area-inset-bottom));justify-content:center;gap:clamp(2px,1vw,12px);padding:3px 10px calc(7px + env(safe-area-inset-bottom))}
.nav button{position:relative;flex:1 1 0;max-width:145px;gap:0;overflow:hidden;transition:transform .17s ease,filter .17s ease,box-shadow .17s ease;border:1px solid transparent;border-radius:11px}
.nav .nav-art{height:53px;width:65px;max-width:95%;object-fit:contain;filter:drop-shadow(0 3px 3px #000a);transition:transform .18s ease,filter .18s ease}
.nav button small{font:600 clamp(11px,1.2vw,15px)/1.15 var(--chrome-font);letter-spacing:.01em;text-shadow:0 2px 4px #000}
.nav button:hover .nav-art,.nav button:focus-visible .nav-art{transform:translateY(-3px) scale(1.12);filter:drop-shadow(0 4px 7px #ffd376aa)}
.nav button.active{background:radial-gradient(ellipse at 50% 45%,#cb8d435e,transparent 76%);box-shadow:inset 0 0 0 1px #e5b65b8c,0 0 16px #e5a64e70}
.nav button.active::after,.pictobtn::after,.scene-return::after{content:'';position:absolute;inset:-65% -20%;pointer-events:none;background:linear-gradient(90deg,transparent,#fff5b000 24%,#fff4b55d 46%,#fff2d91c 58%,transparent 72%);transform:translateX(-165%) rotate(26deg)}
.nav button:hover::after,.pictobtn:hover::after,.scene-return:hover::after{animation:gold-sweep 1s ease-out both}
.nav button:active{transform:scale(.96)}
.helm-hint{position:absolute;z-index:4;left:50%;bottom:13px;transform:translateX(-50%);border-radius:12px;background:#071f2cba;border:1px solid #b89457b8;color:#fff4da;font:500 13px/1.55 'Segoe UI',sans-serif;max-width:calc(100% - 24px);padding:7px 13px;text-align:center;box-shadow:0 4px 12px #0008;pointer-events:none}
.mapcontrols button{transition:filter .2s,transform .2s}.mapcontrols button:hover{transform:scale(1.08);filter:brightness(1.3)}

.ship-poster{position:relative;isolation:isolate;background:linear-gradient(#2c8da32b,#011f32b1),url('../img/ui/world_landscape.webp') center/cover;border:2px solid #ddb46e;box-shadow:0 6px 16px #0008,inset 0 0 0 3px #111a1c66;min-height:365px;border-radius:13px;overflow:hidden}
.ship-poster::after{content:'';position:absolute;z-index:1;inset:0;background:linear-gradient(180deg,#071a2e38,transparent 23% 64%,#00152794);pointer-events:none}
.ship-illustration{position:absolute;z-index:2;left:7%;top:8%;width:86%;height:80%;object-fit:contain;filter:drop-shadow(0 15px 11px #001a2f99);animation:float-art 6s ease-in-out infinite}
.ship-picture-sea{inset:0;background:radial-gradient(ellipse at 48% 46%,#fce5a824,transparent 57%),linear-gradient(0deg,#053b51a4,transparent 44%)}
.corner-stats{position:absolute;z-index:5;inset:9px 8px;pointer-events:none}.corner-stat{position:absolute;min-width:65px;display:flex;gap:5px;align-items:center;justify-content:center;background:linear-gradient(160deg,#101f2bcf,#061a2ee3);border:1px solid #f8d38fa8;border-radius:7px;color:#fff5dd;padding:5px 8px;box-shadow:0 3px 7px #0009;font:bold 14px/1.1 Georgia;font-variant-numeric:tabular-nums;text-shadow:0 1px 4px #000}.corner-stat i{font-size:15px;font-style:normal;color:#ffd17e}
.corner-stat.cs-0{top:1%;left:1%}.corner-stat.cs-1{top:1%;right:1%}.corner-stat.cs-2{top:45%;left:0}.corner-stat.cs-3{top:45%;right:0}.corner-stat.cs-4{bottom:2%;left:1%}.corner-stat.cs-5{bottom:2%;right:1%}
.ship-poster.compact{min-height:208px;height:208px}.ship-poster.compact .ship-illustration{top:7%;height:83%}.ship-poster.compact .corner-stat{min-width:40px;font-size:10px;padding:3px 4px}.ship-poster.compact .corner-stat i{font-size:10px}
.sheet{position:absolute;z-index:21;inset:calc(var(--top-h) + env(safe-area-inset-top)) 0 calc(var(--nav-h) + env(safe-area-inset-bottom));width:auto;max-width:none;height:auto;overflow-y:auto;overscroll-behavior:contain;padding:28px clamp(12px,4vw,45px) 42px;border:0;border-radius:0;background:linear-gradient(90deg,#091726d0,#0a253cc7),url('../img/ui/island_banner.webp') center/cover no-repeat;box-shadow:inset 0 20px 45px #0008;color:#f4dfbd}
.sheet[data-scene="ships"]{background-image:linear-gradient(90deg,#0b1521c9,#142332ba),url('../img/ui/world_landscape.webp')}
.sheet[data-scene="islands"],.sheet[data-scene="stela"]{background-image:linear-gradient(90deg,#0d2437db,#1f3f3e80),url('../img/ui/island_banner.webp')}
.sheet[data-scene="tavern"],.sheet[data-scene="market"],.sheet[data-scene="shop"]{background-image:linear-gradient(90deg,#24160dc2,#2b1b10c7),url('../img/ui/island_harbor.webp')}
.sheet[data-scene="warehouse"],.sheet[data-scene="shipyard"],.sheet[data-scene="sawmill"],.sheet[data-scene="mine"]{background-image:linear-gradient(90deg,#21160db3,#42311cc0),url('../img/ui/island_harbor.webp')}
.sheet[data-scene="farm"]{background-image:linear-gradient(90deg,#243e1c9a,#35451d85),url('../img/ui/island_banner.webp')}
.sheet[data-scene="fort"],.sheet[data-scene="armory"]{background-image:linear-gradient(90deg,#201c1eb8,#1b293cbd),url('../img/ui/island_fort.webp')}
.sheet[data-scene="help"]{background-image:linear-gradient(90deg,#3a2519d2,#2f2719c5),url('../img/ui/island_banner.webp')}
#sheetContent{max-width:1180px;margin:0 auto;padding:19px clamp(14px,3vw,35px) 32px;background:linear-gradient(135deg,#fff7eaf0,#f5e5cbf2 65%,#edd7b9ed);color:#412714;border:2px solid #bd8e4c;border-radius:18px;box-shadow:0 20px 55px #0009,inset 0 0 0 3px #fbe6bd;min-height:min(75vh,640px)}
#sheetContent>h2,#sheetContent>.section-head h2{font:600 clamp(25px,3vw,35px)/1.2 Georgia;color:#593519;margin:6px 0 22px;text-shadow:0 1px #fff3d4}
#sheetContent h3{font:600 clamp(18px,2.1vw,23px)/1.3 Georgia;color:#58351b;margin:24px 0 12px}
#sheetContent p{font-size:15px;line-height:1.75;margin:11px 0;color:#6a492d}
#sheetContent .section-banner{height:clamp(160px,27vw,300px);border-radius:13px}.section-banner .section-banner-title{font-size:clamp(20px,2.6vw,31px)}
.sheet .ship-profile{padding:clamp(12px,1.5vw,26px);border-radius:18px}.sheet .ship-profile h3{font-size:clamp(21px,2.3vw,29px)}
.ship-profile-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(250px,1fr);gap:clamp(16px,2vw,30px)}
.ship-summary{gap:13px;padding:10px 0}.ship-summary-title{font-size:23px}.ship-summary-line{font-size:clamp(14px,1.4vw,16px);line-height:1.7}.ship-extra{font:14px/1.85 'Segoe UI',sans-serif}
.ship-profile .ship-command-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:20px}.ship-profile .ship-command-row .woodbtn{min-height:100px}
.woodbtn{position:relative;overflow:hidden;min-height:47px;font:600 clamp(14px,1.4vw,17px)/1.2 Georgia!important;letter-spacing:.005em;box-shadow:inset 0 2px 2px #f9d58655,0 5px 9px #0005!important;transition:filter .2s ease,transform .2s ease,box-shadow .2s ease}
.woodbtn:hover:not(:disabled){transform:translateY(-2px);filter:brightness(1.15) saturate(1.05);box-shadow:0 0 12px #d39d4d99,0 6px 12px #0007!important}
.pictobtn{display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:center;padding:4px 14px 7px!important;min-height:78px!important}
.pictobtn img{width:58px;height:50px;object-fit:contain;flex:none;filter:drop-shadow(0 2px 4px #0008);transition:transform .22s ease,filter .22s ease}
.pictobtn:hover img{transform:translateY(-3px) scale(1.10);filter:drop-shadow(0 5px 7px #ffca8ba1)}
.pictobtn span{position:relative;z-index:2;font-size:clamp(13px,1.3vw,17px);line-height:1.3}
.action-unit{position:relative;display:inline-flex;min-width:0;align-items:stretch}.action-unit>.woodbtn{flex:1;min-width:0}.action-unit .action-info{align-self:flex-start;z-index:4;right:4px;top:4px}
.building-row{min-height:102px;gap:8px;padding:9px 11px}.building-scene-open{display:flex;align-items:center;gap:14px;flex:1;background:transparent;border:0;color:#422715;text-align:left;min-width:0;padding:2px;border-radius:10px}.building-scene-open:hover{background:#b88a3f30}.building-scene-open img{width:77px;height:80px;object-fit:contain;filter:drop-shadow(0 3px 4px #0004);transition:transform .2s}.building-scene-open:hover img{transform:scale(1.08)}.building-scene-open b{font-size:18px}.building-scene-open small{display:block;font:13px/1.6 'Segoe UI',sans-serif}.building-row>.woodbtn{min-height:45px;min-width:55px}
.service-tile{padding:8px;border-radius:12px}.service-tile>img{height:155px;object-fit:cover;border-radius:7px}.service-tile p{font-size:14px!important}
.ship-fleet-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:15px}.fleet-ship{border-radius:13px;padding:9px}.fleet-ship-thumb{height:92px}
.fleet-ship-text b{font:600 19px Georgia}.fleet-ship-text small{font:13px/1.65 'Segoe UI',sans-serif}
.local-resources{gap:7px;padding:12px}.resource-pill{font:600 13px/1.4 'Segoe UI',sans-serif}.resource-pill strong{font-size:18px}
/* Building detail is a separate immersive window that completely covers the map. */
.inside-scene{position:relative;min-height:75vh;isolation:isolate;padding:12px 5px 25px}
.scene-top{display:flex;justify-content:space-between;align-items:center;gap:10px;border-bottom:1px solid #c8a273;padding-bottom:13px}
.scene-return{position:relative;overflow:hidden;border:1px solid #b88a53;border-radius:11px;padding:10px 16px;color:#f5ddaa;background:linear-gradient(#644020,#24150d);font:600 16px Georgia;box-shadow:0 4px 8px #0003}
.scene-island-name{color:#7c5a3a;font:italic 15px Georgia}
.scene-title{display:flex;align-items:center;gap:18px;padding:14px 0 8px}.scene-title img{width:clamp(85px,15vw,145px);height:clamp(85px,15vw,145px);object-fit:contain;filter:drop-shadow(0 7px 9px #0006)}
.scene-title small{color:#9d793e;font:600 13px 'Segoe UI',sans-serif}.scene-title h2{font:600 clamp(29px,4vw,46px) Georgia;color:#4d2b18;margin:5px 0}.scene-title p{font-size:16px}
.scene-room{position:relative;height:clamp(200px,28vw,320px);margin:12px 0 20px;overflow:hidden;border:3px solid #bf9359;border-radius:16px;background:linear-gradient(110deg,#113f52a8,#192e3585),url('../img/ui/island_harbor.webp') center/cover;box-shadow:inset 0 0 35px #0a1e20ab,0 8px 15px #0005}
.scene-room.farm-room{background:linear-gradient(#387c3885,#274b286e),url('../img/ui/island_banner.webp') center/cover}.scene-room.fort-room{background:linear-gradient(#1221355e,#30241c7b),url('../img/ui/island_fort.webp') center/cover}
.scene-room.tavern-room{background:linear-gradient(#2f24165e,#30170e96),url('../img/ui/island_harbor.webp') center/cover}
.scene-primary-art{position:absolute;left:50%;top:50%;width:min(42%,270px);height:85%;object-fit:contain;transform:translate(-50%,-50%);filter:drop-shadow(0 16px 20px #000b);animation:float-art 7s ease-in-out infinite alternate}
.scene-mote{position:absolute;width:6px;height:6px;border-radius:50%;background:#fee8a8aa;left:25%;top:63%;box-shadow:0 0 14px 5px #ffcb7b5c;animation:ambient-move 7s linear infinite}.scene-mote.two{left:48%;top:75%;animation-delay:-2s}.scene-mote.three{left:65%;top:55%;animation-delay:-4s}
.scene-room .ambient-glow{position:absolute;inset:0;background:radial-gradient(circle at 76% 32%,#ffefad3b,transparent 45%);animation:crest-glint 6s ease-in-out infinite}
.ambient-worker{position:absolute;left:27%;bottom:17%;width:14px;height:37px;border-radius:7px 7px 3px 3px;background:#261b12a8;box-shadow:0 -15px 0 -2px #c1a478,2px 0 2px #0b1419a8;opacity:.78;animation:worker-shift 8s ease-in-out infinite}.ambient-worker.b{left:72%;bottom:12%;transform:scale(.7);animation-delay:-4s}
.scene-controls{border-top:1px solid #c79f68;padding-top:12px}.scene-controls h3{margin-top:14px!important}.scene-stocks{display:flex;flex-wrap:wrap;gap:8px}.scene-stocks span{border:1px solid #d7b68c;border-radius:8px;background:#fff3de;padding:7px 9px;font:13px 'Segoe UI',sans-serif}.scene-stocks b{display:block;color:#3f2516;font:700 18px Georgia;margin-top:2px}
.scene-action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:13px}.scene-action-grid .action-unit{min-width:0}.scene-guidance{font-style:italic;border-left:3px solid #bc9354;padding-left:12px}
.dialog h2{font-size:26px}.dialog label,.dialog p,.dialog .feed{font-size:15px;line-height:1.65}.dialog .row .woodbtn{min-height:45px}.dialog .row .pictobtn{min-height:68px}
/* Tablet/desktop content stays full width; no old right-side 44vw drawer. */
@media(min-width:760px){.sheet{left:0;right:0;top:calc(var(--top-h) + env(safe-area-inset-top));bottom:calc(var(--nav-h) + env(safe-area-inset-bottom));width:100%;border:0;border-radius:0;padding:25px clamp(16px,4vw,60px) 36px}.ship-profile-layout{grid-template-columns:minmax(0,1.5fr) minmax(250px,1fr)}.ship-poster{min-height:420px}.nav{gap:10px}}
@media(max-width:650px){:root{--top-h:63px;--nav-h:90px}.topbar{gap:5px;padding-left:8px;padding-right:8px}.brand{font-size:15px}.brand-wheel{width:29px;height:29px}.balance{height:37px;font-size:14px}.top-action{width:37px;height:38px;min-width:34px}.top-action .icon{width:22px;height:22px}.nav{justify-content:flex-start;overflow-x:auto;scrollbar-width:none;gap:3px;padding-left:6px;padding-right:6px;scroll-snap-type:x mandatory}.nav button{flex:0 0 74px;min-width:74px;scroll-snap-align:start}.nav .nav-art{height:46px;width:57px}.nav button small{font-size:12px}.sheet{padding:10px 7px 15px}.sheet #sheetContent{padding:14px 12px 28px;border-radius:11px}.ship-profile-layout{grid-template-columns:1fr}.ship-poster{height:300px;min-height:300px}.ship-profile .ship-command-row{grid-template-columns:repeat(2,minmax(0,1fr))}.ship-profile .ship-command-row .woodbtn{min-height:95px}.helm-hint{bottom:8px;font-size:11px;padding:5px 9px;max-width:65%;left:63%;transform:translateX(-50%)}.inside-scene{min-height:65vh}.scene-title img{width:94px;height:94px}.scene-room{height:200px}.scene-title h2{font-size:31px}.building-scene-open img{height:65px;width:65px}.building-scene-open b{font-size:16px}}
@media(max-width:390px){.brand-name{font-size:13px}.topbar{gap:2px}.balance{padding:2px 5px}.top-action.extra{width:32px;min-width:31px}.top-action .icon{width:19px;height:19px}.nav button{flex-basis:70px;min-width:70px}.nav button small{font-size:11px}.ship-poster:not(.compact){height:258px;min-height:258px}.corner-stat{font-size:12px;min-width:52px;padding:4px 5px}.ship-summary-line{font-size:14px}.scene-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.sea-wind-lines,.ship-illustration,.scene-primary-art,.scene-mote,.ambient-worker,.ambient-glow{animation:none!important}.pictobtn:hover img,.nav button:hover .nav-art{transform:none}}

@media(max-width:440px){.brand{flex:0 1 110px;min-width:106px;gap:3px;margin-right:auto}.brand-name{font-size:13px!important;line-height:1.02;white-space:normal!important;max-width:77px;display:block;overflow-wrap:normal}.brand-wheel{flex-shrink:0;width:25px;height:25px}.balance{font-size:13px}.top-action{width:33px;min-width:32px;padding:3px}.topbar{gap:3px}}
/* Animated PNG workers are deliberately tiny environmental details, not controls. */
.ambient-worker{width:50px;height:70px;background:transparent url('../img/actors/warehouse_walk.png') 0 0/200px 70px no-repeat;box-shadow:none;opacity:.9;left:28%;bottom:10%;border-radius:0;animation:actor-steps .8s steps(4) infinite,worker-shift 9s ease-in-out infinite;filter:drop-shadow(0 4px 5px #0007)}
.ambient-worker.b{left:72%;bottom:9%;animation-delay:-.4s,-4s;transform:scale(.8)}
.farm-room .ambient-worker{background-image:url('../img/actors/farm_walk.png')}
.shipyard-room .ambient-worker,.sawmill-room .ambient-worker{background-image:url('../img/actors/shipyard_walk.png')}
@keyframes actor-steps{to{background-position:-200px 0}}
@media(prefers-reduced-motion:reduce){.ambient-worker{animation:none!important}}

/* Sparse sky reflections over open water. */
#sea{background-image:url('../img/ocean.webp')!important;background-position:center}
#sea::before{background:linear-gradient(180deg,#001c3714,transparent 40%,#00172517);mix-blend-mode:normal}
.sea-clouds,.sea-sunlight{position:absolute;inset:0;z-index:1;pointer-events:none}
.sea-clouds::before,.sea-clouds::after{
  content:'';position:absolute;inset:-9%;
  background:
    radial-gradient(ellipse 11% 4% at 23% 22%,#dceff01e,transparent 94%),
    radial-gradient(ellipse 7% 3.5% at 28% 21%,#e8f6f215,transparent 94%),
    radial-gradient(ellipse 13% 5% at 67% 73%,#effafd12,transparent 96%);
  filter:blur(8px);
  animation:cloud-drift 66s ease-in-out infinite alternate;
}
.sea-clouds::after{transform:scale(.8);animation-delay:-37s;opacity:.62}
@keyframes cloud-drift{
  from{transform:translate(-8%,3%)}
  to{transform:translate(11%,-5%)}
}
.sea-sunlight{
  mix-blend-mode:screen;
  background:
    radial-gradient(ellipse 17px 2px at 77% 17%,#fff1ba4a,transparent 97%),
    radial-gradient(ellipse 20px 2px at 81% 20%,#fff4ca52,transparent 99%),
    radial-gradient(ellipse 14px 1.5px at 73% 24%,#c4f8fd33,transparent 99%),
    radial-gradient(ellipse 17px 2px at 24% 65%,#c4fdff2c,transparent 98%),
    radial-gradient(ellipse 9px 1.5px at 28% 69%,#e0fdff45,transparent 97%);
  background-size:100% 100%;
  animation:local-water-glints 12s ease-in-out infinite alternate;
}
@keyframes local-water-glints{
  0%,10%{opacity:.12;transform:translate(0,0)}
  55%{opacity:.76}
  100%{opacity:.24;transform:translate(1%,-1%)}
}

#sheetContent .island-portrait{
  display:grid;place-items:center;isolation:isolate;
  background:linear-gradient(#092b3a20,#052b3958),url('../img/ocean.webp') center/cover;
}
#sheetContent .island-portrait{padding:8px 10px 33px}

#sheetContent .island-portrait img{
  width:100%;height:100%;min-height:0;object-fit:contain;object-position:center;
}
.ship-poster{background:linear-gradient(#2c8da32b,#011f325c),url('../img/ocean.webp') center/cover}

.sheet[data-scene="warehouse"]{background-image:linear-gradient(90deg,#21160d9e,#42311c84),url('../img/scenes/warehouse.webp')}
.sheet[data-scene="shipyard"]{background-image:linear-gradient(90deg,#21160d9e,#42311c84),url('../img/scenes/shipyard.webp')}
.sheet[data-scene="farm"]{background-image:linear-gradient(#243e1c72,#35451d66),url('../img/scenes/farm.webp')}
.sheet[data-scene="tavern"]{background-image:linear-gradient(90deg,#24160daa,#2b1b10a6),url('../img/scenes/tavern.webp')}
.sheet[data-scene="market"]{background-image:linear-gradient(90deg,#24160daa,#2b1b10a6),url('../img/scenes/market.webp')}
.sheet[data-scene="shop"]{background-image:linear-gradient(90deg,#24160daa,#2b1b10a6),url('../img/scenes/shop.webp')}
.scene-room.warehouse-room{background:linear-gradient(#182f3c12,#131e2d4a),url('../img/scenes/warehouse.webp') center 58%/cover}
.scene-room.shipyard-room{background:linear-gradient(#182f3c12,#131e2d4a),url('../img/scenes/shipyard.webp') center 58%/cover}
.scene-room.farm-room{background:linear-gradient(#25301809,#27341823),url('../img/scenes/farm.webp') center 63%/cover}
.scene-room.tavern-room{background:linear-gradient(#182f3c15,#21182549),url('../img/scenes/tavern.webp') center 53%/cover}
.scene-room.market-room{background:linear-gradient(#182f3c15,#21182549),url('../img/scenes/market.webp') center 53%/cover}
:is(.warehouse-room,.shipyard-room,.farm-room,.tavern-room,.market-room) .scene-primary-art{display:none}
@media(max-width:440px){
  .topbar .brand{min-width:0;flex:0 1 auto}
  .topbar .balance .d-text{display:none}
  .topbar{gap:3px;padding-inline:7px}
}
@media(max-width:350px){
  .topbar .brand-wheel{width:22px;height:22px}
  .topbar .top-action{width:30px;min-width:30px}
}
@media(prefers-reduced-motion:reduce){
  .sea-clouds::before,.sea-clouds::after,.sea-sunlight{animation:none!important}
}

.fleet-ship { container-type:inline-size; }
.fleet-ship-main { display:grid; width:100%; grid-template-columns:clamp(54px,calc(100% - 185px),92px) minmax(0,1fr); gap:9px; align-items:center;
  text-align:left; padding:0; border:0; background:none; color:inherit; }
.fleet-ship-thumb { position:relative; }
.fleet-ship-upgrades {
  position:absolute; top:2px; right:2px; display:grid; place-items:center;
  width:21px; height:21px; isolation:isolate;
  color:#421e06; font-weight:900; font-size:12px; line-height:1; text-shadow:0 1px #fff3b3;
  filter:drop-shadow(0 1px 1px #241108);
}
.fleet-ship-upgrades::before,.fleet-ship-upgrades::after { content:""; position:absolute; z-index:-1; }
.fleet-ship-upgrades::before {
  inset:0;
  background:conic-gradient(from 18deg,#fff0ad,#a96724 45deg,#ffdb72 105deg,#ad6c27 153deg,#f9d373 205deg,#9f5e20 250deg,#f6cc69 315deg,#fff0ad);
  clip-path:polygon(50% 0%,61% 14%,79% 7%,84% 25%,100% 32%,92% 50%,100% 68%,84% 75%,79% 93%,61% 86%,50% 100%,39% 86%,21% 93%,16% 75%,0% 68%,8% 50%,0% 32%,16% 25%,21% 7%,39% 14%);
}
.fleet-ship-upgrades::after {
  inset:3px; border:1px solid #9a571b; border-radius:50%;
  background:linear-gradient(145deg,#fff1af,#edbe58 62%,#d48929);
  box-shadow:inset 0 0 0 1px #fff3bd;
}
.fleet-ship-text { overflow-wrap:anywhere; }
.fleet-ship-text :is(.fleet-ship-byline,.fleet-ship-cargo,.fleet-ship-supplies) { display:flex; flex-wrap:wrap; gap:0 7px; }
.fleet-ship-text .fleet-ship-supplies { gap:0 .3em; font-size:clamp(10px,3.9cqi,13px); }
.fleet-ship-supplies > span { white-space:nowrap; }
.fleet-ship-status { display:inline-flex; align-items:center; gap:3px; }
.fleet-ship-status::before { content:""; width:6px; height:1px; margin-right:2px; background:#a67a52; }
.fleet-ship-status .icon { width:14px; height:14px; }
.fleet-ship-text .fleet-ship-metrics {
  display:flex;
  flex-wrap:wrap;
  gap:0 .45em;
  color:#553518;
  font-size:10.5px;
  line-height:1.55;
}
.fleet-ship-metrics > span { white-space:nowrap; }
.fleet-ship-metrics strong { font-weight:700; }
.fleet-quick-actions { display:flex; flex-wrap:wrap; align-items:center; gap:5px; padding-top:7px; }
.fleet-quick-actions .helm-action { display:grid; place-items:center; flex:none; width:32px; height:32px; padding:0;
  border:1px solid #b78852; border-radius:50%; color:#fbe3ad; background:radial-gradient(#604022,#392519 70%);
  box-shadow:inset 0 0 0 1px #e0a96065,0 2px 3px #3d2a1b30; }
.fleet-quick-actions .helm-action .icon { width:17px; height:17px; }
.fleet-quick-actions .helm-action:is(:hover,:focus-visible,[aria-pressed="true"]) { border-color:#fed792; background:radial-gradient(#986642,#4b3020); }
.fleet-quick-actions .helm-action.gold-action {
  border-color:#a5681d; color:#523108; background:radial-gradient(circle at 36% 27%,#fff3be,#e9b950 62%,#ab6818);
  box-shadow:inset 0 0 0 1px #fff0a8,0 2px 4px #76511160;
}
.fleet-quick-actions .helm-action.gold-action:is(:hover,:focus-visible) { border-color:#633b16; }
.journal-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; margin-bottom:9px; }
.journal-filters { display:flex; align-items:center; gap:5px; }
.journal-filter { display:grid; place-items:center; width:29px; height:29px; padding:0; border-radius:6px; border:1px solid #a18055;
  color:#ffe6b4; background:linear-gradient(#735333,#3f2b1d); box-shadow:inset 0 1px #ffe6a94a,0 1px 2px #38241532; }
.journal-filter .icon { width:16px; height:16px; }
.journal-filter[aria-pressed="true"] { color:#452915; border-color:#98642b; background:linear-gradient(#ffebbb,#c38c46); }
.journal-filter:is(:hover,:focus-visible) { outline:1px solid #a76f38; outline-offset:1px; }

.sale-price {
  display:inline-flex; align-items:center; gap:5px; margin-block:3px; padding:2px 7px;
  border:1px solid #bd873f; border-radius:6px; color:#623b10; background:#ffecb788;
  font:700 13px/1.35 var(--read-font); font-variant-numeric:tabular-nums;
}
.sale-price .icon { flex:none; width:14px; height:14px; }
.dialog :is(.market-quote,.referral-stats) {
  gap:5px; margin:12px 0; padding:8px 10px; border-block:1px solid #ac784e5c;
  font-size:13px; font-variant-numeric:tabular-nums;
}
:is(.market-quote,.referral-stats) dd { white-space:nowrap; }
:is(.market-quote,.referral-stats) div:last-child { font-weight:700; color:#563913; }
.market-toolbar { display:grid; gap:12px; margin-bottom:14px; }
.market-query { display:grid; grid-template-columns:minmax(0,1fr) minmax(142px,.55fr); gap:8px; }
.market-query label { display:grid; gap:4px; color:#ffe3af; font-size:13px; }
.market-query :is(input,select) {
  min-width:0; width:100%; min-height:38px; margin:0; padding:6px 8px; background:#fff1d5;
  color:#422819; border:1px solid #b0834c; border-radius:7px; font:600 14px var(--read-font);
}
.market-filters,.market-pages { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:7px; }
.market-filters { justify-content:flex-start; }
.market-filters .woodbtn,.market-pages .woodbtn { width:auto; min-height:36px; padding:6px 10px; }
.market-pages { justify-content:center; margin:12px 0; }
.market-pages button:disabled { opacity:.45; cursor:default; }
.settings-identity { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.settings-identity > label { min-width:0; }
.settings-identity .icon { width:1em; height:1em; vertical-align:-.15em; }
.settings-identity :is(input,select) { min-width:0; width:100%; }
@media(max-width:380px) { .market-query { grid-template-columns:minmax(0,1fr); } }
