@font-face {
  font-family: "Carved Spruce";
  src: url("assets/cabin-display.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --night: #111a30;
  --frost: #f9f4e3;
  --ember: #ffcb74;
  --cabin-font: "Carved Spruce", ui-monospace, monospace;
  --gutter: clamp(24px, 5.2vw, 104px);
  --top: max(25px, env(safe-area-inset-top));
  --bottom: max(22px, env(safe-area-inset-bottom));
  --cut: polygon(0 5px, 5px 5px, 5px 0, calc(100% - 5px) 0, calc(100% - 5px) 5px, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 5px calc(100% - 5px), 0 calc(100% - 5px));
  font-family: var(--cabin-font);
}
* { box-sizing: border-box; }
html { height: 100%; overflow-x: clip; overflow-y: auto; overscroll-behavior: none; scrollbar-width: thin; scrollbar-color: #8398a4 #17263b; }
body { margin: 0; min-height: 100%; background: var(--night); color: var(--frost); }
#journey-length { height: calc(100dvh + clamp(560px, 110dvh, 1180px)); pointer-events: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid #fff4ad; outline-offset: 5px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.sr-only, .world-action span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; }
button svg { width: 19px; height: 19px; flex: none; }
#world, #fallback, #interface, .edge-shade { position: fixed; inset: 0; }
#world { z-index: 1; touch-action: pan-y; }
body[data-explore="true"] #world { touch-action: none; }
#world canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .55s; }
body[data-render="world"] #world canvas { opacity: 1; }
#fallback { overflow: hidden; background: #19253d; }
#fallback > div { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity .65s, transform 1.3s cubic-bezier(.44,.02,.58,1); }
.fallback-outside { background-image: url("assets/forest-render.jpg"); transform-origin: 65% 54%; }
.fallback-inside { opacity: 0; background-image: url("assets/hearth-render.jpg"); }
body[data-place="inside"] .fallback-inside { opacity: 1; }
body[data-moving="true"][data-place="outside"] .fallback-outside { transform: scale(1.65); }
.edge-shade {
  z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,14,30,.35), rgba(9,17,34,.14) 24%, transparent 44%),
    linear-gradient(0deg, rgba(8,15,28,.57), transparent 13%, transparent 87%, rgba(6,12,24,.20));
}
body[data-place="inside"] .edge-shade {
  background: linear-gradient(90deg, rgba(24,12,12,.54), transparent 48%),
    linear-gradient(0deg, rgba(17,11,15,.74), transparent 16%, transparent 85%, rgba(17,11,15,.35));
}
#interface { z-index: 3; pointer-events: none; }
#interface button { pointer-events: auto; }
.masthead, .trail-bar { position: absolute; left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; align-items: center; }
.masthead { z-index: 3; top: var(--top); }
.brand { display: inline-flex; gap: 10px; align-items: center; user-select: none; }
.brand img { width: 44px; height: 44px; image-rendering: pixelated; filter: drop-shadow(2px 3px 0 #111725); }
.brand span { color: #fff8e9; font: 900 24px/1 var(--cabin-font); letter-spacing: .3px; text-shadow: 1px 2px #64656d, 2px 3px #20233a; }
.utility { display: flex; gap: 9px; }
.hud-button, .icon-only {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 43px; padding: 0 15px; border: 1px solid #c4d2ec52;
  border-bottom-color: #bacce76b; background: rgba(15,24,43,.74);
  color: #f5f4e8; font: 500 17px/1 var(--cabin-font);
  box-shadow: inset 0 1px #e6ecff13, 0 2px #0e152b69;
}
.hud-button:hover, .hud-button:focus-visible { background: #32425b; border-color: #f7e1ae; }
body[data-place="inside"] .hud-button { background: #302223d9; }
.title-review { position: relative; }
body[data-place="inside"] .title-review, body[data-moving="true"] .title-review { display: none; }
.title-options { position: absolute; z-index: 4; left: 0; top: calc(100% + 6px); min-width: 185px; padding: 5px;
  background: #152034f7; border: 1px solid #718498; box-shadow: 0 4px 0 #091120b3; }
.title-options button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  min-height: 36px; border: 0; padding: 5px 9px; color: #eaeaf0; background: transparent; font: 500 17px/1.15 var(--cabin-font); }
.title-options button:hover, .title-options button:focus-visible { background: #2e405b; }
.title-options button[aria-pressed="true"] { color: #ffe2a0; box-shadow: inset 2px 0 #ffd47f; background: #354351; }
.title-options i { width: 13px; height: 13px; flex: 0 0 13px; border: 1px solid #090f1d; box-shadow: inset 0 3px #dceaf2,inset -3px -3px #617486; background:#aebdc3; }
.title-options [data-title-style="spruce"] i { background:#795134; box-shadow: inset 0 3px #d4ae76,inset -3px -3px #533c2a; }
.title-options [data-title-style="lamps"] i { background:#ffd06d; box-shadow: inset 0 3px #9c5e40,inset -3px -3px #8c4a2d; }
.invitation {
  position: absolute; z-index: 2; left: var(--gutter); top: 46%; transform: translateY(-38%);
  width: min(38vw, 475px); opacity: 1; transition: opacity .22s;
}
body[data-render="world"][data-trail-sign="ready"] #outside-copy {
  left: var(--sign-x); top: var(--sign-y); bottom: auto; width: clamp(165px,var(--sign-width),480px);
  transform: translate(-50%,0); text-align: center;
}
body[data-render="world"][data-trail-sign="ready"] #outside-title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.invitation h1, .invitation h2 { margin: 0; }
.cabin-title { display: block; width: min(35vw, 459px); height: auto; filter: drop-shadow(0 5px 4px #0b13224a); }
.invitation p { margin: 5px auto 10px; color: #fff6e8; text-wrap: balance;
  font: 400 clamp(15px, 1.18vw, 20px)/1.32 var(--cabin-font);
  text-shadow: 0 2px 5px #0a1325, 1px 1px 1px #0a1325; }
.action {
  display: inline-flex; position: relative; align-items: center; justify-content: center; gap: 13px;
  min-height: 44px; min-width: 167px; padding: 0 15px 3px; border: 0; isolation: isolate;
  color: #352538; font: 650 19px/1 var(--cabin-font);
  background: linear-gradient(#fff0b8 0 6%, #ffd783 6% 49%, #face78 49% 84%, #daa658 84% 91%, #915b3c 91%);
  clip-path: var(--cut); box-shadow: inset 3px 0 #ffedac, inset -3px 0 #cf9952;
  transition: filter .15s, translate .15s;
}
.action svg { width: 22px; height: 22px; color: #624232; }
.action:hover { filter: brightness(1.1); translate: 0 -2px; }
.action:active { translate: 0 2px; }
.action:focus-visible { outline: none; background: #fff4c9; box-shadow: inset 0 0 0 4px #25628a, inset 0 0 0 7px #fff3bd; }
#notes h2 { font: 900 clamp(34px, 4.0vw, 60px)/1.07 var(--cabin-font); letter-spacing: .015em; text-transform: uppercase; }
body[data-moving="true"] .invitation { opacity: 0; translate: 0 6px; pointer-events: none; }
body[data-moving="true"] .invitation button { pointer-events: none !important; }
.trail-bar { bottom: var(--bottom); z-index: 3; color: #fcf3dc; }
.look-hint { display: flex; align-items: center; }
.look-hint { min-height: 44px; padding: 5px 0 5px 12px; border: 0; background: transparent; gap: 9px; color: #f5f4e7; font: 500 16px/1 var(--cabin-font); text-shadow: 0 1px 3px #0b1427; }
.look-hint:hover, .look-hint[aria-pressed="true"] { color: #ffe1a0; }
.shore-return, .finish-walk { margin-right: auto; padding-left: 0; }
.walk-hint { display:flex; align-items:center; gap:9px; font-size:15px; color:#f8ecd5; text-shadow:1px 2px 2px #121e30; }
.walk-hint::before { content:""; width:7px; height:9px; border:2px solid #f3d9a1; border-radius:3px; box-shadow:inset 0 2px #c38d51; }
.scene-objects { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.world-action {
  position:absolute; z-index:1; top:var(--pin-y); left:var(--pin-x); transform:translate(-50%,-50%);
  display:grid; place-items:center; width:42px; height:42px; padding:0; border:0; border-radius:0;
  background:transparent; color:#ffe7a4; font:400 15px/1.18 var(--cabin-font);
}
.world-action::before { content:""; width:6px; height:6px; transform:rotate(45deg); background:#ffe5a0; border:1px solid #4d3425; box-shadow:0 0 0 2px #fff3cb59,0 1px 6px #201e28; }
.world-action:hover::before,.world-action.pointed::before,.world-action:focus-visible::before { background:#fff6d8; box-shadow:0 0 0 2px #e9bd73,0 0 8px #fbc86b99; }
.world-action:hover,.world-action:focus-visible { z-index:4; }
body[data-moving="true"] .scene-objects,body[data-explore="true"] .scene-objects { visibility:hidden; }
[data-prop="skate"] { --pin-x:61%; --pin-y:62%; } [data-prop="tree"] { --pin-x:56%; --pin-y:42%; }
[data-prop="pet"] { --pin-x:57%; --pin-y:57%; } [data-prop="mug"] { --pin-x:43%; --pin-y:59%; }
[data-prop="clock"] { --pin-x:42%; --pin-y:32%; } [data-prop="train"] { --pin-x:51%; --pin-y:79%; }
[data-prop="coin"] { --pin-x:52%; --pin-y:25%; }
body[data-explore="true"] .invitation { opacity: 0; visibility: hidden; }
body[data-explore="true"] .edge-shade { opacity: .25; }
body[data-moving="true"] .look-hint { opacity: .45; }
.look-hint svg { width: 18px; height: 18px; }
.pet-cue { position: fixed; left: 62%; top: 40%; opacity: 0; pointer-events: none; }
.pet-cue svg { width: 22px; fill: #ff8790; color: #ff8790; filter: drop-shadow(2px 2px 0 #943e52); }
body[data-render="fallback"] .pet-cue.alive { animation: float-heart .9s ease-out; }
@keyframes float-heart { 0% { opacity: 1; transform: translateY(3px) scale(.7); } 25% { opacity: 1; transform: translateY(-8px) scale(1.1); } 100% { opacity: 0; transform: translateY(-43px); } }
#scene-hit { display: none; background: transparent; border: 0; position: absolute; z-index: 1; left: 49%; top: 25%; width: 36%; height: 43%; }
body[data-render="fallback"] #scene-hit { display: block; }
body[data-render="fallback"] #explore { visibility: hidden; }
#notes { width: min(450px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; margin: auto;
  padding: 22px 28px 28px; color: #382e38; background: #f5e7cc; color-scheme: light;
  border: 4px solid #644b44; outline: 2px solid #ddbd8d; box-shadow: 7px 8px 0 #201b2b9c, inset 0 0 0 2px #fff4df; }
#notes::backdrop { background: #0a1224c9; }
.note-top { display: flex; align-items: center; justify-content: space-between; }
.icon-only { padding: 8px; min-width: 42px; min-height: 42px; border: 0; background: transparent; color: #5a4543; box-shadow: none; }
.icon-only:hover { background: #e3cda9; }
#notes h2 { font-size: clamp(29px, 7vw, 41px); margin: 0; }
.note-character { display: grid; grid-template-columns: 85px 1fr; gap: 12px; }
.note-character img { width: 100%; height: auto; }
.note-character h3, #token-details h3 { font: 650 23px/1.15 var(--cabin-font); margin: 0 0 7px; }
#notes p { font: 400 17px/1.5 var(--cabin-font); margin: 0; }
#token-details { margin: 15px 0 18px; padding-bottom: 16px; border-bottom: 2px dotted #b5987c; }
.coin-fields { margin: 0; }
.coin-fields > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #c5aa86; }
.coin-fields dt, .coin-fields dd { margin: 0; font-size: 17px; line-height: 1.25; }
.coin-fields dt { color: #493328; }
.coin-fields dd { color: #755c49; white-space: nowrap; }
.coin-fields .has-address { display: block; }
.coin-fields .has-address dd { white-space: normal; }
.coin-fields a { color: #694633; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.address { margin: 7px 0; overflow-wrap: anywhere; display: block; font-family: var(--cabin-font); color: #56424b; }
.token-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.token-actions a, .copy-address { display: inline-block; font: 600 17px/1.25 var(--cabin-font); color: #694633; padding: 6px 0; }
.copy-address { border: 0; background: none; text-decoration: underline; }
.no-script { position: fixed; bottom: 15%; left: var(--gutter); z-index: 20; background: #152034; padding: 12px; }
@media (min-width: 1600px) { .cabin-title { width: min(33vw, 495px); } }
@media (max-width: 860px) and (min-aspect-ratio: 9/10) {
  :root { --gutter: 28px; }
  .invitation { width: 41vw; }
  .invitation p { font-size: 17px; }
}
@media (max-aspect-ratio: 9/10) {
  :root { --gutter: max(22px, 6vw); --top: max(17px, env(safe-area-inset-top)); --bottom: max(12px, env(safe-area-inset-bottom)); }
  .brand { gap: 6px; } .brand img { width: 37px; height: 37px; } .brand span { font-size: 19px; }
  .utility { gap: 7px; } .hud-button { min-width: 43px; padding: 0 10px; }
  #title-toggle span { display: none; }
  .title-options { left: auto; right: -48px; }
  .edge-shade, body[data-place="inside"] .edge-shade { background: linear-gradient(0deg, #0b1224bb 0%, #111a2ba1 18%, #12192a2a 36%, transparent 49%, transparent 89%, #10172a51); }
  .invitation { top: auto; bottom: max(78px, calc(env(safe-area-inset-bottom) + 67px)); transform: none; width: min(90%, 500px); }
  #outside-copy { bottom: max(66px, calc(env(safe-area-inset-bottom) + 60px)); }
  body:not([data-trail-sign="ready"]) #outside-copy { left:4.5%; top:21%; bottom:auto; width:min(51vw,285px); text-align:center; transform:none; }
  .cabin-title { width: clamp(180px, 51vw, 285px); }
  .invitation p { font-size: clamp(14px, 3.6vw, 19px); margin: 5px auto 8px; line-height: 1.3; }
  .action { min-height: 42px; min-width: 150px; padding: 0 11px 3px; gap:8px; font-size: 17px; }
  [data-prop="skate"] { --pin-x:41%; --pin-y:61%; } [data-prop="tree"] { --pin-x:35%; --pin-y:47%; }
  [data-prop="mug"] { --pin-x:28%; --pin-y:53%; } [data-prop="pet"] { --pin-x:47%; --pin-y:44%; }
  [data-prop="clock"] { --pin-x:22%; --pin-y:24%; } [data-prop="coin"] { --pin-x:45%; --pin-y:22%; }
  [data-prop="train"] { --pin-x:42%; --pin-y:68%; }
  .look-hint { font-size: 13px; gap: 4px; }
  .look-hint svg { width: 16px; height: 16px; }
  #scene-hit { left: 15%; top: 16%; width: 70%; height: 36%; }
  .fallback-outside { background-image: url("assets/forest-render-mobile.jpg"); transform-origin: 50% 40%; }
  .fallback-inside { background-image: url("assets/hearth-render-mobile.jpg"); }
  .pet-cue { left: 47%; top: 29%; }
}
@media (max-height: 560px) and (min-aspect-ratio: 9/10) {
  :root { --top: max(10px, env(safe-area-inset-top)); --bottom: max(5px, env(safe-area-inset-bottom)); --gutter: max(20px, 4vw); }
  .masthead .brand img { width: 34px; height: 34px; }
  .brand span { font-size: 24px; } .hud-button { min-height: 36px; }
  .cabin-title { width: min(37vw, 48vh); }
  .invitation { top: 52%; transform: translateY(-46%); }
  .invitation p { font-size: 16px; margin: 8px 0 11px; }
  .action { min-height: 42px; font-size: 19px; min-width: 157px; }
}
@media (max-width: 365px) {
  :root { --gutter: 14px; }
  .brand { gap: 4px; }
  .brand img { width: 31px; height: 31px; }
  .brand span { font-size: 16px; }
  .utility { gap: 4px; }
  .hud-button { min-width: 35px; padding: 0 6px; gap: 5px; }
  #sound span { display: none; }
  #notes { padding: 16px 18px 22px; }
  .coin-fields dt, .coin-fields dd { font-size: 15px; }
  .look-hint { font-size: 12px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .action:hover, .action:active { translate: none; }
  body[data-render="fallback"] .pet-cue.alive { animation: none; opacity: 1; }
}
