:root{
  --abyss:#04101c; --deep:#071a2c; --navy:#0b2437; --navy2:#10334a;
  --line:rgba(120,180,215,.18); --line2:rgba(120,180,215,.35);
  --ink:#e8f2fa; --muted:#8fb0c6; --gold:#e6b45c; --gold2:#f6d79b;
  --teal:#4fd1c5; --red:#ef6a5b; --green:#5cd08a;
  --glass:rgba(9,28,44,.82);
}
*{box-sizing:border-box}
.location-stat{min-width:0}.location-stat small{font-size:10px;line-height:1.4;color:var(--muted);white-space:nowrap}
.ship-info{min-width:0;max-width:100%;display:flex;flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:3px 0;padding:8px 12px;border:1px solid rgba(230,180,92,.46);border-radius:10px;background:rgba(230,180,92,.07)}
.ship-info>label{flex:none;margin-right:8px}
.ship-info-line{display:flex;flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:3px 0;min-width:0}
/* Every field of the vessel card sits inline, separated by a slim | divider. */
.ship-info-line>.ship-status+.ship-info-location::before{content:'|';margin:0 8px;color:rgba(160,190,210,.45);font-weight:400}
.ship-info-location{display:inline-flex;flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:3px 0;min-width:0;max-width:100%;line-height:1.35;padding:3px 6px;margin:-3px -6px;border:0;border-radius:6px;background:transparent;color:inherit;text-align:left;cursor:pointer}
.ship-info-location:hover:not(:disabled){background:rgba(230,180,92,.13)}
.ship-info-location:disabled{cursor:default}
.ship-info-location:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.ship-info-location b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ship-info-location small{display:inline;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.ship-info-location b+small::before,.ship-info-location small+small::before{content:'|';margin:0 6px;color:rgba(160,190,210,.45)}
html,body{margin:0;height:100%;font-family:"Microsoft YaHei UI","PingFang SC","Noto Sans SC",system-ui,sans-serif;
  background:var(--abyss);color:var(--ink);overflow:hidden;-webkit-font-smoothing:antialiased}
button,input,select{font-family:inherit}
.hidden{display:none!important}
.grow{flex:1}

/* ---------- boot ---------- */
#boot{position:fixed;inset:0;z-index:999;display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:radial-gradient(120% 90% at 50% 0%,#0d2c44 0%,#04101c 70%);gap:14px}
#boot .boot-mark{font-size:34px;letter-spacing:.34em;color:var(--gold2);font-family:"Songti SC",serif}
#boot .boot-sub{font-size:12px;letter-spacing:.5em;color:var(--muted)}
#boot .boot-bar{width:230px;height:2px;background:rgba(255,255,255,.12);overflow:hidden}
#boot .boot-bar i{display:block;height:100%;width:40%;background:linear-gradient(90deg,transparent,var(--gold),transparent);
  animation:sweep 1.1s infinite linear}
@keyframes sweep{0%{transform:translateX(-60%)}100%{transform:translateX(280%)}}

.screen{position:fixed;inset:0}

