:root{color-scheme:light;font-family:system-ui,-apple-system,'Hiragino Kaku Gothic ProN',sans-serif;color:#2a2328;background:#fff}*{box-sizing:border-box}body{margin:0}button{font:inherit;color:inherit;background:#f3f4f6;border:0;border-radius:8px;min-height:48px;padding:9px 12px;touch-action:manipulation}button:disabled{opacity:.45}button:focus-visible{outline:3px solid #315e64;outline-offset:2px}[hidden]{display:none!important}main{width:100%;max-width:450px;margin:0 auto;padding:6px 10px max(8px,env(safe-area-inset-bottom))}#sea{position:relative;height:280px;min-height:220px;max-height:36dvh;border-radius:16px;overflow:hidden;background:linear-gradient(#e1f1ef 0 32%,#acd4d8 32% 60%,#91c1c9 60%);isolation:isolate}.journey{display:flex;justify-content:space-between;padding:10px;font-size:12px;font-weight:650}.journey span{background:#ffffffe6;padding:5px 8px;border-radius:8px}progress{position:absolute;top:48px;left:14px;width:calc(100% - 28px);height:8px;accent-color:#315e64}.island{position:absolute;right:20px;top:58px;font-size:55px}.raft{position:absolute;left:20%;top:61px;width:150px;text-align:center;animation:bob 4s ease-in-out infinite}.raft>span{font-size:90px;line-height:1.2}.logs{height:15px;border-radius:50%;background:repeating-linear-gradient(0deg,#937250 0 4px,#bc9971 5px 8px)}.companion{position:absolute;bottom:0;left:8px;right:8px;display:flex;align-items:center;gap:4px}.companion img{width:112px;height:112px;object-fit:contain;flex-shrink:0}.companion>div{flex:1}.companion small{font-size:11px}.companion p{font-size:13px;line-height:1.5;min-height:55px;margin:4px 0 8px;padding:9px;background:#fffffff2;border-radius:5px 12px 12px}h2{font-size:20px;margin:14px 0 8px}#intro,#result{text-align:center;padding:6px 10px}#intro p,#result p{font-size:13px;line-height:1.6}#start,#retry{background:#315e64;color:#fff;width:100%;margin:8px 0;min-height:50px;font-weight:650}#resources{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin:8px 0}#resources>div{background:#f3f4f6;padding:6px 3px;text-align:center;border-radius:8px;font-size:11px}#resources b{display:block;font-size:19px;margin-top:2px}.low{color:#a53637}#resources .low::after{content:' 残りわずか';font-size:9px}.work{display:flex;gap:6px}.work button{flex:1;font-size:13px}.work small{display:block;font-size:10px;margin-top:2px}#workNote,.hint,#saveNote,#best{font-size:11px;color:#6e626a;line-height:1.5;margin:5px 0;text-align:center}#routes{display:grid;gap:6px}#routes button{display:flex;align-items:center;text-align:left;gap:10px;min-height:60px;background:#eef0f3;width:100%}#routes .icon{font-size:26px}#routes strong{display:block;font-size:13px}#routes small{font-size:11px;display:block;margin-top:3px}#routes em{margin-left:auto;font-size:12px;font-style:normal;color:#315e64;font-weight:bold;white-space:nowrap}@keyframes bob{50%{transform:translateY(4px) rotate(1deg)}}@media(prefers-reduced-motion:reduce){.raft{animation:none}}@media(max-height:740px){#sea{height:220px}.companion img{width:88px;height:88px}.raft{top:57px;left:17%}.raft>span{font-size:64px}.island{font-size:42px}#routes button{min-height:56px}}
/* The ocean is the control surface: physical tools stay above the raft. */
#sea{height:440px;max-height:none;min-height:390px;background:linear-gradient(#d9eff0 0%,#f4ecd8 19%,#70bdcb 20%,#3698ad 57%,#17687e 100%);touch-action:none}
.journey{position:relative;z-index:7;align-items:center;padding:8px;gap:4px}.journey button{min-height:32px;width:32px;padding:3px;background:#ffffffdc}progress{top:52px;height:5px;z-index:3}.island{top:45px;right:17px;font-size:34px;opacity:.8}.horizon{position:absolute;inset:20% 0 0;overflow:hidden;pointer-events:none}.horizon i{position:absolute;left:-35%;width:170%;height:110px;border:2px solid #e5ffff55;border-radius:48%;transform:rotate(-8deg);animation:tide 7s ease-in-out infinite}.horizon i:nth-child(1){top:18%}.horizon i:nth-child(2){top:45%;animation-delay:-2s}.horizon i:nth-child(3){top:72%;animation-delay:-4s}
#routes{position:absolute;inset:73px 7px auto;display:grid;grid-template-columns:repeat(3,1fr);gap:3px;z-index:5}#routes button{display:flex;flex-direction:column;gap:0;align-items:center;text-align:center;background:none;color:#fff;min-height:150px;padding:0;touch-action:none;border-radius:12px;text-shadow:0 1px 3px #164655;user-select:none;-webkit-user-select:none}#routes button svg{width:88px;height:88px;overflow:visible;filter:drop-shadow(0 7px 3px #174f6750)}#routes strong{font-size:12px}#routes small{font-size:10px;line-height:1.65;margin:2px 0;background:#174e6666;padding:2px 4px;border-radius:5px}#routes button:focus-visible{outline-color:white}#routes button.dragging{z-index:10;filter:drop-shadow(0 0 6px #fff);cursor:grabbing}
.raft{top:215px;left:calc(50% - 110px);width:220px;height:170px;animation:bob 4s ease-in-out infinite;transition:filter .25s}.raft svg{width:100%;height:100%;filter:drop-shadow(0 3px 4px #133d4550)}.raft[data-sail="2"] #sail{fill:#fff}.raft[data-sail="0"] #sail{transform:scaleX(.7);transform-origin:126px 70px}#sail{transition:transform .3s,fill .3s}#patches{stroke:#b29a77;stroke-dasharray:2;stroke-width:1}.logs{display:none}.companion{z-index:6;left:4px;right:8px;pointer-events:none;bottom:0;gap:0}.companion img{width:98px;height:98px;filter:drop-shadow(0 4px 5px #1b4c5860)}.companion small{color:white;text-shadow:0 1px 3px #234}.companion p{font-size:12px;min-height:47px;margin-bottom:6px;padding:7px 9px}.companion>div{padding-top:18px}
#gestureHint{position:absolute;z-index:6;bottom:99px;left:10px;right:10px;text-align:center;color:#fff;font-size:12px;font-weight:650;text-shadow:0 1px 3px #123;background:#153f5355;border-radius:20px;padding:5px;pointer-events:none}#sea:has(.dragging) .raft{filter:drop-shadow(0 0 8px #fff9)}#sea:has(.dragging) .companion img{transform:rotate(-7deg) translateX(4px)}#workTargets{position:absolute;inset:0;z-index:8;pointer-events:none}#workTargets>div{position:absolute;width:120px;height:58px;left:calc(50% - 60px);border:2px dashed white;border-radius:20px;background:#f5e6ba80;text-align:center;padding:15px;color:#173f48;font-size:13px;font-weight:bold}#workTargets [data-drop="upgrade"]{top:235px}#workTargets [data-drop="repair"]{top:315px}#workTargets[data-kind="repair"] [data-drop="upgrade"],#workTargets[data-kind="upgrade"] [data-drop="repair"]{display:none}.work button{touch-action:none;user-select:none}.work button::before{content:'🪵 ';font-size:21px}.work button.dragging{position:relative;z-index:15;background:#e3c392;box-shadow:0 8px 15px #0003}#resources{margin:6px 0}#resources>div{padding:4px 2px}#resources b{font-size:17px}#workNote{margin:4px 0}#forecast{font-size:12px;line-height:1.6;text-align:center;margin:5px 0;min-height:20px}.hint{display:none}#paused{text-align:center;background:#f3f4f6;border-radius:10px;padding:8px;font-size:13px}.paused .horizon i,.paused .raft{animation-play-state:paused}.paused #routes{opacity:.3;pointer-events:none}#sea[data-effect] .raft{animation:haul .7s ease-out}#sea[data-effect="fast"] .horizon{animation:rush .8s ease-out}#sea[data-effect="repair"] .raft{filter:drop-shadow(0 0 12px #ffe7a3)}#sea[data-effect="rain"] .horizon{filter:brightness(1.3)}#sea[data-effect="upgrade"] #sail{fill:#fff;filter:drop-shadow(0 0 6px #fff)}
@keyframes tide{50%{translate:25px 10px}}@keyframes haul{30%{transform:translateY(6px) rotate(-3deg)}65%{transform:translateY(-3px) rotate(2deg)}}@keyframes rush{to{transform:translateY(45px)}}
@media(max-height:740px){#sea{height:390px}.raft{top:185px;width:200px;left:calc(50% - 100px)}#routes{top:64px}#routes button svg{width:74px;height:74px}#workTargets [data-drop="upgrade"]{top:210px}#workTargets [data-drop="repair"]{top:275px}.companion img{width:85px;height:85px}#gestureHint{bottom:87px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
#sea:has(.dragging) #gestureHint{background:linear-gradient(90deg,#27796e calc(var(--pull,0)*100%),#153f53bb 0)}
