@font-face{font-family:Studio Pixel;src:url(assets/studio-pixel.ttf) format("truetype");font-display:swap}
:root{color-scheme:dark;--ink:#21141c;--deep:#160f19;--panel:#2b1b24;--line:#6f4440;--cream:#fff0d2;--dim:#d7b5a0;--gold:#ffbf68;--rust:#b95642;--mint:#9ce0c8;--pixel:"Studio Pixel",monospace;--serif:Georgia,serif;--safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px);--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px)}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;min-height:100dvh;background:radial-gradient(ellipse at 48% 13%,#492b30 0%,#251722 52%,#160f19 100%);color:var(--cream);font:16px/1.48 var(--serif);padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l)}
body:has(.expanded){overflow:hidden}
button,a{ -webkit-tap-highlight-color:transparent}
button{min-height:44px;min-width:44px;font:700 11px/1.24 var(--pixel);text-transform:uppercase;letter-spacing:.02em;color:var(--cream);border:1px solid var(--line);background:#352330;padding:7px 10px;cursor:pointer;touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--mint);outline-offset:2px;z-index:3}
button:active{background:#62403b}
button[disabled]{opacity:.58;cursor:default}
button.primary{background:var(--gold);color:#26171b;border-color:#f3a654;box-shadow:inset 0 -3px #be713f}
button.primary:active{background:#ffe0a2}
.masthead,.site-footer{width:min(100%,1000px);padding:0 13px;margin:auto;display:flex;justify-content:space-between;align-items:center;gap:14px}
.masthead{height:46px;border-bottom:1px solid #573537}
.imprint{display:inline-flex;gap:8px;align-items:center;min-height:44px;color:var(--gold);font:12px var(--pixel);text-decoration:none}
.imprint svg{width:16px;height:16px;fill:currentColor}
.mastnote,.site-footer{font:italic 13px var(--serif);color:var(--dim)}
.site-footer{min-height:43px;padding-block:8px}
main{width:min(100%,1000px);margin:auto;padding:8px 8px 0}
.cabinet{position:relative;isolation:isolate;border:1px solid #986045;background:var(--ink);box-shadow:0 6px 0 #100b11,0 15px 44px #100b12a0}
.cabinet.expanded,.cabinet:fullscreen{position:fixed;inset:0;z-index:10;display:grid;align-items:center;background:#1c121b;width:100%;height:100%;height:100dvh;overflow:auto;overscroll-behavior:contain;border:0;padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l)}
.cabinet.expanded #screens{width:min(100%,1000px);margin:auto}
#screens{min-width:0}
.title{display:grid;background:var(--ink)}
.title-art,.vista{overflow:hidden;position:relative;isolation:isolate;background:#4e2a39}
.title-art{min-height:198px;border-bottom:1px solid #965f45}
.title-art canvas,.vista canvas{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated}
.art-label{position:absolute;z-index:1;bottom:8px;left:9px;padding:4px 7px;background:#241521e8;color:#f6ce9f;font:9px/1.2 var(--pixel);letter-spacing:.1em}
.title-info{display:grid;align-content:center;gap:9px;padding:14px 15px 12px;background:linear-gradient(118deg,#36232d,#231620 78%);min-width:0}
.eyebrow,.legend,.notice,.kicker,.summary-label{font:10px/1.35 var(--pixel);text-transform:uppercase;letter-spacing:.09em;color:var(--gold)}
h1,h2,h3,p{margin:0}
h1{font:700 clamp(28px,9.2vw,58px)/.96 var(--pixel);letter-spacing:-.047em;color:var(--cream);text-shadow:0 3px #b7583e;overflow-wrap:anywhere}
h1 span{display:block;color:var(--gold);text-shadow:0 3px #7e412f}
.tagline{font:italic clamp(16px,4.75vw,22px)/1.25 var(--serif);color:#ffdcbc}
.title-copy{font-size:14px;line-height:1.35;color:var(--dim);max-width:41ch}
.title-buttons{display:grid;gap:5px}
.title-tools,.play-tools{display:grid;gap:4px;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
.title-tools button{padding-inline:3px}
.brand{font:italic 12px/1.25 var(--serif);color:var(--dim)}
.saver{border:1px solid #a66d40;color:#ffd99a;padding:6px 9px;background:#392620;font:13px/1.3 var(--serif)}
.field{display:grid;grid-template-areas:"hud" "vista" "atlas" "tools";gap:5px;padding:6px}
.hud{grid-area:hud;display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:44px;border:1px solid #623a3c;padding:4px 8px;background:#34232c}
.hud h2{font:700 clamp(12px,4.1vw,18px)/1.14 var(--pixel);color:var(--cream)}
.hud .kicker{font-size:8px}
.weather-tag{text-align:right;font:11px/1.18 var(--pixel);white-space:nowrap;color:var(--gold)}
.weather-tag small{display:block;color:var(--dim);font:11px var(--serif);margin-top:3px}
.vista{grid-area:vista;min-height:112px;border:1px solid #84543e}
.vista-caption{position:absolute;bottom:0;left:0;right:0;padding:5px 8px;color:#fff2d9;background:#221622e8;font:14px/1.15 var(--serif);min-height:26px}
.atlas{grid-area:atlas;min-width:0;border:1px solid #70473e;background:#1f1721;padding:3px}
.map{position:relative;display:grid;grid-template-columns:repeat(5,minmax(44px,1fr));grid-template-rows:repeat(4,minmax(44px,1fr));min-height:176px}
.map-links{pointer-events:none;position:absolute;inset:0;width:100%;height:100%}
.map-links line{stroke:#654644;stroke-width:4;vector-effect:non-scaling-stroke}
.map-links .locked{stroke:#b7765a;stroke-width:2;stroke-dasharray:3 5}
.map-links .open{stroke:#f9b565}
.map-links .seen{stroke:#a46d54}
.map-cell{position:relative;padding:0;background:transparent;border:0;display:grid;place-items:center;touch-action:manipulation}
.map-cell:active{background:#a86a543a}
.map-icon{display:grid;place-items:center;width:30px;height:30px;background:#382c38;border:1px solid #76524f;color:#e2bda7}
.map-icon svg{width:18px;height:18px;fill:currentColor}
.map-cell.reachable .map-icon{background:#593831;color:#ffdf9d;border-color:#f8b462}
.map-cell.current .map-icon{color:#291d21;background:var(--gold);border:2px solid #fff0c6;box-shadow:0 0 0 2px #925a42}
.map-cell.blocked .map-icon{border-style:dashed;color:#c59a87}
.map-cell .found-mark{position:absolute;top:5px;right:calc(50% - 20px);height:7px;width:7px;background:var(--mint);border:1px solid #191721}
.map-cell .new-mark{position:absolute;top:4px;right:calc(50% - 23px);height:9px;width:9px;background:#f7da8f;border:2px solid #191721}
.map-cell .stone-mark{position:absolute;bottom:5px;left:calc(50% - 19px);height:6px;width:6px;background:#b2dace;border:1px solid #191721;transform:rotate(45deg)}
.legend{padding:4px 6px;color:#d4a88e;letter-spacing:.025em;font-size:8px}
.play-tools{grid-area:tools}
.play-tools button{padding-inline:1px;font-size:10px}
.play-tools button[data-action="look"]{border-color:#ad744d;background:#4c302d;color:#ffe0a6}
#veil:not([hidden]){position:absolute;inset:0;z-index:5;background:#160e19b8;display:grid;grid-template: minmax(0,1fr) / minmax(0,1fr);place-items:center;padding:7px}
.cabinet.expanded #veil:not([hidden]){position:fixed;padding:calc(var(--safe-t) + 7px) calc(var(--safe-r) + 7px) calc(var(--safe-b) + 7px) calc(var(--safe-l) + 7px)}
.sheet{width:min(100%,480px);min-width:0;min-height:0;max-height:min(100%,calc(100dvh - var(--safe-t) - var(--safe-b) - 60px));display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:#291b26;border:1px solid #c38559;box-shadow:0 5px 0 #140c16,0 0 0 3px #201522;color:var(--cream)}
.cabinet.expanded .sheet{max-height:min(100%,calc(100dvh - var(--safe-t) - var(--safe-b) - 14px))}
.sheet-heading{display:flex;justify-content:space-between;align-items:center;gap:6px;padding:6px 7px 6px 11px;border-bottom:1px solid #795047;background:#38252c}
.sheet-heading h2{font:700 clamp(14px,4.5vw,21px)/1.13 var(--pixel);color:var(--gold)}
.sheet-heading button{padding-inline:7px}
.sheet-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:10px 11px;display:grid;align-content:start;gap:8px;touch-action:pan-y}
.sheet-body p{color:#f5ddcb;font-size:15px;line-height:1.38}
.sheet-body .detail{color:var(--dim);font-size:13px}
.sheet-body .hint{border-left:3px solid #d59659;padding:6px 9px;background:#36252f}
.sheet-body .choices,.sheet-body .entry-list{display:grid;gap:5px}
.sheet-body .choices button{text-align:left}
.sheet-body .choices button small{display:block;margin-top:4px;text-transform:none;font:13px var(--serif);color:var(--dim)}
.sheet-body .choices button.primary small{color:#422725}
.sheet-foot{display:grid;gap:4px;padding:6px;border-top:1px solid #694541;background:#32222b}
.sheet-foot:has(button:nth-child(2)){grid-template-columns:repeat(2,minmax(0,1fr))}
.sheet-foot:empty{display:none}
.sheet-foot button{padding-inline:4px}
.entry{padding:7px 8px;border:1px solid #64443f;background:#30212c;display:grid;gap:3px}
.entry h3{font:700 12px/1.3 var(--pixel);color:#f6cb94}
.sprite-wrap{display:grid;grid-template-columns:68px 1fr;align-items:center;gap:10px}
.sprite{width:66px;height:66px;background-image:url(assets/creatures.png);background-size:300% 200%;image-rendering:pixelated;animation:bob 1.6s steps(2,end) infinite}
[data-gentle="true"] .sprite{animation-duration:4s}
@keyframes bob{50%{transform:translateY(-3px)}}
.setting{display:grid;gap:5px}
.setting input{height:44px;width:100%;accent-color:var(--gold)}
.setting span{font:11px var(--pixel);color:var(--dim)}
.end-head{display:grid;gap:5px}
.badge{color:var(--mint);font:11px var(--pixel);text-transform:uppercase}
body[data-phase="field"] .site-footer{display:none}
@media (max-width:510px){
  .mastnote{display:none}
  .site-footer{font-size:11px;gap:5px}
}
@media (max-width:719px) and (min-height:720px){
  .field{min-height:min(640px,calc(100dvh - var(--safe-t) - var(--safe-b) - 65px));grid-template-rows:auto minmax(112px,1fr) auto auto}
  .map{grid-template-rows:repeat(4,minmax(50px,1fr))}
  .title-art{min-height:245px}
}
@media (min-width:720px) and (min-height:451px){
  main{padding-top:16px}
  .title{grid-template-columns:minmax(0,1.53fr) minmax(310px,1fr);min-height:480px}
  .title-art{border-bottom:0;border-right:1px solid #965f45}
  .title-info{padding:23px;gap:13px}
  .field{grid-template-areas:"hud hud" "vista atlas" "tools tools";grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);padding:8px;gap:6px}
  .vista{min-height:320px}
  .map{height:calc(100% - 19px)}
}
@media (min-width:460px) and (max-height:450px){
  .masthead,.site-footer{display:none}
  main{padding-top:4px}
  .title{grid-template-columns:minmax(0,1.25fr) minmax(244px,1fr)}
  .title-art{border:0;border-right:1px solid #965f45;min-height:0}
  .title-info{gap:5px;padding:8px 10px}
  .title-info h1{font-size:clamp(26px,5.4vw,37px)}
  .title-buttons:has(button:nth-child(2)){grid-template-columns:minmax(0,1.23fr) minmax(0,1fr)}
  .title-copy{display:none}
  .tagline{font-size:15px}
  .field{grid-template-areas:"hud atlas" "vista atlas" "tools tools";grid-template-columns:minmax(0,1fr) minmax(235px,1fr);gap:4px;padding:4px}
  .hud{min-height:44px}
  .hud h2{font-size:14px}
  .vista{min-height:140px}
  .map{height:176px}
  .legend{font-size:8px}
  .sheet{max-height:calc(100dvh - var(--safe-t) - var(--safe-b) - 16px)}
}
@media (max-width:359px) and (max-height:600px){
  .masthead{height:44px}
  main{padding-top:4px}
  .title-art{min-height:150px}
  .title-info{gap:6px;padding:10px}
  .field{gap:4px;padding:4px}
  .vista{min-height:96px}
}
@media (max-width:459px) and (max-height:540px){
  body[data-phase="field"] .masthead{display:none}
  body[data-phase="field"] main{padding-top:3px}
  .vista{min-height:89px}
}
@media (max-width:459px) and (max-height:430px){
  .vista{min-height:66px}
  .title-art{min-height:110px}
  .title-info{gap:5px;padding:8px}
  .title-copy{display:none}
}
@media (min-width:370px) and (max-width:459px) and (max-height:455px){
  .masthead,.site-footer{display:none}
  main{padding-top:3px}
  .title{grid-template-columns:minmax(0,1fr) minmax(215px,1.7fr)}
  .title-info h1{font-size:26px}
  .title-buttons:has(button:nth-child(2)){grid-template-columns:minmax(0,1.23fr) minmax(0,1fr)}
  .title-art{border:0;border-right:1px solid #965f45}
  .field{grid-template-areas:"hud atlas" "vista atlas" "tools tools";grid-template-columns:minmax(0,1fr) minmax(226px,1.7fr)}
  .hud{display:grid;gap:3px}
  .weather-tag{text-align:left}
  .weather-tag small{display:inline;margin-left:4px;font-size:9px}
}
