:root{font-family:Segoe UI,Arial,sans-serif;color:#f1f3e9}
html,body{background:#092635}
#center{display:flex;justify-content:flex-end;align-items:center;padding:clamp(20px,5vw,80px);background:linear-gradient(90deg,rgba(4,23,34,.06) 0%,rgba(4,23,34,.03) 45%,rgba(4,23,34,.48) 100%),url('./watercolor/savilahti-menu.webp') center center/cover no-repeat}
#center[data-outcome="success"]{background-image:linear-gradient(90deg,rgba(4,23,34,.03),rgba(4,23,34,.52)),url('./watercolor/onnistuminen.webp')}
#center[data-outcome="failure"]{background-image:linear-gradient(90deg,rgba(4,23,34,.03),rgba(4,23,34,.58)),url('./watercolor/lento.webp')}
#routePreview{float:right;width:112px;height:154px;object-fit:cover;object-position:center;margin:0 0 8px 16px;border:3px solid #e8d7ae;border-radius:3px;box-shadow:0 8px 18px #0017}
#center[data-outcome] #routePreview{display:none}
#nestPreview,#endingFilm{display:none;width:100%;height:clamp(140px,24vh,220px);object-fit:cover;border:1px solid #e8d7ae88;border-radius:5px 16px 5px 16px;margin:0 0 14px;background:#102f3d}
#center[data-outcome="success"] #nestPreview{display:block}
#center[data-outcome="success"] #endingFilm.ready{display:block}
#nestPreview.hide{display:none!important}
#center[data-outcome="success"] #endingFilm.ready + p{margin-top:3px}
#center[data-outcome="success"] #endingFilm.ready ~ #nestPreview{display:none}
#center[data-outcome] .keys{display:none}
#mission{position:fixed;z-index:2;top:18px;left:50%;transform:translateX(-50%);width:min(360px,calc(100vw - 490px));min-width:210px;padding:12px 18px;color:#ecf2e8;background:rgba(5,34,47,.87);border:1px solid rgba(215,231,218,.38);border-radius:4px 16px 4px 16px;box-shadow:0 12px 30px #001b2d4d;backdrop-filter:blur(12px);text-align:center;pointer-events:none}
#chapter{font-size:10px;letter-spacing:.24em;font-weight:800;color:#f3cc8e}
#objective{font:17px/1.25 Georgia,serif;color:#fff8e5;margin-top:4px}
#actionHint{font-size:11px;line-height:1.35;color:#cce2d8;margin-top:5px}
#danceMeter{display:none;justify-content:center;gap:7px;margin-top:8px}#mission[data-phase="courtship"] #danceMeter{display:flex}#danceMeter i{display:block;width:24px;height:5px;border-radius:9px;background:#ffffff40}#danceMeter i.done{background:#f4c87c;box-shadow:0 0 10px #f4c87c99}
#incubationMeter{display:none;height:7px;margin-top:9px;border-radius:20px;overflow:hidden;background:#ffffff35}#mission[data-phase="family"] #incubationMeter{display:block}#incubationMeter i{display:block;width:0;height:100%;border-radius:20px;background:linear-gradient(90deg,#e7ae72,#f6e5ae);transition:width .18s}
#mission[data-cue="ready"]{border-color:#f1cf89;box-shadow:0 0 0 2px #e3bd6380,0 12px 30px #001b2d4d}#mission[data-cue="ready"] #actionHint{color:#fff0bb;font-weight:800}
#mission[data-danger="true"] #objective{color:#ffd5b4}
.touch.action{border-color:#f1cf89;background:#b78048e8;color:#172e32}
.card{width:min(100%,450px);max-width:none;padding:clamp(24px,3vw,42px);text-align:left;background:linear-gradient(145deg,rgba(7,34,47,.92),rgba(5,28,42,.88));border:1px solid rgba(237,221,181,.48);border-radius:8px 36px 8px 36px;box-shadow:0 25px 70px rgba(0,13,27,.5),inset 0 1px rgba(255,255,255,.16);backdrop-filter:blur(14px)}
.card:before{content:'';display:block;width:54px;height:3px;background:#e8b878;margin-bottom:26px}
.eyebrow{color:#e9c695;letter-spacing:.24em;font-size:11px}
.card h1{font-family:Georgia,serif;font-size:clamp(64px,7vw,98px);font-weight:400;letter-spacing:-.055em;line-height:1.05;margin:9px 0 18px;text-shadow:0 3px 22px #001a28}
.card p{color:#d7e7df;font-size:15px;line-height:1.65;margin:0}
.keys{gap:7px;margin:24px 0 25px;font-size:12px;color:#e4eee5}
.keys span{border-left:2px solid #bba471;background:rgba(199,227,218,.08);padding:9px 11px;border-radius:2px 8px 8px 2px}
.keys b{color:#f4ce91}
.card button{width:100%;background:#edc386;border-radius:4px 18px 4px 18px;color:#102d35;text-transform:uppercase;letter-spacing:.15em;font-size:13px;padding:17px 22px;box-shadow:0 6px 24px #0019;transition:transform .18s,background .18s}
.card button:hover{background:#ffe0ab;transform:translateY(-2px)}
.card button:focus-visible,#sound:focus-visible,.touch:focus-visible{outline:3px solid #fff0bb;outline-offset:3px}
#hud,#mapPanel,#hint{background:rgba(5,34,47,.85);border:1px solid rgba(215,231,218,.35);border-radius:4px 16px 4px 16px;box-shadow:0 12px 30px #001b2d4d;backdrop-filter:blur(12px)}
#brand{color:#e9c695}#count{font-family:Georgia,serif;font-weight:400;color:#fff4dd}
#fill{background:linear-gradient(90deg,#6baca8,#d7d8a0)}#energyFill{background:linear-gradient(90deg,#b77b60,#edc386)}
#sound{border-radius:3px 10px 3px 10px;border-color:#edc38677;color:#f3d5a5}
#hint{color:#e3ede5;white-space:normal;max-width:min(88vw,980px)}
#mapPanel{border-radius:4px 16px 4px 16px}#mapName{color:#f2d1a1}#mapSource{color:#c8dcd6}
.touch{border-radius:4px 12px 4px 12px;background:#082f3ae8;border-color:#edc386aa}
@media (max-width:760px){#center{justify-content:center;align-items:flex-end;padding:16px;background-position:37% center}.card{width:min(100%,540px);padding:22px 24px;background:rgba(5,29,42,.91)}.card:before{margin-bottom:12px}.card h1{font-size:52px;margin:5px 0 9px}.card p{font-size:13px;line-height:1.45}.keys{margin:13px 0;gap:5px}.keys span{padding:6px 8px}.card button{padding:13px}}
@media (min-width:481px) and (max-width:760px){#hud{top:8px;left:8px;width:47vw;min-width:0;padding:9px 11px}#state,#catch,#rivals,#energy{font-size:12px}#mapPanel{top:8px;right:8px;width:42vw;max-width:190px;padding:5px}#minimap{width:100%;height:min(31vh,190px)}#mission{top:auto;bottom:115px;left:50%;width:min(440px,calc(100vw - 30px))}#hint{bottom:10px;max-width:calc(100vw - 24px);font-size:12px}}
@media (max-width:480px){#center{padding:10px;align-items:center}.card{padding:16px 18px}.card h1{font-size:46px}.card p{font-size:12px}.keys{font-size:11px}.eyebrow{font-size:9px}.card:before{display:none}#routePreview{width:76px;height:105px;margin-left:10px}#hud{top:8px;left:8px;min-width:0;width:calc((100vw - 26px)*.51);max-width:190px;padding:8px 10px}#brand{font-size:9px;letter-spacing:.16em}#count{font-size:17px;line-height:1.1}#energy,#state,#catch,#rivals{font-size:11px}#mapPanel{top:8px;right:8px;width:calc((100vw - 26px)*.43);max-width:155px;padding:5px}#minimap{width:100%;height:145px}#mapName{font-size:10px}#route{font-size:9px}#mapSource{font-size:8px}#hint{display:none}}
@media (max-width:980px){#mission{top:276px;width:min(440px,calc(100vw - 32px));min-width:0}}
@media (min-width:481px) and (max-width:760px){#mission{top:auto;bottom:115px;width:min(440px,calc(100vw - 30px))}}
@media (pointer:coarse){#mission{top:276px;left:50%;width:min(380px,calc(100vw - 24px));padding:7px 10px}#chapter{font-size:9px}#objective{font-size:15px}#actionHint{font-size:10px}#touch .group:last-child{display:grid;grid-template-columns:repeat(2,1fr);gap:4px}.touch.wide{width:66px}}
@media (max-width:480px){#touch{display:flex;inset:auto 5px 5px 5px}#touch .group:last-child{display:grid;grid-template-columns:repeat(2,1fr);gap:3px}.move{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px)}.touch{width:44px;height:44px}.touch.wide{width:62px;height:40px;font-size:10px}#mission{top:224px;width:calc(100vw - 16px);padding:6px 8px}#objective{font-size:14px}#actionHint{font-size:9px}}
@media (pointer:coarse) and (max-height:530px){#mission{top:6px;left:50%;width:min(260px,calc(100vw - 400px));padding:5px 8px}#objective{font-size:13px}#actionHint{font-size:9px}#mapPanel{max-width:125px}#minimap{height:105px}}
body[data-cinematic="hatch"] #hud,body[data-cinematic="hatch"] #mapPanel,body[data-cinematic="hatch"] #hint,body[data-cinematic="hatch"] #touch,
body[data-cinematic="laying"] #hud,body[data-cinematic="laying"] #mapPanel,body[data-cinematic="laying"] #hint,body[data-cinematic="laying"] #touch{opacity:0;pointer-events:none}
body[data-cinematic="hatch"] #mission{top:auto;bottom:18px;left:50%;width:min(420px,calc(100vw - 24px));transform:translateX(-50%)}
@media (max-height:700px){#center{display:flex;align-items:center}.card{margin:0}.card h1{font-size:clamp(42px,7vh,64px)}.card p{font-size:12px}.keys{margin:9px 0}.keys span{padding:5px 8px}.card button{padding:11px}}

/* Navigation is intentionally icon-only inside the local map. */
#mapPanel{width:auto;max-width:none;padding:6px;border-radius:50%}
#minimap{width:190px;height:190px;aspect-ratio:1;border-radius:50%}
#waypointArrow{position:fixed;z-index:3;display:none;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:54px;padding:4px 7px 5px;transform:translate(-50%,-50%);border:1px solid #ffe0a2a6;border-radius:12px;background:#15343be6;box-shadow:0 3px 14px #071e26a8;pointer-events:none;color:#fff4d7;font:700 11px/1 Segoe UI,Arial,sans-serif;white-space:nowrap}
#waypointArrow .waypointChevron{display:block;width:24px;height:22px;background:#ffdc92;clip-path:polygon(50% 0,100% 78%,50% 59%,0 78%);filter:drop-shadow(0 1px 2px #1a251f);transform:rotate(var(--waypoint-angle,0rad))}
#waypointArrow .waypointDistance{font-variant-numeric:tabular-nums}
@media (min-width:481px) and (max-width:760px){#minimap{width:min(29vh,166px);height:min(29vh,166px)}}
@media (max-width:480px){#mapPanel{width:auto;max-width:none}#minimap{width:min(32vw,122px);height:min(32vw,122px)}}
@media (pointer:coarse) and (max-height:530px){#minimap{width:102px;height:102px}}
body[data-cinematic="hatch"] #waypointArrow{display:none!important}

/* The opening art has room to breathe; controls live in the game, not on the title card. */
#rivals{display:none!important}
.joystick{display:grid;place-items:center;width:108px;height:108px;flex:none;position:relative;touch-action:none;user-select:none;-webkit-user-select:none;pointer-events:auto}
.joystickBase{display:grid;place-items:center;width:100%;height:100%;position:relative;border:2px solid #edc386b9;border-radius:50%;background:radial-gradient(circle at center,#163f4bdb 0 32%,#0b3442d9 33% 70%,#123843d9 71%);box-shadow:0 6px 18px #0019,inset 0 0 0 4px #ffffff1b;pointer-events:none}
.joystickBase::before{content:'';position:absolute;inset:15px;border:1px solid #edc38669;border-radius:50%}
.joystickThumb{display:grid;place-items:center;z-index:1;width:44px;height:44px;border:2px solid #fff4d5;border-radius:50%;background:radial-gradient(circle at 35% 28%,#ffe8b5,#d7a966 78%);box-shadow:0 5px 12px #0019,inset 0 -3px 5px #8c603a55;transform:translate(var(--joy-x,0px),var(--joy-y,0px));pointer-events:none;will-change:transform}
.joystickThumb::before{content:'✦';color:#18414a;font-size:19px;line-height:1}
.joystick:not(.active) .joystickThumb{transition:transform .12s ease-out}
.joystick.active .joystickBase{border-color:#ffe4a9;box-shadow:0 6px 20px #0019,0 0 0 3px #edc38644,inset 0 0 0 4px #ffffff1b}
#center:not([data-outcome]) .card{width:min(100%,390px)}
#center:not([data-outcome]) .card:before{margin-bottom:18px}
#center:not([data-outcome]) .card h1{margin-bottom:13px}
#center:not([data-outcome]) .card p{margin-bottom:24px}

@media (pointer:coarse), (max-width:600px), (orientation:landscape) and (max-height:530px) and (max-width:980px){
  html,body{height:100dvh;overscroll-behavior:none}
  #game{height:100dvh}
  #hint{display:none}
  #hud{top:calc(env(safe-area-inset-top) + 7px);left:calc(env(safe-area-inset-left) + 7px);width:154px;min-width:0;max-width:none;padding:6px 9px;border-radius:10px}
  #brand,#state{display:none}
  #count{font:600 12px/1.2 Segoe UI,Arial,sans-serif;margin:0;color:#fff4dd;white-space:nowrap}
  #energy{font:600 11px/1.2 Segoe UI,Arial,sans-serif}
  #meter,#energyMeter{height:4px;margin:3px 0 5px}
  #catch{font-size:10px;line-height:1.1;min-height:0;margin:2px 0 0}
  #catch:empty{display:none}
  #sound{font-size:10px;line-height:1;margin:2px 0 0;padding:3px 5px;border-radius:5px}
  #mapPanel{top:calc(env(safe-area-inset-top) + 7px);right:calc(env(safe-area-inset-right) + 7px);width:auto;max-width:none;padding:3px;border-radius:50%}
  #minimap{width:84px;height:84px}
  #mapSource{top:calc(env(safe-area-inset-top) + 77px);bottom:auto;right:calc(env(safe-area-inset-right) + 4px);font-size:7px;opacity:.9}
  #mission{top:calc(env(safe-area-inset-top) + 97px);left:7px;right:7px;bottom:auto;transform:none;width:auto;min-width:0;max-width:430px;padding:5px 9px;border-radius:9px;text-align:left}
  #chapter{font-size:8px;line-height:1;letter-spacing:.15em}
  #objective{font:600 12px/1.2 Segoe UI,Arial,sans-serif;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #actionHint{font-size:9px;line-height:1.15;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #danceMeter{margin-top:4px}
  #incubationMeter{height:4px;margin-top:4px}
  #touch{display:flex;left:calc(env(safe-area-inset-left) + 7px);right:calc(env(safe-area-inset-right) + 7px);bottom:calc(env(safe-area-inset-bottom) + 8px);top:auto;inset:auto calc(env(safe-area-inset-right) + 7px) calc(env(safe-area-inset-bottom) + 8px) calc(env(safe-area-inset-left) + 7px);align-items:end;justify-content:space-between;gap:4px}
  #touch .joystick{width:108px;height:108px}
  #touch .group.touchActions{display:grid;grid-template-columns:56px 56px 82px;grid-template-rows:44px 44px;gap:4px}
  #touch .touchActions .touch{width:auto;height:auto;min-width:0;min-height:0;padding:2px 3px;font-size:10px;line-height:1.05;letter-spacing:0;border-radius:10px;overflow:hidden}
  #touch .touchActions .dive{grid-column:1;grid-row:1}
  #touch .touchActions .land{grid-column:2;grid-row:1}
  #touch .touchActions .dive,#touch .touchActions .land{font-size:9px;white-space:nowrap}
  #touch .touchActions .action{grid-column:1 / span 2;grid-row:2}
  #touch .touchActions .primary{grid-column:3;grid-row:1 / span 2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;background:#edc386f2;color:#102d35;border:2px solid #fff4d7;border-radius:18px;box-shadow:0 5px 15px #001b,0 0 0 3px #0e3432a8;font-size:12px;font-weight:800}
  #touch .touchActions .primary small{font-size:8px;font-weight:700;opacity:.8}
  #touch .touchActions .primary:active{background:#fff0b9;transform:scale(.96)}
  #touch .touchTools{position:fixed;bottom:calc(env(safe-area-inset-bottom) + 111px);left:50%;transform:translateX(-50%);display:flex;gap:7px;align-items:center;pointer-events:auto}
  #helpPanel>summary,#fullscreenBtn{display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid #ffffff91;border-radius:10px;background:#0b3646cb;color:#fff4d7;font:700 20px/1 Segoe UI,Arial,sans-serif;box-shadow:0 4px 14px #0017;cursor:pointer;list-style:none;touch-action:manipulation}
  #helpPanel>summary::-webkit-details-marker{display:none}
  #fullscreenBtn{overflow:hidden;white-space:nowrap;font-size:0;color:transparent}
  #fullscreenBtn::before{content:'⛶';font-size:22px;color:#fff4d7}
  #fullscreenBtn[hidden]{display:none!important}
  #helpPanel[open]>summary{background:#edc386;color:#102d35}
  #helpPanel .helpContent{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom) + 158px);transform:translateX(-50%);width:min(350px,calc(100vw - 24px));max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 185px);overflow:auto;padding:15px 17px;border:1px solid #edc386a8;border-radius:14px;background:#092b39f5;color:#eaf4ea;font-size:12px;line-height:1.4;box-shadow:0 10px 35px #001c;backdrop-filter:blur(15px)}
  #helpPanel .helpContent strong{display:block;color:#f5d9a7;font-size:16px;margin-bottom:6px}
  #helpPanel .helpContent p{margin:0 0 8px}
  #helpPanel .helpContent p:last-child{margin-bottom:0}
  #helpPanel .desktopHelp{display:none}
  #center:not([data-outcome]){justify-content:center;align-items:flex-start;padding:calc(env(safe-area-inset-top) + 18px) 13px 13px;background-position:50% 50%}
  #center:not([data-outcome]) .card{width:min(100%,390px);padding:17px 20px 19px;background:linear-gradient(145deg,rgba(5,31,43,.91),rgba(5,31,43,.80))}
  #center:not([data-outcome]) .card:before{display:none}
  #center:not([data-outcome]) .card h1{font-size:58px;margin:5px 0 6px}
  #center:not([data-outcome]) .card p{font-size:12px;line-height:1.35;margin-bottom:12px}
  #center:not([data-outcome]) .card button{padding:12px 20px}
  #waypointArrow{max-width:90px;min-width:38px;padding:3px 5px;font-size:9px}
}

@media (max-width:350px){
  #touch{flex-direction:row;align-items:end}
  #touch .joystick{width:96px;height:96px}
  #touch .joystickThumb{width:40px;height:40px}
  #touch .group.touchActions{grid-template-columns:48px 48px 64px;grid-template-rows:44px 44px;gap:3px}
  #touch .touchActions .touch{font-size:9px}
  #touch .touchActions .dive,#touch .touchActions .land{font-size:8px}
  #touch .touchActions .primary{font-size:10px}
  #touch .touchActions .primary small{font-size:7px}
  #hud{width:135px}
  #count{font-size:11px}
  #minimap{width:72px;height:72px}
  #mission{top:calc(env(safe-area-inset-top) + 89px)}
}

@media (pointer:coarse) and (orientation:landscape), (orientation:landscape) and (max-height:530px) and (max-width:980px){
  #hud{top:calc(env(safe-area-inset-top) + 5px);left:calc(env(safe-area-inset-left) + 6px);width:128px;padding:4px 6px}
  #count,#energy{font-size:10px}
  #meter,#energyMeter{margin:2px 0 3px}
  #sound{display:none}
  #mapPanel{top:calc(env(safe-area-inset-top) + 5px);right:calc(env(safe-area-inset-right) + 6px)}
  #mapSource{top:calc(env(safe-area-inset-top) + 60px)}
  #minimap{width:65px;height:65px}
  #mission{top:calc(env(safe-area-inset-top) + 5px);left:50%;right:auto;transform:translateX(-50%);width:min(300px,calc(100vw - 330px));padding:4px 8px}
  #chapter{font-size:7px}
  #objective{font-size:11px}
  #actionHint{font-size:8px}
  #touch{bottom:calc(env(safe-area-inset-bottom) + 4px)}
  #touch .joystick{width:96px;height:96px}
  #touch .group.touchActions{grid-template-columns:50px 50px 72px;grid-template-rows:39px 39px;gap:3px}
  #touch .touchActions .primary{font-size:11px}
  #touch .touchTools{bottom:calc(env(safe-area-inset-bottom) + 15px)}
  #helpPanel .helpContent{bottom:calc(env(safe-area-inset-bottom) + 55px);left:50%;width:min(370px,calc(100vw - 320px));max-height:calc(100dvh - 75px)}
  #center:not([data-outcome]){justify-content:flex-end;align-items:center;padding:8px calc(env(safe-area-inset-right) + 12px) 8px 12px;background-position:center center}
  #center:not([data-outcome]) .card{width:min(35vw,350px);min-width:275px;max-height:calc(100dvh - 16px);overflow:auto;padding:12px 16px}
  #center:not([data-outcome]) .card h1{font-size:clamp(38px,11vh,58px)}
  #center:not([data-outcome]) .card p{font-size:11px;line-height:1.25;margin-bottom:9px}
  #center:not([data-outcome]) .card button{padding:9px 14px}
}

/* Browser emulators can report a fine pointer at phone dimensions. Keep the art layout then too. */
@media (max-width:600px) and (orientation:portrait){
  #center:not([data-outcome]){display:flex;justify-content:center;align-items:flex-start;padding:calc(env(safe-area-inset-top) + 20px) 13px 13px;background-position:50% 50%}
  #center:not([data-outcome]) .card{width:min(100%,390px);padding:16px 20px 18px;background:linear-gradient(145deg,rgba(5,31,43,.91),rgba(5,31,43,.80))}
  #center:not([data-outcome]) .card:before{display:none}
  #center:not([data-outcome]) .card h1{font-size:58px;margin:5px 0 6px}
  #center:not([data-outcome]) .card p{font-size:12px;line-height:1.35;margin-bottom:12px}
  #center:not([data-outcome]) .card button{padding:12px 20px}
}

@media (orientation:landscape) and (max-height:530px){
  #center:not([data-outcome]){display:flex;justify-content:flex-end;align-items:center;padding:8px calc(env(safe-area-inset-right) + 12px) 8px 12px;background-position:center center}
  #center:not([data-outcome]) .card{width:min(35vw,300px);min-width:260px;max-height:calc(100dvh - 16px);overflow:auto;padding:12px 16px}
  #center:not([data-outcome]) .card h1{font-size:clamp(38px,11vh,58px);margin:5px 0 6px}
  #center:not([data-outcome]) .card p{font-size:11px;line-height:1.25;margin-bottom:9px}
  #center:not([data-outcome]) .card button{padding:9px 14px}
}

#center.hidden{display:none!important}

/* The view stays clear while the bird is moving. Gameplay details open on demand. */
html,body,body *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
html,body{overscroll-behavior:none}
button,summary{touch-action:manipulation}
summary{cursor:pointer;list-style:none}
summary::-webkit-details-marker{display:none}
#game{touch-action:none}

#hud{top:18px;left:18px;width:188px;min-width:0;max-width:none;padding:10px 48px 9px 12px;border-radius:12px;pointer-events:auto}
#energy{font:700 12px/1.1 Segoe UI,Arial,sans-serif;color:#fff5d9;white-space:nowrap}
#energyMeter{height:6px;margin:7px 0 0}
#survivalPanel{position:absolute;top:7px;right:7px;width:32px;height:32px}
#survivalPanel>summary{display:grid;place-items:center;width:32px;height:32px;border:1px solid #e8c8928f;border-radius:9px;background:#244854d9;color:#ffe2a7;font:800 22px/1 Georgia,serif;letter-spacing:1px;padding-bottom:8px}
#survivalPanel[open]>summary{background:#eed097;color:#17343b}
#survivalPanel .survivalContent{position:absolute;top:40px;right:0;width:234px;padding:12px 14px;border:1px solid #e8c8929e;border-radius:12px;background:#092c3af5;box-shadow:0 12px 28px #001b2da6;text-align:left;backdrop-filter:blur(10px)}
#survivalPanel:not([open]) .survivalContent{display:none}
#brand{font-size:10px;letter-spacing:.13em}
#count{font:600 13px/1.3 Segoe UI,Arial,sans-serif;margin:9px 0 4px}
#meter{height:6px;margin:4px 0 10px}
#state{font-size:11px;line-height:1.35}
#sound{margin-top:12px;padding:7px 10px;font-size:11px}
#catch{position:fixed;z-index:4;top:70px;left:50%;transform:translateX(-50%);width:max-content;max-width:min(400px,calc(100vw - 36px));min-height:0;margin:0;padding:7px 12px;border:1px solid #f2d59a9e;border-radius:10px;background:#0b3440e9;color:#fff1cc;font:700 12px/1.3 Segoe UI,Arial,sans-serif;text-align:center;box-shadow:0 8px 22px #001a27a6;pointer-events:none}
#catch:empty{display:none}

#mission{top:18px;left:50%;right:auto;bottom:auto;transform:translateX(-50%);width:42px;min-width:0;max-width:none;padding:0;border:0;border-radius:12px;background:none;box-shadow:none;backdrop-filter:none;text-align:left;pointer-events:auto;z-index:3}
#mission>summary,#mapPanel>summary,#hint>summary{display:grid;place-items:center;width:42px;height:42px;padding:0;border:1px solid #e9d19ba8;border-radius:12px;background:#0a3442db;color:#ffe2a5;font:700 23px/1 Segoe UI,Arial,sans-serif;box-shadow:0 6px 18px #001b28a6;backdrop-filter:blur(10px)}
#mission>summary{font-size:20px}
#mission[data-cue="ready"]>summary{background:#f1cf89;color:#0d313c;box-shadow:0 0 0 4px #f1cf8963,0 6px 18px #001b28a6}
#mission[data-danger="true"]>summary{border-color:#ff9380;color:#ffada4}
#mission[open]{width:min(340px,calc(100vw - 28px));padding:8px;border:1px solid #e9d19ba8;background:#092c3af5;box-shadow:0 12px 32px #001b2da6;backdrop-filter:blur(12px)}
#mission[open]>summary{margin:0 auto 4px}
#mission .missionContent{padding:5px 10px 9px;text-align:center}
#chapter{font-size:10px;letter-spacing:.17em}
#objective{font:500 16px/1.3 Georgia,serif;white-space:normal;overflow:visible;margin-top:6px}
#actionHint{font-size:12px;line-height:1.4;white-space:normal;overflow:visible;margin-top:7px}

#mapPanel{top:18px;right:18px;left:auto;bottom:auto;z-index:4;width:42px;max-width:none;padding:0;border:0;border-radius:12px;background:none;box-shadow:none;backdrop-filter:none;text-align:left;pointer-events:auto}
#mapPanel>summary{font-size:29px;padding-bottom:4px}
#mapPanel[open]{width:min(370px,calc(100vw - 28px));padding:8px;border:1px solid #e9d19ba8;background:#092c3af5;box-shadow:0 12px 32px #001b2da6;backdrop-filter:blur(12px)}
#mapPanel[open]>summary{margin-left:auto;margin-bottom:5px}
#mapPanel .mapContent{display:flex;flex-direction:column;align-items:center;gap:7px}
#mapPanel:not([open]) .mapContent{display:none}
#minimap{display:block;width:min(320px,100%);height:auto;aspect-ratio:1;border-radius:50%;background:#21453f;image-rendering:auto}
#mapControls{display:flex;justify-content:space-between;align-items:center;width:100%;padding:0 6px;gap:12px;color:#e5efdd;font-size:12px;font-weight:700}
#mapControls>div{display:flex;gap:6px}
#mapControls button{display:grid;place-items:center;width:30px;height:30px;padding:0;border:1px solid #e8c89299;border-radius:8px;background:#254957;color:#fff0cc;font-size:20px;font-weight:600;line-height:1}
#mapControls button:active{background:#edc386;color:#16343b}
#mapSource{position:static;display:block;align-self:flex-end;margin:0 6px 2px;padding:0;background:none;color:#bfd3ce;font-size:9px;line-height:1.2}

#hint{position:fixed;z-index:3;left:auto;right:18px;bottom:18px;top:auto;transform:none;width:42px;max-width:none;padding:0;border:0;border-radius:12px;background:none;box-shadow:none;backdrop-filter:none;white-space:normal;pointer-events:auto}
#hint[open]{width:min(300px,calc(100vw - 36px));padding:8px;border:1px solid #e9d19ba8;background:#092c3af5;box-shadow:0 12px 32px #001b2da6}
#hint[open]>summary{margin-left:auto}
#hint .hintContent{padding:8px 10px;color:#e6f1e9;text-align:left;font-size:12px;line-height:1.5}
#hint .hintContent strong{display:block;color:#ffe1a7;font-size:16px}
#hint .hintContent p{margin:5px 0 2px}

#mission>summary:focus-visible,#mapPanel>summary:focus-visible,#hint>summary:focus-visible,#survivalPanel>summary:focus-visible,#mapControls button:focus-visible{outline:3px solid #fff4c3;outline-offset:2px}
body[data-cinematic="hatch"] #catch{display:none}
body[data-cinematic="hatch"] #mission{display:none}
body[data-cinematic="fledging"] #hud,body[data-cinematic="fledging"] #mapPanel,body[data-cinematic="fledging"] #hint,body[data-cinematic="fledging"] #touch,body[data-cinematic="fledging"] #mission,body[data-cinematic="fledging"] #waypointArrow{opacity:0;pointer-events:none}
body[data-cinematic="maturing"] #hud,body[data-cinematic="maturing"] #mapPanel,body[data-cinematic="maturing"] #hint,body[data-cinematic="maturing"] #touch,body[data-cinematic="maturing"] #mission,body[data-cinematic="maturing"] #waypointArrow{opacity:0;pointer-events:none}

@media (pointer:coarse), (max-width:600px), (orientation:landscape) and (max-height:530px) and (max-width:980px){
  #hud{top:calc(env(safe-area-inset-top) + 7px);left:calc(env(safe-area-inset-left) + 7px);width:150px;min-width:0;max-width:none;padding:7px 39px 7px 9px}
  #energy{font-size:11px}
  #energyMeter{height:5px;margin-top:5px}
  #survivalPanel{top:5px;right:5px}
  #survivalPanel .survivalContent{width:220px;max-width:calc(100vw - 14px)}
  #mission{top:calc(env(safe-area-inset-top) + 7px);right:calc(env(safe-area-inset-right) + 56px);left:auto;bottom:auto;transform:none;width:42px;min-width:0;max-width:none;padding:0}
  #mission[open]{width:min(300px,calc(100vw - 63px));padding:7px}
  #mission[open]>summary{margin:0 0 3px auto}
  #mission .missionContent{padding:4px 8px 7px}
  #objective{font-size:15px;white-space:normal}
  #actionHint{font-size:11px;white-space:normal}
  #mapPanel{top:calc(env(safe-area-inset-top) + 7px);right:calc(env(safe-area-inset-right) + 7px);width:42px;max-width:none;padding:0}
  #mapPanel[open]{width:min(356px,calc(100vw - 14px));padding:7px}
  #mapPanel[open]>summary{margin-left:auto}
  #minimap{width:min(320px,calc(100vw - 42px));height:auto}
  #mapSource{position:static;font-size:9px;opacity:1}
  #hint{display:none}
  #touch .touchActions .primary small{display:none}
  #touch .touchActions .primary span{font-size:12px;line-height:1.15;overflow-wrap:anywhere}
  #catch{top:calc(env(safe-area-inset-top) + 62px);font-size:11px}
}
@media (max-width:350px){
  #hud{width:139px}
  #energy{font-size:10px}
  #mission{right:calc(env(safe-area-inset-right) + 55px)}
  #mission[open]{width:calc(100vw - 62px)}
  #mapPanel[open]{width:calc(100vw - 14px)}
}
@media (pointer:coarse) and (orientation:landscape), (orientation:landscape) and (max-height:530px) and (max-width:980px){
  #hud{top:calc(env(safe-area-inset-top) + 5px);left:calc(env(safe-area-inset-left) + 6px);width:142px;padding:5px 38px 5px 7px}
  #energy{font-size:10px}
  #energyMeter{margin-top:3px;height:4px}
  #mission{top:calc(env(safe-area-inset-top) + 5px);right:calc(env(safe-area-inset-right) + 55px);left:auto;transform:none;width:42px}
  #mission[open]{width:min(300px,calc(100vw - 63px))}
  #mapPanel{top:calc(env(safe-area-inset-top) + 5px);right:calc(env(safe-area-inset-right) + 6px);width:42px}
  #mapPanel[open]{width:min(300px,calc(100vw - 12px))}
  #minimap{width:min(250px,calc(100dvh - 115px));height:auto}
  #mapControls{font-size:10px}
  #mapControls button{width:26px;height:26px;font-size:18px}
  #catch{top:calc(env(safe-area-inset-top) + 52px);max-width:320px;font-size:10px}
}

/* The title tells the full objective before play; narration is an optional tap. */
#center:not([data-outcome]) #message{margin-bottom:8px}
#gameArc{font-size:13px;line-height:1.4;color:#f1d9aa;font-weight:600}
#center:not([data-outcome]) #gameArc{margin-bottom:13px}
#center[data-outcome] #gameArc,#center[data-outcome] #introNarration{display:none}
#introNarration{display:block;width:auto;max-width:100%;padding:9px 14px;margin:0 0 10px;border:1px solid #eac88fab;border-radius:10px;background:#0c3a48da;color:#ffe1ae;box-shadow:none;text-transform:none;letter-spacing:.03em;font:700 12px/1.25 Segoe UI,Arial,sans-serif}
#introNarration:hover{background:#1b5360;transform:none}
#introNarration[disabled]{opacity:.55;cursor:default}

/* A north-up paper-map panel, with a distinct marker and no lake labels. */
#mapPanel[open]{max-height:calc(100dvh - 28px);overflow-y:auto;overscroll-behavior:contain}
body:has(#mapPanel[open]) #touch{opacity:0;pointer-events:none}
#mapPanel .mapContent{align-items:stretch;gap:7px}
#mapTitle{display:flex;justify-content:space-between;align-items:center;padding:0 4px;color:#f1e4c8;font:700 13px/1.2 Segoe UI,Arial,sans-serif}
#mapTitle span{font-size:11px;color:#c7e6dd}
#minimap{width:100%;max-width:none;height:auto;aspect-ratio:25 / 18;align-self:center;border:1px solid #e9e2c69e;border-radius:6px;background:#c6ceb6}
#mapLegend{display:flex;justify-content:space-between;gap:6px;padding:0 4px;color:#e7efe6;font:600 11px/1.2 Segoe UI,Arial,sans-serif}
#mapLegend span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
#mapLegend i{display:inline-block;flex:none;width:10px;height:10px;border:1.5px solid #fff9dd}
#mapLegend .playerDot{border-radius:50%;background:#203e49}
#mapLegend .targetDot{width:9px;height:9px;transform:rotate(45deg);border-color:#523c2a;background:#f4b35e}
#mapControls{padding:0 3px;gap:6px}
#mapScale{font-size:11px;line-height:1.2;font-variant-numeric:tabular-nums}
#mapSource{align-self:flex-end;margin:0 3px 1px;font-size:9px}
@media (max-width:600px){
  #center:not([data-outcome]) #message{margin-bottom:6px}
  #gameArc{font-size:11px;line-height:1.3}
  #center:not([data-outcome]) #gameArc{margin-bottom:9px}
  #introNarration{padding:8px 10px;margin-bottom:8px;font-size:11px}
  #mapPanel[open]{max-height:calc(100dvh - env(safe-area-inset-top) - 14px)}
  #mapTitle{font-size:12px}
}
@media (orientation:landscape) and (max-height:530px){
  #mapPanel[open]{max-height:calc(100dvh - env(safe-area-inset-top) - 10px)}
  #minimap{width:min(100%,calc((100dvh - 138px)*25/18));height:auto}
  #mapLegend,#mapScale{font-size:10px}
  #mapPanel .mapContent{gap:4px}
  #center:not([data-outcome]) #gameArc{margin-bottom:6px}
  #introNarration{padding:6px 9px;margin-bottom:6px}
}

/* Courtship timing follows the real cue window, even with the mission panel closed. */
#danceTiming{position:fixed;z-index:3;left:50%;bottom:24px;transform:translateX(-50%);width:min(360px,calc(100vw - 24px));padding:11px 14px 10px;background:#082c39ec;border:1px solid #e9c58fbc;border-radius:12px;box-shadow:0 8px 26px #001a28ad;color:#fff2d5;pointer-events:none;user-select:none;-webkit-user-select:none}
#danceTiming[hidden]{display:none!important}
.danceTimingHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;font:800 12px/1.2 Segoe UI,Arial,sans-serif;letter-spacing:.04em;text-transform:uppercase}
#danceTimingPips{display:flex;gap:5px;flex:none}
#danceTimingPips i{display:block;width:14px;height:6px;border-radius:4px;background:#ffffff52}
#danceTimingPips i.done{background:#f3c37d;box-shadow:0 0 8px #f3c37d99}
#danceTimingTrack{position:relative;height:18px;margin:10px 2px 7px;border:1px solid #d2ded282;border-radius:10px;background:#06202e;overflow:visible}
#danceTimingWindow{position:absolute;top:-1px;bottom:-1px;left:var(--dance-window-start,66.667%);width:var(--dance-window-size,33.333%);border:1px solid #fff0bc;border-radius:0 9px 9px 0;background:linear-gradient(90deg,#ba7937,#f4cf88);box-shadow:inset 0 0 9px #fff4c399,0 0 10px #eec17872}
#danceTimingNeedle{position:absolute;z-index:1;top:-6px;left:0;width:3px;height:29px;border-radius:3px;background:#f5ffff;box-shadow:0 0 0 2px #0c3943,0 0 10px #eafffc;transform:translateX(-50%)}
#danceTimingHint{min-height:15px;color:#d7e7df;font:600 11px/1.25 Segoe UI,Arial,sans-serif;text-align:center}
#danceTiming[data-state="ready"]{border-color:#ffe3a6;box-shadow:0 0 0 3px #e9c87f62,0 8px 26px #001a28ad}
#danceTiming[data-state="ready"] #danceTimingLabel{color:#ffe3a6}
#danceTiming[data-feedback="success"]{border-color:#a8e9bf}
#danceTiming[data-feedback="success"] #danceTimingLabel{color:#a8e9bf}
#danceTiming[data-feedback="miss"]{border-color:#ffb39a}
#danceTiming[data-feedback="miss"] #danceTimingLabel{color:#ffb39a}
body:has(#danceTiming:not([hidden])) #touch .touchTools{display:none}
/* Keep the action in its familiar place while the courtship/nest pose is held. */
body[data-movement-locked="true"] #moveJoystick,
body[data-movement-locked="true"] #touch button:not(.action){visibility:hidden;pointer-events:none}
body:has(#danceTiming[data-state="ready"]:not([hidden])) #touch .touch.action{background:#f8d58c;color:#12343d;border-color:#fff5d5;box-shadow:0 0 0 3px #f3cb8075,0 0 16px #f3cb80a6}
@media (pointer:coarse), (max-width:600px){#danceTiming{bottom:calc(env(safe-area-inset-bottom) + 127px);width:min(330px,calc(100vw - 20px));padding:9px 11px 8px}.danceTimingHeader{font-size:11px}#danceTimingHint{font-size:10px}}
@media (orientation:landscape) and (max-height:530px){#danceTiming{bottom:calc(env(safe-area-inset-bottom) + 103px);width:min(300px,calc(100vw - 390px));min-width:240px;padding:6px 10px}.danceTimingHeader{font-size:10px}#danceTimingTrack{height:14px;margin:7px 2px 5px}#danceTimingNeedle{top:-5px;height:24px}#danceTimingHint{font-size:9px}}

/* A contextual hint appears only after the objective has stalled. */
#guideHint{position:fixed;z-index:4;top:18px;right:78px;width:42px;pointer-events:auto}
#guideHint[hidden],#guideHintBody[hidden]{display:none!important}
#guideHintButton{display:grid;place-items:center;width:42px;height:42px;padding:0;border:1px solid #ffe1a9;border-radius:12px;background:#e8b86a;color:#12323c;font:900 23px/1 Segoe UI,Arial,sans-serif;box-shadow:0 0 0 4px #e9bd6760,0 6px 18px #001b28a6;animation:guidePulse 2.6s ease-in-out infinite}
#guideHint[data-seen="true"] #guideHintButton{animation:none;background:#0a3442db;color:#ffe2a5}
#guideHintButton:focus-visible{outline:3px solid #fff4c3;outline-offset:3px}
#guideHintBody{position:absolute;top:49px;right:0;width:min(278px,calc(100vw - 20px));padding:13px 15px;border:1px solid #e9d19ba8;border-radius:12px;background:#092c3af5;box-shadow:0 12px 32px #001b2da6;backdrop-filter:blur(12px);color:#edf5eb}
#guideHintBody strong{font:800 13px/1.2 Segoe UI,Arial,sans-serif;color:#ffe1a7}
#guideHintBody p{margin:7px 0;font:600 12px/1.4 Segoe UI,Arial,sans-serif;color:#e9f0e8}
#guideHintBody small{font:500 10px/1.3 Segoe UI,Arial,sans-serif;color:#bcd1cc}
@keyframes guidePulse{50%{box-shadow:0 0 0 8px #e9bd6724,0 6px 18px #001b28a6}}
@media (pointer:coarse), (max-width:600px){#guideHint{top:calc(env(safe-area-inset-top) + 7px);right:calc(env(safe-area-inset-right) + 111px)}#guideHintBody{right:-100px}}
@media (prefers-reduced-motion:reduce){#guideHintButton{animation:none}}

/* Readable first-play guidance, with separate mouse and touch layouts. */
#mobileWelcome[hidden]{display:none!important}
#mobileWelcome{position:fixed;z-index:5;top:68px;left:50%;transform:translateX(-50%);box-sizing:border-box;width:min(340px,calc(100vw - 24px));padding:12px 14px;border:1px solid #dfc29199;border-radius:12px;background:#082e3bf5;color:#eff3e6;box-shadow:0 8px 26px #0019;font:13px/1.4 Segoe UI,Arial,sans-serif}
#mobileWelcome strong{color:#ffe2ac;font-size:15px}
#mobileWelcome p{margin:6px 0 10px}
#mobileWelcome>div{display:flex;justify-content:space-between;gap:8px}
#mobileWelcome button{padding:9px 10px;border:1px solid #e2c58b;border-radius:8px;background:#e6bf7f;color:#13333c;font:700 12px Segoe UI,Arial,sans-serif;touch-action:manipulation}
#mobileWelcome #welcomeMission{background:transparent;color:#f3dfba}
@media (pointer:fine) and (min-width:601px){
  #hint,#hint[open]{display:block;left:50%;right:auto;bottom:14px;transform:translateX(-50%);width:auto;max-width:calc(100vw - 28px);border-radius:12px;background:#082e3bf2;border:1px solid #d8c08c80;box-shadow:0 8px 26px #0018}
  #hint[open]{width:min(1040px,calc(100vw - 36px));box-sizing:border-box;padding:8px 14px 10px}
  #hint>summary,#hint[open]>summary{width:auto;height:auto;min-height:28px;margin:0;padding:6px 10px;display:flex;justify-content:space-between;gap:18px;border:0;background:none;box-shadow:none;font:700 14px/1.2 Segoe UI,Arial,sans-serif;cursor:pointer}
  #hint:not([open])>summary span{transform:rotate(180deg)}
  #hint .hintContent{padding:4px 4px 0;font-size:13px}
  .keyGuide{display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center}
  .keyGuide>div{display:flex;align-items:center;gap:5px;line-height:1.4}
  .keyGuide span{margin-left:3px;color:#eef3e9}
  #hint kbd{display:inline-block;padding:3px 7px;white-space:nowrap;border:1px solid #c8d3c780;border-bottom-width:3px;border-radius:5px;background:#284b55;color:#fff0c9;font:700 12px/1.2 Segoe UI,Arial,sans-serif}
  #hint .mouseGuide{margin-top:10px;color:#c3d5d1;font-size:12px}
  #mission:not([open]){width:112px}
  #mission>summary{width:auto;padding:0 12px;font:700 13px Segoe UI,Arial,sans-serif}
  #mission>summary:after{content:'Tehtävä · J';margin-left:6px}
  #mission[open]{width:min(390px,calc(100vw - 430px));min-width:240px}
  #mission[open]>summary{height:28px;background:none;border:0;box-shadow:none}
  body:has(#mission[open]) #catch{top:auto;bottom:180px}
  body:has(#danceTiming:not([hidden])) #hint{display:none}
}
body:has(#center:not(.hidden)) #hint,body:has(#center:not(.hidden)) #mobileWelcome{display:none}
