*{box-sizing:border-box}
:root{--ink:#173d33;--deep:#102f28;--paper:#fff2d5;--gold:#f1bd64;--line:#bcb297;--body:"Trebuchet MS",Arial,sans-serif;--display:Georgia,"Times New Roman",serif}
body{margin:0;background:var(--deep);color:var(--ink);font-family:var(--body)}
[hidden]{display:none!important}
.map[data-location=forest],.map[data-location=crown]{background-image:url("../data/forest.webp")}
.map[data-location=crown]{background-size:140% 130%;background-position:50% 10%}
.map[data-location=inside]{background-image:url("../data/rooms.webp")}
.map .target.wildlife{transform:translate(-50%,-88%)}
.directions #dot-guide{font-weight:bold;display:flex;gap:10px;flex-wrap:wrap;margin-top:4px;font-size:12px}
#dot-guide span::before{content:"";display:inline-block;width:8px;height:8px;border:1px solid #504b3e;border-radius:50%;margin-right:3px;background:#ba4231}
#dot-guide span:nth-child(2)::before{background:#438259}#dot-guide span:nth-child(3)::before{background:#eabd4c}
#play-two{margin:4px;background:#f9e5b9}
#replay-one{min-height:44px;background:transparent;color:#325247;border:1px solid #a29b80;border-radius:6px;padding:7px 12px}
@media(max-width:480px){.directions #dot-guide{gap:3px 7px;font-size:10px}#play-two,#play{padding:10px 14px}#play-two b,#play b{margin-left:4px}}
button{font:inherit;cursor:pointer;color:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button:focus-visible{outline:3px solid #fff3ab;outline-offset:3px;box-shadow:0 0 0 6px #1e564b}
button:disabled{opacity:.55;cursor:default}
#cover{position:relative;isolation:isolate;min-height:100svh;display:grid;color:var(--paper);background:#183f33}
.cover-art{position:absolute;inset:0;z-index:-2;background:url("../data/island-cover.webp") center 64%/cover no-repeat}
#cover:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgba(8,34,27,.91) 0%,rgba(8,34,27,.77) 21%,rgba(8,34,27,.22) 47%,transparent 67%)}
.cover-inner{position:relative;min-height:min(100svh,1200px);padding:clamp(24px,5vh,60px) clamp(24px,6vw,110px);display:flex;flex-direction:column;align-items:flex-start}
.byline,.brand{display:flex;align-items:center;gap:12px}.byline{font:italic clamp(17px,1.6vw,24px) var(--display);text-shadow:0 1px 3px #173325}
.cover-copy{margin:auto 0;padding:35px 0 70px}.kicker,.pack-name{text-transform:uppercase;letter-spacing:.16em;font-size:12px;font-weight:bold}
.kicker{display:flex;align-items:center;gap:12px;color:#f4d799;margin:0 0 17px}.kicker span{height:2px;background:currentColor;width:32px}
h1{font-family:var(--display);font-weight:700;font-size:clamp(62px,min(9.7vw,15vh),160px);line-height:.86;letter-spacing:-.066em;margin:0 0 clamp(26px,5vh,55px);text-shadow:0 3px 12px #122f244d}
h1 small{display:block;font:italic .36em/1.5 var(--display);letter-spacing:-.03em}
.gold{border:1px solid #674620;border-bottom-width:3px;border-radius:7px;background:var(--gold);font-weight:800;padding:13px 22px;min-height:48px;color:#21372b}
.gold:hover{background:#ffce7e}.gold b{margin-left:22px;font-size:1.2em}
.cover-calm,.tools button{background:#173e35d9;color:var(--paper);border:1px solid #9bb8a871;border-radius:6px;min-height:44px;padding:6px 13px;font-size:14px}
[data-calm][aria-pressed=true]{border-color:var(--gold);color:var(--gold)}
#game{min-height:100svh;background:radial-gradient(ellipse at 50% 40%,#2d564a,#122f29 85%);padding:0 clamp(10px,4vw,70px) 12px}
.mast,.board{max-width:1300px;margin:auto}.mast{height:clamp(55px,8vh,82px);display:flex;align-items:center;justify-content:space-between;color:#f5e6c0}
.brand b{font:600 clamp(18px,2.1vw,29px) var(--display);letter-spacing:-.035em}.tools{display:flex;gap:7px}
.board{overflow:hidden;border:1px solid #a69269;border-radius:12px;background:#f8edce;box-shadow:0 12px 40px #0a211d77}
.guide{display:flex;align-items:center;gap:clamp(10px,2vw,28px);min-height:74px;padding:10px clamp(12px,2.5vw,38px);background:#fbf1d9;border-bottom:2px solid #a79772}
.day{display:flex;align-items:center;gap:9px;white-space:nowrap;font:italic 18px var(--display);padding-right:22px;border-right:1px solid #c3b99e}.day canvas,.resources canvas,.brand canvas,.byline canvas{flex:none}
.directions{flex:1;min-width:0}.directions h2{font:700 clamp(21px,2.1vw,34px)/1.04 var(--display);margin:0 0 4px;letter-spacing:-.035em}.directions p{margin:0;font-size:clamp(13px,1.25vw,18px);line-height:1.25;color:#3c5747}
.guide.warn{background:#ffe4c1}.warn .directions p{color:#8b351b;font-weight:bold}#counter{min-width:58px;padding:7px 12px;border:1px solid #b0a078;border-radius:18px;white-space:pre-line;text-align:center;font-weight:bold;font-size:15px}
.map{position:relative;width:100%;height:clamp(275px,calc(100svh - 240px),720px);overflow:hidden;background:#dec28b url("../data/shore.webp") center/100% 100% no-repeat;isolation:isolate;touch-action:manipulation}
#scene,#targets{position:absolute;inset:0;width:100%;height:100%}#targets{pointer-events:none}
.target{position:absolute;transform:translate(-50%,-76%);border:0;background:transparent;pointer-events:auto;border-radius:40%;min-width:44px;min-height:44px;touch-action:manipulation}
.target:hover,.target:focus-visible{background:#fff3bd30;outline:2px dashed #755226}.target:active{background:#fff3bd60}
.target .label{position:absolute;left:50%;bottom:0;transform:translate(-50%,55%);background:#16382eee;color:#fff2d5;border:1px solid #ffdf9f;border-radius:16px;font-weight:bold;font-size:clamp(11px,1.05vw,15px);line-height:1.1;padding:4px 9px;white-space:nowrap}
.target.tree .label{padding:2px 6px}.target.fish{transform:translate(-50%,-50%)}
.pack{min-height:71px;padding:9px clamp(12px,2.5vw,36px);display:flex;align-items:center;gap:14px;justify-content:space-between;border-top:2px solid #a79772}
.resources,.resources>span{display:flex;align-items:center}.resources{gap:15px;flex-wrap:wrap}.resources>span{gap:5px;font-size:15px}.resources .pack-name{font-size:10px;color:#536554}.resources strong{font-size:18px}#note{color:#425e4f;font-size:14px}#note:empty{display:none}
#gesture,.dialog{padding:18px 24px;border:2px solid #a58b61;box-shadow:0 8px 25px #163b3060;border-radius:13px;background:#f8edce;text-align:center}
#gesture{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-height:100%;max-width:95%}
#gesture h3{font:700 24px var(--display);margin:0}#stick-pad{height:clamp(82px,17vh,135px);touch-action:none;cursor:ns-resize}
#stick-pad canvas{width:100%;height:100%;object-fit:contain}.arrows{display:flex;gap:8px;justify-content:center}
.arrows button{background:#234f41;color:#fff1cf;border:0;border-radius:6px;min-height:44px;padding:6px 14px;font-weight:bold}
#modal{position:fixed;inset:0;background:#0a2b25b8;display:grid;place-items:center;z-index:3}.dialog{min-width:235px}.dialog h2{font:700 36px var(--display);margin:8px 0 24px}
@media(max-height:400px) and (min-aspect-ratio:1.4){#gesture{padding:4px 12px}#gesture h3{font-size:18px}#stick-pad{height:62px}}
@media(max-width:660px){.cover-art{background-position:86% center}#cover:before{background:linear-gradient(0deg,#0c3029f5 0%,#143d30aa 33%,transparent 70%),linear-gradient(95deg,#0c302988,transparent 60%)}.cover-inner{padding:20px;min-height:100svh}.cover-copy{margin:auto 0 0;padding:30px 0 18px}h1{font-size:clamp(64px,13vw,88px);margin-bottom:20px}.cover-calm{position:absolute;right:16px;top:20px}
#game{padding:0 6px 8px}.mast{height:55px}.brand{gap:4px}.brand canvas{width:28px;height:28px}.brand b{font-size:19px}.tools button{padding:5px 8px;font-size:12px}.guide{min-height:89px;padding:8px;gap:8px}.day{flex-direction:column;gap:0;font-size:13px;padding-right:8px}.day canvas{width:26px;height:26px}.directions h2{font-size:23px}#counter{padding:5px;min-width:38px;font-size:12px}.map{height:clamp(260px,54svh,570px)}.pack{flex-wrap:wrap;gap:6px;min-height:62px;padding:6px 10px}.pack-name{display:none!important}.resources{gap:8px}.resources>span{font-size:13px}.resources canvas{width:22px;height:21px}#action{padding:8px 12px;font-size:14px}#note{font-size:12px}.target .label{font-size:11px}}
@media(max-width:380px){.byline{font-size:16px;gap:6px}.byline canvas{width:29px;height:29px}.cover-calm{right:10px;padding:5px 8px;font-size:12px}}
@media(max-height:480px) and (min-aspect-ratio:1.4){.mast{height:44px}.tools button{min-height:35px}.guide{min-height:52px;padding:4px 12px}.map{height:calc(100svh - 156px);min-height:172px}.pack{min-height:45px;padding:2px 12px}.pack .gold{min-height:39px;padding:5px 13px}.cover-inner{padding:12px 5vw}.cover-copy{padding:10px 0}.cover-calm{position:absolute;right:15px;top:10px}h1{font-size:53px;margin-bottom:10px}.kicker{margin-bottom:0}}
.map[data-location=lair]{background:#34363a}
.map[data-location=window]{background-image:url("../data/forest.webp");background-size:cover}
.cover-sound{position:absolute;right:clamp(24px,5vw,80px);bottom:clamp(24px,5vh,60px);z-index:1;background:#173e35f3;border:1px solid #9bb8a8;border-radius:7px}
.cover-sound summary{padding:12px 16px;cursor:pointer}
[data-sound-settings]{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:8px 12px}
[data-sound-settings] button{border:1px solid #958561;border-radius:6px;padding:6px 10px;min-height:44px;color:#173d33;background:#f8edce}
[data-sound-settings] label{display:flex;align-items:center;gap:6px;font-size:14px}
[data-sound-settings] input{width:85px;min-height:36px;accent-color:#527768}
.dialog [data-sound-settings]{margin-bottom:16px}
#play-three{background:#f4d69c}
#play-four{background:#cce0bd}
.map[data-location=island]{background-image:url("../data/whole-island.webp")}
.map .shore-stop{width:auto!important;height:48px!important;min-width:72px;background:transparent;transform:translate(-50%,-50%)}
.shore-stop .label{bottom:50%;transform:translate(-50%,50%);padding:7px 11px}
.shore-stop.shore-0{transform:translate(-20%,-50%)}
.shore-stop.shore-2{transform:translate(-80%,-50%)}
#island-pack{column-gap:18px;row-gap:4px}
#island-pack span:empty{display:none}
#rescue-pack{gap:clamp(8px,1.4vw,20px)}
@media(max-width:660px){
  .map[data-location=island]{height:clamp(250px,min(95vw,52svh),450px)}
  #island-pack{column-gap:10px}
  .cover-sound{left:auto;right:16px;bottom:auto;top:72px}
  .cover-copy .gold{padding:9px 12px;margin:2px 0;font-size:14px}
  .cover-copy .gold b{margin-left:4px}
  .cover-sound[open]{max-width:calc(100% - 32px)}
}