/* ---------- auth ---------- */
#screenAuth{display:grid;grid-template-columns:1.15fr 1fr;background:#04101c;overflow:hidden}
.auth-hero{position:relative;overflow:hidden;background:linear-gradient(160deg,#082438 0%,#041423 55%,#020a12 100%)}
.hero-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;background:#04101c;filter:brightness(.7) saturate(.9)}
.auth-hero::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(3,13,23,.82) 0%,rgba(3,13,23,.60) 56%,rgba(3,13,23,.33) 100%),linear-gradient(0deg,rgba(3,13,23,.66),transparent 40%);pointer-events:none}
.auth-hero-copyright{position:absolute;left:clamp(18px,3vw,48px);bottom:clamp(18px,3vh,30px);z-index:1;color:rgba(232,242,250,.78);font-size:clamp(9px,.85vw,12px);font-weight:600;letter-spacing:.16em;text-transform:uppercase;text-shadow:0 2px 10px rgba(0,0,0,.72);white-space:nowrap}
.auth-brand{margin:0 0 calc(2 * 1.85em + 6px)}  /* two blank lines before the sign-in block */
.auth-brand + .auth-tabs{margin-top:0}
.auth-kicker{font-size:10.5px;letter-spacing:.3em;color:var(--gold);opacity:.9}
.auth-title{font-family:"Songti SC","Noto Serif SC",serif;font-size:clamp(30px,3.2vw,42px);margin:8px 0 4px;letter-spacing:.14em;line-height:1.1;color:#f2f7fb;text-shadow:0 6px 26px rgba(0,0,0,.5)}
.auth-title span{color:var(--gold2)}
.auth-en{font-size:11px;letter-spacing:.5em;color:var(--muted)}
/* Game copy sits in the top-left corner of the video column. */
.auth-hero-intro{position:absolute;z-index:1;left:clamp(18px,3vw,48px);top:clamp(18px,3vh,40px);width:min(34em,calc(100% - 36px));max-width:min(560px,60%);pointer-events:none;padding:clamp(10px,1.2vw,16px) clamp(12px,1.4vw,20px);border:1px solid rgba(230,180,92,.28);border-radius:12px;background:linear-gradient(140deg,rgba(4,16,28,.78),rgba(4,16,28,.42));backdrop-filter:blur(3px);box-shadow:0 12px 30px rgba(0,0,0,.35)}
.auth-desc{margin:0;font-size:clamp(11.5px,1vw,13px);line-height:1.8;color:#cfe0ea;text-shadow:0 1px 6px rgba(0,0,0,.7)}
.auth-points{list-style:none;padding:0;margin:10px 0 0;display:grid;grid-template-columns:1fr 1fr;gap:5px 14px;font-size:clamp(10.5px,.9vw,11.5px);color:#a8c2d2}
.auth-points b{color:var(--gold2);font-size:clamp(11px,.95vw,12.5px);margin-right:4px}
@media(max-width:760px){.auth-hero-intro{left:10px;right:10px;top:8px;width:auto;max-width:none;padding:7px 10px;border-radius:10px}.auth-desc{font-size:10.5px;line-height:1.5}.auth-points{grid-template-columns:1fr 1fr;gap:3px 8px;font-size:10px}.auth-points b{font-size:10.5px}}
.auth-panel{background:var(--glass);backdrop-filter:blur(14px);border-left:1px solid var(--line);
  padding:clamp(28px,6vh,64px) clamp(20px,4vw,52px);overflow:auto;scrollbar-width:none}
.auth-panel::-webkit-scrollbar{display:none}
@media(max-width:760px){#screenAuth{grid-template-columns:1fr;grid-template-rows:minmax(200px,34vh) minmax(0,1fr);overflow:hidden}.auth-hero{min-height:180px}.auth-brand{margin-bottom:calc(2 * 1.75em)}.auth-title{font-size:clamp(28px,7.5vw,38px)}.auth-desc{font-size:12px;line-height:1.7}.auth-points{grid-template-columns:1fr 1fr;gap:5px 10px;font-size:11px}.auth-panel{padding:20px 22px 40px;overflow:auto;border-left:0;border-top:1px solid var(--line)}}
@media(max-width:600px){#btnLogout{min-width:68px;min-height:36px;padding:7px 13px;font-size:13.5px}}@media(max-width:400px){.auth-kicker{font-size:9px;letter-spacing:.14em}.auth-en{font-size:10px;letter-spacing:.3em}.auth-points{grid-template-columns:1fr}.auth-panel{padding:18px 16px 36px}}
.auth-lang{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px}
.auth-lang-label{font-size:10.5px;letter-spacing:.18em;color:var(--muted)}
.auth-lang-options{display:flex;gap:6px;flex-wrap:wrap}
.auth-lang-options button{font:12px/1 system-ui,sans-serif;padding:7px 11px;border:1px solid var(--line);border-radius:999px;background:rgba(9,28,44,.6);color:#b9cede;cursor:pointer}
.auth-lang-options button:hover{border-color:var(--gold);color:var(--gold2)}
.auth-lang-options button[aria-pressed="true"]{background:rgba(230,180,92,.16);border-color:var(--gold);color:var(--gold2)}
.auth-tabs{display:flex;gap:8px;margin-bottom:26px}
.tab{flex:1;padding:11px 0;background:transparent;border:1px solid var(--line);color:var(--muted);
  cursor:pointer;font-size:14px;letter-spacing:.06em;transition:.2s}
.tab.active{color:#0a1a26;background:linear-gradient(180deg,var(--gold2),var(--gold));border-color:var(--gold);font-weight:700}
.auth-form label{display:block;font-size:12px;color:var(--muted);margin-bottom:14px;letter-spacing:.05em}
.auth-form input:not([type]),.auth-form input[type=text],.auth-form input[type=email],.auth-form input[type=password],.auth-form select{
  width:100%;margin-top:7px;padding:12px 13px;background:#16384e;border:1px solid var(--line2);
  color:#f0f6fc;border-radius:3px;font-size:14px;outline:none;transition:.2s;color-scheme:dark}
.auth-form input::placeholder{color:#aac0d0;opacity:1}
.auth-form input:focus,.auth-form select:focus{border-color:var(--gold);background:#20465e}
.auth-form select option,.auth-form select optgroup{background:#16384e;color:#f0f6fc}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.btn{border:1px solid var(--line2);background:rgba(255,255,255,.05);color:var(--ink);padding:11px 18px;
  cursor:pointer;border-radius:3px;font-size:14px;letter-spacing:.04em;transition:.18s}
.btn:hover{background:rgba(230,180,92,.12);border-color:var(--gold)}
.btn.primary{background:linear-gradient(180deg,var(--gold2),var(--gold));color:#12222e;font-weight:700;border-color:var(--gold)}
.btn.primary:hover{filter:brightness(1.06)}
.btn.ghost{background:transparent}
.btn.small{padding:7px 12px;font-size:12.5px}
.btn.danger{color:var(--red);border-color:rgba(239,106,91,.5)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.is-locked{opacity:.45;cursor:not-allowed}
.hint{font-size:12px;color:var(--muted);min-height:18px;margin-top:10px;line-height:1.6}
.hint.err{color:var(--red)}
.hint.ok{color:var(--green)}
.auth-age-guide{margin-top:18px;padding:15px 16px 13px;border:1px solid rgba(230,180,92,.32);border-radius:10px;background:linear-gradient(150deg,rgba(23,57,73,.8),rgba(8,29,44,.78));color:#d8e8ef}
.auth-age-guide h2{margin:0 0 5px;color:var(--gold2);font-size:15px;line-height:1.45}
.auth-age-guide p{margin:0;font-size:11.5px;line-height:1.6;color:#b7ced8}
.auth-age-guide table{width:100%;margin:10px 0 7px;border-collapse:collapse;font-size:11.5px;line-height:1.4;font-variant-numeric:tabular-nums}
.auth-age-guide th,.auth-age-guide td{padding:6px 7px;border-bottom:1px solid rgba(188,213,222,.13);text-align:left}
.auth-age-guide thead th{color:#9fb9c6;font-size:10.5px;font-weight:600}
.auth-age-guide tbody th{font-weight:600;white-space:nowrap;color:#e1eced}
.auth-age-guide td{white-space:nowrap}
.auth-age-guide .auth-stars{display:inline-block;min-width:6.5em;color:#f2c975;letter-spacing:.07em}
.auth-age-guide .auth-age-note{font-size:10.5px;color:#a7bbc7}
.auth-age-guide .auth-time-note{margin-top:9px;padding-top:9px;border-top:1px solid rgba(188,213,222,.18);color:#d8e5e7}
@media(max-width:420px){.auth-age-guide{padding:12px 10px}.auth-age-guide table{font-size:10.5px}.auth-age-guide th,.auth-age-guide td{padding:6px 3px}.auth-age-guide .auth-stars{min-width:5.8em;letter-spacing:0}}
.steps{display:flex;gap:8px;margin-bottom:18px}
.step{flex:1;text-align:center;font-size:11.5px;padding:7px 0;color:var(--muted);
  border-bottom:1px solid var(--line)}
.step.active{color:var(--gold2);border-bottom-color:var(--gold)}
.field-label{font-size:12px;color:var(--muted);margin:14px 0 9px;letter-spacing:.05em}
.field-label .val{color:var(--gold2);font-weight:700}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips button{padding:8px 13px;font-size:13px;border:1px solid var(--line2);background:rgba(255,255,255,.03);
  color:var(--ink);cursor:pointer;border-radius:20px;transition:.15s}
.chips button.active{border-color:var(--gold);background:rgba(230,180,92,.16);color:var(--gold2)}
.chips.swatch button{display:flex;align-items:center;gap:7px;border-radius:4px}
.chips.swatch i{width:16px;height:16px;border-radius:50%;border:1px solid rgba(255,255,255,.35)}
input[type=range]{width:100%;accent-color:var(--gold)}
.avatar-preview{display:flex;gap:18px;align-items:center;margin-top:18px}
#avatarCanvas{border:1px solid var(--line2);border-radius:6px;background:radial-gradient(circle at 50% 30%,#153347,#08161f)}
.avatar-meta{font-size:12.5px;color:var(--muted);line-height:2}
.step-actions{display:flex;gap:10px;margin-top:22px}
.step-actions .btn{flex:1}
/* ---------- game shell ---------- */
#screenGame{display:flex;flex-direction:column;background:#04101c}
/* One row whenever the cards fit; long-label languages wrap to a second row
   instead of hiding entries behind an invisible horizontal scroll. */
#topbar{min-height:64px;height:auto;flex-wrap:wrap;display:flex;align-items:center;column-gap:10px;row-gap:6px;padding:8px 16px;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
  background:linear-gradient(180deg,#0a2136,#071726);border-bottom:1px solid var(--line);z-index:8}
#topbar::-webkit-scrollbar{display:none}
#topbar>*{flex:0 0 auto}
/* The spacer keeps its flexible width so the right-hand logout chip hugs the
   top bar's right edge. */
#topbar .grow{flex:1 1 auto;min-width:0}
/* Vietnamese and Spanish labels are much longer than the two-character
   Chinese ones; their titles tighten so the same readouts stay visible. */
#topbar .stat label,#topbar .weather-info>label,#topbar .sea-state-item label{font-size:calc(10px * var(--tb-label-scale,1));
  letter-spacing:calc(.12em * var(--tb-label-scale,1))}
html[data-lang="en"]{--tb-label-scale:.92}
html[data-lang="es"]{--tb-label-scale:.84}
html[data-lang="vi"]{--tb-label-scale:.76}
.brand{display:flex;align-items:center;justify-content:center;flex:none;min-width:0}
.brand-logo{display:block;width:auto;height:clamp(48px,5.4vw,70px);max-width:min(100%,160px);object-fit:contain}
.stat{display:inline-flex;flex-direction:row;align-items:baseline;gap:4px;line-height:1.25;white-space:nowrap}
.stat label{font-size:10px;color:var(--muted);letter-spacing:.12em}
.stat b{font-size:13px;font-weight:600;color:#eaf4fb}
/* A changed reading flashes green so supplies and trades stay visible. */
.stat b.is-changed{color:#5be7a9;text-shadow:0 0 8px rgba(91,231,169,.55);transition:color .3s ease,text-shadow .3s ease}
/* Cash and total assets print their cents one size smaller than the amount. */
.stat b .num-dec{font-size:.85em;font-weight:600;letter-spacing:0}
.captain-info{display:flex;flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:3px 0;max-width:100%;padding:8px 12px;border:1px solid rgba(230,180,92,.46);border-radius:10px;background:rgba(230,180,92,.07)}
.captain-info .stat{min-width:0}.captain-info .stat b{overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
/* Inline separators keep the captain card on one line without nested boxes. */
.captain-info>.stat+.stat::before{content:'|';margin:0 8px;color:rgba(160,190,210,.45);font-weight:400}
.mooring-notice{position:fixed;z-index:32;max-width:min(300px,calc(100vw - 16px));padding:9px 11px;border:1px solid rgba(230,180,92,.55);border-radius:9px;background:rgba(8,25,38,.97);box-shadow:0 12px 34px rgba(0,0,0,.55);color:#dbe9f1;font-size:11.5px;line-height:1.5;animation:mooring-in .22s ease-out}
.mooring-notice.hidden{display:none}
.mooring-notice strong{display:block;font-size:12px;font-weight:600;color:var(--gold2)}
.mooring-notice-rows{display:grid;gap:2px;margin:5px 0 3px}
.mooring-notice-rows span{display:flex;justify-content:space-between;gap:12px;color:#a9c1cf}
.mooring-notice-rows b{color:#f0e6cf;font-weight:600;font-variant-numeric:tabular-nums}
.mooring-notice small{display:block;color:#87a2b3;font-size:9.5px;line-height:1.4}
.port-grade{margin-top:2px;color:#c9b98f}
@keyframes mooring-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.mooring-notice{animation:none}}
@media(max-width:650px){.captain-info{flex:1 1 100%}}
.chip{font-size:12px;padding:6px 11px;border:1px solid var(--line2);border-radius:20px;color:#bcd6e5;
  background:rgba(255,255,255,.03);white-space:nowrap}
/* Redesigned logout: larger hit area and label, never wraps. */
#btnLogout{flex:none;min-width:84px;min-height:40px;padding:9px 18px;font-size:15px;font-weight:600;
  letter-spacing:.06em;line-height:1.1;white-space:nowrap;border-radius:22px}
.chip.danger{cursor:pointer;color:var(--red);border-color:rgba(239,106,91,.45);background:transparent}
/* One ship readout; the four shapes remain decorative because its text names each state. */
.ship-status{display:inline-flex;align-self:center;align-items:center;gap:8px;max-width:100%;min-height:30px;padding:4px 9px;
  border:1px solid rgba(79,209,197,.48);border-radius:20px;background:rgba(79,209,197,.09);color:#e8f7f5;font-size:12px;line-height:1.4}
.ship-status[data-mode="docked"]{border-color:rgba(230,180,92,.48);background:rgba(230,180,92,.1);color:var(--gold2)}
.ship-status[data-mode="disaster"],.ship-status[data-mode="pirate"]{border-color:rgba(239,106,91,.7);background:rgba(239,106,91,.14);color:#ffd4cd}
.ship-status-icon{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:19px;height:19px;font-size:15px;line-height:1}
.ship-status-icon>span{display:none}
.ship-status[data-mode="docked"] .ship-status-anchor{display:block;animation:ship-anchor 3s ease-in-out infinite}
.ship-status[data-mode="sailing"] .ship-status-sail{display:block;position:relative;width:20px;height:22px;animation:ship-sail 2.4s ease-in-out infinite}
.ship-status-sail:before{content:"";position:absolute;left:9px;top:1px;width:2px;height:19px;background:currentColor}
.ship-status-sail:after{content:"";position:absolute;left:2px;top:2px;border-right:6px solid currentColor;border-top:13px solid transparent;transform:rotate(180deg)}
.ship-status-sail i{position:absolute;left:11px;top:5px;border-left:7px solid currentColor;border-top:13px solid transparent}
.ship-status[data-mode="disaster"] .ship-status-storm{display:block;position:relative;animation:ship-storm 1.8s ease-in-out infinite}
.ship-status-storm i{position:absolute;left:10px;top:8px;font-size:17px;font-style:normal;color:#ffe99b;animation:ship-lightning 2s step-end infinite}
.ship-status[data-mode="pirate"] .ship-status-pirate{display:block;transform-origin:20% 70%;animation:ship-flag 1.3s ease-in-out infinite}
.ship-status-text{overflow-wrap:anywhere}
/* The surrounding ship card is the only frame; keep status colour and icon, not a second pill. */
#shipInfo .ship-status{align-self:baseline;min-height:0;padding:0;border:0;border-radius:0;background:none}
.weather-info{display:flex;flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:3px 0;min-width:0;max-width:100%;padding:8px 12px;border:1px solid rgba(126,196,214,.42);border-radius:10px;background:rgba(20,62,82,.38)}
.weather-info>label{flex:none;margin-right:8px;font-size:10px;color:var(--muted);letter-spacing:.12em}
.weather-info-line{display:flex;flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:3px 0;min-width:0}
.weather-info .weather-warning{align-self:center;flex:none;margin-left:8px;border-radius:6px;padding:3px 6px;font-size:14px;line-height:1;animation:weather-warning-flash 1.25s ease-in-out infinite}
@keyframes weather-warning-flash{0%,100%{opacity:1;box-shadow:0 0 0 rgba(255,196,92,0)}50%{opacity:.45;box-shadow:0 0 10px rgba(255,196,92,.45)}}
@media(prefers-reduced-motion:reduce){.weather-info .weather-warning{animation:none;opacity:1}}
.sea-state{display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:0;min-height:0;padding:0;border:0;border-radius:0;background:none;color:#d9eef5}
.sea-state[data-empty="true"]{opacity:.62}
.sea-state-item{display:inline-flex;flex-direction:row;align-items:baseline;gap:4px;line-height:1.25;min-width:0}
.sea-state-item label{font-size:10px;color:var(--muted);letter-spacing:.1em;white-space:nowrap}
.sea-state-item b{font-size:13px;font-weight:600;color:#eaf4fb;white-space:nowrap}
.sea-state-item small{font-size:10px;color:#a7c4cb;white-space:nowrap}
.sea-state-item+.sea-state-item{padding-left:0;border-left:0}
.sea-state-item+.sea-state-item::before{content:'|';margin:0 7px;color:rgba(160,190,210,.45);font-weight:400}
@media(max-width:650px){.sea-state-item{min-width:0}}
@keyframes ship-anchor{50%{transform:translateY(2px) rotate(5deg)}}
@keyframes ship-sail{50%{transform:translateY(-2px) rotate(-5deg)}}
@keyframes ship-storm{50%{transform:translateX(2px)}}
@keyframes ship-lightning{0%,55%,70%,100%{opacity:0}58%,73%{opacity:1}}
@keyframes ship-flag{50%{transform:skewY(-12deg) rotate(-7deg)}}
@media(max-width:650px){#topbar{column-gap:8px;row-gap:7px;padding:7px 10px;max-height:min(42vh,360px);overflow-y:auto;scrollbar-width:none}#topbar::-webkit-scrollbar{display:none}.brand-logo{height:48px;max-width:90px}.ship-info,.weather-info{min-width:0;max-width:100%;flex:1 1 100%}.ship-info-line,.weather-info-line{align-items:baseline;gap:3px 0}.ship-info .ship-status{order:0;flex:0 1 auto;justify-content:flex-start;border-radius:0;text-align:left}.ship-status-text{min-width:0}.ship-info-location{flex:0 1 auto}.weather-info .sea-state{order:0;min-width:0;max-width:100%;justify-content:flex-start}.weather-info .sea-state-item{align-items:baseline}.weather-info .weather-warning{order:1}.captain-info .stat b{font-size:12px}}
@media(prefers-reduced-motion:reduce){.ship-status-icon>span,.ship-status-storm i{animation:none!important}}

#stage{position:relative;flex:1;overflow:hidden;background:radial-gradient(120% 120% at 50% 40%,#0a2b42 0%,#04101c 80%)}
#map{position:absolute;inset:0;width:100%;height:100%;cursor:grab}
#map.dragging{cursor:grabbing}
#stage.navigation-locked #map,#stage.navigation-locked #map.dragging{cursor:default}
#mapNightOverlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:hidden;z-index:1;transition:opacity 2s linear}
#mapPortOverlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}
/* Local solar time is part of the bridge console now: an inline readout instead
   of a floating pill over the map's longitude labels. */
.con-solar{display:flex;align-items:center;gap:6px;min-width:0;margin:0 0 7px;padding:4px 7px;border:1px solid rgba(126,199,214,.2);border-radius:6px;background:rgba(9,30,42,.7);color:#cfe4ef;font-size:10px;line-height:1.35;letter-spacing:.02em}
.con-solar-icon{flex:none;color:#f0d18a;font-size:10px;text-shadow:0 0 6px rgba(240,209,138,.55)}
#mapSolarClock{position:static;display:block;flex:1 1 auto;min-width:0;max-width:none;padding:0;border:0;border-radius:0;background:none;color:#cfe4ef;font-size:10px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:none}
#mapExploreStatus{display:block;min-width:0;margin:0 0 7px;padding:3px 7px 3px 0;border-radius:6px;background:linear-gradient(90deg,rgba(9,30,42,.72),rgba(9,30,42,.18));color:#b9cfdd;font-size:10px;line-height:1.35;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
#mapExploreStatus[hidden]{display:none}
@media(max-width:600px){.con-solar{font-size:9.5px;padding:3px 6px}#mapSolarClock{font-size:9.5px}#mapExploreStatus{font-size:9.5px;padding-right:6px}}

/* All six map tool icons are twice their original size. */
#mapTools{position:absolute;right:16px;top:16px;display:flex;flex-direction:column;gap:8px;z-index:6}
#mapTools button{width:76px;height:76px;font-size:34px;background:var(--glass);border:1px solid var(--line2);
  color:#d6e8f3;cursor:pointer;border-radius:6px;backdrop-filter:blur(6px);transition:.15s}
#mapTools button:hover:not(:disabled){border-color:var(--gold);color:var(--gold2)}
#mapTools button:disabled{opacity:.48;cursor:not-allowed;filter:grayscale(.55)}
/* Global view active: the globe shrinks and turns green until it is toggled off. */
#mapTools button[data-act="fit"].is-world{width:60px;height:60px;min-width:60px;font-size:28px;margin:0 auto;
  color:#5fd1cb;border-color:rgba(95,209,203,.75);background:rgba(9,42,50,.88);box-shadow:0 0 10px rgba(95,209,203,.28)}
#mapTools button[data-act="fit"].is-world:hover:not(:disabled){border-color:#5fd1cb;color:#8ff0ea}
/* Pirate alert: the toolbar skull keeps flashing until the captain opens it. */
#mapTools button#btnPirateMap{font-size:32px}
#mapTools button#btnMapSound{font-size:34px}
#mapTools button#btnMapSound[aria-pressed="true"]{color:#ffd28a;border-color:var(--gold)}
/* Phones: two columns keep the enlarged tools compact, and both the grid and the
   solar clock derive their width from one variable so the two can never collide. */
@media(max-width:640px){
  #mapTools{--map-tool-w:min(160px,42vw);--map-tool-cell:calc((var(--map-tool-w) - 6px) / 2);
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(4,auto);gap:6px;
    width:var(--map-tool-w)}
  #mapTools button{width:100%;height:auto;aspect-ratio:1;font-size:clamp(14px,5vw,28px)}
  #mapTools button[data-act="zoomIn"]{grid-column:1;grid-row:1}
  #mapTools button[data-act="zoomOut"]{grid-column:1;grid-row:2}
  #mapTools button[data-act="home"]{grid-column:1;grid-row:3}
  #mapTools button[data-act="fit"]{grid-column:2;grid-row:1}
  #mapTools button#btnPirateMap{grid-column:2;grid-row:2}
  #mapTools button#btnMapSound{grid-column:2;grid-row:3}
  #mapTools button[data-act="fit"].is-world{width:100%;min-width:0;height:auto;aspect-ratio:1}
  #mapTools button#btnPirateMap,#mapTools button#btnMapSound{font-size:clamp(14px,5vw,28px)}
}
#mapTools button#btnPirateMap.is-alert{color:#ff8f7a;border-color:rgba(239,106,91,.9);background:rgba(60,20,18,.82);
  animation:pirate-alert-flash 1.05s ease-in-out infinite}
@keyframes pirate-alert-flash{0%,100%{opacity:1;box-shadow:0 0 0 rgba(239,106,91,0)}50%{opacity:.35;box-shadow:0 0 14px rgba(239,106,91,.55)}}
@media(prefers-reduced-motion:reduce){#mapTools button#btnPirateMap.is-alert{animation:none;opacity:1;color:#ff8f7a}}
#mapNavigationStatus{position:absolute;right:84px;top:0;width:126px;padding:5px 7px;border:1px solid var(--line2);border-radius:4px;background:var(--glass);color:#d6e8f3;font-size:11px;line-height:1.4;text-align:right;pointer-events:none;display:none!important}
#mapNavigationStatus[hidden]{display:none}

/* The compass and the ship gauges keep a gutter along the stage edge: the map
   paints the graticule's longitude labels along the top edge and its latitude
   labels down the left edge. Both panels therefore start below the top label
   band and inside the left label column, so none of those readouts is covered;
   the local solar time now lives inside the bridge console. */
#compassBox{position:absolute;left:76px;bottom:96px;z-index:5;background:var(--glass);border:1px solid var(--line);
  border-radius:8px;padding:8px;backdrop-filter:blur(8px);text-align:center}
#compass{display:block;width:130px;height:130px}
#compassBox.is-sailing{border-color:rgba(246,215,155,.75);box-shadow:0 0 0 1px rgba(246,215,155,.12),0 0 15px rgba(246,215,155,.16);animation:compass-sail-beat 1.5s ease-in-out infinite}
@keyframes compass-sail-beat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@media(prefers-reduced-motion:reduce){#compassBox.is-sailing{animation:none}}
.compass-label{font-size:10px;color:var(--muted);margin-top:2px;letter-spacing:.08em}

#recoveryPanel{position:absolute;left:16px;top:245px;width:min(330px,85vw);max-height:45%;overflow:auto;background:rgba(7,23,36,.95);border:1px solid #c89c52;border-radius:8px;padding:12px;z-index:8;font-size:12px;line-height:1.7}#recoveryPanel .recovery-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}#recoveryPanel p{margin:5px 0}
/* Bridge console: six instruments (three status gauges, three navigational
   dials), an alarm bar and the voyage button row replace the old gauge stack.
   max-height keeps the console clear of the compass at the bottom of the stage. */
#shipPanel{position:absolute;left:76px;top:42px;width:252px;background:var(--glass);border:1px solid var(--line);
  border-radius:10px;padding:9px 12px 8px;backdrop-filter:blur(8px);z-index:5;
  max-height:var(--con-max-height,calc(100% - 322px));overflow:auto;scrollbar-width:thin;
  box-shadow:inset 0 0 0 1px rgba(126,199,214,.13),0 14px 34px rgba(2,14,24,.46)}
.con-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:6px;
  margin-bottom:7px;border-bottom:1px solid rgba(126,199,214,.22)}
.con-id{min-width:0}
.con-eyebrow{display:block;font-size:7.5px;letter-spacing:.2em;color:#7fb9c9;line-height:1.2}
.con-id strong{display:block;max-width:104px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:11.5px;font-weight:600;letter-spacing:.04em;line-height:1.3;color:#e7f3fb}
.con-dials{display:flex;flex:none;gap:5px}
.con-dial{min-width:54px;padding:3px 5px;border-radius:6px;text-align:center;
  background:linear-gradient(180deg,rgba(9,32,46,.9),rgba(5,20,31,.9));border:1px solid rgba(126,199,214,.26)}
.con-dial b{display:block;font-size:13px;line-height:1.12;font-variant-numeric:tabular-nums;letter-spacing:.01em;color:#8ee6c8}
.con-dial small{display:block;font-size:7.5px;line-height:1.2;letter-spacing:.05em;color:#9db8c6;white-space:nowrap}
.con-dial[data-dial="hdg"] b{color:#7fc4f0}
.con-dial[data-dial="range"] b{color:#f0d18a}
/* Voyage strip: route, percentage, bar and a one-line voyage summary, shown as
   the first row of the console grid so it reads above the hull gauge. */
.con-voyage{margin-bottom:8px;padding:5px 7px;border-radius:6px;
  background:linear-gradient(180deg,rgba(9,32,46,.92),rgba(5,20,31,.92));border:1px solid rgba(126,199,214,.28)}
.con-voyage[hidden]{display:none}
.con-voyage-head{display:flex;align-items:baseline;justify-content:space-between;gap:6px}
.con-voyage-route{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;color:#e7f3fb;letter-spacing:.02em}
.con-voyage-pct{flex:none;font-size:12px;color:#8ee6c8;font-variant-numeric:tabular-nums}
.con-voyage-bar{position:relative;height:6px;margin-top:3px;border-radius:3px;overflow:hidden;background:rgba(255,255,255,.1)}
.con-voyage-bar i{display:block;height:100%;width:0;border-radius:3px;
  background:linear-gradient(90deg,#4fd1c5,#8ee6c8);transition:width .45s ease}
.con-voyage-meta{margin-top:3px;font-size:9px;line-height:1.3;color:#a9c2d2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.con-alarm{display:flex;align-items:center;gap:6px;margin-top:5px;padding:5px 7px;border-radius:6px;
  font-size:11px;line-height:1.35;color:#cfe4ef;background:rgba(9,30,42,.82);border:1px solid rgba(126,199,214,.2)}
/* Weather ticker under the status row: one continuous marquee, no wrapping. */
.con-weather{margin-top:4px;padding:3px 0;overflow:hidden;white-space:nowrap;border-radius:6px;
  background:rgba(9,30,42,.55);border:1px solid rgba(126,199,214,.16);font-size:10px;line-height:1.4;color:#a9c2d2}
.con-weather-track{display:inline-block;padding-left:100%;animation:con-marquee 20s linear infinite}
@keyframes con-marquee{from{transform:translateX(0)}to{transform:translateX(-100%)}}
@media(prefers-reduced-motion:reduce){.con-weather-track{animation:none;padding-left:6px}}
.con-alarm-light{flex:none;width:7px;height:7px;border-radius:50%;background:#5be7a9;box-shadow:0 0 6px rgba(91,231,169,.8)}
#conAlarmText{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.con-alarm[data-level="warn"]{color:#f6e2b6;border-color:rgba(230,180,92,.5);background:rgba(48,34,10,.6)}
.con-alarm[data-level="warn"] .con-alarm-light{background:#e6b45c;box-shadow:0 0 7px rgba(230,180,92,.85);animation:con-blink 1.7s ease-in-out infinite}
.con-alarm[data-level="crit"]{color:#ffd2ca;border-color:rgba(239,106,91,.62);background:rgba(60,16,14,.62)}
.con-alarm[data-level="crit"] .con-alarm-light{background:#ef6a5b;box-shadow:0 0 9px rgba(239,106,91,.9);animation:con-blink .9s step-end infinite}
.con-buttons{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}
.con-buttons .btn{flex:1 1 auto;min-width:0;padding:4px 6px;font-size:10.5px;line-height:1.25}
/* Quick actions ride along with the moving ship marker on the map. */
#shipTools{position:absolute;z-index:9;display:flex;pointer-events:none;gap:4px;padding:4px;border-radius:999px;
  background:rgba(6,22,33,.82);border:1px solid rgba(126,199,214,.35);
  box-shadow:0 6px 18px rgba(0,0,0,.45);transform:translate(-50%,-50%);backdrop-filter:blur(6px)}
#shipTools.hidden{display:none}
.ship-tool{width:26px;height:26px;padding:0;border-radius:50%;cursor:pointer;pointer-events:auto;
  display:flex;align-items:center;justify-content:center;font-size:13px;line-height:1;
  color:#dbe9f2;background:rgba(9,32,46,.9);border:1px solid rgba(126,199,214,.4);transition:.15s}
.ship-tool:hover:not(:disabled){border-color:var(--gold);color:#ffe6a8}
.ship-tool:disabled{opacity:.42;cursor:not-allowed;filter:grayscale(1);border-color:rgba(126,199,214,.22);color:#8fa6b3}
/* Ready to broadcast: the SOS button turns green only while a call can go out. */
.ship-tool.is-ready{color:#eaffee;border-color:#5be7a9;background:rgba(12,60,42,.92);
  box-shadow:0 0 10px rgba(91,231,169,.55)}
.ship-tool.is-ready:hover:not(:disabled){border-color:#8ff0ea;color:#ffffff}
@media(prefers-reduced-motion:no-preference){
  .ship-tool.is-ready{animation:ship-tool-ready 1.8s ease-in-out infinite}
}
@keyframes ship-tool-ready{0%,100%{box-shadow:0 0 6px rgba(91,231,169,.35)}50%{box-shadow:0 0 14px rgba(91,231,169,.8)}}
.ship-tool[aria-pressed="true"]{border-color:#5be7a9;color:#8ff0ea;box-shadow:0 0 8px rgba(91,231,169,.35)}
.ship-tool.is-alert{border-color:#ef6a5b;color:#ffd2ca;animation:pirate-alert-flash 1.05s ease-in-out infinite}
@media(max-width:520px){#shipTools{gap:3px;padding:3px}.ship-tool{width:23px;height:23px;font-size:12px}}
@keyframes con-blink{50%{opacity:.32}}
/* Short stages: the gauges fold away first, then the whole strip hides, so the
   console can never sit on top of the compass. */
#shipPanel[data-compact="strip"]{padding:6px 9px}
#shipPanel[data-compact="strip"] .con-grid{display:none}
#shipPanel[data-compact="strip"] .con-eyebrow{display:none}
#shipPanel[data-compact="hidden"]{display:none}
/* Narrow phones: keep the same left gutter for the latitude labels but let the
   gauges use the remaining width instead of overflowing the stage. */
@media(max-width:520px){
  #shipPanel{left:64px;top:40px;width:calc(100% - 76px);padding:8px 10px 7px;max-height:var(--con-max-height,calc(100% - 322px))}
  .con-id strong{max-width:84px;font-size:11px}
  .con-dial{min-width:47px;padding:2px 4px}
  .con-dial b{font-size:12px}
  .con-dial small{font-size:7px}
  #compassBox{left:64px;bottom:92px}
}
@media(max-width:360px){
  .con-eyebrow{display:none}
  .con-buttons .btn{font-size:10px}
}
.gauge{margin-bottom:11px}
.gauge:last-child{margin-bottom:0}
.gauge-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:4px}
.gauge-head label{font-size:10.5px;color:var(--muted);letter-spacing:.1em;line-height:1.25;white-space:nowrap}
.gauge-cap{font-size:10px;color:#a9c2d2;letter-spacing:.02em;white-space:nowrap;font-weight:600}
.bar{height:6px;background:rgba(255,255,255,.09);border-radius:3px;overflow:hidden}
.bar i{display:block;height:100%;width:50%;background:linear-gradient(90deg,#4fd1c5,#8ee6c8);transition:width .45s ease}
.bar i.warn{background:linear-gradient(90deg,#e6b45c,#f6d79b)}
.bar i.bad{background:linear-gradient(90deg,#ef6a5b,#ff9b8e)}
.bar.energy i{background:linear-gradient(90deg,#4a8fd6,#7fc4f0)}
.bar.cargo i{background:linear-gradient(90deg,#8a6bd1,#b49af0)}
/* Dynamic ruler: the ruler spans exactly the bar width, so the needle (and the
   value tag it carries) always sits on the tick matching the bar fill. */
.gauge-scale{position:relative;height:27px;margin-top:2px}
.gauge-ticks{position:absolute;left:0;right:0;top:0;height:8px;pointer-events:none;
  background:
    repeating-linear-gradient(90deg,rgba(213,232,244,.55) 0 1px,transparent 1px 25%) top/100% 8px no-repeat,
    repeating-linear-gradient(90deg,rgba(213,232,244,.22) 0 1px,transparent 1px 5%) top/100% 4px no-repeat}
.gauge-pointer{position:absolute;top:0;left:0;width:0;height:100%;transform:translateX(-50%);
  transition:left .5s cubic-bezier(.22,.61,.36,1)}
.gauge-needle{position:absolute;top:2px;left:-.5px;width:1px;height:9px;border-radius:1px;
  transition:background .3s ease,box-shadow .3s ease}
.gauge-health .gauge-needle{background:linear-gradient(180deg,#8ee6c8,rgba(79,209,197,0))}
.gauge-energy .gauge-needle{background:linear-gradient(180deg,#7fc4f0,rgba(74,143,214,0))}
.gauge-cargo .gauge-needle{background:linear-gradient(180deg,#b49af0,rgba(138,107,209,0))}
.gauge-pointer .gauge-value{position:absolute;top:12px;left:0;width:max-content;transform:translateX(-50%);
  font-size:11.5px;line-height:1.15;color:#dfeef8;font-weight:600;white-space:nowrap;
  transition:transform .45s ease,color .3s ease,text-shadow .3s ease}
/* A changed reading (anchoring, breakdown, pirate raid or self-supply) turns
   green and its needle lights up until the next settled value. */
.gauge-pointer.is-changed .gauge-value{color:#5be7a9;text-shadow:0 0 8px rgba(91,231,169,.55)}
.gauge-pointer.is-changed .gauge-needle{background:linear-gradient(180deg,#7df0bb,rgba(91,231,169,.1));box-shadow:0 0 7px rgba(91,231,169,.7)}
@media(prefers-reduced-motion:reduce){
  .gauge-pointer{transition:none}
  .gauge-pointer .gauge-value{transition:none}
  .bar i{transition:none}
}

#voyageHud{position:absolute;top:var(--vh-top,8px);left:var(--vh-left,8px);width:min(460px,calc(100% - 16px));max-height:var(--vh-max-height,calc(100% - var(--vh-top,8px) - 8px));overflow:auto;box-sizing:border-box;
  background:rgba(9,28,44,.95);border:1px solid var(--line2);border-radius:8px;padding:9px 11px;z-index:6;
  backdrop-filter:blur(10px);box-shadow:0 10px 24px rgba(0,0,0,.35)}
.vh-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:12px;margin-bottom:5px}
.vh-route{color:#e6f3fb;min-width:0;overflow-wrap:anywhere}
.vh-progress{color:var(--gold2);font-weight:700;white-space:nowrap}
.vh-bar{height:4px;background:rgba(255,255,255,.1);border-radius:3px;overflow:hidden}
.vh-bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--gold),var(--gold2));transition:width .5s}
.vh-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 9px;margin-top:7px}
.vh-detail{min-width:0;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
.vh-detail span{color:var(--muted);margin-right:5px}.vh-detail b{font-weight:600;color:#e8f2fa}
.vh-detail:nth-child(2){grid-column:2;grid-row:1}.vh-detail:nth-child(3){grid-column:1/-1}
.vh-detail:nth-child(4),.vh-detail:nth-child(5){color:#e5bcb4}
#voyageHud[data-energy-warning="low"] .vh-detail:nth-child(3) b{color:var(--gold2)}
#voyageHud[data-energy-warning="critical"] .vh-detail:nth-child(3) b{color:#ffab9d}
.vh-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;margin-top:6px;padding-top:5px;border-top:1px solid var(--line);font-size:10.5px;line-height:1.4;color:var(--muted)}
#vhSea{min-width:0;overflow-wrap:anywhere}.vh-actions{display:none}.vh-footer .btn{flex:none;padding:4px 7px;font-size:10.5px;white-space:nowrap}
#btnVoyageDivert[aria-pressed="true"]{border-color:var(--gold);color:var(--gold2)}
#voyageHud[data-paused="true"]{border-color:rgba(246,215,155,.75)}
#stage.voyage-active #mapTools{top:var(--vh-tools-top,16px)}
@media(max-width:600px){.vh-details{grid-template-columns:1fr 1fr;gap:3px 6px}.vh-footer{align-items:flex-start}}

#alerts{position:absolute;right:16px;bottom:16px;display:flex;flex-direction:column;gap:8px;z-index:6;max-width:330px}
.alert{background:rgba(239,106,91,.14);border:1px solid rgba(239,106,91,.5);color:#ffd0c9;
  padding:10px 13px;border-radius:6px;font-size:12.5px;line-height:1.7;backdrop-filter:blur(6px)}
.alert.warn{background:rgba(230,180,92,.12);border-color:rgba(230,180,92,.5);color:#f7e2b8}

/* The legend toggle is the seventh map-tool cell: it stacks directly under the
   sound button with the same gutter as the other icons. */
#legend{position:relative;flex:none;width:76px;height:76px;box-sizing:border-box;background:var(--glass);
  border:1px solid var(--line2);border-radius:6px;font-size:11px;color:#d6e8f3;backdrop-filter:blur(6px);
  transition:border-color .15s,color .15s}
#legend:hover{border-color:var(--gold);color:var(--gold2)}
#legend div{display:flex;align-items:center;gap:7px;margin:5px 0}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.dot.me{background:var(--gold2);box-shadow:0 0 8px var(--gold)}
.dot.other{background:#ef6a5b}
.dot.bc{background:#ffd479;box-shadow:0 0 8px #ffd479}
.dot.locked{background:#5a6f7e;border:1px solid #8aa4b6}

#selectCard{position:absolute;left:50%;transform:translateX(-50%);top:16px;width:min(1000px,calc(100% - 32px));max-height:calc(100% - 32px);overflow:auto;background:var(--glass);border:1px solid var(--line2);
  border-radius:8px;padding:14px 16px;z-index:7;backdrop-filter:blur(10px)}
#selectCard.arrival-card{z-index:12;border-color:var(--gold2);box-shadow:0 10px 40px #020a12bc}
.arrival-welcome{margin:10px 0 14px;padding:12px 16px;border:1px solid rgba(230,180,92,.48);border-radius:7px;background:rgba(230,180,92,.12);color:var(--gold2);font-size:16px;font-weight:600}
.arrival-level-reward{display:flex;align-items:center;gap:12px;margin:0 0 14px;padding:12px 16px;border:1px solid rgba(91,231,169,.55);border-radius:8px;background:rgba(91,231,169,.12);color:#eafcf2}
.arrival-level-reward.hidden{display:none}
.arrival-level-icon{font-size:30px;line-height:1}
.arrival-level-reward strong,.arrival-level-amount{display:block;line-height:1.55}
.arrival-level-amount{color:#5be7a9;font-size:18px;font-weight:700;font-variant-numeric:tabular-nums}
.popup-close{display:inline-flex;align-items:center;justify-content:center;gap:5px;flex:none;min-width:44px;min-height:44px;padding:7px 10px;border:1px solid var(--line2);border-radius:7px;background:rgba(13,42,60,.85);color:var(--gold2);font:500 13px system-ui,sans-serif;cursor:pointer;white-space:nowrap}
.popup-close:hover{background:#234c60;color:#fff}.popup-close:focus-visible{outline:2px solid var(--gold2);outline-offset:2px}
.sc-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-height:44px}
.sc-title{font-size:15px;color:var(--gold2);margin-bottom:8px;font-family:"Songti SC",serif;min-width:0;overflow-wrap:anywhere}
.sc-body{font-size:12.5px;color:#b9d1df;line-height:1.9;max-height:none}
.city-gallery-header{display:flex;justify-content:space-between;gap:12px;margin:18px 0 10px;align-items:center}
.city-gallery-header b{color:var(--gold2);font-size:15px}.city-gallery-header span{font-size:11px;color:var(--muted)}
.city-photo-grid{display:grid;grid-template-columns:1fr 1.6fr 1fr;grid-template-rows:160px 160px;gap:12px}
.city-photo{margin:0;min-width:0;position:relative;overflow:hidden;border-radius:8px;border:1px solid rgba(231,211,166,.26);background:#163345}
.city-photo-grid:has(> .city-photo:only-child){display:block}.city-photo-grid:has(> .city-photo:only-child) .city-photo{height:250px}
.city-photo-0{grid-column:1;grid-row:1}.city-photo-1{grid-column:1;grid-row:2}.city-photo-2{grid-column:2;grid-row:1/3}.city-photo-3{grid-column:3;grid-row:1}.city-photo-4{grid-column:3;grid-row:2}
.city-photo button{position:relative;display:block;width:100%;height:100%;padding:0;border:0;background:#153044;cursor:zoom-in;overflow:hidden;color:#fff}
.city-photo img{width:100%;height:100%;object-fit:cover;display:block;filter:saturate(.88) contrast(1.04)}
.city-photo figcaption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.city-watermark{position:absolute;right:10px;bottom:28px;color:rgba(255,255,255,.78);font:bold 10px system-ui,sans-serif;letter-spacing:.16em;text-shadow:0 1px 4px #000;pointer-events:none}
.city-photo-caption{position:absolute;bottom:0;left:0;right:0;padding:16px 10px 6px;background:linear-gradient(transparent,rgba(3,16,26,.85));font-size:11px;text-align:left;letter-spacing:.08em}
.city-photo-expand{position:absolute;top:8px;right:9px;text-shadow:0 1px 3px #000;font-size:22px}
.city-photo.locked img{filter:blur(3px) saturate(.35) brightness(.48);transform:scale(1.04)}
.city-photo.locked button{cursor:zoom-in}
.city-photo-no-image{display:grid;place-items:center;width:100%;height:100%;min-height:110px;background:linear-gradient(140deg,#102b40,#176276);font-size:34px;color:var(--gold2)}
.city-photo-info{display:block;width:100%;padding:24px 16px;border:1px solid var(--line2);border-radius:8px;background:#13334a;color:var(--gold2);cursor:pointer;text-align:center;font-size:15px}
.city-photo-info:hover{background:#1b4760}
.city-video-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:12px;margin:14px 0 0}
.city-video{margin:0;min-width:0;border:1px solid var(--line2);border-radius:9px;overflow:hidden;background:#10293b}
.city-video video{display:block;width:100%;max-height:260px;aspect-ratio:16/9;object-fit:contain;background:#061522}
.city-video figcaption{padding:7px 10px;color:#d5e7ee;font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.city-photo-lock{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;background:rgba(6,22,34,.2);padding:6px}
.city-photo-lock>span{font-size:25px}.city-photo-lock b{font:600 12px system-ui,sans-serif;letter-spacing:.1em}.city-photo-lock small{font-size:10px;color:#cfdae0}
.modal-card:has(.city-photo-detail){width:min(1500px,94vw)}
.city-photo-detail{margin:0}.city-photo-detail>div{position:relative}.city-photo-detail img{max-height:72vh;width:100%;object-fit:contain;display:block;filter:saturate(.88) contrast(1.04)}
.city-photo-detail .city-watermark{font-size:16px;bottom:18px;right:18px}.city-photo-detail figcaption{font-size:12px;color:var(--muted);margin-top:12px}.city-photo-detail a{color:var(--gold2)}
@media(max-width:650px){.city-photo-grid{grid-template-columns:1fr 1.25fr 1fr;grid-template-rows:120px 120px;gap:6px}.city-photo-lock b{font-size:8px;letter-spacing:0}.city-gallery-header{align-items:flex-start;flex-direction:column;gap:2px}.city-photo-caption{font-size:10px}.city-watermark{font-size:7px;right:4px}}
.sc-actions{display:flex;gap:8px;margin-top:12px}

/* Bottom strip: the index box and the dock buttons share one row. */
#dock{min-height:80px;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;padding:6px 10px;flex-shrink:0;
  background:linear-gradient(0deg,#08192a,#0a2136);border-top:1px solid var(--line);z-index:8}
#dockButtons{display:flex;align-items:center;justify-content:center;gap:4px;flex:1 1 auto;min-width:0;min-height:62px;overflow-x:auto;flex-shrink:1;scrollbar-width:none}
#dockButtons::-webkit-scrollbar{display:none}
/* The index is its own framed box, aligned in the same row as the dock buttons. */
/* Merged channel box: online captains plus every server channel's speed.
   Same framing as the index box that follows it. */
.dock-channel-box{display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;flex:0 0 auto;gap:8px;height:56px;min-height:56px;max-width:min(330px,44vw);padding:4px 12px;margin:0;
  border:1px solid rgba(126,189,210,.34);border-radius:11px;background:rgba(9,28,42,.82);box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);
  white-space:nowrap;font-size:11px;overflow:hidden}
.dock-channel-online{display:inline-flex;align-items:baseline;gap:4px;color:#cfe0ea;font-variant-numeric:tabular-nums}
.dock-channel-online b{font-size:12.5px;font-weight:600;color:#eaf4fb}
.dock-channel-dot{color:#5fd1cb;font-size:9px}
.dock-channel-nodes{display:inline-flex;align-items:center;gap:5px;overflow-x:auto;scrollbar-width:none;max-width:190px}
.dock-channel-nodes::-webkit-scrollbar{display:none}
.dock-channel{display:inline-flex;align-items:center;gap:4px;padding:2px 5px;border:1px solid rgba(126,189,210,.3);border-radius:8px;background:rgba(13,38,54,.7);color:#b9ceda;cursor:pointer;font-size:10.5px;white-space:nowrap}
.dock-channel:hover{border-color:#5fd1cb;color:#e6f3f8}
.dock-channel.is-active{border-color:#5fd1cb;background:rgba(95,209,203,.14);color:#eaf7f6}
.dock-channel-bars{display:inline-flex;align-items:flex-end;gap:1px;height:10px}
.dock-channel-bars i{display:block;width:2px;height:3px;border-radius:1px;background:currentColor;opacity:.22}
.dock-channel-bars i:nth-child(2){height:5px}.dock-channel-bars i:nth-child(3){height:7px}.dock-channel-bars i:nth-child(4){height:9px}.dock-channel-bars i:nth-child(5){height:11px}
.dock-channel[data-speed="拥挤"] .dock-channel-bars i:nth-child(-n+1),
.dock-channel[data-speed="缓慢"] .dock-channel-bars i:nth-child(-n+2),
.dock-channel[data-speed="一般"] .dock-channel-bars i:nth-child(-n+3),
.dock-channel[data-speed="快"] .dock-channel-bars i:nth-child(-n+4),
.dock-channel[data-speed="飞速"] .dock-channel-bars i{opacity:1}
.dock-channel[data-speed="拥挤"]{color:#ef6466}.dock-channel[data-speed="缓慢"]{color:#ed9d58}
.dock-channel[data-speed="一般"]{color:#e6d174}.dock-channel[data-speed="快"]{color:#89dbaa}.dock-channel[data-speed="飞速"]{color:#53ddda}
.dock-channel-name{font-weight:600}
.dock-channel-ms{opacity:.7;font-variant-numeric:tabular-nums}
#channelBox #serverSpeed{min-width:0;padding:3px 7px;background:rgba(13,38,54,.7)}
#dock #marketTicker{display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;flex:0 0 auto;gap:9px;height:56px;min-height:56px;min-width:min(236px,30vw);max-width:min(320px,42vw);padding:4px 12px;margin:0;
  border:1px solid rgba(126,189,210,.34);border-radius:11px;background:rgba(9,28,42,.82);box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);
  white-space:nowrap;font-size:11px;overflow:hidden}
#dock #marketTicker>strong{font-size:19px;font-variant-numeric:tabular-nums}
#dock #marketTicker small{margin-left:5px}
#dock #marketTicker .mv-ticker-chart{display:none}
@media(max-width:900px){.dock-channel-box{max-width:min(280px,48vw);height:52px;min-height:52px;gap:6px;padding:4px 9px}.dock-channel-nodes{max-width:120px}#dock #marketTicker{height:52px;min-height:52px;min-width:min(200px,34vw)}}
@media(max-width:420px){.dock-channel-box{max-width:46vw;height:44px;min-height:44px;padding:4px 7px;gap:5px}.dock-channel-nodes{max-width:64px}.dock-channel-name{display:none}#dock #marketTicker{height:44px;min-height:44px;min-width:0;max-width:44vw;padding:4px 8px;gap:6px;font-size:10px}#dock #marketTicker>strong{font-size:15px}}
@media(max-width:900px){#dock{gap:7px;padding:6px 8px}#dock #marketTicker{gap:7px;font-size:10px}#dock #marketTicker>strong{font-size:16px}}
@media(max-width:420px){#dock{gap:5px;padding:5px 6px}#dock #marketTicker{gap:6px;font-size:10px}#dock #marketTicker>strong{font-size:15px}}
/* Sponsorship chip: a compact second row under the canvas terrain legend.
   Its left edge (12px) matches the legend box, and the half-size chip keeps
   clear of the map scale bar at the bottom-right. */
#mapQuickLinks{position:absolute;left:12px;right:auto;bottom:8px;z-index:7;display:flex;
  align-items:center;gap:6px;max-width:calc(100% - 24px)}
#mapQuickLinks .chip{font-size:10px;line-height:1.2;padding:2px 9px;border-radius:11px;
  background:rgba(9,28,42,.86);white-space:nowrap}
#mapQuickLinks .chip:hover{border-color:var(--gold);color:var(--gold2)}
@media(max-width:650px){#mapQuickLinks{bottom:6px;gap:5px}
  #mapQuickLinks .chip{padding:2px 8px;font-size:9.5px}}
#dock button{flex:1;min-width:80px;max-width:120px;height:58px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  gap:2px;background:transparent;border:1px solid transparent;color:#a8c3d4;cursor:pointer;border-radius:6px;
  font-size:18px;transition:.15s}
#dock button .dock-icon{display:block;width:auto;height:30px;max-width:34px;margin-inline:auto;object-fit:contain;pointer-events:none}
#dock button span{display:block;width:100%;text-align:center;font-size:15px;line-height:1.15;letter-spacing:.03em;white-space:nowrap}
#dock button:hover{background:rgba(230,180,92,.1);border-color:var(--line2);color:var(--gold2)}
#dock button.active{background:rgba(230,180,92,.16);border-color:var(--gold);color:var(--gold2)}

#drawer{position:absolute;right:0;top:var(--topbar-h,56px);bottom:var(--dock-h,80px);width:372px;background:rgba(7,22,35,.95);
  border-left:1px solid var(--line2);backdrop-filter:blur(14px);z-index:9;display:flex;flex-direction:column;
  box-shadow:-20px 0 60px rgba(0,0,0,.4)}
#drawer header{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;
  border-bottom:1px solid var(--line)}
#drawer h2{margin:0;font-size:15px;letter-spacing:.12em;color:var(--gold2);font-weight:600;
  font-family:"Songti SC",serif}
#drawerClose{color:var(--gold2)}
#drawerBody{flex:1;overflow:auto;padding:16px 18px 26px}
@media(max-width:600px){#drawer{width:min(372px,100vw);top:var(--drawer-top,var(--topbar-h,56px));bottom:var(--drawer-bottom,var(--dock-h,80px))}}
/* Phones wrap the index box above the button row, so the drawer clears the taller dock. */
@media(max-width:420px){#drawer{bottom:var(--drawer-bottom,var(--dock-h,80px))}}
/* ---------- drawer widgets ---------- */
.sec-title{font-size:11px;letter-spacing:.18em;color:var(--gold);margin:2px 0 10px}
.port-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:14px}
#island3d{width:100%;height:210px;border:1px solid var(--line2);border-radius:6px;background:#06131e;display:block}
.port-name{font-family:"Songti SC",serif;font-size:22px;color:#f0f7fc;letter-spacing:.1em}
.port-sub{font-size:11.5px;color:var(--muted);margin-top:4px;line-height:1.9}
.port-intro{font-size:12.5px;color:#b9d1df;line-height:1.95;margin:12px 0;padding:12px;
  background:rgba(255,255,255,.03);border-left:2px solid var(--gold);border-radius:0 4px 4px 0}
.kv{display:grid;grid-template-columns:78px 1fr;gap:6px 10px;font-size:12px;color:#c3d9e6}
.kv span{color:var(--muted)}

.table{width:100%;border-collapse:collapse;font-size:12px}
.table th{text-align:left;color:var(--muted);font-weight:400;font-size:10.5px;letter-spacing:.1em;
  padding:6px 4px;border-bottom:1px solid var(--line)}
.table td{padding:7px 4px;border-bottom:1px solid rgba(120,180,215,.08);color:#d3e6f1}
.table tr:hover td{background:rgba(255,255,255,.03)}
.table .num{text-align:right;font-variant-numeric:tabular-nums}
.up{color:#5cd08a}.down{color:#ef6a5b}
.tag{display:inline-block;font-size:10px;padding:1px 6px;border-radius:10px;border:1px solid var(--line2);color:var(--muted)}
.tag.rare{color:#f0c674;border-color:rgba(230,180,92,.5)}
.tag.uncommon{color:#8fd6c0;border-color:rgba(79,209,197,.4)}

.modal-card:has(#shipyardCenter){width:min(920px,94vw)}
#shipyardCenter{display:block}
#drawer #shipyardCenter .ship-card{margin-bottom:10px}
@media(max-width:650px){#shipyardCenter{display:block}}
.ship-card{border:1px solid var(--line);border-radius:8px;padding:13px 14px;margin-bottom:11px;
  background:linear-gradient(160deg,rgba(16,51,74,.55),rgba(6,20,32,.5));transition:.18s}
.ship-card:hover{border-color:var(--gold)}
.ship-card.owned{border-color:var(--green)}
.ship-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px}
.ship-name{font-size:14px;color:#eef6fb}
.ship-price{color:var(--gold2);font-weight:700;font-size:13.5px}
.ship-desc{font-size:11.5px;color:var(--muted);line-height:1.8;margin:6px 0 9px}
.ship-specs{display:flex;gap:12px;font-size:11px;color:#a9c6d7;margin-bottom:10px;flex-wrap:wrap}
.ship-specs b{color:#e3f1fa;font-weight:600}

.shipyard-repair{border:1px solid rgba(79,209,197,.42);border-radius:9px;padding:13px 14px;margin:14px 0 16px;background:linear-gradient(160deg,rgba(38,135,139,.12),rgba(8,24,38,.55))}
.shipyard-repair .kv{margin:9px 0}.shipyard-repair .hint{margin:9px 0;line-height:1.6}
.shipyard-repair #repairFeedback:empty{display:none}
.tradein-box{border:1px solid rgba(230,180,92,.38);border-radius:9px;padding:13px 14px;margin-bottom:16px;
  background:linear-gradient(160deg,rgba(230,180,92,.10),rgba(8,24,38,.55))}
.tradein-hero{display:flex;justify-content:space-between;gap:12px;align-items:center;
  padding-bottom:10px;border-bottom:1px solid rgba(230,180,92,.18);margin-bottom:10px}
.tradein-label{font-size:10.5px;letter-spacing:.15em;color:var(--muted)}
.tradein-old{font-size:14px;color:#f2f8fc;margin:4px 0}
.tradein-meta{font-size:11px;color:var(--muted);line-height:1.7}
.tradein-meta b{color:var(--gold2)}
.tradein-credit{text-align:right;white-space:nowrap}
.tradein-credit span{display:block;font-size:10.5px;color:var(--muted);letter-spacing:.1em}
.tradein-credit b{font-size:19px;color:var(--gold2);font-variant-numeric:tabular-nums}
.tradein-net{display:flex;justify-content:space-between;align-items:baseline;font-size:11.5px;color:var(--muted);margin-bottom:9px}
.tradein-net b{color:var(--gold2);font-size:13px}
.tradein-net b.back{color:var(--green)}
.tradein-locked{border:1px dashed var(--line2);border-radius:8px;padding:13px 14px;margin-bottom:16px;background:rgba(255,255,255,.02)}
.tradein-locked .reason{font-size:12px;color:#c3d9e6;line-height:1.8;margin-bottom:9px}
.mega-port-list{display:flex;flex-wrap:wrap;gap:6px}
.mega-port-list .tag{font-size:10.5px;padding:3px 8px}

.list-row{display:flex;justify-content:space-between;align-items:center;padding:9px 0;
  border-bottom:1px solid rgba(120,180,215,.08);font-size:12.5px;gap:10px}
.list-row .meta{color:var(--muted);font-size:11px}
.feed-admin-messages{flex:none;min-height:34px;padding:5px 11px;margin-left:auto;margin-right:8px;border:1px solid rgba(126,189,210,.42);border-radius:7px;background:rgba(24,72,92,.7);color:#cfe6f0;font:500 12px system-ui,sans-serif;cursor:pointer;white-space:nowrap}
.feed-admin-messages:hover{background:#265a72;color:#fff}
.feed-admin-messages:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.world-feed-notices{display:flex;flex-direction:column;gap:8px;margin:0 0 14px}
.world-feed-notice{padding:9px 11px;border:1px solid rgba(230,180,92,.28);border-radius:7px;background:rgba(230,180,92,.06)}
.world-feed-notice h3{margin:0 0 4px;font-size:12.5px;font-weight:600;color:var(--gold2);line-height:1.5}
.world-feed-notice p{margin:0;font-size:11.5px;line-height:1.6;color:#d3e2ea;overflow-wrap:anywhere;white-space:pre-wrap}
.world-feed-notice small{display:block;margin-top:5px;font-size:9.5px;color:var(--muted)}
.world-feed-events{display:flex;flex-direction:column}
.world-feed-event{display:flex;align-items:center;gap:6px;min-width:0;padding:4px 0;border-bottom:1px solid rgba(120,180,215,.08);font-size:11px;line-height:1.4}
.world-feed-icon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;font-size:12px}
.world-feed-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#d7e6ee}
.world-feed-event .meta{flex:none;margin-left:auto;font-size:9.5px;color:#8ba4b4;font-variant-numeric:tabular-nums}
.world-feed-sail-logo{display:inline-block;width:22px;height:16px;object-fit:contain;vertical-align:middle}
.btn-row{display:flex;gap:6px;flex-wrap:wrap}

.dest-item{display:flex;justify-content:space-between;align-items:center;padding:9px 10px;border-radius:5px;
  border:1px solid transparent;font-size:12.5px;cursor:pointer}
.dest-item:hover{background:rgba(255,255,255,.04);border-color:var(--line2)}
.dest-item.locked{opacity:.45;cursor:not-allowed}
.dest-item.far{opacity:.6}
.dest-item .d-left{display:flex;flex-direction:column;gap:2px}
.dest-item .d-sub{font-size:10.5px;color:var(--muted)}

.radar-wrap{display:flex;justify-content:center;margin:8px 0}
#radarSoundStatus:empty{display:none}
#drawer[data-panel="radar"] #drawerBody{overflow-y:auto;padding-bottom:14px;display:flex;flex-direction:column}
.radar-comms{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
.radar-comms .radar-close-row{margin-top:auto}
.radar-comms #radarComms{margin-bottom:6px}
.radar-close-row{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;margin:8px 0 0;padding:7px 12px;
  border:1px dashed rgba(241,203,140,.55);border-radius:8px;background:rgba(241,203,140,.08);color:#f1cb8c;
  font:700 16px/1 'Microsoft YaHei UI','PingFang SC',sans-serif;text-align:left;cursor:pointer}
.radar-close-meta{flex:1;min-width:0;font:400 10.5px/1.45 'Microsoft YaHei UI','PingFang SC',sans-serif;color:#bcd6e2;letter-spacing:.01em}
.radar-close-arrow{flex:0 0 auto;font:700 15px/1 'Microsoft YaHei UI','PingFang SC',sans-serif}
.radar-close-row:hover{background:rgba(241,203,140,.16)}
.radar-close-row:focus-visible{outline:2px solid #f1cb8c;outline-offset:2px}
#radarCanvas{border-radius:50%;border:1px solid var(--line2);background:radial-gradient(circle,#06283c,#03101b 70%)}

.chat-log{height:240px;overflow:auto;border:1px solid var(--line);border-radius:6px;padding:10px;
  font-size:12.5px;background:rgba(0,0,0,.22);margin-bottom:10px}
.chat-msg{margin-bottom:8px;line-height:1.6}
.chat-msg .who{color:var(--gold2);margin-right:6px}
.chat-msg .who.mine{color:var(--teal)}
.chat-msg .dist{color:var(--muted);font-size:10.5px;margin-left:6px}
.chat-input{display:flex;gap:8px}
.chat-input input{flex:1;padding:9px 11px;background:rgba(255,255,255,.05);border:1px solid var(--line2);
  color:var(--ink);border-radius:4px;outline:none;font-size:13px}
.recording{color:var(--red);animation:pulse 1s infinite}
@keyframes pulse{50%{opacity:.35}}

.quiz-q{margin-bottom:16px;font-size:13px;line-height:1.8}
.quiz-q b{color:var(--gold2);display:block;margin-bottom:8px;font-weight:600}
.quiz-opt{display:block;padding:9px 12px;border:1px solid var(--line2);border-radius:5px;margin-bottom:6px;
  cursor:pointer;font-size:12.5px;transition:.15s}
.quiz-opt:hover{border-color:var(--gold)}
.quiz-opt.sel{border-color:var(--gold);background:rgba(230,180,92,.14)}
.quiz-opt.right{border-color:var(--green);background:rgba(92,208,138,.12)}
.quiz-opt.wrong{border-color:var(--red);background:rgba(239,106,91,.12)}

#modal{position:fixed;inset:0;background:rgba(2,8,14,.72);z-index:60;display:flex;align-items:center;
  justify-content:center;backdrop-filter:blur(3px)}
.modal-card{width:min(640px,92vw);max-height:86vh;display:flex;flex-direction:column;background:#0b2233;
  border:1px solid var(--line2);border-radius:10px;box-shadow:0 30px 80px rgba(0,0,0,.6)}
.modal-card header{padding:12px 16px 12px 20px;border-bottom:1px solid var(--line);font-family:"Songti SC",serif;
  font-size:16px;color:var(--gold2);letter-spacing:.1em;display:flex;align-items:center;justify-content:space-between;gap:12px}
#modalTitle{min-width:0;overflow-wrap:anywhere}
.modal-card #modalBody{padding:18px 20px;overflow:auto;font-size:13px;line-height:1.85}
.modal-card footer{padding:12px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:9px}
#modal:has(.guide-body) .modal-card{width:min(880px,94vw)}
.guide-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px 14px}
.guide-body section{padding:11px 13px;border:1px solid #2b4a5c;border-radius:9px;background:#0e2a3b;min-width:0}
.guide-body h3{margin:0 0 6px;font-size:14px;font-weight:600;color:#f0c674;letter-spacing:.04em;
  display:flex;gap:8px;align-items:baseline;line-height:1.4}
.guide-body h3 b{font:600 11px/1 system-ui,sans-serif;color:#7fb3c9;letter-spacing:.08em}
.guide-body p{margin:0;font-size:12.5px;line-height:1.75;color:#c7dbe6;overflow-wrap:anywhere}
@media(max-width:520px){#modal:has(.guide-body) .modal-card{width:min(100% - 20px,96vw)}
  .guide-body{grid-template-columns:1fr;gap:9px}.guide-body section{padding:9px 11px}}

#toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%) translateY(20px);z-index:80;
  background:rgba(10,30,46,.95);border:1px solid var(--line2);color:#e7f2fa;padding:11px 20px;border-radius:24px;
  font-size:13px;opacity:0;pointer-events:none;transition:.28s;max-width:70vw;text-align:center}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
#toast.err{border-color:rgba(239,106,91,.6);color:#ffd0c9}
/* Server-confirmed new-ship film: block navigation until playback ends. */
.ship-purchase-film{position:fixed;inset:0;z-index:1100;display:grid;place-items:center;overflow:hidden;background:#020a11;color:#e8f2fa}
.ship-purchase-film video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#020a11}
.ship-purchase-film-panel{position:absolute;z-index:1;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(520px,calc(100% - 32px));padding:12px 20px;text-align:center;border:1px solid rgba(230,180,92,.42);border-radius:10px;background:rgba(4,16,28,.82);backdrop-filter:blur(8px)}
.ship-purchase-film-panel h2{margin:0 0 5px;color:var(--gold2);font-size:17px}
.ship-purchase-film-panel p{margin:0;font-size:12px;line-height:1.55}
.ship-purchase-film-panel button{margin-top:10px}
.ship-purchase-film[data-playing="true"] .ship-purchase-film-panel{opacity:0;pointer-events:none;transition:opacity .4s}
/* New-ship home-port reveal: locks the page while the camera settles. */
.home-port-reveal{position:fixed;inset:0;z-index:1090;display:flex;align-items:flex-start;justify-content:center;padding-top:max(18px,env(safe-area-inset-top));cursor:wait;touch-action:none;background:radial-gradient(circle at 50% 42%,rgba(4,16,28,0) 34%,rgba(4,14,24,.55) 100%);pointer-events:auto}
.home-port-reveal.hidden{display:none}
.home-port-reveal-caption{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:min(320px,84vw);padding:9px 18px;border:1px solid rgba(230,180,92,.55);border-radius:11px;background:rgba(5,20,33,.9);box-shadow:0 12px 34px rgba(0,0,0,.5);text-align:center}
.home-port-reveal-kicker{font-size:9.5px;letter-spacing:.32em;color:var(--muted)}
.home-port-reveal-caption strong{font-family:"Songti SC",serif;font-size:21px;letter-spacing:.14em;color:#f6e2b4}
.home-port-reveal-caption [data-homeport-status]{font-size:10.5px;color:#a9c1cf;font-variant-numeric:tabular-nums}
.home-port-reveal.is-blink .home-port-reveal-caption{animation:home-port-blink 1.05s ease-in-out infinite}
.home-port-reveal.is-zooming .home-port-reveal-caption{border-color:rgba(126,189,210,.5)}
@keyframes home-port-blink{0%,100%{opacity:1;border-color:rgba(246,215,155,.8);box-shadow:0 12px 34px rgba(0,0,0,.5),0 0 0 1px rgba(246,215,155,.35)}50%{opacity:.6;border-color:rgba(230,180,92,.35);box-shadow:0 8px 22px rgba(0,0,0,.42)}}
@media(prefers-reduced-motion:reduce){.home-port-reveal.is-blink .home-port-reveal-caption{animation:none}}

::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-thumb{background:rgba(120,180,215,.25);border-radius:4px}
::-webkit-scrollbar-track{background:transparent}

/* ================= 赞助商 ================= */
.auth-sponsor{position:absolute;top:clamp(16px,3vh,30px);right:clamp(18px,3vw,48px);z-index:5;display:flex;align-items:center;gap:8px;
  font-size:12px;color:var(--dim,#8fa9bb);letter-spacing:.04em;white-space:nowrap}
.linkish{background:none;border:none;color:#f0c674;font-size:12px;cursor:pointer;padding:0;
  border-bottom:1px dashed rgba(240,198,116,.5)}
.linkish:hover{color:#ffe0a3}

.sponsor-screen{position:fixed;inset:0;z-index:60;overflow:auto;
  background:radial-gradient(1200px 700px at 20% 0%,#0d2c40 0%,#061620 55%,#04101a 100%)}
.sp-wrap{max-width:1080px;margin:0 auto;padding:34px 28px 60px}
.sp-head{display:flex;gap:24px;align-items:flex-start;justify-content:space-between;margin-bottom:22px}
.sp-kicker{font-size:10px;letter-spacing:.28em;color:#5f9ab8;margin-bottom:8px}
.sp-head h2{margin:0 0 8px;font-size:26px;font-weight:600;color:#eaf4fb;letter-spacing:.04em}
.sp-sub{margin:0;max-width:660px;font-size:13px;line-height:1.75;color:#9db7c8}
.sp-sub b{color:#f0c674;font-weight:600}
.sp-tabs{display:flex;gap:8px;border-bottom:1px solid rgba(120,180,215,.16);margin-bottom:20px}
.sp-tabs .tab{background:none;border:none;padding:10px 18px;color:#8ba8bb;font-size:13px;cursor:pointer;
  border-bottom:2px solid transparent}
.sp-tabs .tab.active{color:#f0c674;border-bottom-color:#f0c674}
.sp-form{display:block}
.sp-form.hidden,.sp-dash.hidden{display:none}
.sp-grid{display:grid;grid-template-columns:180px 1fr;gap:26px;align-items:start}
.sp-icon-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  width:150px;height:150px;border:1px dashed rgba(120,180,215,.35);border-radius:10px;cursor:pointer;
  background:rgba(255,255,255,.03);overflow:hidden;position:relative}
.sp-icon-drop:hover{border-color:#f0c674}
.sp-icon-drop img{width:96px;height:96px;object-fit:contain;display:none;border-radius:8px;background:#0b1a26}
.sp-icon-drop img.show{display:block}
.sp-icon-drop span{font-size:11px;color:#7f9cb0;text-align:center;line-height:1.6}
.sp-icon-drop span i{display:block;font-style:normal;font-size:10px;color:#5d7b8f;margin-top:2px}
.sp-icon-drop.has img + span{display:none}
.sp-fields label{display:block;font-size:12px;color:#9db7c8;margin-bottom:12px}
.sp-fields input,.sp-fields select{width:100%;margin-top:6px;padding:9px 11px;border-radius:5px;
  border:1px solid rgba(120,180,215,.22);background:rgba(255,255,255,.05);color:#e8f3fa;font-size:13px;outline:none}
.sp-fields input:focus,.sp-fields select:focus{border-color:#f0c674}
.sp-quote{margin:18px 0 16px;padding:16px 18px;border-radius:8px;border:1px solid rgba(120,180,215,.18);
  background:linear-gradient(180deg,rgba(14,42,58,.85),rgba(8,26,38,.85));font-size:12.5px;color:#9db7c8}
.sp-quote .q-row{display:flex;justify-content:space-between;padding:4px 0}
.sp-quote .q-row b{color:#dcecf6;font-weight:600}
.sp-quote .q-row.total{margin-top:8px;padding-top:10px;border-top:1px solid rgba(120,180,215,.18);font-size:14px}
.sp-quote .q-row.total b{color:#f0c674;font-size:19px}
.q-islands{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.q-islands span{font-size:11px;padding:3px 8px;border-radius:10px;background:rgba(120,180,215,.1);color:#a9c6d8}
.q-islands i{font-style:normal;color:#5f7f94;margin-left:6px}
.sp-dash{display:block}
.sp-dash-head{display:flex;align-items:center;gap:16px;padding:18px;border-radius:10px;
  border:1px solid rgba(120,180,215,.2);background:rgba(10,32,46,.7);margin-bottom:18px}
.sp-dash-head img{width:64px;height:64px;object-fit:contain;border-radius:8px;background:#0b1a26}
.sp-dash-head .who{flex:1}
.sp-dash-head .who b{display:block;font-size:19px;color:#eaf4fb}
.sp-dash-head .who span{font-size:12px;color:#8fa9bb}
.sp-dash-stats{display:flex;gap:22px;margin-bottom:16px;flex-wrap:wrap}
.sp-dash-stats div{font-size:11px;color:#7f9cb0}
.sp-dash-stats div b{display:block;font-size:16px;color:#f0c674;margin-top:3px}
.sp-dash-table{width:100%;border-collapse:collapse;font-size:12.5px}
.sp-dash-table th{text-align:left;color:#7f9cb0;font-weight:500;padding:8px 6px;border-bottom:1px solid rgba(120,180,215,.16)}
.sp-dash-table td{padding:9px 6px;border-bottom:1px solid rgba(120,180,215,.08);color:#cfe2ee}
.sp-dash-table td.num{text-align:right;font-variant-numeric:tabular-nums}

/* 赞助申请：深色表单、区域选择和小屏布局 */
.sponsor-screen,.sponsor-screen *{box-sizing:border-box}
.sp-wrap,.sp-fields,.sp-dash-head .who{min-width:0}
.sponsor-screen .sp-form input:not([type="checkbox"]):not([type="file"]),
.sponsor-screen .sp-form textarea,.sponsor-screen .sp-form select{
  display:block;width:100%;margin-top:6px;padding:10px 11px;border:1px solid #426276;border-radius:6px;
  background:#102b3b;color:#edf7fb;font:inherit;outline:none}
.sponsor-screen .sp-form textarea{min-height:116px;resize:vertical;line-height:1.5}
.sponsor-screen .sp-form input::placeholder,.sponsor-screen .sp-form textarea::placeholder{color:#96afbf}
.sponsor-screen .sp-form select option{background:#102b3b;color:#edf7fb}
.sponsor-screen .sp-form>label,.sp-fields>label,.sp-fields .row2 label{display:block;color:#c0d6e3;font-size:12px;margin-bottom:13px}
#spIntroCount{display:block;text-align:right;color:#9db7c8;margin-top:5px}
.sp-regions{border:0;padding:0;margin:0 0 15px;min-width:0}
.sp-regions legend,.sp-fields .field-label,.sp-icon-box .field-label{font-size:12px;color:#c0d6e3;margin-bottom:8px}
.sp-country-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:9px}
.sp-country-tile{display:flex!important;gap:10px;align-items:center;min-width:0;margin:0!important;padding:12px!important;
  background:#102b3b;border:1px solid #426276;border-radius:8px;cursor:pointer;color:#edf7fb!important}
.sp-country-tile:has(input:checked){background:#254354;border-color:#f0c674}
.sp-country-tile input{accent-color:#f0c674;appearance:none;flex:none;width:18px;height:18px;margin:0;background:#102b3b;border:2px solid #a7c3d3;border-radius:4px}
.sp-country-tile input:checked{background:#775d25;border-color:#f0c674}
.sp-country-tile input:checked::after{content:'✓';display:block;color:#fff;font-size:15px;line-height:13px}
.sponsor-screen input[type="file"]{background:#102b3b}
.sp-country-tile span{min-width:0}.sp-country-tile b,.sp-country-tile small{display:block;overflow-wrap:anywhere}
.sp-country-tile small{color:#a7c3d3;line-height:1.5;margin-top:3px}
.sp-region-summary{color:#f0c674;margin-top:10px;font-size:13px}
.sponsor-screen .chip-d{background:#102b3b;color:#e7f3f9;border-color:#426276}
.sponsor-screen .chip-d.active{background:#354632;color:#ffe0a3;border-color:#f0c674}
.sponsor-screen .sp-icon-drop{background:#102b3b;color:#e7f3f9}
.sponsor-screen .sp-quote,.sponsor-screen .sp-status,.sponsor-screen .sp-details,.sponsor-screen .sp-receipt{
  background:#102b3b;color:#d9ebf4;border:1px solid #426276;border-radius:9px;padding:16px;margin:14px 0}
.sp-status>b,.sp-receipt>b{font-size:18px;color:#f0c674}
.sp-status p{line-height:1.6;overflow-wrap:anywhere}
.sponsor-screen .sp-pay-form{min-width:0;background:#102b3b;color:#d9ebf4;border:1px solid #426276;border-radius:9px;padding:16px;margin:14px 0}
.sp-pay-form h3{margin:0 0 8px;color:#f0c674}.sp-pay-form p{line-height:1.6;overflow-wrap:anywhere}
.sp-pay-form label{display:block;margin:12px 0;color:#d9ebf4}
.sponsor-screen .sp-pay-form :is(select,input){display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;padding:11px 12px;margin:7px 0 0;border-radius:7px;border:1px solid #426276;background:#0b1c29;color:#eaf4fb;font:inherit}
.sp-pay-form .hint{overflow-wrap:anywhere}
.sp-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;line-height:1.6;overflow-wrap:anywhere}
.sp-intro{grid-column:1/-1;white-space:pre-wrap}.sp-share-list{margin-top:10px;line-height:1.8}
.sponsor-screen :is(button,input,textarea,select,.sp-icon-drop):focus-visible,
.sponsor-screen .sp-country-tile:focus-within{outline:2px solid #f0c674;outline-offset:3px}
.sponsor-screen .q-row{gap:12px;overflow-wrap:anywhere}.sponsor-screen .q-row b{text-align:right}
@media(max-width:650px){.sp-wrap{padding:20px 16px 45px}.sp-grid{grid-template-columns:1fr;gap:18px}.sp-head{flex-wrap:wrap}.sp-head h2{font-size:22px}.sp-icon-drop{width:100%;height:110px}.sp-dash-head{flex-wrap:wrap}.sp-dash-head .who{flex:1 1 160px}}
@media(max-width:420px){.sp-fields .row2{grid-template-columns:1fr;gap:0}.sp-country-grid{grid-template-columns:1fr}.sp-details{grid-template-columns:1fr}.sp-tabs .tab{padding:10px 12px}.sp-head .btn{width:auto;margin-left:auto}}
.sp-head .popup-close{margin-left:auto;position:sticky;top:8px;z-index:2}

/* 港口赞助卡 */
.sponsor-wrap{display:flex;flex-direction:column;gap:10px;margin:14px 0 4px}
.sponsor-wrap .sponsor-card{margin:0}
.sponsor-card{display:flex;gap:12px;align-items:center;margin:14px 0 4px;padding:12px 14px;border-radius:9px;
  border:1px solid rgba(240,198,116,.35);background:linear-gradient(120deg,rgba(240,198,116,.10),rgba(20,52,72,.55))}
.sponsor-card img{width:52px;height:52px;object-fit:contain;border-radius:8px;background:#0b1a26;flex:0 0 auto}
.sponsor-main{flex:1;min-width:0}
.sponsor-brand{font-size:14px;color:#ffe6b8;font-weight:600}
.sponsor-tag{font-size:11.5px;color:#9db7c8;margin:2px 0 5px}
.sponsor-meta{font-size:11px;color:#7f9cb0;line-height:1.6}
.sponsor-meta b{color:#e9d3a2}
.sponsor-card .btn.small{flex:0 0 auto}

.profile-avatar-button{padding:0;width:42px;height:42px;flex-shrink:0;border:1px solid var(--gold);border-radius:50%;overflow:hidden;background:#14384f;cursor:pointer}
.profile-avatar-button canvas{width:40px;height:40px;display:block}
.avatar-chooser{text-align:center}
#avatarChoicePreview{width:130px;height:130px;border-radius:12px;border:1px solid var(--line2)}
.avatar-choice-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:14px 0}
.avatar-choice-grid button{min-width:0;padding:4px;background:#102c40;border:2px solid transparent;border-radius:7px;color:var(--ink);cursor:pointer}
.avatar-choice-grid button[aria-pressed=true]{border-color:var(--gold);background:#304650}
.avatar-choice-grid button:focus-visible,.profile-avatar-button:focus-visible{outline:2px solid var(--gold2);outline-offset:2px}
.avatar-choice-grid canvas{display:block;width:100%;height:auto;max-width:80px;margin:auto;border-radius:5px}
.avatar-choice-grid span{font-size:11px}
.avatar-choice-nav{display:flex;align-items:center;justify-content:center;gap:14px;margin-bottom:16px;font-size:12px;color:var(--muted)}
@media(max-width:480px){.avatar-choice-grid{gap:4px}.avatar-choice-nav{gap:7px}}

/* 船体配色与船型图鉴 */
.hull-fieldset{min-width:0;margin:16px 0;padding:12px;border:1px solid var(--line2);border-radius:8px}
.hull-fieldset legend{font-size:12px;color:var(--gold2);padding:0 6px}
.hull-count{font-size:10px;color:var(--muted);margin-left:6px}
.hull-preview{display:flex;align-items:center;gap:12px;margin-bottom:12px;min-width:0}
.hull-preview canvas{display:block;width:120px;height:83px;flex-shrink:0;background:radial-gradient(ellipse,#163e54,#061622);border-radius:6px}
.hull-selection{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink);overflow-wrap:anywhere}
.hull-selection i,.ship-detail-color i{display:inline-block;width:22px;height:22px;flex-shrink:0;border:1px solid #a9c6d7;border-radius:4px}
.hull-swatches{display:grid;grid-template-columns:repeat(auto-fill,26px);justify-content:start;gap:4px}
.hull-swatches .hull-swatch{display:block;position:relative;width:26px;height:26px;margin:0;cursor:pointer}
.hull-swatch input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.hull-swatch>span{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border:2px solid rgba(255,255,255,.3);border-radius:5px;pointer-events:none}
.hull-swatch b{visibility:hidden;color:white;font-size:14px;line-height:1;text-shadow:0 1px 3px #000,1px 0 2px #000,-1px 0 2px #000}
.hull-swatch input:checked+span{border-color:white;box-shadow:0 0 0 2px var(--gold)}
.hull-swatch input:checked+span b{visibility:visible}
.hull-swatch input:focus-visible+span{outline:3px solid var(--teal);outline-offset:3px}
.boat-color-shop{margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid var(--line2)}
/* Opening takes the gallery out of the toolbar flow, so #mapTools ends at the
   sound button again and the panel spans exactly the toolbar: its top edge meets
   the "+" frame, its bottom edge meets the sound button's lower frame. */
#legend[open]{position:absolute;right:calc(100% + 10px);top:0;bottom:0;width:clamp(280px,24vw,340px);height:auto;aspect-ratio:auto;
  display:flex;flex-direction:column;overflow:hidden;padding:0 12px;border-radius:8px;z-index:1;
  transition:width .18s ease,background .18s ease}
#legend summary{display:flex;align-items:center;justify-content:center;width:100%;height:100%;
  cursor:pointer;list-style:none;color:var(--gold2);font-size:30px;user-select:none}
#legend[open] summary{order:3;width:auto;height:38px;flex:0 0 38px;justify-content:flex-start;gap:6px;
  padding:0 2px;font-size:12px;letter-spacing:.06em;border-top:1px solid var(--line2);margin-top:auto}
/* The list takes the top of the panel; the collapse row is ordered last so the
   "❯ 图例标识说明" title sits at the bottom edge and stays clickable.
   Chromium >= 131 wraps the non-summary children in ::details-content, which is
   itself the flex item there, so both containers are given the same treatment. */
#legend[open]::details-content{order:1;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden}
#legend[open] #legendContent{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
#legend summary::-webkit-details-marker{display:none}
#legend summary:focus-visible{outline:2px solid var(--teal);outline-offset:-3px;border-radius:6px}
#legend summary:hover{color:#fff;background:rgba(230,180,92,.12)}
#legend .legend-arrow{display:inline-block;transition:transform .18s ease}
#legend[open] .legend-arrow{transform:rotate(180deg);font-size:14px}
#legend .legend-toggle-text{display:none}
#legend[open] .legend-toggle-text{display:inline;color:var(--gold2);font-weight:600}
#legend:not([open]) #legendContent{display:none}
#legend #legendContent{display:block}
#legend .ship-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0 0 8px}
/* Scoped to #legend so the generic "#mapTools button" sizing (76x76) cannot win. */
#legend .ship-legend-item{display:flex;align-items:center;gap:8px;width:100%;height:auto;min-width:0;padding:5px 7px;
  font-size:13px;line-height:1.3;background:rgba(255,255,255,.03);border:1px solid var(--line2);border-radius:6px;
  color:var(--ink);cursor:pointer;text-align:left;backdrop-filter:none}
#legend .ship-legend-item img{display:block;flex:0 0 44px;width:44px;height:44px;aspect-ratio:1;object-fit:contain;margin:0;border-radius:4px;background:#0b2233}
#legend .ship-legend-item .ship-legend-text{display:flex;flex-direction:column;gap:1px;flex:1 1 auto;min-width:0}
#legend .ship-legend-item .ship-legend-name{display:block;font-size:11.5px;line-height:1.3;overflow-wrap:anywhere}
#legend .ship-legend-item small{display:block;font-size:9.5px;line-height:1.25;color:var(--muted)}
#legend .ship-legend-item:hover:not(:disabled){border-color:var(--gold);color:var(--gold2);background:rgba(230,180,92,.1)}
#legend .ship-legend-item:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
#legend .legend-subtitle{font-size:10px;color:#cfe2ea;letter-spacing:.04em;margin:6px 0 4px;padding-top:5px;border-top:1px solid var(--line2)}
#legend .legend-subtitle:first-child{margin-top:0;padding-top:0;border-top:0}
#legend .legend-key{display:grid;grid-template-columns:1fr 1fr;gap:5px 10px;margin:0 0 4px}
#legend .legend-key span{display:flex;align-items:center;gap:5px;min-width:0;font-size:10.5px;line-height:1.4;color:#c3d8e3;white-space:normal;overflow-wrap:anywhere}
#legend .legend-note{font-size:9px;line-height:1.45;color:#8faebe;margin:4px 0 0;padding-top:4px;border-top:1px solid var(--line2)}
.dot.port1{background:#f0c674}.dot.port2{background:#cfd9e0}.dot.port3{background:#bf9a72}
.lg-sym{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:14px;font:700 11px/1 'Segoe UI Symbol','Microsoft YaHei UI',sans-serif;color:#d7e8ef}
.lg-sym.gold{color:#f3cb72}.lg-sym.island{color:#79dfc5}.lg-sym.sos{color:#ff736a;font-size:8px;letter-spacing:-.03em}.lg-sym.pirate{font-size:11px}
.lg-sym.warn{width:13px;height:12px;border:1px solid #e8a45d;border-radius:2px;color:#e8a45d;font-size:9px}.lg-sym.drift{color:#eeaf83}.lg-sym.level{color:#e9c982}
.lg-sym.health{color:#ffb89b}.lg-sym.route{color:#85dae1}.lg-sym.current{color:#82d2eb}.lg-sym.wind{color:#c8e1f0}.lg-sym.radar{color:#4fd1c5}
.flag-mark{position:relative;display:inline-block;flex:none;width:12px;height:13px}
.flag-mark::before{content:'';position:absolute;left:1px;top:0;width:1.5px;height:13px;border-radius:1px;background:#e8f4f8}
.flag-mark::after{content:'';position:absolute;left:2px;top:1px;width:0;height:0;border-left:8px solid #e33d3d;border-top:3.5px solid transparent;border-bottom:3.5px solid transparent;filter:drop-shadow(0 0 1px rgba(6,17,29,.9))}
.ship-detail-card{display:flex;flex-direction:column;gap:9px}
.ship-detail-image{display:block;width:100%;height:150px;object-fit:contain;background:radial-gradient(circle at 50% 42%,#123448,#071b2d 72%);border:1px solid var(--line2);border-radius:8px}
.ship-intro-card{display:flex;flex-direction:column;gap:10px}
.ship-intro-video{display:block;width:100%;max-height:300px;background:#04131f;border:1px solid var(--line2);border-radius:8px}
.ship-intro-desc{margin:0;color:#c9dde7;line-height:1.8}
.ship-intro-specs{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;margin:0}
.ship-intro-specs div{display:flex;justify-content:space-between;gap:10px;padding:6px 8px;border:1px solid var(--line2);border-radius:5px;background:rgba(255,255,255,.03)}
.ship-intro-specs dt{color:var(--muted);font-size:11px}.ship-intro-specs dd{margin:0;color:#f1e6c8;font-size:12px;text-align:right}
.ship-intro-note{margin:0;font-size:11px;line-height:1.6;color:#8faebe;padding-top:7px;border-top:1px solid var(--line2)}
.modal-card:has(.ship-intro-card){width:min(560px,94vw)}
.modal-card:has(.ship-detail-card){width:min(320px,88vw)}
.modal-card:has(.ship-detail-card) header{padding:8px 12px}
.modal-card:has(.ship-detail-card) #modalBody{padding:12px 14px}
.modal-card:has(.ship-detail-card) footer{padding:8px 12px}
.ship-detail-card .ship-owner-details{font-size:12px;line-height:1.55;grid-template-columns:66px 1fr;gap:3px 8px}
.ship-country-flags{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding-top:7px;border-top:1px solid var(--line2)}
.ship-country-label{font-size:11px;color:var(--muted)}
.ship-country-list{display:flex;flex-wrap:wrap;gap:4px}
.ship-country-list img{display:block;width:24px;height:16px;object-fit:cover;border-radius:2px;border:1px solid #ffffff2e;background:#071b2d}
.ship-owner-details{font-size:13px;line-height:1.8;overflow-wrap:anywhere}
.ship-detail-color{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ship-detail-color small{color:var(--muted)}
@media(max-width:640px){
  /* Phones keep the same relationship: the toggle is the second-column cell
     under the sound button, and the open panel still spans the toolbar exactly
     (8px inset + 10px gutter to the toolbar's left edge). */
  #legend{grid-column:2;grid-row:4;width:100%;height:auto;aspect-ratio:1}
  #legend summary{font-size:clamp(14px,5vw,28px)}
  /* An absolutely positioned grid child would otherwise use its own 77px cell
     as the containing block, so both auto placements are reset and the height is
     pinned to the three tool rows: exactly the sound button's lower edge. */
  #legend[open]{grid-column:auto;grid-row:auto;right:calc(100% + 10px);top:0;bottom:auto;
    height:min(420px,calc(100vh - var(--topbar-h,0px) - var(--maptools-top,16px) - var(--dock-h,80px) - 8px));
    width:min(300px,calc(100vw - 26px - var(--map-tool-w) - 8px))}
  /* On phones the open panel covers the whole left column, which is where the
     compass and the bridge console sit, so both step aside until the gallery is
     collapsed again; nothing is left occluded while it is open. */
  #stage:has(#legend[open]) #compassBox,
  #stage:has(#legend[open]) #shipPanel,
  #stage:has(#legend[open]) #alerts{visibility:hidden;pointer-events:none}
  #legend[open] summary{height:34px;flex:0 0 34px;gap:5px;font-size:12px}
  #legend[open] .ship-legend{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  #legend[open] .legend-key{grid-template-columns:1fr 1fr;gap:2px 6px}
  #legend[open] .legend-key span{font-size:9.5px;line-height:1.3;gap:4px}
  #legend[open] .legend-note{font-size:9px;line-height:1.4}
  #legend[open] .ship-legend-item{padding:3px 5px;gap:6px}
  #legend[open] .ship-legend-item small{display:block;font-size:8.5px;line-height:1.2}
  #legend[open] .ship-legend-item img{flex:0 0 34px;width:34px;height:34px;margin:0}
  #legend[open] .ship-legend-name{font-size:10px;line-height:1.25;overflow-wrap:anywhere}
}
.user-level{display:inline-flex!important;align-items:baseline;gap:1px;vertical-align:baseline;white-space:nowrap;font:700 11px/1.2 system-ui,sans-serif;padding:2px 4px;margin-left:4px;border:1px solid #91b6c83b;border-radius:4px;background:#071b2dbd;letter-spacing:0}
.user-level .user-level-letter{color:#e9c982!important;font:inherit;display:inline!important}
.user-level .user-level-number{font:inherit;display:inline!important}
#btnProfileAvatar{position:relative;overflow:visible}
#uiAvatarLevel{position:absolute;right:-6px;bottom:-5px;pointer-events:none}
#uiAvatarLevel .user-level{margin:0;font-size:10px;padding:1px 3px}
/* A captain level whose ASA certificate is still missing shows as locked. */
.user-level.is-locked{opacity:.62;border-style:dashed;border-color:#e9c98288}
.user-level.is-locked .user-level-number{color:#b9c6d2!important}


/* ---------- 船坞中心折叠分组 ---------- */
.yard-fold{margin:0 0 12px;border:1px solid rgba(126,174,201,.28);border-radius:9px;background:rgba(10,31,44,.55);overflow:hidden}
.yard-fold>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 13px;cursor:pointer;list-style:none;font-weight:700;color:#f0d39c;background:rgba(255,255,255,.03)}
.yard-fold>summary::-webkit-details-marker{display:none}
.yard-fold>summary:hover{background:rgba(76,181,218,.12)}
.yard-fold>summary:focus-visible{outline:2px solid #f1cb8c;outline-offset:-2px}
.yard-fold-state::after{content:'▸ 展开';font-weight:400;font-size:12px;color:#9fc3d2;white-space:nowrap}
.yard-fold[open]>summary{border-bottom:1px solid rgba(126,174,201,.22)}
.yard-fold[open] .yard-fold-state::after{content:'▾ 收起'}
.yard-fold-body{padding:12px 13px}
.yard-fold-body>.shipyard-repair{margin:0}
@media(max-width:430px){.yard-fold>summary{padding:10px 11px;font-size:13px}.yard-fold-body{padding:10px 11px}}
/* Engine power upgrade inside the repair fold of the shipyard panel. */
.yard-footer-link{display:block;width:100%;margin:10px 0 2px;padding:10px 12px;border:1px dashed rgba(241,203,140,.55);
  border-radius:8px;background:rgba(241,203,140,.08);color:#f1cb8c;font-size:13px;letter-spacing:.02em;
  text-align:center;cursor:pointer;font-family:inherit}
.yard-footer-link:hover{background:rgba(241,203,140,.16)}
.yard-footer-link:focus-visible{outline:2px solid #f1cb8c;outline-offset:2px}
.power-upgrade{margin-top:16px;padding-top:14px;border-top:1px dashed rgba(126,174,201,.35)}
.power-titlebar{display:flex;align-items:baseline;justify-content:space-between;gap:10px;font-weight:700;color:#f0d39c;margin-bottom:8px}
.power-current{font-size:12px;font-weight:400;color:#9fc3d2}
.power-card{margin:10px 0;padding:12px 13px;border:1px solid rgba(126,174,201,.3);border-radius:9px;background:rgba(8,24,38,.55)}
.power-card.owned{border-color:rgba(120,220,160,.55);background:rgba(30,110,80,.14)}
.power-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.power-icon{font-size:18px;line-height:1}
.power-title{font-weight:700;color:#e9f4fb}
.power-price{margin-left:auto;font-weight:700;color:#f1cb8c}
.power-desc{margin:8px 0;color:#a9c6d6;font-size:12.5px;line-height:1.6}
.power-specs{display:flex;flex-wrap:wrap;gap:6px 14px;margin:8px 0 10px;font-size:12px;color:#9fc3d2;line-height:1.6}
.power-specs b{color:#e9f4fb}
.power-card .btn{width:100%}
.power-tag{font-size:11px;padding:1px 7px;border-radius:999px;background:rgba(120,220,160,.18);
  color:#8fe3b4;border:1px solid rgba(120,220,160,.45)}


/* Login intro sits in the bottom-left corner, one line above the copyright. */
.auth-hero{--auth-bottom:clamp(18px,3vh,30px)}
.auth-hero-copyright{bottom:var(--auth-bottom)}
.auth-hero-intro{top:auto;bottom:calc(var(--auth-bottom) + 30px)}
@media(max-width:760px){.auth-hero{--auth-bottom:14px}.auth-hero-intro{top:auto;bottom:calc(var(--auth-bottom) + 30px)}}

/* Destination confirmation: highlight + route + twin energy rulers on the left,
   weather/current/risk on the right. */
.modal-card:has(.nav-confirm){width:min(880px,94vw)}
.nav-confirm{display:grid;grid-template-columns:minmax(0,1.04fr) minmax(0,.96fr);gap:0}
.nc-left{padding-right:18px;border-right:1px solid var(--line);min-width:0;display:flex;flex-direction:column;gap:9px}
.nc-right{padding-left:18px;min-width:0;display:flex;flex-direction:column;gap:8px}
.nc-dest{font-family:"Songti SC","Noto Serif SC",serif;font-size:21px;font-weight:700;letter-spacing:.04em;line-height:1.25;color:#f6d79b;text-shadow:0 2px 12px rgba(246,215,155,.18)}
.nc-route{display:flex;flex-direction:column;gap:2px;font-size:12px;color:#c3d9e6}
.nc-route b{color:#eaf4fb;font-variant-numeric:tabular-nums}
.nc-energy{display:flex;flex-direction:column;gap:8px;margin-top:2px}
.nc-gauge{border:1px solid var(--line);border-radius:8px;padding:7px 10px 4px;background:rgba(255,255,255,.03)}
.nc-gauge-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:11px;color:var(--muted);margin-bottom:4px}
.nc-gauge-head b{font-size:13px;color:#eaf4fb;font-variant-numeric:tabular-nums}
.nc-gauge[data-tone="bad"] .nc-gauge-head b{color:#ff9b8e}
.nc-gauge[data-tone="ok"] .nc-gauge-head b{color:#f6d79b}
.nc-gauge[data-tone="ready"] .nc-gauge-head b{color:#7be3a4}
.nc-ruler{position:relative;height:14px;margin:0 1px}
.nc-ruler-track{position:absolute;left:0;right:0;top:2px;height:8px;border-radius:2px;background:rgba(255,255,255,.08)}
.nc-ruler-fill{position:absolute;left:0;top:2px;height:8px;width:var(--pct,0%);border-radius:2px;background:linear-gradient(90deg,#4a8fd6,#7fc4f0);transition:width .3s ease}
.nc-gauge[data-tone="bad"] .nc-ruler-fill{background:linear-gradient(90deg,#ef6a5b,#ff9b8e)}
.nc-gauge[data-tone="ok"] .nc-ruler-fill{background:linear-gradient(90deg,#e6b45c,#f6d79b)}
.nc-gauge[data-tone="ready"] .nc-ruler-fill{background:linear-gradient(90deg,#37b37c,#7be3a4)}
.nc-ruler-needle{position:absolute;top:0;left:var(--pct,0%);width:0;height:13px;border-left:1px solid rgba(240,246,252,.9);transform:translateX(-.5px)}
.nc-ruler-needle::after{content:"";position:absolute;left:-3px;top:-2px;width:6px;height:6px;border-radius:50%;background:#f0f6fc}
.nc-ruler-labels{display:flex;justify-content:space-between;font-size:9.5px;color:var(--muted);margin-top:1px;font-variant-numeric:tabular-nums}
.nc-ruler-labels i{font-style:normal}
.nc-sec .nc-k{display:block;font-size:10.5px;letter-spacing:.08em;color:var(--muted);margin-bottom:2px}
.nc-sec .nc-v{font-size:12px;line-height:1.6;color:#cfe0ea;overflow-wrap:anywhere}
.nc-risk .nc-v{color:#ffc9b8}
.nc-note{grid-column:1/-1;border-top:1px solid var(--line);padding-top:9px;margin-top:11px}
.nc-note .hint{margin:0}
@media(max-width:640px){.nav-confirm{grid-template-columns:1fr}.nc-left{padding-right:0;border-right:0;border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:10px}.nc-right{padding-left:0}}

/* 登录页简介：首字“从”与版权行 “VOYAGESAIL” 的 V 对齐；版权行最右显示教材说明 */
@media(min-width:761px){.auth-hero-intro{left:calc(clamp(18px,3vw,48px) - clamp(12px,1.4vw,20px) - 1px)}}
.auth-hero-copyright{right:clamp(18px,3vw,48px);display:flex;justify-content:space-between;align-items:baseline;gap:14px;flex-wrap:wrap}
.auth-hero-copyright>span{white-space:nowrap}
.auth-hero-copyright-note{color:rgba(232,242,250,.62);letter-spacing:.06em}

/* 登录：邮箱与验证码展示、密码与验证码输入各占一列，共用行距和列线。 */
#formLogin .auth-login-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(8px,2vw,16px);width:100%;margin-bottom:14px}
#formLogin .auth-login-row .auth-login-field{display:block;min-width:0;width:100%;margin-bottom:0}
#formLogin .auth-login-row .auth-login-field input{min-width:0}
.auth-captcha-display{min-width:0;margin:0}
.auth-captcha-label{display:block;font-size:12px;color:var(--muted);letter-spacing:.05em;line-height:normal}
.auth-captcha-controls{display:flex;align-items:stretch;gap:clamp(3px,.6vw,8px);min-width:0;min-height:43px;margin-top:7px}
.auth-captcha-code{flex:1;min-width:0;font:600 clamp(13px,1.55vw,20px)/1 "Courier New",monospace;letter-spacing:.12em;text-align:center;padding:7px 2px;border:1px dashed rgba(230,180,92,.55);border-radius:4px;background:rgba(9,28,44,.75);color:var(--gold2);cursor:pointer;user-select:none;text-shadow:0 0 8px rgba(230,180,92,.35)}
.auth-captcha-code.is-loading{opacity:.6}
.auth-captcha-refresh{flex:none;font:12px/1 system-ui,sans-serif;padding:7px clamp(4px,.7vw,10px);border:1px solid var(--line);border-radius:999px;background:rgba(9,28,44,.6);color:#b9cede;cursor:pointer}
.auth-captcha-refresh:hover{border-color:var(--gold);color:var(--gold2)}
.auth-sound-btn{margin-left:auto;display:inline-flex;align-items:center;gap:6px;font:12px/1 system-ui,sans-serif;padding:7px 11px;border:1px solid var(--line);border-radius:999px;background:rgba(9,28,44,.6);color:#b9cede;cursor:pointer}
.auth-sound-btn:hover{border-color:var(--gold);color:var(--gold2)}
.auth-sound-btn[aria-pressed="true"]{background:rgba(230,180,92,.16);border-color:var(--gold);color:var(--gold2)}
@media(max-width:640px){
#formLogin .auth-login-row{gap:8px}
#formLogin .auth-login-row .auth-login-field input{padding:12px 7px;font-size:12px}
.auth-captcha-code{font-size:13px;letter-spacing:0}
.auth-captcha-refresh{font-size:11px;padding-inline:4px}
}

/* ---- Bridge console live instruments ---- */
#shipPanel {
  background-image:
    radial-gradient(120% 60% at 50% 0%, rgba(86, 210, 255, .10), transparent 62%),
    linear-gradient(rgba(126, 199, 214, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 199, 214, .045) 1px, transparent 1px);
  background-size: auto, 100% 12px, 12px 100%;
}
#shipPanel::before {
  content: ""; position: absolute; left: 0; right: 0; top: -42%; height: 42%;
  pointer-events: none; background: linear-gradient(180deg, transparent, rgba(105, 224, 255, .075), transparent);
  animation: con-panel-scan 7.5s linear infinite;
}
@keyframes con-panel-scan { 0% { transform: translateY(0); } 100% { transform: translateY(360%); } }
.con-dial { position: relative; overflow: hidden; box-shadow: inset 0 -7px 12px rgba(80, 220, 255, .055); }
.con-dial::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 10%, rgba(150, 235, 255, .15) 50%, transparent 90%);
  transform: translateY(-120%); animation: con-dial-sheen 4.8s linear infinite;
}
.con-dial:nth-child(2)::before { animation-delay: -1.6s; }
.con-dial:nth-child(3)::before { animation-delay: -3.2s; }
@keyframes con-dial-sheen { 0% { transform: translateY(-120%); } 55%, 100% { transform: translateY(120%); } }
.con-dial b { text-shadow: 0 0 8px rgba(142, 230, 200, .2); transition: color .24s ease; }
.con-dial b.is-ticking { animation: con-digit-pop .5s cubic-bezier(.18, .89, .32, 1.2); }
@keyframes con-digit-pop {
  0% { opacity: .38; transform: translateY(35%) scale(.9); filter: brightness(2); }
  55% { opacity: 1; transform: translateY(-9%) scale(1.06); filter: brightness(1.35); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: none; }
}
.gauge-pointer .gauge-value.is-ticking { animation: con-value-pop .46s ease-out; }
@keyframes con-value-pop {
  0% { opacity: .45; scale: .92; filter: brightness(1.9); }
  55% { opacity: 1; scale: 1.08; filter: brightness(1.35); }
  100% { opacity: 1; scale: 1; filter: none; }
}
.gauge-pointer.is-changed .gauge-needle { animation: con-needle-pulse .9s ease-in-out infinite; }
@keyframes con-needle-pulse { 50% { opacity: .55; box-shadow: 0 0 11px rgba(91, 231, 169, .95); } }
.bar i { position: relative; overflow: hidden; box-shadow: 0 0 8px rgba(91, 231, 169, .2); }
.bar i::after, .con-voyage-bar i::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, .48) 50%, transparent 82%);
  transform: translateX(-130%); animation: con-bar-flow 3.4s ease-in-out infinite;
}
.con-voyage-bar i { position: relative; overflow: hidden; }
@keyframes con-bar-flow { 0% { transform: translateX(-130%); } 62%, 100% { transform: translateX(130%); } }
@media (prefers-reduced-motion: reduce) {
  #shipPanel::before, .con-dial::before, .con-dial b.is-ticking, .gauge-pointer .gauge-value.is-ticking,
  .gauge-pointer.is-changed .gauge-needle, .bar i::after, .con-voyage-bar i::after { animation: none !important; }
}


/* ================= 赞助合作 · 与远洋证券交易所统一宽屏样式 ================= */
.sponsor-screen{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;z-index:1200;display:flex;flex-direction:column;overflow:hidden;background:#0b1b27;color:#e8f2f6;overscroll-behavior:contain}
.sp-wrap{flex:1;max-width:none;width:100%;min-height:0;margin:0;padding:0 20px 24px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(122,178,196,.45) transparent}
.sp-wrap::-webkit-scrollbar{display:block;width:6px}
.sp-wrap::-webkit-scrollbar-thumb{background:rgba(122,178,196,.34);border-radius:6px}
.sp-head{position:sticky;top:0;z-index:3;gap:20px;align-items:flex-start;margin:0 -20px 20px;padding:16px 20px 14px;background:linear-gradient(#0b1b27 82%,rgba(11,27,39,.94));border-bottom:1px solid rgba(126,189,210,.12)}
.sp-kicker{color:#5fd1cb;font-size:11px;letter-spacing:.16em;margin-bottom:6px}
.sp-head h2{font-size:26px;line-height:1.25;margin:0 0 6px;color:#e8f2f6;letter-spacing:normal}
.sp-sub{max-width:980px;color:#9aaebd;font-size:13px;line-height:1.65}
.sp-sub b{color:#67d6ba}
.sp-method-tabs{display:flex;gap:10px;border-bottom:0;margin:0 0 10px}
.sp-method-tabs .tab{padding:10px 16px;border:1px solid #456579;border-radius:8px;background:#142530;color:#bcd3d8;border-bottom:1px solid #456579}
.sp-method-tabs .tab.active{background:#19685e;border-color:#65d5bb;color:#eafffb;border-bottom-color:#65d5bb}
.sp-method-note{margin:0 0 18px;padding:11px 14px;border:1px solid rgba(126,189,210,.2);border-radius:10px;background:rgba(14,33,46,.75);color:#9aaebd;font-size:13px;line-height:1.65}
.sp-grid{grid-template-columns:180px minmax(0,1fr);gap:24px}
.sponsor-screen .sp-form input:not([type="checkbox"]):not([type="file"]),.sponsor-screen .sp-form textarea,.sponsor-screen .sp-form select{border-color:#456579;background:#091a24;color:#e8f2f6;border-radius:8px;padding:11px 12px;font-size:14px}
.sponsor-screen .sp-form textarea{min-height:120px;line-height:1.65}
.sponsor-screen .sp-form>label,.sp-fields>label,.sp-fields .row2 label{color:#bcd3d8;font-size:12px;margin-bottom:14px}
.sp-country-grid{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.sp-country-tile{background:#142530;border-color:#456579;border-radius:9px;padding:12px!important}
.sp-country-tile:has(input:checked){background:#203c4d;border-color:#65d5bb}
.sp-country-tile input{border-color:#8eabb9;background:#091a24}
.sp-country-tile input:checked{background:#19685e;border-color:#65d5bb}
.sp-country-tile small{color:#8ea6b4}
.sp-region-summary{color:#67d6ba}
.sponsor-screen .chip-d{background:#142530;color:#dcecf6;border-color:#456579}
.sponsor-screen .chip-d.active{background:#19685e;color:#eafffb;border-color:#65d5bb}
.sponsor-screen .sp-icon-drop{width:160px;height:160px;background:#142530;border-color:#456579;border-radius:12px;color:#dcecf6}
.sp-icon-drop img{width:96px;height:96px}
.sponsor-screen .sp-quote,.sponsor-screen .sp-status,.sponsor-screen .sp-details,.sponsor-screen .sp-receipt{background:#102532;border-color:#456579;border-radius:12px;color:#dcecf6}
.sp-stock-panel{margin:2px 0 14px;padding:16px;border:1px solid rgba(170,203,219,.16);border-radius:12px;background:#142530}
.sp-stock-spec{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}
.sp-stock-spec>div{display:grid;gap:5px;padding:12px;border:1px solid rgba(170,203,219,.16);border-radius:9px;background:#0b1b27}
.sp-stock-spec small{color:#8ea6b4;font-size:11px}
.sp-stock-spec b{color:#e8f2f6;font-size:15px;overflow-wrap:anywhere}
.sp-stock-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px;padding:14px;border:1px solid #456579;border-radius:10px;background:#0b1b27}
.sp-stock-summary>span{display:grid;gap:5px;color:#9aaebd;font-size:12px;min-width:0}
.sp-stock-summary b{color:#e8f2f6;font-size:16px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.sp-stock-summary small{grid-column:1/-1;color:#7fd6c0;line-height:1.6;overflow-wrap:anywhere}
.sp-stock-summary.is-error{border-color:#a94a3d}
.sp-stock-summary.is-error small{color:#ffb3a4}
.sponsor-screen .q-row.total b{color:#67d6ba}
.sponsor-screen .btn.primary{background:#19685e;border-color:#65d5bb}
.sp-dash-head img{background:#091a24}
.sp-status>b,.sp-receipt>b{color:#67d6ba}
.sp-head .popup-close{top:0}
@media(max-width:760px){.sp-wrap{padding:0 12px 24px}.sp-head{margin:0 -12px 16px;padding:12px 12px 12px}.sp-method-tabs{flex-wrap:wrap}.sp-method-tabs .tab{flex:1 1 210px}.sp-grid{grid-template-columns:1fr;gap:18px}.sp-icon-drop{width:100%;height:110px}.sp-stock-spec,.sp-stock-summary{grid-template-columns:1fr}.sp-head h2{font-size:22px}.sp-head{flex-wrap:wrap}.sp-head .btn{margin-left:auto}}
.feed-close-row{flex:none;margin:8px 18px 12px;width:auto;text-align:center}

/* Sailing coordinates mirror the asset readout: green, bold, tabular. */
.ship-info-location #uiCoordinates{color:#5be7a9;font-weight:700;font-size:12px;font-variant-numeric:tabular-nums;text-shadow:0 0 8px rgba(91,231,169,.42)}

/* Captain level guide opened from the avatar menu. */
.level-guide{display:grid;gap:13px}
.level-guide *{box-sizing:border-box}
.lg-hero{display:flex;align-items:center;gap:13px;padding:12px 14px;border:1px solid rgba(230,180,92,.42);border-radius:10px;background:rgba(230,180,92,.07)}
.lg-badge{flex:none;display:inline-flex;align-items:baseline;gap:1px;padding:5px 9px;border:1px solid var(--lg-color,#a9c5d9);border-radius:8px;background:rgba(7,27,45,.72);font:700 20px/1 system-ui,sans-serif;color:var(--lg-color,#a9c5d9);box-shadow:0 0 12px rgba(0,0,0,.25) inset}
.lg-badge b{font:700 13px/1 system-ui,sans-serif;color:#e9c982}
.lg-hero-text{min-width:0}
.lg-title{display:block;font-size:14px;line-height:1.45;color:#f4e7c8}
.lg-sub{margin:3px 0 0;font-size:11.5px;line-height:1.55;color:#a9c3d3}
.lg-progress{display:grid;gap:5px}
.lg-bar{height:8px;border-radius:99px;background:rgba(255,255,255,.09);overflow:hidden}
.lg-bar i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#2f9e70,#5be7a9);box-shadow:0 0 10px rgba(91,231,169,.45);transition:width .35s ease}
.lg-bar-label{font-size:11px;line-height:1.4;color:#9fbbc9;font-variant-numeric:tabular-nums}
.lg-legend-title{margin:1px 0 0;font-size:12px;font-weight:600;letter-spacing:.08em;color:#d8c69a}
.lg-levels{list-style:none;margin:0;padding:0;display:grid;gap:5px}
.lg-level{display:grid;grid-template-columns:62px minmax(0,1fr) 104px minmax(96px,auto);align-items:center;gap:8px;padding:7px 10px;border:1px solid rgba(151,197,212,.2);border-radius:8px;background:rgba(16,43,62,.55);font-size:11.5px;line-height:1.45}
.lg-level.is-met{border-color:rgba(91,231,169,.28);background:rgba(19,56,58,.5)}
.lg-level.is-next{border-color:rgba(91,231,169,.8);background:rgba(91,231,169,.09);box-shadow:0 0 0 1px rgba(91,231,169,.18) inset}
.lg-lv{display:inline-flex;align-items:center;font-size:12.5px;color:#f0ead8;white-space:nowrap}
.lg-dot{width:9px;height:9px;border-radius:50%;margin-right:6px;flex:none;box-shadow:0 0 6px rgba(0,0,0,.5)}
.lg-cond{min-width:0;color:#cfe4ee}
.lg-cert{color:#e5c88f;white-space:nowrap}
.lg-state{text-align:right;color:#9fbbc9;white-space:nowrap;font-variant-numeric:tabular-nums}
.lg-level.is-met .lg-state{color:#8fd9b4}
.lg-level.is-next .lg-state{color:#5be7a9;font-weight:700}
.lg-note{margin:0;font-size:11px;line-height:1.6;color:#93aebb}
@media(max-width:560px){
  .lg-level{grid-template-columns:54px minmax(0,1fr);row-gap:2px}
  .lg-cert{grid-column:2}
  .lg-state{grid-column:2;text-align:left}
}
@media(prefers-reduced-motion:reduce){.lg-bar i{transition:none}}

/* ---------- topbar single-row layout (all languages, desktop) ---------- */
/* Only when every readout really fits; narrower desktop windows fall back to
the wrapping layout so no cash/asset figure is cut off. */

@media(min-width:1280px){
#topbar{display:flex;flex-wrap:nowrap;height:56px;min-height:56px;column-gap:8px;row-gap:0;padding:4px 10px;overflow:hidden;align-items:center;white-space:nowrap}
#topbar>*{flex:0 0 auto;min-width:0}
#topbar .grow{flex:1 1 auto;min-width:0}
#topbar .brand-logo{height:40px;max-width:58px}
#topbar .profile-avatar-button{width:30px;height:30px}
#topbar .profile-avatar-button canvas{width:28px;height:28px}
#topbar .captain-info{flex:0 1 auto;display:flex;flex-wrap:nowrap;min-width:0;max-width:none;padding:2px 8px;gap:0;overflow:hidden}
#topbar .captain-info .stat{flex:0 1 auto;display:flex;flex-wrap:nowrap;align-items:baseline;gap:4px;min-width:0}
#topbar .captain-info .stat label{flex:none;font-size:calc(9.5px * var(--tb-scale,1));letter-spacing:.02em;line-height:1.2}
#topbar .captain-info .stat b{flex:none;font-size:calc(12.5px * var(--tb-scale,1));line-height:1.25}
#topbar .captain-info>.stat+.stat::before{margin:0 6px;flex:none;font-weight:400}
#topbar .ship-info{flex:0 1 auto;display:flex;flex-wrap:nowrap;align-items:baseline;min-width:0;max-width:none;padding:2px 8px;gap:0;overflow:hidden}
#topbar .ship-info>label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;padding:0;margin:-1px}
#topbar .ship-info-line{display:flex;flex-wrap:nowrap;align-items:baseline;min-width:0;overflow:hidden;gap:0}
#topbar #shipInfo .ship-status{flex:0 4 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;gap:5px;padding:0;border:0;background:none;min-height:0;font-size:calc(11.5px * var(--tb-scale,1))}
#topbar #shipInfo .ship-status-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#topbar .ship-info-location{flex:0 1 auto;display:flex;flex-wrap:nowrap;align-items:baseline;min-width:0;gap:0;overflow:hidden;white-space:nowrap}
#topbar .ship-info-location b{flex:none;font-size:calc(12.5px * var(--tb-scale,1));white-space:nowrap}
#topbar .ship-info-location #uiCoordinates{flex:none;font-size:calc(11px * var(--tb-scale,1));white-space:nowrap}
#topbar .ship-info-location #uiMarineRegion{flex:0 1 auto;min-width:0;font-size:calc(9.5px * var(--tb-scale,1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#topbar .ship-info-location b+small::before,#topbar .ship-info-location small+small::before{margin:0 5px;flex:none}
#topbar .weather-info{flex:0 1 auto;display:flex;flex-wrap:nowrap;align-items:baseline;min-width:0;max-width:none;padding:2px 8px;gap:0;overflow:hidden}
#topbar .weather-info>label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;padding:0;margin:-1px}
#topbar .weather-info-line{display:flex;flex-wrap:nowrap;align-items:baseline;min-width:0;overflow:hidden;gap:0}
#topbar .sea-state{display:flex;flex-wrap:nowrap;align-items:baseline;min-width:0;overflow:hidden;gap:0}
#topbar .sea-state-item{flex:0 1 auto;display:flex;flex-wrap:nowrap;align-items:baseline;min-width:0;gap:5px;overflow:hidden}
#topbar .sea-state-item label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;padding:0;margin:-1px}
#topbar .sea-state-item b{flex:0 6 auto;min-width:0;font-size:calc(12px * var(--tb-scale,1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#topbar .sea-state-item small{flex:none;font-size:calc(9.5px * var(--tb-scale,1));white-space:nowrap}
#topbar .sea-state-item+.sea-state-item::before{margin:0 6px;flex:none}
#topbar .weather-info .weather-warning{flex:none;font-size:13px;padding:2px 5px;margin-left:6px}
#topbar #btnLogout{flex:none;min-width:0;min-height:26px;padding:4px 10px;font-size:12.5px;letter-spacing:0;line-height:1.2}
}
@media(min-width:651px) and (max-width:1599px){#topbar .ship-info-location #uiMarineRegion{display:none}}
html[data-lang="en"]{--tb-scale:.93}
html[data-lang="ko"]{--tb-scale:.92}
html[data-lang="es"]{--tb-scale:.83}
html[data-lang="vi"]{--tb-scale:.78}
@media(min-width:651px) and (max-width:1599px){
#topbar .captain-info .stat{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:0;line-height:1.12}
#topbar .captain-info .stat label{font-size:calc(8.5px * var(--tb-scale,1));letter-spacing:0;line-height:1.15}
#topbar .captain-info .stat b{font-size:calc(12px * var(--tb-scale,1));line-height:1.2}
#topbar .captain-info>.stat+.stat::before{content:none}
#topbar .captain-info>.stat+.stat{border-left:1px solid rgba(160,190,210,.35);padding-left:7px;margin-left:7px}
#topbar .sea-state-item{display:grid;grid-template-columns:auto auto;justify-content:start;column-gap:4px;align-items:baseline}
#topbar .sea-state-item label{grid-column:1/-1;font-size:calc(8.5px * var(--tb-scale,1));line-height:1.15;letter-spacing:0}
#topbar .sea-state-item b{font-size:calc(12px * var(--tb-scale,1))}
#topbar .sea-state-item+.sea-state-item::before{content:none}
#topbar .sea-state-item+.sea-state-item{border-left:1px solid rgba(160,190,210,.35);padding-left:7px;margin-left:7px}
}

/* 能源补给站：补给方式切换（默认能源仓，货舱不会被误改） */
.shop-supply{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 12px;padding:8px 10px;
  border:1px solid rgba(120,190,220,.22);border-radius:8px;
  background:linear-gradient(160deg,rgba(16,51,74,.5),rgba(6,20,32,.42))}
.shop-supply-label{font-size:11px;letter-spacing:.08em;color:var(--muted)}
.shop-supply-opts{display:flex;gap:4px;padding:2px;border-radius:999px;
  background:rgba(4,18,28,.7);border:1px solid rgba(120,190,220,.18)}
.shop-supply-opt{min-height:26px;padding:3px 12px;border:0;border-radius:999px;background:none;
  color:#9fb9c8;font-size:12px;letter-spacing:.02em;cursor:pointer;transition:background .15s,color .15s}
.shop-supply-opt:hover{color:#e7f4fb}
.shop-supply-opt.is-active{background:linear-gradient(180deg,#2e7d9e,#1d5d78);color:#f2fbff;
  box-shadow:0 1px 6px rgba(47,157,196,.35)}
.shop-supply-note{font-size:11px;color:#8fb0c6}
@media(max-width:640px){.shop-supply-note{flex-basis:100%}}

/* ===== R11 topbar ship status baseline (2026-11-19) ===== */
@media (min-width:1280px){
  #topbar #shipInfo .ship-status{transform:translateY(4px);}
}
