@font-face{font-family:FerryHelper;src:url('assets/helper.ttf') format('truetype');font-weight:100 900;font-style:normal;font-display:swap}
:root{--sea:#367f91;--navy:#123849;--console:#102f3c;--paper:#eff6f4;--shore:#a7b788;--red:#c95149;--line:#466775;--pwa-focus:#f3d788;--pwa-accent:#e6d59e;--pwa-on-accent:#173e4c;--pwa-surface:#214b5d;--pwa-ink:#eff6f4;--pwa-border:#6b8c95;--radius:4px}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;background:var(--navy);color:var(--paper);font:16px/1.35 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}body{overflow:hidden}button,select,input{font:inherit}button,select{color:inherit;background:var(--pwa-surface);border:1px solid var(--line);border-radius:2px}button{cursor:pointer}button:disabled,input:disabled{opacity:.45;cursor:default}button:focus,input:focus,select:focus,a:focus{outline:2px solid #f3d788;outline-offset:2px}button,input,select{touch-action:manipulation}button:hover:not(:disabled){border-color:#c5d9d4}input[type=range]{display:block;margin:0;width:100%;min-width:44px;height:44px;accent-color:#e6d59e;cursor:pointer;touch-action:none;background:transparent}input[type=checkbox]{width:22px;height:22px;margin:0 8px 0 0;flex-shrink:0;accent-color:#24596a}label{cursor:pointer}p{margin:0 0 12px}strong,output{font-variant-numeric:tabular-nums}[hidden]{display:none!important}.helper{font-family:FerryHelper,'Arial Narrow',sans-serif;font-stretch:condensed;line-height:1.25;font-size:.875rem}.header{display:flex;align-items:center;flex:0 0 auto;padding:4px 8px;min-height:56px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;color:inherit;text-decoration:none}.brand img{margin-right:8px}.brand h1{font-size:1.125rem;margin:0;font-weight:650}.header-actions{display:flex;align-items:flex-start;margin-left:auto}.header-actions>*+*{margin-left:6px}#save-state{margin:0 8px;color:#bbd3d3;font-size:.75rem}#language{width:70px}#game{height:100%;height:100dvh;display:flex;flex-direction:column;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.play-layout{flex:1;min-height:0;display:flex;flex-direction:column}#chart-region{flex:1;min-height:140px;min-width:0;overflow:hidden;background:var(--sea);position:relative}#chart,#chart svg{display:block;width:100%;height:100%}#chart svg{background:#367f91}#console{flex:0 0 auto;background:var(--console);padding:6px 8px;border-top:1px solid var(--line);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:'route route' 'readings readings' 'guidance guidance' 'helm power' 'actions actions';column-gap:12px;row-gap:2px}.route{grid-area:route;display:flex;align-items:flex-start;justify-content:space-between;min-width:0}.route>div{min-width:0;padding:2px 6px 0 0}.route strong{display:block;font-size:.875rem}.route span{display:block;font-size:.75rem;color:#bed5d5}.route button{font-size:.75rem;max-width:120px}.readings{grid-area:readings;display:flex;border-bottom:1px solid var(--line);padding-bottom:4px}.readings>div,.readings>button{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;padding:2px 6px;border:0;border-left:1px solid var(--line);border-radius:0;text-align:left;background:transparent}.readings>div:first-child{border:0;padding-left:0}.readings span{font-size:.7rem;color:#bed5d5}.readings strong{font-size:1.0625rem;font-weight:650;white-space:nowrap}.readings small{font-size:.65rem;color:#bed5d5}.reading-button{min-height:44px;min-width:44px}.reading-button small{text-decoration:underline;text-underline-offset:2px}.guidance{grid-area:guidance;min-height:24px;padding:3px 0;display:flex;align-items:center}.guidance p{margin:0}.guidance progress{width:52px;margin-left:8px;flex-shrink:0}.helm{grid-area:helm}.power{grid-area:power}.control-label{display:flex;align-items:center;justify-content:space-between;font-size:.75rem;color:#cce0dc}.control-label output{color:#eff6f4}.rudder-row{display:flex;align-items:flex-start}.rudder-row input{min-width:0;flex:1}.steer{width:44px;flex-shrink:0;background:transparent}.steer:first-child{color:#e89a8f}.steer:last-child{color:#b3dba9}.power-presets{display:flex}.power-presets>button{flex:1;min-width:44px;padding:4px!important;font-size:.75rem}.power-presets>button+button{margin-left:4px}#stop{border-color:#b47671}#stop[aria-pressed=true]{background:#643d3b}.sailing-actions{grid-area:actions;display:flex;align-items:flex-start;padding-top:4px}.sailing-actions>*+*{margin-left:6px}.sailing-actions>#resume-main{flex:1}#help{width:44px}#notice,#conflict{flex:0 0 auto;padding:8px;background:#f4dfb0;color:#51391e;border-bottom:1px solid #d4b16a;font-size:.875rem}#notice button,#conflict button{background:#fff5df;color:#51391e;margin-left:8px}#conflict p{margin-bottom:6px}.panel-backdrop{position:fixed;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:12px;background:rgba(6,28,39,.55)}.panel{display:flex;flex-direction:column;max-height:100%;width:100%;max-width:480px;background:var(--paper);color:#173e4c;border:1px solid #b9cfd0;border-radius:4px;box-shadow:0 8px 24px #071a2840;outline:none;overflow:hidden;--pwa-focus:#24596a;--pwa-surface:#e2ebe7;--pwa-ink:#173e4c;--pwa-border:#7b9d9e;--pwa-accent:#24596a;--pwa-on-accent:white}.panel-header{display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:6px 8px;border-bottom:1px solid #bfd0cb}.panel h2{font-size:1.2rem;margin:0;padding-right:8px}.panel-header button{background:transparent}#panel-body{padding:12px;overflow:auto;overscroll-behavior:contain;min-height:0;overflow-wrap:break-word}.panel h3{font-size:1rem;margin:0}.panel p,.panel li{font-size:.9375em;line-height:1.45}.panel a{color:#24596a}.panel button,.panel select{background:var(--pwa-surface);color:var(--pwa-ink)}.panel .pwa-control-primary{background:var(--pwa-accent);color:white}.panel .pwa-control-danger{background:#fff2f0;color:#9b3028}.panel .full{width:100%;margin-top:8px}.field{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;margin-bottom:8px;min-height:44px}.field select{margin-left:8px;max-width:100%}.check-field{justify-content:flex-start}.check-field label{display:flex;align-items:center;min-height:44px}.panel .helper{font-size:.875rem;color:#4a6c74}.section{border-top:1px solid #bfd0cb;margin-top:12px;padding-top:8px}.section:first-child{border:0;margin:0;padding:0}.section summary{display:flex;align-items:center;min-height:44px;cursor:pointer;font-weight:650;list-style:none}.section summary:after{content:'⌄';margin-left:auto;padding:8px;font-weight:400}.section[open] summary:after{content:'⌃'}.section summary::-webkit-details-marker{display:none}.section>.section-body{padding-top:6px}dl{margin:8px 0 12px}dl>div{display:flex;justify-content:space-between;padding:5px 0;border-bottom:1px solid #cfddd7}dt{padding-right:8px}dd{margin:0;font-variant-numeric:tabular-nums;text-align:right}.badge{padding:8px;border:1px solid #93b8a1;background:#dcebe1;margin:8px 0}.muted{color:#4a6c74}.version{margin:16px 0 0;font-size:.75rem;color:#4a6c74}#toast{position:fixed;bottom:12px;left:12px;right:12px;max-width:480px;margin:auto;background:#eff6f4;color:#173e4c;border:1px solid #6b8c95;padding:8px;z-index:10;border-radius:4px;pointer-events:none}.no-script{position:fixed;inset:20%;padding:16px;background:white;color:#173e4c;z-index:20}#import-file{display:block;max-width:100%;margin:8px 0;min-height:44px}#restore-summary{white-space:pre-line}.warning{padding:8px;border-left:3px solid #b78636;background:#f5e6bd}
@media(min-aspect-ratio:6/5) and (min-width:560px){.play-layout{flex-direction:row}#console{flex:0 0 270px;width:270px;min-width:0;display:flex;flex-direction:column;border-top:0;border-left:1px solid var(--line);overflow:auto;padding:8px}#chart-region{min-height:0}.route{flex-shrink:0}.readings{padding:8px 0;flex-shrink:0;flex-wrap:wrap}.readings strong{font-size:1.125rem}.guidance{padding:8px 0;min-height:40px}.helm,.power{margin-top:12px}.power-presets>button{font-size:.875rem}.sailing-actions{margin-top:auto;padding-top:12px}#console>.route>button{max-width:90px}.panel-backdrop{justify-content:flex-end;background:rgba(6,28,39,.25)}.panel{max-width:440px;height:100%}}
@media(min-width:1100px){#console{flex-basis:300px;width:300px;padding:12px}.readings{padding:12px 0}.helm,.power{margin-top:20px}}
@media(max-height:450px) and (min-aspect-ratio:6/5){.header{min-height:52px;padding-block:2px}#console{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:'route route' 'readings readings' 'guidance guidance' 'helm power' 'actions actions';flex-basis:340px;width:340px;padding:4px 6px;row-gap:0}.readings{padding:2px 0}.readings strong{font-size:1rem}.readings small{font-size:.6rem}.guidance{min-height:24px;padding:2px 0}.helm,.power{margin-top:0}.sailing-actions{margin:0;padding-top:4px}.route strong{font-size:.75rem}.route span{font-size:.65rem}.readings span{font-size:.65rem}.power-presets button{font-size:.7rem!important}}
@media(max-width:340px){.header{padding-inline:6px}#save-state{display:none}#console{column-gap:8px;padding-inline:6px}.readings strong{font-size:1rem}.brand img{display:none}.panel-backdrop{padding:6px}.field select{margin-left:0}.readings small{font-size:.6rem}}
@media(max-height:570px) and (max-aspect-ratio:6/5){.header{min-height:52px;padding-block:2px}#console{padding-block:3px}.readings{padding-bottom:2px}.guidance{min-height:20px;padding:1px 0}.readings small{display:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
/* Reserve chart space when text is enlarged; only the console scrolls. */
#console{max-height:65%;min-height:0;overflow:auto}
@media(min-aspect-ratio:6/5) and (min-width:560px){#console{max-height:none}}
/* Safari 12 predates the inset shorthand. */
.panel-backdrop{top:0;right:0;bottom:0;left:0}
.section summary:after{content:'';width:20px;height:20px;padding:0;margin-right:4px;background:url('shared-chevron.svg') center/20px no-repeat}
.section[open] summary:after{content:'';transform:rotate(180deg)}
/* Holding or dragging game controls must not select labels or open iOS callouts. */
#console{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
