:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color-scheme:dark;background:#071723;color:#eaf5fa}
*{box-sizing:border-box}body{margin:0;min-width:0;background:radial-gradient(circle at 50% 0,#21516b,#071723 65%);min-height:100vh}
a{color:#a8e9f6}.shell{max-width:1160px;margin:auto;padding:18px clamp(12px,3vw,36px) 36px}
.skip{position:absolute;left:12px;top:-90px;padding:12px;background:#fff;color:#000;z-index:5}.skip:focus{top:10px}
.masthead{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding-bottom:20px;border-bottom:1px solid #456c7f}
.brand{font-size:20px;font-weight:800;color:#fff;text-decoration:none}.masthead nav{display:flex;gap:12px;flex-wrap:wrap}.masthead a{min-height:44px;display:inline-flex;align-items:center}
.intro{padding:25px 0}.eyebrow{font-weight:800;letter-spacing:.12em;font-size:12px;color:#9ceac6}
h1{font-size:clamp(30px,6vw,56px);line-height:1.07;margin:9px 0}h1 em{color:#9ceac6;font-style:normal}
.intro p:last-child{max-width:780px;color:#d2e4ee;line-height:1.55}
.layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(285px,.85fr);gap:16px;align-items:start}
.panel{min-width:0;border:1px solid #4b7386;background:#112e40;border-radius:16px;padding:clamp(12px,2vw,22px);box-shadow:0 15px 36px #0004}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.panel-head h2,.controls h2{font-size:20px;margin:0 0 8px}#phase{font-size:13px;border-radius:999px;background:#245c70;padding:7px 12px}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0}
.stats div{background:#092534;border:1px solid #426579;border-radius:11px;min-width:0;padding:9px}
.stats span{font-size:12px;color:#c0deea;display:block}.stats strong{display:block;font-size:clamp(15px,3vw,20px);margin-top:5px;overflow-wrap:anywhere}
.hint{color:#cee4ed;font-size:13px;line-height:1.5}.fleet{padding:0;margin:16px 0 0;list-style:none;display:grid;gap:9px}
.ship{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:12px;border:1px solid #57859b;border-radius:12px;background:#163e54;min-width:0}
.ship strong,.ship small{display:block;overflow-wrap:anywhere}.ship strong{font-size:15px}.ship small{color:#d1e6ed;font-size:12px;margin-top:4px;line-height:1.5}
.ship[data-done="true"]{background:#1c4a42;border-color:#6db7a1}.ship[data-done="true"] strong::after{content:" ✓";color:#b3ffcd}
button,select{font:inherit;color:#fff;border-radius:9px;min-height:44px;max-width:100%}
button{cursor:pointer;background:#216f82;border:1px solid #84c8d4;padding:9px 13px;touch-action:manipulation;font-weight:750}
button:hover:not(:disabled){background:#1d6573}button:disabled{opacity:.56;cursor:not-allowed}
button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #d9ff9b;outline-offset:3px}
.ship-actions{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.ship-actions button{min-width:72px;padding:9px 8px;font-size:12px}.ship-status{font-size:12px;font-weight:700;color:#b2f4d3}.berths{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0}.berth{border:1px solid #73adc0;background:#0b2b3e;border-radius:10px;padding:11px;min-width:0}.berth strong,.berth span{display:block;overflow-wrap:anywhere}.berth strong{font-size:13px;color:#b9f8e1}.berth span{margin-top:5px;font-size:12px}.berth[data-busy="true"]{border-color:#f0be74;background:#3b3b32}.selectors{display:grid;gap:14px;margin-top:16px}.selectors label{font-size:13px;display:grid;gap:7px}
select{width:100%;padding:9px;border:1px solid #7bb1c6;background:#0a2637}
#status-text{min-height:45px;line-height:1.5;background:#0a2637;border-left:4px solid #9ceac6;padding:11px;margin:16px 0}
.actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.actions #reset{grid-column:1/-1;background:#36556a}
#hint-text{min-height:36px;overflow-wrap:anywhere;color:#cff6d9}
#pg-bot{border:1px solid #668aa0;border-radius:10px;background:#092638;margin-top:16px;padding:10px}
#pg-bot summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:800}
.bot-actions{display:flex;flex-wrap:wrap;gap:7px}.bot-actions button{font-size:12px}
#bot-answer{line-height:1.5;overflow-wrap:anywhere}.rules{padding-top:22px;color:#d4e6eb;line-height:1.55}
footer{border-top:1px solid #456c7f;padding-top:17px;margin-top:28px;color:#b6cad5;font-size:12px}
@media(max-width:780px){.layout{grid-template-columns:minmax(0,1fr)}.intro{padding:18px 0}.ship-actions button{min-width:68px}}
@media(max-width:350px){.ship{padding:9px;gap:6px}.ship-actions button{font-size:12px;padding:8px 5px;min-width:64px}.actions{gap:6px}button{font-size:13px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
