:root {
  --cream: #fff9e8; --cream2: #f7ecd0; --ink: #6b4f30; --ink2: #8d6e4b; --brown: #7a5a3a; --green: #6fbe5a; --leaf: #8ccf63;
  --sky: #7fb8f2; --tag: #f3a83b; --shadow: 0 4px 0 rgba(90, 60, 30, 0.18), 0 10px 24px rgba(40, 30, 10, 0.18);
  --font: 'M PLUS Rounded 1c', 'Nunito', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #7fb8f2; font-family: var(--font); color: var(--ink); -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; }
button { font: inherit; color: inherit; }
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#ui > * { pointer-events: auto; }

/* ---------- loading: a leaf turning in the corner, like the game */
#loader { position: fixed; inset: 0; z-index: 50; background: #1d1a17; transition: opacity .5s; }
#loader.done { opacity: 0; pointer-events: none; }
#loader .leaf { position: absolute; right: 34px; bottom: 34px; width: 40px; height: 40px; border-radius: 0 60% 0 60%; background: linear-gradient(135deg, #a7e07d, #4fa64a);
  animation: leaf 1.1s ease-in-out infinite; box-shadow: inset -3px -3px 0 rgba(0,0,0,.12); }
#loader .leaf::after { content: ''; position: absolute; left: 50%; top: 50%; width: 70%; height: 3px; background: rgba(255,255,255,.6); transform: translate(-50%,-50%) rotate(-45deg); border-radius: 2px; }
#loader .bar { position: absolute; right: 90px; bottom: 52px; width: 120px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
#loader .bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: #a7e07d; transition: width .2s; }
@keyframes leaf { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.9); } 100% { transform: rotate(360deg) scale(1); } }

#fade { position: fixed; inset: 0; z-index: 40; background: #0e0c0a; opacity: 0; pointer-events: none; transition: opacity .32s ease; }
#fade.on { opacity: 1; pointer-events: auto; }

/* ---------- title */
#title { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.05), rgba(30, 40, 60, 0.25)); transition: opacity .6s; cursor: pointer; padding-bottom: 6vh; }
#title.gone { opacity: 0; pointer-events: none; }
.logo { position: relative; display: flex; flex-direction: column; align-items: center; line-height: .86; font-family: 'Fredoka', var(--font); font-weight: 700;
  padding: 3.2vh 5vw 4vh; filter: drop-shadow(0 6px 0 rgba(70, 45, 20, .28)); }
.logo::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 40% 35%, #bfe98a, #78c255 70%); border-radius: 46% 54% 50% 50% / 58% 52% 48% 42%;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.08), 0 0 0 7px #fff9e8, 0 0 0 12px #7a5a3a; transform: rotate(-2deg); }
.logo-row { display: flex; }
.logo i { font-style: normal; font-size: clamp(54px, 10.5vw, 132px); color: #fffdf3; -webkit-text-stroke: clamp(6px, 1.1vw, 13px) #7a5a3a; paint-order: stroke fill;
  display: inline-block; transform: rotate(var(--r, 0deg)) translateY(var(--y, 0)); animation: bob 2.6s ease-in-out infinite; animation-delay: var(--d, 0s); letter-spacing: -.01em; }
