/* Original Ember Harbor title. The illustration belongs only to the menu. */
#game-shell[data-state='menu'] .game-menu{
 background:linear-gradient(180deg,#112c3e18 12%,#102d3c88 48%,#102b3ff5 100%),url('art/environment/comic-v1/harbor-wide-v1.png') center/cover;
 backdrop-filter:none;border-radius:12px;grid-template-columns:1fr;gap:10px;padding:26px 18px;
 box-shadow:inset 0 0 0 1px #f3ce8b66;
}
.harbor-brand{display:none;color:#ffe1a0;position:relative;filter:drop-shadow(0 3px 2px #172c38)}
[data-state='menu'] .harbor-brand{display:block;grid-row:1}
.harbor-brand .brand-series{font-size:13px;font-weight:800;letter-spacing:.44em;margin-left:.44em}
.harbor-brand .brand-name{display:block;font-family:Georgia,serif;font-size:clamp(38px,6vw,76px);font-weight:900;line-height:1.04;letter-spacing:-.05em}
.harbor-brand .brand-port{display:block;margin-top:10px;font-size:10px;letter-spacing:.28em;color:#fff2ce;text-transform:uppercase}
.harbor-brand:before,.harbor-brand:after{content:'✦';position:absolute;top:35%;font-size:24px;color:#ffe3a7;animation:harbor-glint 4s ease-in-out infinite alternate}
.harbor-brand:before{left:-36px}.harbor-brand:after{right:-36px;animation-delay:-2s}
@keyframes harbor-glint{from{opacity:.4}to{opacity:1}}
[data-state='menu'] #run-modes{grid-row:4}
[data-state='menu'] #harbor-cast{grid-row:2;max-width:370px;gap:24px}
[data-state='menu'] .cast-portrait{height:clamp(70px,12vh,116px);filter:drop-shadow(0 8px 5px #122f3e99)}
[data-state='menu'] #menu-title{grid-row:3;font-family:Georgia,serif;font-size:20px;color:#fff1cf;text-shadow:0 2px 3px #102b3f}
[data-state='menu'] #menu-description{grid-row:6;font-size:11px;line-height:1.5;max-width:470px;color:#dae7e6}
[data-state='menu'] #play{grid-row:5;min-width:240px;min-height:58px;border:1px solid #fff0c1;border-radius:11px;font-size:21px;letter-spacing:.02em;background:linear-gradient(#ffe5a4,#eab65f);color:#253440;box-shadow:0 4px 0 #9d7135,0 9px 24px #071e3199}
.title-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;grid-row:7}
#title-sound{display:none}
[data-state='menu'] #title-sound{display:block;position:absolute;top:max(10px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));min-height:44px;background:#153747da;border-radius:9px;font-size:11px}
#game-shell .title-actions button{min-height:46px;min-width:105px;font-size:12px;background:#163e4eec;border:1px solid #dfbb7866!important;border-radius:9px;color:#fff1cf!important}
.title-actions button:hover{background:#285665}.title-actions button:focus-visible,#play:focus-visible{outline:3px solid #fff4ce;outline-offset:4px}
#notice-badge{display:inline-block;background:#f4cd82;color:#18333e;padding:2px 6px;border-radius:10px;margin-left:4px;font-size:10px;font-weight:800}
[data-state='menu'] .game-update{grid-row:8;margin:2px auto;font-size:12px;padding:10px}
[data-state='menu'] .game-update p{font-size:10px}
[data-state='paused'] .title-actions,[data-state='over'] .title-actions{grid-column:1/-1;grid-row:auto}
.harbor-panel{border:1px solid #d5af6d;border-radius:16px;background:linear-gradient(155deg,#234e5c,#102a3b);box-shadow:0 20px 80px #0009;color:#fff0cd}
.harbor-panel h2{font-family:Georgia,serif;font-size:30px;color:#ffe0a0;margin:.3em 0}.harbor-panel p{color:#e0e7df}
.harbor-panel .notice-eyebrow{font-size:10px;letter-spacing:.22em;color:#eac385;text-transform:uppercase;margin:0}
.harbor-panel::backdrop{background:#081b2ad9;backdrop-filter:blur(3px)}
#record-list{margin:20px 0}#record-list>div{display:flex;justify-content:space-between;gap:16px;padding:13px 0;border-bottom:1px solid #d8c08733;font-size:13px}
#record-list dt{color:#e0e7df}#record-list dd{margin:0;text-align:right;font-weight:700;color:#ffe0a0}
.is-playing #game-shell[data-state='menu']{grid-template-rows:minmax(0,1fr);padding:0;gap:0}
.is-playing [data-state='menu']>.player-hud,.is-playing [data-state='menu']>.player-status,.is-playing [data-state='menu']>.runner-actions{display:none}
.is-playing #game-shell[data-state='menu'] .play-area{width:100%;height:100%;max-width:none;align-self:stretch}
.is-playing [data-state='menu'] #game-surface{height:100%;width:100%;aspect-ratio:auto;border:0;border-radius:0}
.is-playing [data-state='menu'] .game-menu{border-radius:0;padding:max(24px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
[data-state='running'] #game-surface{animation:harbor-depart .28s ease-out}
@keyframes harbor-depart{from{opacity:.65}to{opacity:1}}
@media(max-width:600px) and (orientation:portrait){
 [data-state='menu'] .game-menu{background-image:linear-gradient(180deg,#112c3e18,#102d3c77 42%,#102b3ff5 100%),url('art/environment/comic-v1/harbor-phone-v1.png');gap:14px}
 [data-state='menu'] .harbor-brand .brand-name{font-size:48px}.harbor-brand .brand-series{font-size:12px}
 [data-state='menu'] #harbor-cast{max-width:270px;gap:14px}[data-state='menu'] .cast-portrait{height:100px}
 [data-state='menu'] #menu-title{font-size:18px}[data-state='menu'] #menu-description{max-width:320px;font-size:11px}
 .title-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:min(100%,320px);gap:6px}
 #game-shell .title-actions button{width:100%;min-width:0;padding:8px 5px;font-size:11px}
}
@media(max-height:700px) and (max-width:600px){
 [data-state='menu'] .run-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:5px}
 [data-state='menu'] .run-modes button{width:100%;padding:6px 3px;font-size:11px;min-height:44px}
 .is-playing [data-state='menu'] .game-menu{gap:6px;padding:14px 16px}
 [data-state='menu'] .harbor-brand .brand-name{font-size:38px}.harbor-brand .brand-port{font-size:8px;margin-top:6px}
 [data-state='menu'] .cast-portrait{height:56px}[data-state='menu'] .harbor-cast small{display:none}
 [data-state='menu'] #menu-title{font-size:16px}[data-state='menu'] #menu-description{font-size:10px;line-height:1.4}
 [data-state='menu'] #play{min-height:50px;font-size:19px;padding:10px 18px}
}
@media(max-height:600px) and (min-width:601px){
 [data-state='menu'] .game-menu{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 24px;padding:14px 32px}
 [data-state='menu'] .harbor-brand{grid-column:1;grid-row:1/3}.harbor-brand .brand-name{font-size:48px}
 [data-state='menu'] #harbor-cast{grid-column:1;grid-row:3/6;gap:10px}[data-state='menu'] .cast-portrait{height:68px}
 [data-state='menu'] #menu-title{grid-column:2;grid-row:1;font-size:17px}[data-state='menu'] #run-modes{grid-column:2;grid-row:2}
 [data-state='menu'] #play{grid-column:2;grid-row:3;min-height:48px;font-size:18px}
 [data-state='menu'] #menu-description{grid-column:2;grid-row:4;font-size:10px}
 [data-state='menu'] .title-actions{grid-column:2;grid-row:5;gap:6px}.title-actions button{min-width:80px;padding:8px;font-size:11px}
 [data-state='menu'] .game-update{grid-column:1/-1;grid-row:6;padding:6px;gap:3px}
}
@media(prefers-reduced-motion:reduce){.harbor-brand:before,.harbor-brand:after,[data-state='running'] #game-surface{animation:none}}

@media(max-height:600px) and (max-width:600px){[data-state="menu"] .cast-portrait{height:38px}[data-state="menu"] .harbor-brand .brand-name{font-size:34px}[data-state="menu"] #menu-description{line-height:1.3;font-size:10px}}

#menu-description #local-save-status{display:block;margin-top:.5em;font-size:11px;line-height:1.35;color:#dcebe6}
#menu-description #local-save-status[data-level='warning']{color:#ffe0a0}

#run-goals:not([hidden]){display:block;margin-top:6px;color:#ffe1a0;font-weight:600}

#next-outfit:not([hidden]){display:block;margin-top:4px;color:#dae7e6}

#next-run-target:not([hidden]){display:block;margin-top:6px;color:#ffe1a0;font-weight:600}

#distance-ladder{margin:18px 0;padding:14px;border:1px solid #dfbb7866;border-radius:12px;background:#102b3f88}
#distance-ladder h3{margin:0;color:#ffe0a0}#distance-ladder p{font-size:13px;line-height:1.5}
#distance-ladder-progress{display:block;width:100%;height:14px;accent-color:#f3c675}
#distance-ladder-progress[hidden]{display:none}
#distance-ladder-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;list-style:none;padding:0;margin:12px 0}
#distance-ladder-steps li{padding:8px 4px;text-align:center;border:1px solid #d8c08755;border-radius:7px;font-size:12px;color:#e0e7df}
#distance-ladder-steps [data-reached="true"]{color:#ffe0a0;background:#47654d66;border-color:#dfbb78}
#distance-ladder .ladder-note{font-size:11px;margin-bottom:0}
@media(max-width:400px){#distance-ladder-steps{grid-template-columns:repeat(2,minmax(0,1fr))}}

#harbor-records .dialog-actions{position:sticky;top:0;z-index:1;justify-content:flex-end;margin:0 0 12px}