.logo-row:last-child i { font-size: clamp(44px, 8.2vw, 104px); }
.logo i:nth-child(1) { --r: -6deg; --d: 0s; } .logo i:nth-child(2) { --r: 4deg; --d: .15s; } .logo i:nth-child(3) { --r: -3deg; --d: .3s; } .logo i:nth-child(4) { --r: 7deg; --d: .45s; }
.logo i:nth-child(5) { --r: -5deg; --d: .6s; } .logo i:nth-child(6) { --r: 3deg; --d: .75s; } .logo i:nth-child(7) { --r: -4deg; --d: .9s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.start { pointer-events: auto; border: 0; background: var(--cream); color: var(--brown); font-weight: 800; font-size: clamp(18px, 2.2vw, 24px); padding: .55em 1.8em .6em; border-radius: 999px;
  box-shadow: var(--shadow); cursor: pointer; animation: pulse 1.6s ease-in-out infinite; letter-spacing: .04em; }
.start::before { content: '▶'; font-size: .7em; margin-right: .6em; vertical-align: .12em; color: #f06a4f; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ---------- HUD */
.hud-clock { position: fixed; left: max(18px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); color: #fff; text-shadow: 0 2px 0 rgba(60,40,20,.35), 0 0 12px rgba(0,0,0,.18);
  display: grid; grid-template-columns: auto auto; align-items: end; column-gap: 6px; opacity: 0; transition: opacity .5s; pointer-events: none !important; }
body.playing .hud-clock { opacity: 1; }
.hc-time { font-size: clamp(34px, 4.4vw, 54px); font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.hc-ampm { font-size: clamp(14px, 1.5vw, 19px); font-weight: 800; padding-bottom: .35em; }
.hc-date { grid-column: 1 / -1; font-size: clamp(13px, 1.3vw, 17px); font-weight: 700; margin-top: 2px; }
.hud-btns { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; gap: 10px; opacity: 0; transition: opacity .5s; z-index: 6; }
body.playing .hud-btns { opacity: 1; }
.hud-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--cream); color: var(--brown); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; padding: 0; }
.hud-btn svg { width: 30px; height: 30px; }
.hud-btn:hover { transform: translateY(-2px); }
.hud-btn:focus-visible, .start:focus-visible, .house-sign:focus-visible { outline: 3px solid #f06a4f; outline-offset: 3px; }

/* ---------- talking */
.talk { position: fixed; left: 50%; bottom: max(26px, calc(env(safe-area-inset-bottom) + 18px)); transform: translateX(-50%); width: min(760px, calc(100vw - 32px)); min-height: 128px;
  background: var(--cream); border-radius: 46px 52px 48px 50px / 50px 46px 54px 48px; padding: 34px 44px 30px; box-shadow: 0 6px 0 rgba(120, 90, 50, .16), 0 16px 40px rgba(40,30,10,.22);
  z-index: 30; cursor: pointer; animation: talkin .22s cubic-bezier(.3,1.6,.6,1); }
.talk.out { animation: talkout .18s ease-in forwards; }
@keyframes talkin { from { transform: translateX(-50%) scale(.85); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes talkout { to { transform: translateX(-50%) scale(.9); opacity: 0; } }
.talk-tag { position: absolute; left: 30px; top: -20px; background: var(--tag); color: #fff; font-weight: 800; font-size: 17px; padding: 6px 20px 7px; border-radius: 999px; transform: rotate(-4deg);
  box-shadow: 0 3px 0 rgba(0,0,0,.12); text-shadow: 0 1px 0 rgba(0,0,0,.15); max-width: calc(100% - 60px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk-text { margin: 0; font-size: clamp(18px, 2.2vw, 23px); line-height: 1.55; font-weight: 700; color: var(--ink); min-height: 1.55em; }
.talk.whisper .talk-text { font-weight: 500; font-style: italic; color: var(--ink2); }
.talk-next { position: absolute; right: 38px; bottom: 18px; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 13px solid #f0a33a; opacity: 0; }
.talk.done .talk-next { opacity: 1; animation: nudge .8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }
.head-bubble { position: fixed; left: 0; top: 0; z-index: 8; background: var(--cream); color: var(--ink); font-weight: 800; font-size: 15px; line-height: 1.35; padding: 8px 14px 9px; border-radius: 18px;
  max-width: 240px; width: max-content; box-shadow: 0 3px 0 rgba(120, 90, 50, .16), 0 8px 18px rgba(0,0,0,.16); opacity: 0; transition: opacity .2s; pointer-events: none !important; text-align: center; }
.head-bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: var(--cream); }
.head-bubble.on { opacity: 1; }
.head-bubble.whisper { font-style: italic; font-weight: 600; color: var(--ink2); }
.head-bubble.bang { background: #fff; color: #f06a4f; font-size: 24px; font-weight: 900; padding: 2px 13px 4px; border-radius: 50%; animation: bang .35s cubic-bezier(.3,1.8,.6,1); }
@keyframes bang { from { transform: scale(.2); } }

/* ---------- the house sign over the nearest door */
.house-sign { position: fixed; left: 0; top: 0; z-index: 7; border: 0; cursor: pointer; background: #fff9e8; color: var(--brown); padding: 7px 16px 8px; border-radius: 14px;
  box-shadow: 0 3px 0 rgba(120,90,50,.2), 0 8px 18px rgba(0,0,0,.14); display: flex; flex-direction: column; align-items: center; line-height: 1.15; white-space: nowrap; transition: opacity .15s; }
.house-sign b { font-size: 16px; font-weight: 800; }
.house-sign small { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: #a5865f; margin-top: 2px; }
.house-sign::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fff9e8; }
body.in-house .house-sign, body.in-house .head-bubble { display: none; }

/* ---------- inside a house */
.room { position: fixed; inset: 0; z-index: 25; background: #17130f; display: grid; grid-template-columns: 1fr; overflow: hidden; }
.room[hidden] { display: none; }
.room-stage { position: relative; display: grid; place-items: center; overflow: hidden; padding: 12px; }
.room-box { position: relative; }
.room-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 4px; }
.room-spots { position: absolute; inset: 0; width: 100%; height: 100%; }
.spot { fill: rgba(255,255,255,0); stroke: rgba(255, 250, 220, 0); stroke-width: .004; cursor: pointer; transition: fill .15s, stroke .15s; vector-effect: non-scaling-stroke; outline: none; }
.spot:hover, .spot:focus-visible { fill: rgba(255, 248, 210, .16); stroke: rgba(255, 246, 200, .95); stroke-width: 3px; }
.spot-look:hover, .spot-look:focus-visible { fill: rgba(255, 248, 210, .08); }
.room-exit { position: absolute; left: 50%; bottom: 0; width: 13%; height: 11%; transform: translateX(-50%); border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.room-exit span { width: 22px; height: 22px; border-right: 4px solid rgba(255,245,215,.75); border-bottom: 4px solid rgba(255,245,215,.75); transform: rotate(45deg) translate(-4px, -4px); border-radius: 2px; animation: nudge 1.2s ease-in-out infinite; }
.room-exit:hover span, .room-exit:focus-visible span { border-color: #fff; }
.room-notes { position: absolute; inset: 0; pointer-events: none; }
.note { position: absolute; font-style: normal; font-size: 26px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); animation: note 2.1s ease-out infinite; opacity: 0; }
@keyframes note { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(-20%, -70px) scale(1.1) rotate(12deg); opacity: 0; } }

.letter { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 94vw); z-index: 30; overflow-y: auto; background: rgba(30, 24, 20, .94); padding: 22px 20px 30px 10px; outline: none; scrollbar-width: thin; scrollbar-color: #6b5a48 transparent; box-shadow: -20px 0 40px rgba(0,0,0,.35); animation: slidein .25s cubic-bezier(.2,.9,.3,1); overscroll-behavior: contain; touch-action: pan-y; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.letter-x { position: sticky; top: 0; float: right; margin: 0 4px -40px 0; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--cream); box-shadow: var(--shadow); cursor: pointer; }
.letter-x::before, .letter-x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 4px; border-radius: 2px; background: var(--brown); }
.letter-x::before { transform: translate(-50%, -50%) rotate(45deg); } .letter-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.letter-in { background: var(--paper, #fffaf0); border-radius: 20px; padding: 30px 28px 24px; position: relative; color: #5a4128;
  background-image: radial-gradient(rgba(150, 110, 70, .1) 1.2px, transparent 1.6px); background-size: 18px 18px;
  box-shadow: 0 0 0 6px var(--ink, #7a5a3a), 0 0 0 10px #fff4dc, 0 14px 30px rgba(0,0,0,.35); margin: 10px 8px; }
.l-head { margin-bottom: 14px; }
.l-title { margin: 0; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.1; font-weight: 900; color: #5a3e22; letter-spacing: -.01em; }
.l-client { margin: 6px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; color: #a5865f; }
.l-desc { font-size: 16.5px; line-height: 1.7; font-weight: 600; margin: 0 0 18px; }
.l-sec { margin: 0 0 16px; }
.l-h { font-size: 15px; font-weight: 900; margin: 14px 0 4px; color: #6b4a2a; }
.l-head::after { content: ''; display: block; width: 64px; height: 6px; border-radius: 3px; background: var(--ink, #7a5a3a); margin-top: 10px; }
.l-p { font-size: 13.5px; line-height: 1.5; margin: 0 0 8px; font-weight: 600; color: #7d6448; }
.l-credits { font-size: 12.5px; line-height: 1.6; font-weight: 700; color: #8d7254; border-top: 2px dashed rgba(150,110,70,.3); padding-top: 12px; margin-top: 18px; }
.l-contact { font-size: 15px; font-weight: 700; } .l-contact a { color: var(--ink, #7a5a3a); }
.l-roles { list-style: none; padding: 0; margin: 14px 0 0; font-size: 13.5px; line-height: 1.45; }
.l-roles li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed rgba(150,110,70,.25); }
.l-roles b { font-weight: 800; } .l-roles span { font-weight: 800; font-size: 11px; letter-spacing: .1em; color: #a5865f; text-align: right; }
.pockets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.pockets-pics { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.item { border: 0; padding: 7px 7px 8px; background: #fff6df; border-radius: 16px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 3px 0 rgba(150,110,70,.22); transition: transform .12s; }
.item:hover, .item:focus-visible { transform: translateY(-2px) rotate(-1deg); outline: none; box-shadow: 0 3px 0 rgba(150,110,70,.22), 0 0 0 3px #f0a33a; }
.item-pic { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #e8dcc0; }
.item-film.is-tall .item-pic { aspect-ratio: 4 / 5; }
.item-img .item-pic { aspect-ratio: 1; }
.item-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-play { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 249, 232, .92); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.item-play::after { content: ''; position: absolute; left: 9px; top: 6px; border-left: 9px solid #f06a4f; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.item-name { font-size: 12.5px; font-weight: 800; line-height: 1.25; padding: 0 2px; }
.item-dur { font-size: 11px; font-weight: 700; color: #a5865f; padding: 0 2px; }
.tracks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 7px; }
.track { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto 5px; column-gap: 10px; align-items: center; background: #fff6df; border-radius: 14px; padding: 8px 12px 8px 8px; box-shadow: 0 3px 0 rgba(150,110,70,.18); }
.track-play { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f3a83b; cursor: pointer; position: relative; }
.track-play::after { content: ''; position: absolute; left: 13px; top: 10px; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.track.on .track-play::after { left: 11px; top: 10px; width: 4px; height: 14px; border: 0; background: #fff; box-shadow: 8px 0 0 #fff; }
.track-name { font-size: 13.5px; font-weight: 800; }
.track-bar { height: 4px; border-radius: 2px; background: rgba(150,110,70,.2); overflow: hidden; }
.track-bar i { display: block; height: 100%; width: 0; background: #f3a83b; }
.l-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.l-nav button { border: 0; background: #7a5a3a; color: #fff9e8; font-weight: 800; font-size: 13px; padding: 9px 14px; border-radius: 999px; cursor: pointer; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-prev::before { content: '◀ '; font-size: .8em; } .l-next::after { content: ' ▶'; font-size: .8em; }
.l-nav button:hover, .l-nav button:focus-visible { filter: brightness(1.12); outline: none; }

/* ---------- the TV and the pictures, up close */
.viewer { position: fixed; inset: 0; z-index: 35; background: rgba(20, 15, 10, .82); display: grid; place-items: center; align-content: center; gap: 14px; padding: 56px 70px 40px; animation: fadein .2s; }
.viewer[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } }
.tv-set { background: linear-gradient(#4d4a52, #34313a); border-radius: 26px; padding: 18px; box-shadow: 0 0 0 5px #23212a, 0 20px 50px rgba(0,0,0,.5); width: min(1100px, calc(100vw - 150px), calc((100vh - 170px) * 1.78)); }
.tv-set.is-tall { width: min(calc((100vh - 170px) * 0.5625 + 36px), calc(100vw - 150px)); }
.tv-set.is-square { width: min(calc(100vh - 170px), calc(100vw - 150px)); }
.tv-screen { position: relative; border-radius: 12px; overflow: hidden; background: #000; width: 100%; }
.tv-screen iframe, .tv-screen img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.tv-static { position: absolute; inset: 0; background: repeating-radial-gradient(circle at 30% 40%, #ddd 0 1px, #333 1px 3px); opacity: .9; animation: static .38s steps(6) forwards; }
@keyframes static { 0% { opacity: .95; transform: scale(1.02); } 100% { opacity: 0; transform: scale(1); } }
.tv-cap, .pic-cap { background: var(--cream); color: var(--ink); border-radius: 999px; padding: 8px 22px 9px; font-weight: 800; font-size: 16px; display: flex; gap: 12px; align-items: baseline; box-shadow: var(--shadow); max-width: calc(100vw - 40px); }
.tv-cap span { font-size: 13px; color: #a5865f; }
.pic-frame { background: #fdf7e8; padding: 14px; border-radius: 6px; box-shadow: 0 0 0 10px #8a6440, 0 0 0 13px #5d4128, 0 20px 50px rgba(0,0,0,.5); max-width: calc(100vw - 170px); }
.pic-frame img { display: block; max-width: calc(100vw - 200px); max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); }
.v-prev, .v-next, .v-close { position: fixed; border: 0; cursor: pointer; background: var(--cream); box-shadow: var(--shadow); border-radius: 50%; width: 52px; height: 52px; }
.v-prev { left: 12px; top: 50%; transform: translateY(-50%); } .v-next { right: 12px; top: 50%; transform: translateY(-50%); }
.v-prev::after, .v-next::after { content: ''; position: absolute; left: 50%; top: 50%; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.v-prev::after { border-right: 13px solid #f06a4f; transform: translate(-60%, -50%); } .v-next::after { border-left: 13px solid #f06a4f; transform: translate(-40%, -50%); }
.v-close { right: 14px; top: 14px; width: 46px; height: 46px; }
.v-close::before, .v-close::after, .map-x::before, .map-x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 4px; border-radius: 2px; background: var(--brown); }
.v-close::before, .map-x::before { transform: translate(-50%, -50%) rotate(45deg); } .v-close::after, .map-x::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---------- the map board */
.map { position: fixed; inset: 0; z-index: 32; background: rgba(30, 40, 25, .5); display: grid; place-items: center; padding: 18px; animation: fadein .2s; }
.map[hidden] { display: none; }
.map-card { position: relative; width: min(860px, 100%); height: min(760px, calc(100vh - 36px), calc(100dvh - 36px)); background: #c99a62; border-radius: 26px; padding: 16px;
  display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 14px; box-shadow: inset 0 0 0 5px #a87a48, 0 6px 0 #7a5a3a, 0 20px 50px rgba(0,0,0,.35); }
.map-left { position: relative; background: #5ec8d4; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 4px rgba(255,255,255,.4); }
.map-canvas { position: absolute; inset: 0; cursor: pointer; }
.map-right { background: var(--cream); border-radius: 16px; overflow-y: auto; padding: 10px; scrollbar-width: thin; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.map-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.map-item { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 6px 10px 6px 6px; border-radius: 14px; cursor: pointer; text-align: left; }
.map-item:hover, .map-item:focus-visible { background: #ffe9b8; outline: none; }
.map-ic { width: 54px; height: 50px; flex: none; display: grid; place-items: end center; }
.map-ic img { max-width: 100%; max-height: 100%; }
.map-tx { display: flex; flex-direction: column; line-height: 1.2; }
.map-tx b { font-size: 16px; font-weight: 800; }
.map-tx small { font-size: 10.5px; letter-spacing: .1em; font-weight: 800; color: #a5865f; margin-top: 2px; }
.map-x { position: absolute; right: -10px; top: -10px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--cream); box-shadow: var(--shadow); cursor: pointer; }
body.no-gl { background: #86cf70; }
body.no-gl #world { display: none; }

/* ---------- phones */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .room { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .room-stage { padding: 8px 6px 4px; height: auto; overflow: visible; display: flex; justify-content: center; }
  .letter-in { padding: 24px 18px 20px; }
  .talk { padding: 28px 26px 22px; min-height: 108px; border-radius: 34px; }
  .talk-tag { font-size: 15px; left: 22px; }
  .hud-btn { width: 48px; height: 48px; }
  .viewer { padding: 66px 10px 70px; }
  .tv-set { width: calc(100vw - 20px); padding: 10px; border-radius: 18px; }
  .tv-set.is-tall { width: min(calc(100vw - 20px), calc((100dvh - 200px) * 0.5625 + 20px)); }
  .tv-set.is-square { width: calc(100vw - 20px); }
  .pic-frame { max-width: calc(100vw - 30px); padding: 8px; }
  .pic-frame img { max-width: calc(100vw - 60px); max-height: calc(100dvh - 230px); }
  .v-prev, .v-next { top: auto; bottom: 14px; transform: none; }
  .map-card { grid-template-columns: 34% 1fr; padding: 10px; gap: 10px; height: calc(100dvh - 24px); }
  .map-ic { width: 44px; height: 40px; }
  .map-tx b { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- people in the room */
.room-actors { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ra { position: absolute; width: 0; height: 0; }
.ra-sprite { position: absolute; left: 0; bottom: 0; background-repeat: no-repeat; transform-origin: 50% 100%; pointer-events: none; }
.ra-owner .ra-sprite { pointer-events: auto; cursor: pointer; }
.ra-shadow { position: absolute; left: 0; bottom: 0; height: 10px; transform: translate(-50%, 45%); border-radius: 50%; background: radial-gradient(rgba(20, 12, 4, .38), rgba(20, 12, 4, 0) 70%); }
.room-spots { pointer-events: none; } .room-spots .spot { pointer-events: all; }
.room-tools { position: absolute; right: max(16px, env(safe-area-inset-right)); top: max(16px, env(safe-area-inset-top)); z-index: 26; display: flex; gap: 10px; }
.rt { border: 0; background: var(--cream); color: var(--brown); box-shadow: var(--shadow); border-radius: 999px; padding: 7px 16px 7px 10px; display: flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 800; font-size: 15px; }
.rt svg { width: 26px; height: 26px; } .rt:hover { transform: translateY(-2px); } .rt:focus-visible { outline: 3px solid #f06a4f; outline-offset: 3px; }
.rt-letter.nudge { animation: nudgeL 1.1s ease-in-out 3; } @keyframes nudgeL { 50% { transform: translateY(-4px) rotate(-4deg); box-shadow: var(--shadow), 0 0 0 4px #f3a83b; } }
.room.letter-open .room-tools { opacity: 0; pointer-events: none; }
.now-playing { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 27; border: 0; background: var(--cream); color: var(--brown); font-weight: 800; font-size: 14px; padding: 7px 16px; border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; }
.talk-skip { position: absolute; right: 26px; top: -16px; border: 0; background: #7a5a3a; color: #fff9e8; font-weight: 800; font-size: 13px; padding: 5px 13px 6px; border-radius: 999px; cursor: pointer; display: none; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.talk.can-skip .talk-skip { display: block; }
.talk.no-tag .talk-tag { display: none; }
.held-fish { position: fixed; left: 0; top: 0; z-index: 9; width: 120px; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); animation: hold .5s cubic-bezier(.3,1.6,.6,1); }
.held-fish[data-big="1"] { width: 190px; }
@keyframes hold { from { transform: translate(var(--x, 0), var(--y, 0)) scale(.3); } }

/* ---------- the catch log */
.log { position: fixed; inset: 0; z-index: 32; background: rgba(20, 40, 50, .5); display: grid; place-items: center; padding: 18px; animation: fadein .2s; }
.log-card { position: relative; width: min(820px, 100%); max-height: min(760px, calc(100dvh - 36px)); display: flex; flex-direction: column; background: #3f8a9a; border-radius: 26px; padding: 14px; box-shadow: inset 0 0 0 5px #2f6f7e, 0 6px 0 #275b66, 0 20px 50px rgba(0,0,0,.35); }
.log-tabs { display: flex; gap: 8px; padding: 2px 4px 12px; }
.log-tabs button { border: 0; border-radius: 999px; padding: 8px 18px; font-weight: 800; font-size: 15px; background: rgba(255,255,255,.25); color: #fff; cursor: pointer; }
.log-tabs button.on { background: var(--cream); color: var(--brown); }
.log-body { background: var(--cream); border-radius: 16px; overflow-y: auto; padding: 14px; min-height: 0; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.log-fish { background: #fff6df; border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; box-shadow: 0 3px 0 rgba(150,110,70,.2); }
.log-fish img { width: 100%; height: 70px; object-fit: contain; filter: brightness(0) opacity(.18); }
.log-fish.caught img { filter: none; }
.log-fish b { font-size: 14px; font-weight: 800; line-height: 1.2; } .log-fish small { font-size: 12px; font-weight: 700; color: #a5865f; }
.log-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.log-board li { display: grid; grid-template-columns: 30px 116px 54px 1fr auto; align-items: center; gap: 10px; background: #fff6df; border-radius: 14px; padding: 6px 14px 6px 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.log-board li.me { box-shadow: 0 0 0 3px #f3a83b; }
.log-board li.empty { display: block; color: #a5865f; text-align: center; padding: 18px; }
.log-board .rk { color: #a5865f; } .log-board .in { font-size: 16px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .log-board img { width: 54px; height: 32px; object-fit: contain; } .log-board .fn { font-size: 14px; } .log-board .cm { font-size: 16px; white-space: nowrap; }
.log-foot { margin: 12px 4px 2px; font-size: 12.5px; font-weight: 700; color: #a5865f; }
.initials { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(20, 30, 40, .45); }
.ini-card { background: var(--cream); border-radius: 26px; padding: 22px 26px; display: grid; gap: 10px; justify-items: center; box-shadow: var(--shadow); width: min(340px, 92vw); }
.ini-h { font-size: 22px; font-weight: 900; color: #c4572f; } .ini-l { font-size: 14px; font-weight: 800; color: #8d6e4b; }
.ini-card input { width: min(260px, 72vw); font: 900 26px/1.1 var(--font); text-align: center; letter-spacing: .02em; padding: 8px 10px; border: 3px solid #e7d6b0; border-radius: 14px; background: #fff; color: var(--ink); }
.ini-card input.bad { border-color: #e0805f; }
.ini-card input:focus { outline: none; border-color: #f3a83b; }
.ini-b { display: flex; gap: 10px; } .ini-b button { border: 0; border-radius: 999px; padding: 9px 20px; font-weight: 800; cursor: pointer; background: #7a5a3a; color: #fff9e8; } .ini-b .ini-no { background: #e7d6b0; color: #7a5a3a; }
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .room-tools { position: static; justify-content: center; padding: 6px 0 10px; }
  /* the work fills the phone and scrolls under a finger, with momentum; it never drags the room or the town behind */
  .letter { position: fixed; inset: 0; width: auto; padding: 10px 8px 40px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .log-grid { grid-template-columns: repeat(2, 1fr); }
  .log-board li { grid-template-columns: 22px 92px 40px 1fr auto; gap: 6px; padding: 6px 10px; } .log-board .fn { font-size: 11px; line-height: 1.2; } .log-board .in { font-size: 14px; }
  .held-fish { width: 90px; } .held-fish[data-big="1"] { width: 140px; }
}
.room-exit, .room-notes { z-index: 3; }
