/* Spine Street, storybook edition
   Layout: a side-scrolling twilight lane you walk with a little reader; each door opens
   (through an iris wipe) onto a full-bleed shop with a game dialogue box, then a
   crafting-style pairing sheet and a cozy reading nook.
   Deliberately single-theme: it is always twilight on Spine Street. */
:root {
  color-scheme: dark;
  --ink: #2b1d3f;            /* the storybook outline on everything */
  --night: #1a1336;          /* page ground */
  --dusk: #2a1f55;           /* panels */
  --dusk-2: #352868;
  --gold: #ffd77a;           /* lamplight and magic, the street's accent */
  --rose: #ff8fb1;
  --mint: #8fe3c0;
  --cream: #fff4dc;          /* text */
  --haze: #cfc3ea;           /* secondary text */
  --line: rgba(255, 244, 220, 0.16);
  --card: #fff8ea;           /* trading cards, tickets and the library card */
  --card-ink: #2b2016;
  --font-display: 'Caprasimo', 'Cooper Black', Georgia, serif;
  --font-body: 'Alegreya', Georgia, 'Times New Roman', serif;
  --font-ui: 'Fredoka', ui-rounded, 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Courier Prime', 'Courier New', ui-monospace, monospace;
  --acc-detective: #a3b5ff;
  --acc-romance: #ff8fb1;
  --acc-fantasy: #b8e05a;
  --acc-scifi: #6fe3f2;
  --acc-horror: #c9b0ff;
  --acc-history: #ffb46b;
  --acc-fortune: #ffd36b;
  --acc: var(--gold);
  --on-acc: var(--ink);
  --bounce: cubic-bezier(.3, 1.5, .5, 1);
  --smooth: cubic-bezier(.2, .8, .2, 1);
}
[data-shop="detective"] { --acc: var(--acc-detective); }
[data-shop="romance"] { --acc: var(--acc-romance); }
[data-shop="fantasy"] { --acc: var(--acc-fantasy); }
[data-shop="scifi"] { --acc: var(--acc-scifi); }
[data-shop="horror"] { --acc: var(--acc-horror); }
[data-shop="history"] { --acc: var(--acc-history); }
[data-shop="fortune"] { --acc: var(--acc-fortune); }

[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--night); color: var(--cream);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
#app { height: 100%; }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--haze); margin: 0; font-weight: 600; }
kbd { font-family: var(--font-ui); font-size: 0.8em; font-weight: 600; padding: 1px 6px; border-radius: 6px; border: 2px solid rgba(255, 244, 220, 0.35); border-bottom-width: 3px; }

/* ---------- Chunky game buttons ---------- */
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap;
  border-radius: 14px; padding: 9px 18px; font-family: var(--font-ui); font-weight: 600; font-size: 0.95rem; text-decoration: none;
  transition: transform 0.14s var(--smooth), box-shadow 0.14s var(--smooth), background-color 0.15s, border-color 0.15s, filter 0.15s;
}
.btn { background: var(--acc); color: var(--on-acc); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-ghost { background: rgba(255, 244, 220, 0.07); border: 2px solid rgba(255, 244, 220, 0.3); color: var(--cream); box-shadow: 0 3px 0 rgba(10, 6, 24, 0.55); }
.btn-ghost:hover { border-color: var(--acc); background: rgba(255, 244, 220, 0.12); transform: translateY(-1px); }
.btn-ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(10, 6, 24, 0.55); }
.btn[disabled], .btn-ghost[disabled] { opacity: 0.55; cursor: progress; transform: none; }
.btn-big { padding: 13px 26px; font-size: 1.06rem; border-radius: 16px; }
.btn-sm { padding: 6px 13px; font-size: 0.86rem; border-radius: 12px; }
.btn svg, .btn-ghost svg, .choice svg { width: 16px; height: 16px; flex: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  max-width: min(520px, calc(100vw - 32px)); background: var(--card); color: var(--card-ink); padding: 10px 18px; border-radius: 16px;
  border: 2.5px solid var(--ink); box-shadow: 0 5px 0 var(--ink); font-size: 0.92rem; opacity: 0; transition: opacity 0.25s, transform 0.3s var(--bounce); z-index: 120; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Iris wipe, particles, confetti ---------- */
.iris { position: fixed; inset: 0; z-index: 110; overflow: hidden; pointer-events: all; }
.iris-hole { position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-radius: 50%; box-shadow: 0 0 0 5px var(--gold), 0 0 0 200vmax #140e2c; }
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 105; overflow: hidden; }
.fx { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; animation: fxFly 0.95s cubic-bezier(.15, .7, .3, 1) both; }
.fx svg { display: block; width: 100%; height: 100%; }
.fx-puff { width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: currentColor; animation-name: fxPuff; animation-duration: 0.7s; }
@keyframes fxFly { 0% { transform: translate(0, 0) scale(0.2) rotate(0deg); opacity: 1; } 65% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(var(--s)) rotate(var(--rot)); opacity: 0; } }
@keyframes fxPuff { 0% { transform: translate(0, 0) scale(0.3); opacity: 0.85; } 100% { transform: translate(var(--dx), var(--dy)) scale(calc(var(--s) * 1.9)); opacity: 0; } }
.fx-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 106; }

/* =======================================================================
   THE STREET
   ======================================================================= */
.screen-street { min-height: 100%; }
.scene {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #120c2e 0%, #21184e 26%, #3b2a72 44%, #6c4a92 58%, #b8709c 68%, #f2a49a 76%, #ffd29a 82%, #ffd29a 100%);
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.moon { position: absolute; top: 74px; right: 10%; width: clamp(84px, 9vw, 124px); z-index: 1; pointer-events: none; filter: drop-shadow(0 0 26px rgba(255, 236, 170, 0.55)); }
.moon svg { display: block; width: 100%; height: auto; overflow: visible; }
.clouds { position: absolute; inset: 0 0 auto 0; height: 340px; pointer-events: none; z-index: 1; }
.cloud { position: absolute; left: 0; width: 190px; }
.cloud svg { width: 100%; height: auto; display: block; }
.cl0 { top: 92px; width: 220px; } .cl1 { top: 200px; width: 160px; } .cl2 { top: 34px; width: 150px; } .cl3 { top: 260px; width: 240px; }
.hud { position: absolute; top: 12px; left: 0; right: 0; z-index: 6; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-card {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 14px 5px 5px; border-radius: 999px;
  background: rgba(26, 19, 54, 0.78); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink), inset 0 0 0 2px rgba(255, 215, 122, 0.35);
  backdrop-filter: blur(4px); transition: transform 0.15s var(--bounce);
}
.hud-card:hover { transform: translateY(-2px) scale(1.02); }
.hud-lvl { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--ink); border: 2.5px solid var(--ink); font-family: var(--font-display); font-size: 0.9rem; line-height: 1; }
.hud-meta { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.hud-title { font-weight: 600; font-size: 0.86rem; line-height: 1.1; }
.hud-xp { display: block; width: 104px; height: 7px; border-radius: 4px; background: rgba(255, 244, 220, 0.18); overflow: hidden; border: 1.5px solid var(--ink); }
.hud-xp span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffb46b); transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.6s var(--smooth); }
.hud-sound {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  background: rgba(26, 19, 54, 0.78); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink), inset 0 0 0 2px rgba(255, 215, 122, 0.35); color: var(--gold);
}
.hud-sound svg { width: 22px; height: 22px; }
.hud-sound .snd-off { display: none; }
.hud-sound.off .snd-off { display: inline; }
.hud-sound.off .snd-on { display: none; }
.hud-sound.off { color: var(--haze); }
.street-head { position: relative; z-index: 2; text-align: center; padding-block: 64px 0; }
.street-head .eyebrow { color: #e9dcff; }
.sign {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem, 9vw, 6rem); line-height: 1.05; margin: 8px 0 14px; color: var(--gold); letter-spacing: 0.01em;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 2.2px 2.2px 0 var(--ink), -2.2px 2.2px 0 var(--ink), 2.2px -2.2px 0 var(--ink), -2.2px -2.2px 0 var(--ink), 0 7px 0 var(--ink), 0 0 36px rgba(255, 215, 122, 0.55);
}
.lede { font-family: var(--font-body); font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: #f6ecff; max-width: 50ch; margin: 0 auto; text-shadow: 0 2px 8px rgba(20, 12, 46, 0.6); }
.resume { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin: 16px auto 0; max-width: 760px; }
.resume p { margin: 0; }
.resume em { font-family: var(--font-body); color: var(--gold); }

.street-scroll {
  position: relative; z-index: 2; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: #6c5aa0 transparent; margin-top: 10px;
}
.street { --bw: clamp(150px, calc((100vw - 72px - 6 * 30px) / 7), 214px); position: relative; width: max-content; min-width: 100%; padding-top: 70px; }
.layers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.layer { position: absolute; left: -80px; right: -80px; pointer-events: none; will-change: transform; }
.layer svg { display: block; width: 100%; height: 100%; }
.layer-far { bottom: 174px; height: 270px; }
.layer-mid { bottom: 122px; height: 176px; }
.street-row { position: relative; z-index: 3; display: flex; align-items: flex-end; justify-content: center; padding: 0 36px; }
.bldg { position: relative; flex: none; width: var(--bw); padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bldg:focus-visible { outline: none; }
.bldg:focus-visible .bldg-plaque { outline: 3px solid var(--gold); outline-offset: 3px; }
.bldg-art { display: block; transform-origin: 50% 100%; transition: transform 0.45s var(--bounce), filter 0.35s; }
.bldg-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.bldg-art text, .layer text { font-family: var(--font-display); }
.bldg:hover .bldg-art, .bldg:focus-visible .bldg-art { transform: translateY(-8px) scale(1.025); filter: drop-shadow(0 0 22px rgba(255, 215, 122, 0.45)) brightness(1.06); }
.bldg .door { transform-box: fill-box; transform-origin: 0 50%; transition: transform 0.45s var(--smooth); }
.bldg:hover .door, .bldg:focus-visible .door, .bldg.near .door { transform: scaleX(0.14); }
.bldg-plaque {
  position: absolute; left: 50%; top: calc(100% + 7px); transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 1px; width: max-content; max-width: calc(var(--bw) + 24px);
  padding: 4px 12px 5px; border-radius: 10px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  background: linear-gradient(180deg, #a8714a, #8a5a3a);
}
.bldg-plaque::before, .bldg-plaque::after { content: ''; position: absolute; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--ink); }
.bldg-plaque::before { left: 5px; } .bldg-plaque::after { right: 5px; }
.bldg-name { font-family: var(--font-display); font-size: 13.5px; line-height: 1.15; color: #fff1d0; white-space: nowrap; text-shadow: 0 1.5px 0 var(--ink); }
.bldg-genre { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #ffe4b5; white-space: nowrap; font-weight: 600; }
.lamp { position: relative; flex: none; width: 30px; pointer-events: none; }
.lamp svg { display: block; width: 100%; height: auto; }
.lamp::before { content: ''; position: absolute; left: 50%; top: 4%; width: 140px; height: 140px; transform: translate(-50%, -30%); background: radial-gradient(circle, rgba(255, 215, 122, 0.4) 0%, rgba(255, 215, 122, 0) 62%); }
.lamp::after { content: ''; position: absolute; left: 50%; bottom: -42px; width: 180px; height: 46px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(255, 215, 122, 0.3), rgba(255, 215, 122, 0) 70%); z-index: 1; }
.player { position: absolute; left: 0; bottom: 8px; z-index: 4; width: 50px; pointer-events: none; will-change: transform; }
.player svg { display: block; width: 100%; height: auto; overflow: visible; transition: transform 0.26s var(--smooth), opacity 0.26s; }
.player.face-left svg { transform: scaleX(-1); }
.player.entering svg { transform: translateY(-14px) scale(0.75); opacity: 0; }
.player .leg, .player .arm { transform-box: fill-box; transform-origin: 50% 8%; }
.door-prompt {
  position: absolute; z-index: 6; transform: translate(-50%, -100%); cursor: pointer; white-space: nowrap;
  padding: 6px 12px; border-radius: 14px; background: var(--card); color: var(--card-ink); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  font-size: 0.82rem; font-weight: 600;
}
.door-prompt::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 12px; margin-left: -6px; background: var(--card); border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); }
.dp-key { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 6px; background: var(--ink); color: var(--gold); font-size: 0.75rem; }
.dp-name { font-family: var(--font-display); font-weight: 400; }
.ground { position: relative; z-index: 1; height: 128px; }
.verge {
  position: relative; height: 46px; border-top: 3px solid var(--ink);
  background:
    radial-gradient(circle, #ff9fc0 2.6px, transparent 3.2px) 6px 10px / 46px 30px,
    radial-gradient(circle, #fff1a8 2.2px, transparent 2.8px) 24px 20px / 38px 26px,
    radial-gradient(circle, #ffffff 2px, transparent 2.6px) 34px 6px / 54px 34px,
    linear-gradient(180deg, #5f9a5b, #477a48);
}
.lane {
  height: 79px; border-top: 3px solid var(--ink);
  background:
    radial-gradient(ellipse 12px 6px at 50% 50%, #8a7bb3 58%, transparent 64%) 0 0 / 26px 14px,
    radial-gradient(ellipse 12px 6px at 50% 50%, #7a6aa4 58%, transparent 64%) 13px 7px / 26px 14px,
    #4c3f72;
}
.scroll-hint {
  position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: 70px; z-index: 6; cursor: pointer;
  padding: 6px 14px; border-radius: 14px; background: var(--card); color: var(--card-ink); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: 0.82rem; font-weight: 600;
}
.street-help { position: relative; z-index: 2; margin: 0; padding-block: 12px 18px; text-align: center; font-size: 0.86rem; font-weight: 500; background: #3a2f5e; color: var(--haze); }
@media (hover: none) { .kb-help { display: none; } }

/* Lights come on one by one when you arrive; then the street keeps breathing. */
@media (prefers-reduced-motion: no-preference) {
  .street .lamp::before { animation: lightOn 0.9s ease-out both; animation-delay: calc(var(--i, 0) * 160ms + 250ms); }
  .street .lamp-glass { animation: lightOn 0.9s ease-out both, lampFlicker 9s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 160ms + 250ms), 3s; }
  .street .win-lit { animation: lightOn 1.1s ease-out both; animation-delay: calc(var(--i, 0) * 160ms + 420ms); }
  .street .win-lit.flicker { animation: lightOn 1.1s ease-out both, flicker 2.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 160ms + 420ms), 2s; }
  .sign { animation: signIn 1.1s var(--bounce) both; }
  .moon { animation: moonBob 7s ease-in-out infinite alternate; }
  .moon .z { animation: zzz 3.6s ease-in-out infinite; opacity: 0; }
  .moon .z2 { animation-delay: 1.2s; } .moon .z3 { animation-delay: 2.4s; }
  .cloud { animation: drift 120s linear infinite; }
  .cl0 { animation-duration: 140s; animation-delay: -30s; } .cl1 { animation-duration: 100s; animation-delay: -70s; }
  .cl2 { animation-duration: 170s; animation-delay: -110s; } .cl3 { animation-duration: 120s; animation-delay: -10s; }
  .mill-blades { animation: spin 14s linear infinite; transform-box: fill-box; transform-origin: center; }
  .door-prompt { animation: promptBob 1.2s ease-in-out infinite alternate; }
  .player:not(.walking) .pl-body { animation: idle 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  .player.walking .pl-body { animation: bob 0.18s ease-in-out infinite alternate; }
  .player.walking .leg-l { animation: legSwing 0.36s ease-in-out infinite alternate; }
  .player.walking .leg-r { animation: legSwing 0.36s ease-in-out infinite alternate-reverse; }
  .player.walking .arm-l { animation: armSwing 0.36s ease-in-out infinite alternate-reverse; }
  .player.walking .arm-r { animation: armSwing 0.36s ease-in-out infinite alternate; }
  .player .scarf-tail { animation: scarf 0.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0 0; }
  .player .pl-eyes, .peek { animation: blinkEyes 4.6s infinite; transform-box: fill-box; transform-origin: center; }
  .peek .pupils { animation: lookAround 6s ease-in-out infinite; }
  .ghost-peek { animation: ghostPeek 6s ease-in-out infinite; }
  .alien { animation: alienPeek 7s ease-in-out infinite; }
  .cuckoo { animation: cuckoo 11s ease-in-out infinite; }
  .cuckoo-door { transform-box: fill-box; transform-origin: 0 50%; animation: cuckooDoor 11s ease-in-out infinite; }
  .pend2 { animation: swing 1.8s ease-in-out infinite alternate; }
  .sign-swing { animation: signSwing 3.4s ease-in-out infinite alternate; }
  .flag-moon { animation: signSwing 2.6s ease-in-out infinite alternate; }
  .twinkle { transform-box: fill-box; transform-origin: center; animation: sparkle 2.8s ease-in-out infinite; }
  .twinkle.t2 { animation-delay: 0.9s; } .twinkle.t3 { animation-delay: 1.8s; }
  .ffd { animation: ffBlink 2.4s ease-in-out infinite; } .ffd.d2 { animation-delay: 0.8s; } .ffd.d3 { animation-delay: 1.6s; }
  .fg { animation: fogDrift 9s ease-in-out infinite alternate; } .fg2 { animation-duration: 12s; }
  .ht { transform-box: fill-box; transform-origin: center; animation: heartRise 4.8s ease-in infinite; opacity: 0; }
  .ht2 { animation-delay: 1.6s; } .ht3 { animation-delay: 3.2s; }
  .sm { transform-box: fill-box; transform-origin: center; animation: smoke 5.4s ease-out infinite; opacity: 0; }
  .sm2 { animation-delay: 1.8s; } .sm3 { animation-delay: 3.6s; }
  .bub { transform-box: fill-box; transform-origin: center; animation: bubble 1.8s ease-in infinite; }
  .bub.b2 { animation-delay: 0.6s; } .bub.b3 { animation-delay: 1.2s; }
  .blink { animation: blink 1.6s steps(1) infinite; } .blink.b2 { animation-delay: 0.5s; } .blink.b3 { animation-delay: 1s; }
  .flicker, .flame { animation: flicker 2.6s ease-in-out infinite; }
  .flame { transform-box: fill-box; transform-origin: 50% 100%; }
  .flame.f2 { animation-delay: 0.7s; } .flame.f3 { animation-delay: 1.3s; }
  .bat { animation: bat 6s ease-in-out infinite; } .bat2 { animation-delay: -2s; animation-duration: 7.5s; } .bat3 { animation-delay: -4s; animation-duration: 5.2s; }
  .bulb { animation: bulb 2.4s ease-in-out infinite; } .bulb.bl1 { animation-delay: 0.8s; } .bulb.bl2 { animation-delay: 1.6s; }
  .spk { transform-box: fill-box; transform-origin: center; animation: sparkle 3.2s ease-in-out infinite; } .spk.s2 { animation-delay: 1.1s; } .spk.s3 { animation-delay: 2.2s; }
  .ball { animation: ballGlow 3.4s ease-in-out infinite; }
}
@keyframes lightOn { 0% { opacity: 0.15; } 40% { opacity: 0.95; } 52% { opacity: 0.4; } 100% { opacity: 1; } }
@keyframes signIn { 0% { opacity: 0; transform: translateY(-18px) scale(0.92); } 100% { opacity: 1; transform: none; } }
@keyframes moonBob { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(8px) rotate(3deg); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: 0.9; } 100% { opacity: 0; transform: translate(6px, -10px); } }
@keyframes drift { from { transform: translateX(-280px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes promptBob { from { margin-top: 0; } to { margin-top: -5px; } }
@keyframes idle { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-0.6px) scaleY(1.012); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-2.6px); } }
@keyframes legSwing { from { transform: rotate(-26deg); } to { transform: rotate(26deg); } }
@keyframes armSwing { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
@keyframes scarf { from { transform: rotate(-6deg); } to { transform: rotate(10deg); } }
@keyframes blinkEyes { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes lookAround { 0%, 20%, 100% { transform: translate(0, 0); } 30%, 45% { transform: translate(-3px, 0); } 55%, 70% { transform: translate(2px, -1px); } }
@keyframes ghostPeek { 0%, 100% { transform: translateY(18px); } 40%, 70% { transform: translateY(0); } }
@keyframes alienPeek { 0%, 55%, 100% { transform: translateY(18px); } 65%, 90% { transform: translateY(0); } }
@keyframes cuckoo { 0%, 78%, 100% { transform: translateX(0); } 82%, 92% { transform: translateX(12px); } }
@keyframes cuckooDoor { 0%, 76%, 100% { transform: scaleX(1); } 80%, 94% { transform: scaleX(-0.2); } }
@keyframes swing { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes signSwing { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes sparkle { 0%, 100% { opacity: 0.3; transform: scale(0.65); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes ffBlink { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }
@keyframes fogDrift { from { transform: translateX(-12px); } to { transform: translateX(14px); } }
@keyframes heartRise { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -46px) scale(1.15); } }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 0) scale(0.5); } 20% { opacity: 0.8; } 100% { opacity: 0; transform: translate(16px, -70px) scale(2.2); } }
@keyframes bubble { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-14px) scale(1.1); opacity: 0; } }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 30% { opacity: 0.78; } 55% { opacity: 0.95; } 70% { opacity: 0.72; } }
@keyframes bat { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(14px, -8px); } 50% { transform: translate(26px, 2px); } 75% { transform: translate(10px, 6px); } }
@keyframes bulb { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes ballGlow { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }
@keyframes lampFlicker { 0%, 46%, 50%, 100% { opacity: 1; } 47% { opacity: 0.72; } 49% { opacity: 0.88; } }

/* ---------- Directory, how it works, footer ---------- */
.street-body { max-width: 1180px; margin: 0 auto; }
.directory { padding-block: 54px 8px; }
.section-h { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: 0 0 6px; color: var(--gold); }
.section-sub { color: var(--haze); margin: 0 0 22px; max-width: 62ch; font-family: var(--font-body); font-size: 1.05rem; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 252px), 1fr)); gap: 16px; }
.dir-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer; overflow: hidden;
  padding: 0 16px 14px; background: var(--dusk); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.25s var(--bounce), box-shadow 0.2s;
}
.dir-card:hover { transform: translateY(-4px) rotate(-0.5deg); box-shadow: 0 9px 0 var(--ink); }
.dir-awning {
  display: block; height: 24px; margin: 0 -16px 2px;
  background:
    radial-gradient(circle at 9px 0, var(--acc) 8.4px, var(--ink) 8.5px, var(--ink) 10.5px, transparent 11px) 0 13px / 18px 11px repeat-x,
    repeating-linear-gradient(90deg, var(--acc) 0 18px, #fff4dc 18px 36px) 0 0 / 100% 13px no-repeat;
}
.dir-head { display: flex; align-items: center; gap: 10px; }
.dir-emblem { width: 28px; height: 28px; color: var(--acc); flex: none; }
.dir-name { display: block; font-family: var(--font-display); font-size: 1.18rem; line-height: 1.2; }
.dir-genre { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc); font-weight: 600; }
.dir-blurb { font-family: var(--font-body); font-size: 1rem; color: #ece2ff; line-height: 1.4; }
.dir-owner { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 2px dashed var(--line); font-size: 0.88rem; }
.dir-owner small { display: block; color: var(--haze); font-size: 0.76rem; }
.dir-face { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #3a2e6e; flex: none; border: 2.5px solid var(--ink); }
.dir-face svg, .speaker-face svg, .pair-face svg { width: 100%; height: 100%; display: block; }
.dir-go { margin-left: auto; color: var(--acc); font-weight: 600; font-size: 0.84rem; white-space: nowrap; }
.how { padding-block: 46px 10px; }
.how ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 22px; counter-reset: step; }
.how li { position: relative; padding: 14px 16px 16px 16px; border-radius: 18px; background: rgba(255, 244, 220, 0.04); border: 2px dashed var(--line); }
.how li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 8px; border-radius: 50%; background: var(--gold); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: var(--font-display); font-size: 1.2rem; }
.how h3 { font-size: 1.05rem; margin: 0 0 4px; font-weight: 600; }
.how p { margin: 0; color: var(--haze); font-size: 0.94rem; }
.street-foot { padding-block: 44px calc(40px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 26px; }
.foot-h { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; margin: 0 0 8px; color: var(--gold); }
.log-sum { margin: 0 0 8px; }
.log-sum strong { color: var(--gold); font-weight: 600; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.log-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.log-t { font-family: var(--font-body); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-m { color: var(--haze); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-empty, .fine { color: var(--haze); font-size: 0.9rem; margin: 0 0 8px; }

/* =======================================================================
   THE SHOP
   ======================================================================= */
.screen-shop {
  height: 100%; min-height: 500px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  --wall: #36406e; --wall-art: none; --counter: #6b4a35; --counter-top: #8a6244;
  --shelf: #7a5236; --shelf-back: #2b1f3f;
  --note-bg: #fff4dc; --note-ink: #2b2016; --note-font: var(--font-body); --note-rot: -1.5deg; --note-line: rgba(43, 29, 63, 0.14);
  background: var(--wall);
}
.screen-shop[data-shop="detective"] { --wall: #36406e; --counter: #6b4a35; --counter-top: #8a6244; --wall-art: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 3px, transparent 3px 44px); --note-bg: #ecd49a; --note-font: var(--font-mono); --note-rot: -2deg; }
.screen-shop[data-shop="romance"] { --wall: #7a3a5e; --counter: #a8496f; --counter-top: #ffc2d6; --shelf: #a8496f; --shelf-back: #4a1f3a; --wall-art: radial-gradient(circle at 50% 50%, rgba(255, 190, 215, 0.13) 3px, transparent 3.5px) 0 0 / 28px 28px; --note-bg: #ffe3ec; --note-ink: #5a1f36; --note-rot: 1.5deg; }
.screen-shop[data-shop="fantasy"] { --wall: #2f4a3a; --counter: #6b4a2e; --counter-top: #8a6440; --shelf: #6b4a2e; --shelf-back: #1d2d22; --wall-art: linear-gradient(rgba(0, 0, 0, 0.16) 3px, transparent 3px) 0 0 / 68px 36px, linear-gradient(90deg, rgba(0, 0, 0, 0.16) 3px, transparent 3px) 0 0 / 68px 72px; --note-bg: #f3e6c4; --note-ink: #3a2a1d; --note-rot: -1deg; }
.screen-shop[data-shop="scifi"] { --wall: #243a6b; --counter: #3a4f80; --counter-top: #6fe3f2; --shelf: #4a5f90; --shelf-back: #152447; --wall-art: linear-gradient(rgba(111, 227, 242, 0.07) 1.5px, transparent 1.5px) 0 0 / 42px 42px, linear-gradient(90deg, rgba(111, 227, 242, 0.07) 1.5px, transparent 1.5px) 0 0 / 42px 42px; --note-bg: #0f1d3a; --note-ink: #8ff3ff; --note-font: var(--font-mono); --note-rot: 0deg; --note-line: rgba(111, 227, 242, 0.25); }
.screen-shop[data-shop="horror"] { --wall: #3a2d55; --counter: #4a3550; --counter-top: #6b5080; --shelf: #4a3550; --shelf-back: #1f1730; --wall-art: radial-gradient(ellipse 14px 20px at 50% 50%, rgba(255, 255, 255, 0.05) 60%, transparent 62%) 0 0 / 40px 52px; --note-bg: #ece6d6; --note-font: var(--font-mono); --note-rot: 2.5deg; }
.screen-shop[data-shop="history"] { --wall: #5a3a28; --counter: #7a4b2e; --counter-top: #a06a42; --shelf: #7a4b2e; --shelf-back: #2e1d14; --wall-art: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.14) 0 4px, transparent 4px 120px), linear-gradient(transparent 62%, rgba(0, 0, 0, 0.16) 62% 63.5%, transparent 63.5%); --note-bg: #fbe9c3; --note-font: var(--font-mono); --note-rot: -1deg; }
.screen-shop[data-shop="fortune"] { --wall: #4a2363; --counter: #5a2a6e; --counter-top: #ffd36b; --shelf: #6b3a80; --shelf-back: #24112f; --wall-art: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 30px, rgba(255, 255, 255, 0.035) 30px 60px); --note-bg: #2a1638; --note-ink: #ffd36b; --note-rot: 0deg; --note-line: rgba(255, 211, 107, 0.3); }
.shop-bar {
  position: relative; z-index: 9; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding-block: 9px;
  background: rgba(20, 13, 44, 0.82); border-bottom: 3px solid var(--ink); backdrop-filter: blur(6px);
}
.shop-bar .btn-ghost { padding: 6px 13px; font-size: 0.86rem; justify-self: start; }
.shop-bar .bar-right { justify-self: end; display: flex; gap: 8px; }
.shop-title { text-align: center; min-width: 0; }
.shop-name { display: block; font-family: var(--font-display); font-size: 1.16rem; line-height: 1.2; color: var(--acc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-genre { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--haze); }
.notes-toggle { display: none !important; }
.notes-count:empty { display: none; }
.notes-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--acc); color: var(--on-acc); font-size: 0.72rem; font-weight: 700; padding: 0 5px; }

.stage { position: relative; overflow: hidden; min-height: 0; isolation: isolate; }
.wall { position: absolute; inset: 0; background: var(--wall-art), var(--wall); }
.wall::after { content: ''; position: absolute; inset: 0; background: radial-gradient(110% 90% at 50% 30%, transparent 45%, rgba(14, 8, 32, 0.5)); }
.backwin {
  position: absolute; left: 50%; top: 9%; width: min(28%, 280px); aspect-ratio: 3 / 4; max-height: 64%; transform: translateX(-50%);
  border-radius: 999px 999px 10px 10px; border: 9px solid #7a5236; box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--ink), 0 0 60px rgba(255, 215, 122, 0.18);
  background: radial-gradient(circle at 70% 26%, #fff6d6 0 7%, rgba(255, 246, 214, 0.25) 7.5% 13%, transparent 14%), linear-gradient(180deg, #1b1440, #3b2a72 55%, #8a5a9a 85%, #e7a19a);
  overflow: hidden;
}
.backwin::before, .backwin::after { content: ''; position: absolute; background: #7a5236; box-shadow: 0 0 0 2px var(--ink); }
.backwin::before { left: 50%; top: 0; bottom: 0; width: 7px; margin-left: -3.5px; }
.backwin::after { left: 0; right: 0; top: 52%; height: 7px; }
.bw-stars { position: absolute; inset: 0; background: radial-gradient(circle, #fff 1px, transparent 1.6px) 6px 8px / 28px 30px, radial-gradient(circle, #ffe9b0 1.2px, transparent 1.8px) 18px 22px / 36px 34px; opacity: 0.8; mask-image: linear-gradient(#000 40%, transparent 70%); -webkit-mask-image: linear-gradient(#000 40%, transparent 70%); }
.beam { position: absolute; left: 50%; top: 18%; width: 64%; height: 80%; transform: translateX(-50%); pointer-events: none; background: linear-gradient(180deg, rgba(255, 238, 190, 0.16), rgba(255, 238, 190, 0)); clip-path: polygon(40% 0, 60% 0, 96% 100%, 4% 100%); }
.garland { position: absolute; left: 0; right: 0; top: 0; height: 80px; z-index: 1; pointer-events: none; }
.garland svg { display: block; width: 100%; height: 100%; }
.shelf { position: absolute; bottom: 19%; width: min(23%, 240px); }
.shelf-l { left: 2%; } .shelf-r { right: 2%; }
.shelf svg, .wall-prop svg, .counter-prop svg { display: block; width: 100%; height: auto; overflow: visible; }
.shelf svg text, .wall-prop svg text, .counter-prop svg text { font-family: var(--font-display); }
.wall-prop, .counter-prop { filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink)) drop-shadow(0 8px 10px rgba(14, 8, 32, 0.4)); }
.wall-prop { position: absolute; top: 15%; left: 27%; width: min(17%, 190px); transform: translateX(-50%) rotate(-2deg); }
.screen-shop[data-shop="romance"] .wall-prop, .screen-shop[data-shop="fortune"] .wall-prop { transform: translateX(-50%); }
.owner-wrap {
  position: absolute; left: 50%; bottom: calc(19% - 2px); height: 66%; aspect-ratio: 200 / 230; transform: translateX(-50%); z-index: 1;
  filter: drop-shadow(2.5px 0 0 var(--ink)) drop-shadow(-2.5px 0 0 var(--ink)) drop-shadow(0 2.5px 0 var(--ink)) drop-shadow(0 -2.5px 0 var(--ink)) drop-shadow(0 16px 20px rgba(14, 8, 32, 0.4));
  transition: filter 0.4s;
}
.owner { width: 100%; height: 100%; }
.owner-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.owner-svg text { font-family: var(--font-mono); }
.motes { position: absolute; left: 30%; right: 30%; top: 18%; bottom: 20%; z-index: 2; pointer-events: none; }
.motes i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff3c4; box-shadow: 0 0 6px #ffe6a0; opacity: 0; }
.motes i:nth-child(1) { left: 10%; top: 80%; } .motes i:nth-child(2) { left: 26%; top: 60%; } .motes i:nth-child(3) { left: 44%; top: 90%; }
.motes i:nth-child(4) { left: 62%; top: 70%; } .motes i:nth-child(5) { left: 80%; top: 85%; } .motes i:nth-child(6) { left: 90%; top: 50%; }
.motes i:nth-child(7) { left: 18%; top: 40%; } .motes i:nth-child(8) { left: 36%; top: 30%; } .motes i:nth-child(9) { left: 54%; top: 45%; }
.motes i:nth-child(10) { left: 72%; top: 25%; } .motes i:nth-child(11) { left: 6%; top: 55%; } .motes i:nth-child(12) { left: 50%; top: 15%; }
.counter { position: absolute; left: 0; right: 0; bottom: 0; height: 19%; min-height: 66px; z-index: 3; }
.counter-top { position: absolute; left: -1%; right: -1%; top: 0; height: 18px; background: linear-gradient(180deg, var(--counter-top), var(--counter)); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 0 4px 0 rgba(14, 8, 32, 0.4); z-index: 1; }
.counter-front {
  position: absolute; left: 0; right: 0; top: 12px; bottom: 0; border-top: 3px solid var(--ink);
  background:
    radial-gradient(ellipse 46% 60% at 50% 70%, rgba(255, 255, 255, 0.06) 60%, transparent 61%) 0 0 / 25% 100%,
    linear-gradient(180deg, rgba(14, 8, 32, 0.25), transparent 30%), var(--counter);
}
.screen-shop[data-shop="scifi"] .counter-top { box-shadow: 0 0 20px rgba(111, 227, 242, 0.55), 0 4px 0 rgba(14, 8, 32, 0.4); }
.screen-shop[data-shop="fortune"] .counter-front { background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 22px), linear-gradient(180deg, #ffd36b 0 6px, transparent 6px), var(--counter); }
.counter-prop { position: absolute; right: 9%; bottom: calc(100% - 6px); width: min(13%, 140px); z-index: 3; }
.screen-shop[data-shop="fortune"] .counter-prop { right: auto; left: 50%; transform: translateX(-50%); width: min(15%, 150px); }
.notes {
  position: absolute; top: 14%; right: 4%; z-index: 4; width: min(220px, 22%);
  background: var(--note-bg); color: var(--note-ink); font-family: var(--note-font); transform: rotate(var(--note-rot));
  padding: 12px 14px 14px; border-radius: 8px; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink), 0 14px 24px rgba(14, 8, 32, 0.35); transition: opacity 0.3s;
}
.notes::before { content: ''; position: absolute; top: -9px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--acc); border: 2.5px solid var(--ink); }
.notes-title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; }
.notes-list { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; line-height: 1.35; }
.notes-list li { padding: 4px 0 4px 18px; border-bottom: 1.5px dashed var(--note-line); position: relative; overflow-wrap: anywhere; }
.notes-list li::before { content: '★'; position: absolute; left: 0; top: 4px; color: var(--acc); -webkit-text-stroke: 0.6px var(--ink); font-family: var(--font-ui); }
.notes-list .notes-empty { opacity: 0.65; font-style: italic; }
.notes-list .notes-empty::before { content: none; }
.notes.pulse { animation: pulse 0.55s var(--bounce); }
@keyframes pulse { 0% { transform: rotate(var(--note-rot)) scale(1); } 40% { transform: rotate(var(--note-rot)) scale(1.07); } 100% { transform: rotate(var(--note-rot)) scale(1); } }

@media (prefers-reduced-motion: no-preference) {
  .owner-svg .o-all { animation: breathe 4.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  .talking .owner-svg .o-all { animation: talkBob 0.32s ease-in-out infinite alternate; }
  .owner-svg .o-eyes { animation: blinkEyes 5s infinite; transform-box: fill-box; transform-origin: center; }
  .talking .owner-svg .o-head { animation: nod 0.9s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 90%; }
  .pendulum { transform-box: view-box; transform-origin: 110px 84px; animation: swing 2s ease-in-out infinite alternate; }
  .sway { transform-box: fill-box; transform-origin: 50% 0; animation: sway 4s ease-in-out infinite alternate; }
  .sway.s2 { animation-delay: -1.3s; } .sway.s3 { animation-delay: -2.6s; }
  .pbub { animation: bubble 1.6s ease-in infinite; transform-box: fill-box; } .pbub.pb2 { animation-delay: 0.5s; } .pbub.pb3 { animation-delay: 1s; }
  .ps { transform-box: fill-box; transform-origin: center; animation: smoke 4.2s ease-out infinite; } .ps2 { animation-delay: 1.4s; } .ps3 { animation-delay: 2.8s; }
  .holo-globe .lon { animation: lon 4s linear infinite; transform-box: fill-box; transform-origin: center; }
  .holo-globe .lon2 { animation: lon 4s linear infinite -2s; transform-box: fill-box; transform-origin: center; }
  .sand-fall { animation: sand 0.8s linear infinite; }
  .mist { animation: mist 6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
  .orbit { animation: blink 2.4s steps(1) infinite; }
  .steam-s path { animation: steamUp 3s ease-in-out infinite; }
  .string { stroke-dasharray: 4 3; animation: dash 30s linear infinite; }
  .motes i { animation: mote 9s ease-in-out infinite; }
  .motes i:nth-child(2n) { animation-duration: 11s; animation-delay: -3s; } .motes i:nth-child(3n) { animation-duration: 13s; animation-delay: -6s; }
  .motes i:nth-child(4n) { animation-delay: -8s; } .motes i:nth-child(5n) { animation-duration: 10s; animation-delay: -1s; }
}
.owner-svg .m-open { opacity: 0; }
.talking .owner-svg .m-open { animation: talkOpen 0.26s steps(1) infinite; }
.talking .owner-svg .m-closed { animation: talkClose 0.26s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .talking .owner-svg .m-open, .talking .owner-svg .m-closed { animation: none; } }
.talking .eqb { animation: eq 0.32s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 50%; }
.talking .eqb.e2 { animation-delay: 0.08s; } .talking .eqb.e3 { animation-delay: 0.16s; } .talking .eqb.e4 { animation-delay: 0.04s; } .talking .eqb.e5 { animation-delay: 0.12s; }
@keyframes talkOpen { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes talkClose { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes talkBob { from { transform: translateY(0) scale(1, 1); } to { transform: translateY(-1.5px) scale(1.01, 0.995); } }
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1.2); } }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px) scaleY(1.008); } }
@keyframes nod { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(1.4deg) translateY(0.6px); } }
@keyframes sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes lon { 0% { transform: scaleX(1); } 50% { transform: scaleX(0.1); } 100% { transform: scaleX(1); } }
@keyframes sand { to { stroke-dashoffset: -5; } }
@keyframes mist { from { transform: translateX(-4px) scale(0.95); opacity: 0.6; } to { transform: translateX(4px) scale(1.05); opacity: 1; } }
@keyframes steamUp { 0%, 100% { opacity: 0.2; transform: translateY(0); } 50% { opacity: 0.6; transform: translateY(-3px); } }
@keyframes dash { to { stroke-dashoffset: -200; } }
@keyframes mote { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 0.9; } 80% { opacity: 0.6; } 100% { opacity: 0; transform: translate(18px, -90px); } }

/* ---------- Game dialogue box ---------- */
.dialogue { position: relative; z-index: 8; padding-block: 24px calc(14px + env(safe-area-inset-bottom, 0px)); max-height: 62vh; overflow-y: auto; background: linear-gradient(180deg, rgba(20, 13, 44, 0), rgba(20, 13, 44, 0.85) 30px); margin-top: -26px; }
.dialogue-inner { max-width: 1000px; margin: 0 auto; }
.dbox {
  position: relative; padding: 30px 22px 18px; border-radius: 22px;
  background: linear-gradient(180deg, #33266a, #241a52); border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 3px #e9c46a, inset 0 0 0 5px var(--ink), 0 6px 0 var(--ink), 0 18px 34px rgba(10, 6, 24, 0.5);
}
.dbox::before, .dbox::after { content: ''; position: absolute; width: 14px; height: 14px; background: var(--gold); border: 2.5px solid var(--ink); transform: rotate(45deg); }
.dbox::before { right: -9px; top: 20px; } .dbox::after { right: -9px; bottom: 20px; }
.speaker { position: absolute; top: -20px; left: 22px; right: 22px; display: flex; align-items: center; gap: 0; min-width: 0; pointer-events: none; }
.speaker-face { position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 50%; overflow: hidden; flex: none; background: #4a3a86; border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--acc), 0 0 0 5.5px var(--ink); margin-top: -14px; }
.speaker-text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; margin-left: -10px; padding: 3px 14px 4px 18px; background: var(--acc); color: var(--ink); border: 3px solid var(--ink); border-radius: 0 12px 12px 0; box-shadow: 0 3px 0 var(--ink); }
.speaker-name { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.2; }
.speaker-role { font-size: 0.78rem; font-weight: 600; opacity: 0.8; }
.step-count { margin-left: auto; flex: none; align-self: flex-end; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--ink); }
.line { font-family: var(--font-body); font-size: clamp(1.08rem, 0.7vw + 0.85rem, 1.26rem); line-height: 1.5; margin: 0 0 14px; min-height: 3em; max-width: 72ch; cursor: default; color: #fff8ec; }
.dots { display: inline-flex; gap: 6px; padding: 8px 0; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); opacity: 0.35; animation: dots 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.18s; } .dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes dots { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 9px; }
.choice {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; padding: 8px 14px 8px 8px; border-radius: 14px;
  background: rgba(255, 244, 220, 0.06); border: 2px solid rgba(255, 244, 220, 0.2); font-family: var(--font-ui); font-weight: 500; font-size: 0.97rem; line-height: 1.3; color: var(--cream);
  transition: background-color 0.15s, border-color 0.15s, transform 0.18s var(--bounce);
}
.choice:hover, .choice:focus-visible { border-color: var(--gold); background: rgba(255, 215, 122, 0.13); transform: translateX(4px); }
.choice-key { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: var(--gold); font-size: 0.82rem; font-weight: 700; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.choice-primary { background: var(--acc); border: 2.5px solid var(--ink); color: var(--ink); font-weight: 600; box-shadow: 0 3px 0 var(--ink); }
.choice-primary:hover, .choice-primary:focus-visible { background: var(--acc); filter: brightness(1.06); }
.choice-primary .choice-key { background: rgba(43, 29, 63, 0.85); }
.choice-quiet, .choice-free { border-style: dashed; color: #e4dafb; background: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .choices:not([hidden]) .choice { animation: choiceIn 0.32s var(--bounce) both; }
  .choices .choice:nth-child(2) { animation-delay: 0.05s; } .choices .choice:nth-child(3) { animation-delay: 0.1s; }
  .choices .choice:nth-child(4) { animation-delay: 0.15s; } .choices .choice:nth-child(5) { animation-delay: 0.2s; }
}
@keyframes choiceIn { from { opacity: 0.1; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
.free-form { display: grid; gap: 8px; margin-top: 10px; max-width: 760px; }
.free-form textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 244, 220, 0.08); color: var(--cream); border: 2px solid rgba(255, 244, 220, 0.3); font-family: var(--font-body); font-size: 1.05rem; line-height: 1.45;
}
.free-form textarea::placeholder { color: #a99cc8; }
.free-form textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.free-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.free-hint { font-size: 0.82rem; color: var(--haze); margin: 0; flex: 1 1 220px; }

/* ---------- Trading cards on the counter ---------- */
.stage.is-recs .owner-wrap { filter: brightness(0.45) saturate(0.8); }
.stage.is-recs .notes, .stage.is-recs .wall-prop { opacity: 0; pointer-events: none; }
.stage.is-recs::after { content: ''; position: absolute; inset: 0; z-index: 3; background: radial-gradient(80% 70% at 50% 45%, rgba(20, 13, 44, 0.45), rgba(14, 8, 32, 0.8)); }
.table {
  position: absolute; inset: 0; z-index: 5; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px max(14px, env(safe-area-inset-right, 0px)) 34px max(14px, env(safe-area-inset-left, 0px));
}
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); gap: 28px; justify-content: center; width: 100%; margin: auto 0; }
.slot { min-width: 0; display: grid; perspective: 1400px; }
.slot-empty { border: 3px dashed rgba(255, 244, 220, 0.3); border-radius: 20px; display: grid; place-items: center; padding: 24px; color: var(--haze); text-align: center; min-height: 160px; font-family: var(--font-body); }
.book-card {
  position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; outline: none;
  transition: transform 0.36s var(--bounce), opacity 0.32s; --yes: 0; --no: 0;
}
.book-card:focus-visible .tc-front { box-shadow: inset 0 0 0 5px var(--acc), inset 0 0 0 7.5px var(--ink), 0 0 0 4px var(--gold), 0 8px 0 var(--ink); }
.book-card.dragging { transition: none; cursor: grabbing; }
.book-card.leaving { pointer-events: none; }
.book-card.fly-left { transform: translate(-140%, 30px) rotate(-24deg) !important; opacity: 0; }
.book-card.fly-up { transform: translate(0, -70%) scale(0.5) rotate(8deg) !important; opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .book-card.enter { animation: deal 0.55s var(--bounce) both; } }
@keyframes deal { from { opacity: 0; transform: translate(0, 140px) rotate(-8deg) scale(0.7); } to { opacity: 1; transform: none; } }
.tc-inner { position: relative; transform-style: preserve-3d; transition: transform 0.6s var(--bounce); height: 100%; }
.book-card.facedown .tc-inner { transform: rotateY(180deg); }
.tc-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; }
.tc-front {
  position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; box-sizing: border-box; padding: 14px 16px 16px;
  background: linear-gradient(180deg, #fffbf1, var(--card)); color: var(--card-ink); border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 5px var(--acc), inset 0 0 0 7.5px var(--ink), 0 8px 0 var(--ink), 0 24px 40px rgba(10, 6, 24, 0.5);
}
.tc-front::after {
  content: ''; position: absolute; inset: 0; border-radius: 17px; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.5) 45%, transparent 60%) -200% 0 / 220% 100% no-repeat;
}
@media (prefers-reduced-motion: no-preference) { .tc-front::after { animation: foil 5s ease-in-out infinite; } }
@keyframes foil { 0%, 60% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.tc-back {
  position: absolute; inset: 0; transform: rotateY(180deg); display: grid; place-items: center; align-content: center; gap: 8px; border: 3px solid var(--ink);
  background: repeating-linear-gradient(45deg, rgba(43, 29, 63, 0.18) 0 10px, transparent 10px 20px), var(--acc);
  box-shadow: inset 0 0 0 6px var(--card), inset 0 0 0 8.5px var(--ink), 0 8px 0 var(--ink);
  color: var(--ink); font-family: var(--font-display); font-size: 1.1rem;
}
.tc-back-emb { width: 76px; height: 76px; padding: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); stroke-width: 1.5; }
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 0; }
.tc-genre { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #5a4636; }
.tc-emb { width: 15px; height: 15px; color: var(--ink); }
.tc-match { display: inline-flex; gap: 1px; }
.tc-match i { display: block; width: 14px; height: 14px; color: rgba(43, 29, 63, 0.18); }
.tc-match i.on { color: #ff5c8a; }
.tc-match svg { width: 100%; height: 100%; display: block; }
.tc-art { display: grid; place-items: center; padding: 10px 0 12px; border-radius: 14px; border: 2.5px solid var(--ink); background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.55), transparent 60%), var(--acc); }
.tc-cover { width: 96px; }
.tc-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.bc-stamps { display: flex; flex-wrap: wrap; gap: 6px; }
.stamp-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--card-ink); background: var(--acc); border: 2px solid var(--ink); border-radius: 8px; padding: 1px 7px; }
.stamp-tag svg { width: 11px; height: 11px; }
.bc-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; line-height: 1.12; color: var(--card-ink); }
.bc-meta { margin: 0; font-size: 0.8rem; color: #6a5646; }
.bc-author { color: var(--card-ink); font-weight: 600; }
.bc-hook { margin: 0; font-family: var(--font-body); font-size: 0.98rem; line-height: 1.38; color: #3a2c20; }
.bc-why { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.bc-why-l { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: #7a6656; margin-right: 2px; font-weight: 600; }
.chip { font-size: 0.74rem; font-weight: 500; padding: 1px 9px; border-radius: 999px; background: rgba(43, 29, 63, 0.08); border: 1.5px solid rgba(43, 29, 63, 0.3); color: var(--card-ink); white-space: nowrap; }
.tc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 7px 10px; border-radius: 12px; background: rgba(43, 29, 63, 0.06); border: 1.5px dashed rgba(43, 29, 63, 0.25); }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stat-l { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #5a4636; }
.pips { display: inline-flex; gap: 3px; }
.pips i { display: block; width: 14px; height: 7px; border-radius: 3px; background: rgba(43, 29, 63, 0.14); border: 1.5px solid var(--ink); }
.pips i.on { background: var(--acc); }
.bc-note { margin: 0; font-size: 0.78rem; color: #8a3a3a; font-style: italic; }
.bc-actions { display: flex; gap: 8px; margin-top: auto; }
.bc-actions button {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; padding: 8px 10px; border-radius: 12px;
  font-weight: 600; font-size: 0.92rem; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform 0.14s var(--smooth), box-shadow 0.14s;
}
.bc-actions button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.bc-actions button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.bc-actions svg { width: 15px; height: 15px; }
.btn-pass { background: #efe4d0; color: var(--card-ink); }
.btn-like { background: var(--rose); color: var(--ink); }
.book-card.is-liked .tc-front { box-shadow: inset 0 0 0 5px var(--acc), inset 0 0 0 7.5px var(--ink), 0 8px 0 var(--ink), 0 0 0 5px var(--gold), 0 0 40px rgba(255, 215, 122, 0.6); }
.book-card.is-liked .bc-actions { opacity: 0.4; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .book-card.is-liked { animation: likedPulse 1.6s ease-in-out infinite; } }
@keyframes likedPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.stamp {
  position: absolute; top: 46px; z-index: 3; pointer-events: none; font-family: var(--font-display); font-size: 1.6rem; padding: 2px 14px;
  border: 4px solid currentColor; border-radius: 10px; text-transform: uppercase; background: rgba(255, 248, 234, 0.85); box-shadow: 0 0 0 2px var(--ink);
}
.stamp-no { right: 18px; color: #d9465f; transform: rotate(12deg); opacity: var(--no); }
.stamp-yes { left: 18px; color: #e0437a; transform: rotate(-12deg); opacity: var(--yes); }
.book-card.is-liked .stamp-yes { opacity: 1; }
.table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; width: 100%; max-width: 960px; }
.shortlist { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sl-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.sl-item { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 12px; cursor: pointer; background: var(--card); color: var(--card-ink); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: 0.82rem; max-width: 260px; transition: transform 0.18s var(--bounce); }
.sl-item:hover { transform: translateY(-2px) rotate(-1deg); }
.sl-item .cover { width: 26px; }
.sl-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sl-pick { color: #b0365e; font-weight: 600; font-size: 0.76rem; }
.btn-archive .btn-archive-sub { font-weight: 500; opacity: 0.75; font-size: 0.78rem; }
.table-hint { margin: 0; text-align: center; font-size: 0.8rem; color: var(--haze); }
@media (hover: none) { .table-hint { display: none; } }
.search-veil { display: none; }
.table.is-searching .search-veil { display: grid; place-items: center; position: absolute; inset: 0; z-index: 6; background: rgba(14, 8, 32, 0.78); text-align: center; padding: 20px; }
.search-veil p { font-family: var(--font-body); font-size: 1.15rem; margin: 12px 0 0; }
.search-orb { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 35% 32%, #fff, #d6c8ff 45%, #7a5bd6 100%); box-shadow: 0 0 30px rgba(196, 166, 255, 0.7); animation: orb 1.6s ease-in-out infinite; }
@keyframes orb { 0%, 100% { transform: scale(0.92); } 50% { transform: scale(1.06); } }

/* ---------- Generated covers ---------- */
.cover {
  position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 3px 8px 8px 3px; overflow: hidden; container-type: inline-size;
  background-color: var(--c1); color: var(--ink); border: 2px solid var(--ink); box-sizing: border-box;
  box-shadow: inset 5px 0 0 rgba(0, 0, 0, 0.22), inset 7px 0 0 rgba(255, 255, 255, 0.07), 0 4px 0 var(--ink);
}
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(255, 255, 255, 0.14), transparent 35%, rgba(0, 0, 0, 0.16)); pointer-events: none; }
.cover-detective { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.16) 0 6px, transparent 6px 14px); }
.cover-romance { background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.4px, transparent 1.9px); background-size: 11px 11px; }
.cover-fantasy { background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.14) 25%, transparent 25%), linear-gradient(225deg, rgba(0, 0, 0, 0.14) 25%, transparent 25%), linear-gradient(45deg, rgba(0, 0, 0, 0.14) 25%, transparent 25%), linear-gradient(315deg, rgba(0, 0, 0, 0.14) 25%, transparent 25%); background-size: 18px 18px; }
.cover-scifi { background-image: repeating-radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.12) 0 1.4px, transparent 1.4px 11px); }
.cover-horror { background-image: radial-gradient(ellipse at 50% 34%, transparent 22%, rgba(0, 0, 0, 0.55) 100%); }
.cover-history { background-image: repeating-conic-gradient(from -90deg at 50% 108%, rgba(255, 255, 255, 0.08) 0 5deg, transparent 5deg 10deg); }
.cover-fortune { background-image: radial-gradient(rgba(255, 230, 160, 0.3) 0.9px, transparent 1.4px), radial-gradient(circle at 50% 30%, var(--c2), transparent 72%); background-size: 9px 9px, 100% 100%; }
.cover-frame {
  position: absolute; inset: 7%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45em;
  padding: 0.5em 0.4em; text-align: center; color: var(--ink); border: 1px solid rgba(255, 232, 180, 0.65); outline: 1px solid rgba(255, 232, 180, 0.25); outline-offset: 2px;
  font-size: 12px; font-size: 9.5cqw;
}
.cover-title { font-family: var(--font-display); line-height: 1.06; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; max-width: 100%; }
.cover-author { font-size: 0.58em; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; font-weight: 600; line-height: 1.2; }
.cover-rule { width: 30%; height: 1px; background: currentColor; opacity: 0.55; }
.cover-emblem { width: 1.7em; height: 1.7em; opacity: 0.85; }
.cover-sm { border-width: 1.5px; box-shadow: none; }
.cover-sm .cover-frame { inset: 6%; border-width: 0; outline: none; gap: 0; padding: 0; }
.cover-sm .cover-title, .cover-sm .cover-author, .cover-sm .cover-rule { display: none; }
.cover-sm .cover-emblem { width: 60%; height: 60%; }

/* =======================================================================
   THE PAIRING
   ======================================================================= */
.screen-pair { min-height: 100%; background: radial-gradient(1100px 520px at 12% -12%, rgba(196, 166, 255, 0.18), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(255, 215, 122, 0.1), transparent 60%), var(--night); }
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding-block: 10px; background: rgba(20, 13, 44, 0.9); border-bottom: 3px solid var(--ink); backdrop-filter: blur(8px);
}
.bar .btn-ghost { justify-self: start; padding: 6px 13px; font-size: 0.86rem; }
.bar-title { font-family: var(--font-display); font-size: 1.15rem; color: var(--acc); }
.pair-wrap { max-width: 1120px; margin: 0 auto; padding-block: 30px calc(64px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 26px; }
.pair-hero { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 26px; align-items: center; }
.pair-cover { transform: rotate(-3deg); }
.pair-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.04; margin: 6px 0 8px; color: var(--cream); }
.pair-by { margin: 0; color: #efe4ff; font-family: var(--font-body); font-size: 1.08rem; }
.pair-time { margin: 4px 0 0; color: var(--haze); font-size: 0.92rem; }
.pair-quote { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; font-family: var(--font-body); font-style: italic; font-size: 1.08rem; color: #fff4dc; }
.pair-face { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex: none; background: #4a3a86; border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--acc), 0 0 0 5.5px var(--ink); }
.pair-quote cite { display: block; font-style: normal; font-family: var(--font-ui); font-size: 0.82rem; color: var(--acc); font-weight: 600; margin-top: 2px; }
.pair-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pair-side { display: grid; gap: 20px; min-width: 0; align-content: start; }
.card { background: var(--dusk); border: 3px solid var(--ink); border-radius: 22px; padding: 20px; min-width: 0; box-shadow: 0 6px 0 var(--ink), inset 0 0 0 2px rgba(255, 215, 122, 0.18); }
.card-h { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; margin: 4px 0 6px; color: var(--gold); }
.drink-card { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 20px; align-items: start; }
.drink-stage { position: sticky; top: 80px; }
.drink-visual { position: relative; border-radius: 18px; padding: 10px 6px 4px; background: radial-gradient(circle at 50% 60%, rgba(255, 215, 122, 0.22), transparent 70%); }
.drink-visual svg, .snack-visual svg { display: block; width: 100%; height: auto; overflow: visible; }
.brewed {
  position: absolute; left: 50%; top: -6px; z-index: 2; white-space: nowrap; padding: 3px 14px; border-radius: 999px; pointer-events: none;
  background: var(--gold); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: var(--font-display); font-size: 1rem;
  transform: translateX(-50%) scale(0); opacity: 0;
}
.brewed.show { animation: ribbon 2.4s var(--bounce) both; }
@keyframes ribbon { 0% { transform: translateX(-50%) scale(0) rotate(-12deg); opacity: 0; } 18% { transform: translateX(-50%) scale(1.12) rotate(4deg); opacity: 1; } 28%, 78% { transform: translateX(-50%) scale(1) rotate(-3deg); opacity: 1; } 100% { transform: translateX(-50%) scale(0.9) translateY(-10px); opacity: 0; } }
.drink-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); background: var(--mint); border: 2px solid var(--ink); border-radius: 8px; padding: 1px 7px; margin-left: 8px; vertical-align: middle; }
.drink-why { font-family: var(--font-body); font-size: 1.08rem; margin: 0 0 14px; color: #f4ebff; }
.opts { display: grid; gap: 10px; margin-bottom: 14px; }
.opt { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 10px; }
.opt-l { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--haze); font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(10, 6, 24, 0.35); border: 2px solid var(--ink); justify-self: start; max-width: 100%; }
.seg button { border: 2px solid transparent; background: transparent; padding: 5px 12px; border-radius: 11px; font-size: 0.88rem; font-weight: 500; cursor: pointer; color: #ddd2f5; white-space: nowrap; transition: background-color 0.15s, transform 0.15s var(--bounce); }
.seg button:hover { color: var(--cream); background: rgba(255, 244, 220, 0.08); }
.seg button[aria-pressed="true"] { background: var(--acc); color: var(--ink); font-weight: 600; border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.ticket {
  position: relative; margin: 6px 0 22px; padding: 14px 16px 16px; background: var(--card); color: var(--card-ink); font-family: var(--font-mono);
  border-radius: 6px 6px 0 0; border: 2.5px solid var(--ink); border-bottom: 0; box-shadow: 4px 6px 0 rgba(10, 6, 24, 0.45); font-size: 0.94rem; line-height: 1.45; transform: rotate(-0.6deg);
}
.ticket::after {
  content: ''; position: absolute; left: -2.5px; right: -2.5px; bottom: -10px; height: 10px;
  background: linear-gradient(-45deg, transparent 5px, var(--card) 5px) 0 0 / 10px 10px repeat-x, linear-gradient(45deg, transparent 5px, var(--card) 5px) 0 0 / 10px 10px repeat-x;
}
.ticket-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; letter-spacing: 0.12em; font-size: 0.78rem; border-bottom: 1.5px dashed rgba(0, 0, 0, 0.3); padding-bottom: 6px; margin-bottom: 8px; text-transform: uppercase; }
.ticket-lines { list-style: none; margin: 0; padding: 0; }
.ticket-lines li { padding: 1px 0; }
.ticket-lines li.first { font-weight: 700; font-size: 1.02rem; }
.ticket-say { margin: 10px 0 0; padding-top: 8px; border-top: 1.5px dashed rgba(0, 0, 0, 0.3); font-size: 0.88rem; }
.ticket-say b { display: block; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }
.ticket-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.drink-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.where { font-size: 0.88rem; color: var(--haze); margin: 14px 0 0; }
.home { margin-top: 12px; border-top: 2px dashed var(--line); padding-top: 10px; }
.home summary { cursor: pointer; font-weight: 600; font-size: 0.94rem; color: var(--gold); }
.home p { margin: 8px 0 0; font-family: var(--font-body); color: #efe4ff; font-size: 1rem; }
.snack-card { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; align-items: center; }
.snack-visual.pop-in { animation: popIn 0.7s var(--bounce) both; }
@keyframes popIn { 0% { transform: scale(0.3) rotate(-10deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.snack-name { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; margin: 4px 0; color: var(--gold); }
.snack-line { margin: 0 0 12px; font-family: var(--font-body); font-size: 1.04rem; color: #efe4ff; }
.mood-list { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px 12px; margin: 10px 0 0; }
.mood-list dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--haze); font-weight: 600; padding-top: 4px; }
.mood-list dd { margin: 0; font-family: var(--font-body); font-size: 1.04rem; }
.mood-foot { margin: 12px 0 0; font-size: 0.86rem; color: var(--haze); }
.pair-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-top: 4px; }
.pair-cta p { margin: 0; color: var(--haze); font-size: 0.92rem; max-width: 48ch; }

/* =======================================================================
   THE READING NOOK
   ======================================================================= */
.screen-read { height: 100%; min-height: 560px; display: grid; grid-template-columns: minmax(0, 1fr) 390px; overflow: hidden; --room: #3a2a4e; background: var(--room); }
.screen-read[data-weather="rain"] { --room: #34405e; }
.screen-read[data-weather="snow"] { --room: #5a3a32; }
.screen-read[data-weather="petals"] { --room: #6a3352; }
.screen-read[data-weather="fireflies"] { --room: #2f4a3a; }
.screen-read[data-weather="stars"] { --room: #2c3566; }
.screen-read[data-weather="fog"] { --room: #3d2f55; }
.room { position: relative; overflow: hidden; min-height: 0; }
.room-wall { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 2px, transparent 2.5px) 0 0 / 26px 26px, radial-gradient(70% 60% at 82% 84%, rgba(255, 215, 122, 0.24), transparent 70%), radial-gradient(60% 60% at 50% 30%, rgba(255, 255, 255, 0.05), transparent 70%), var(--room); }
.window { position: absolute; top: 7%; left: 50%; transform: translateX(-50%); width: min(60%, 540px); aspect-ratio: 5 / 4; max-height: 52%; }
.window canvas { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); display: block; border-radius: 999px 999px 4px 4px; }
.window-frame { position: absolute; inset: 0; border: 14px solid #7a5236; border-radius: 999px 999px 8px 8px; box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--ink), 0 18px 40px rgba(14, 8, 32, 0.45); pointer-events: none; }
.window-frame::before, .window-frame::after { content: ''; position: absolute; background: #7a5236; box-shadow: 0 0 0 2px var(--ink); }
.window-frame::before { left: 50%; top: 0; bottom: 0; width: 10px; margin-left: -5px; }
.window-frame::after { top: 52%; left: 0; right: 0; height: 10px; }
.sill { position: absolute; left: -26px; right: -26px; bottom: -16px; height: 18px; background: #8a6244; border: 3px solid var(--ink); border-radius: 8px; box-shadow: 0 6px 0 rgba(14, 8, 32, 0.4); }
.curtain { position: absolute; top: -18px; bottom: -34px; width: 24%; pointer-events: none; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0 6px, rgba(255, 255, 255, 0.08) 6px 14px, rgba(0, 0, 0, 0.12) 14px 22px), var(--acc); border: 3px solid var(--ink); opacity: 0.92; filter: saturate(0.75) brightness(0.8); }
.curtain-l { left: -11%; border-radius: 6px 6px 0 60%; }
.curtain-r { right: -11%; border-radius: 6px 6px 60% 0; }
.rod { position: absolute; top: -26px; left: -15%; right: -15%; height: 8px; border-radius: 4px; background: #c9a14a; border: 2.5px solid var(--ink); }
.table-top { position: absolute; left: -2%; right: -2%; bottom: 0; height: 30%; background: linear-gradient(180deg, #a06a42 0, #8a5a38 14px, #6b4430 100%); border-top: 3px solid var(--ink); }
.table-top::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 2px, transparent 2px 90px); }
.items { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); width: min(96%, 780px); display: grid; grid-template-columns: 0.95fr 1.6fr 1.05fr; align-items: end; gap: 3%; }
.tt { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.tt-drink-art, .tt-snack-art, .tt-book { width: 100%; }
.tt-drink-art { max-width: 190px; } .tt-snack-art { max-width: 230px; }
.tt svg { display: block; width: 100%; height: auto; overflow: visible; }
.tt-label { font-size: 0.74rem; line-height: 1.25; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: 8px; padding: 1px 8px; text-align: center; font-weight: 600; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tt-book { align-self: end; margin-bottom: 4%; }
.book-svg text { font-family: var(--font-body); }
@media (prefers-reduced-motion: no-preference) {
  .cup-hot .st { animation: steam 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  .cup-hot .st2 { animation-delay: 1.1s; } .cup-hot .st3 { animation-delay: 2.2s; }
  .cup-iced .drip { animation: drip 6s ease-in infinite; }
  .page-flip.flipping { animation: flip 1.1s ease-in-out; transform-box: view-box; transform-origin: 140px 60px; }
}
.page-flip { opacity: 0; }
@keyframes steam { 0% { opacity: 0; transform: translateY(6px) scaleY(0.9); } 35% { opacity: 0.8; } 100% { opacity: 0; transform: translateY(-16px) scaleY(1.1); } }
@keyframes drip { 0%, 30% { transform: translateY(0); opacity: 0; } 35% { opacity: 0.6; } 100% { transform: translateY(110px); opacity: 0; } }
@keyframes flip { 0% { opacity: 1; transform: scaleX(1); } 50% { opacity: 1; transform: scaleX(0.02); } 51% { opacity: 1; transform: scaleX(-0.02); } 100% { opacity: 0; transform: scaleX(-1); } }
.snack-svg .crumb { transition: opacity 0.6s; }
.cup-svg, .snack-svg, .book-svg { filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink)); }

.timer-panel { position: relative; z-index: 2; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; background: linear-gradient(180deg, #2a1f55, #1f1745); border-left: 3px solid var(--ink); padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px)); }
.read-back { align-self: flex-start; padding: 6px 13px; font-size: 0.86rem; }
.t-block { display: flex; flex-direction: column; gap: 16px; }
.t-h { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.12; margin: 2px 0 0; color: var(--gold); }
.t-reward { margin-top: 6px; color: var(--mint); font-weight: 500; }
.field { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.field legend { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--haze); font-weight: 600; padding: 0; margin-bottom: 8px; }
.custom-min { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--haze); }
.custom-min input, .vol input { accent-color: var(--gold); }
.custom-min input { width: 76px; padding: 6px 9px; border-radius: 10px; background: rgba(255, 244, 220, 0.08); color: var(--cream); border: 2px solid rgba(255, 244, 220, 0.3); font: inherit; }
.hint { margin: 0; color: var(--haze); font-size: 0.88rem; }
.t-phase { margin: 0; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc); font-weight: 600; }
.t-clock { font-family: var(--font-display); font-weight: 400; font-size: clamp(3.6rem, 7vw, 5.4rem); line-height: 1; color: var(--cream); text-shadow: 0 5px 0 var(--ink); white-space: nowrap; }
.t-clock .d { display: inline-block; width: 0.66em; text-align: center; }
.t-clock .c { display: inline-block; width: 0.34em; text-align: center; }
.t-bar { height: 14px; border-radius: 8px; background: rgba(10, 6, 24, 0.45); overflow: hidden; border: 2.5px solid var(--ink); }
.t-bar span { display: block; height: 100%; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.25) 0 8px, transparent 8px 16px), var(--acc); transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.25s linear; }
.t-status { margin: 0; font-size: 0.9rem; color: #efe4ff; min-height: 1.3em; }
.t-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.sound-row { display: grid; gap: 10px; }
.vol { display: flex; align-items: center; gap: 10px; font-size: 0.84rem; color: var(--haze); }
.vol input { flex: 1; }
.t-done-q { font-family: var(--font-body); font-style: italic; font-size: 1.05rem; color: #fff4dc; margin: 0; }
.t-done-p { margin: 0; font-family: var(--font-body); font-size: 1.05rem; color: #efe4ff; }
.reward { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: rgba(10, 6, 24, 0.35); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px rgba(255, 215, 122, 0.25); }
.rw-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.rw-xp { font-family: var(--font-display); font-size: 1.9rem; color: var(--gold); text-shadow: 0 3px 0 var(--ink); }
.rw-level { font-weight: 600; color: var(--cream); }
.rw-bar { height: 14px; border-radius: 8px; background: rgba(255, 244, 220, 0.12); border: 2.5px solid var(--ink); overflow: hidden; }
.rw-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffb46b); transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.2s var(--smooth); }
.rw-up { margin: 0; justify-self: start; padding: 2px 12px; border-radius: 999px; background: var(--mint); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: var(--font-display); font-size: 1.05rem; }
@media (prefers-reduced-motion: no-preference) { .rw-up:not([hidden]) { animation: popIn 0.7s var(--bounce) 0.6s both; } }
.rw-stamp { display: flex; align-items: center; gap: 14px; }
.rw-stamp-art { display: grid; place-items: center; gap: 2px; width: 92px; height: 92px; flex: none; border-radius: 50%; border: 4px double var(--acc); color: var(--acc); transform: rotate(-12deg); text-align: center; font-family: var(--font-display); font-size: 0.68rem; line-height: 1.05; padding: 10px; box-sizing: border-box; background: rgba(10, 6, 24, 0.3); }
.rw-emb { width: 30px; height: 30px; }
.rw-stamp-note { margin: 0; font-weight: 500; color: var(--cream); }
@media (prefers-reduced-motion: no-preference) { .rw-stamp.slam .rw-stamp-art { animation: slam 0.55s cubic-bezier(.5, 0, .7, .4) 0.9s both; } }
@keyframes slam { 0% { transform: scale(2.6) rotate(-30deg); opacity: 0; } 70% { transform: scale(0.92) rotate(-10deg); opacity: 1; } 100% { transform: scale(1) rotate(-12deg); opacity: 1; } }
.screen-read.is-running .read-back { opacity: 0.75; }

/* ---------- Library card ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(14, 8, 32, 0.72); backdrop-filter: blur(3px); overflow-y: auto; }
.library-card {
  position: relative; width: min(520px, 100%); box-sizing: border-box; padding: 22px 22px 20px; border-radius: 18px; color: var(--card-ink);
  background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(70, 110, 170, 0.18) 27px 28px), var(--card);
  border: 3px solid var(--ink); box-shadow: 0 8px 0 var(--ink), 0 30px 60px rgba(10, 6, 24, 0.6);
}
@media (prefers-reduced-motion: no-preference) { .modal:not([hidden]) .library-card { animation: cardIn 0.5s var(--bounce) both; } }
@keyframes cardIn { from { transform: translateY(40px) rotate(-4deg) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.library-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; border-radius: 15px 15px 0 0; background: repeating-linear-gradient(90deg, var(--rose) 0 22px, var(--gold) 22px 44px, var(--mint) 44px 66px, #c4a6ff 66px 88px); border-bottom: 2.5px solid var(--ink); }
.library-card .eyebrow { color: #7a6656; margin-top: 4px; }
.lc-h { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; margin: 2px 0 12px; color: var(--card-ink); }
.modal-x { position: absolute; top: 16px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--gold); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.lc-top { display: flex; align-items: center; gap: 14px; }
.lc-avatar { width: 64px; flex: none; padding: 6px; border-radius: 16px; background: #ffe9b8; border: 2.5px solid var(--ink); }
.lc-avatar svg { display: block; width: 100%; height: auto; }
.lc-who { flex: 1; min-width: 0; }
.lc-level { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.2rem; }
.lc-xp { height: 14px; border-radius: 8px; background: rgba(43, 29, 63, 0.1); border: 2.5px solid var(--ink); overflow: hidden; }
.lc-xp span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffb46b); transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.8s var(--smooth); }
.lc-next { margin: 5px 0 0; font-size: 0.82rem; color: #6a5646; }
.lc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 8px; }
.lc-stats div { padding: 8px 12px; border-radius: 12px; border: 2px solid var(--ink); background: #fff3d6; }
.lc-stats dt { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: #7a6656; font-weight: 600; }
.lc-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.3rem; }
.lc-sub { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; margin: 14px 0 8px; }
.lc-stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.lc-stamps li { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 8px 4px; border-radius: 12px; border: 2px dashed rgba(43, 29, 63, 0.35); }
.lc-stamps li.on { border-style: solid; border-color: var(--ink); background: #fff3d6; }
.lc-stamp { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 3px double rgba(43, 29, 63, 0.25); color: rgba(43, 29, 63, 0.25); }
.lc-stamps li.on .lc-stamp { border-color: var(--ink); color: var(--card-ink); background: var(--acc); transform: rotate(-10deg); }
.lc-emb { width: 24px; height: 24px; }
.lc-sname { font-size: 0.74rem; font-weight: 600; line-height: 1.15; }
.lc-count { font-size: 0.7rem; color: #7a6656; }
.library-card .log-list li { border-bottom-color: rgba(43, 29, 63, 0.2); }
.library-card .log-m, .library-card .log-empty { color: #6a5646; }

/* =======================================================================
   SMALL SCREENS
   ======================================================================= */
@media (max-width: 1100px) {
  .notes { width: min(200px, 24%); }
  .wall-prop { left: 25%; width: min(19%, 170px); }
}
@media (max-width: 900px) {
  .cards { grid-template-columns: minmax(0, 560px); gap: 18px; }
  .tc-front { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "top top" "art body" "act act"; gap: 10px 14px; }
  .tc-top { grid-area: top; } .tc-art { grid-area: art; align-self: start; padding: 8px 0; } .tc-body { grid-area: body; } .bc-actions { grid-area: act; }
  .tc-cover { width: 72px; }
  .bc-hook { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .stamp { top: 40px; }
  .pair-grid { grid-template-columns: minmax(0, 1fr); }
  .screen-read { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(330px, 56vh) auto; height: auto; min-height: 100%; overflow: visible; }
  .timer-panel { border-left: 0; border-top: 3px solid var(--ink); overflow: visible; }
  .t-clock { font-size: clamp(3.2rem, 16vw, 4.6rem); }
}
@media (max-width: 720px) {
  .shelf { width: 30%; bottom: 19%; opacity: 0.6; }
  .shelf-l { left: -7%; } .shelf-r { right: -7%; }
  .wall-prop, .beam { display: none; }
  .backwin { width: 46%; top: 7%; }
  .owner-wrap { height: 70%; }
  .notes { display: none; }
  .notes.open { display: block; top: 4%; right: 3%; width: min(240px, 72%); }
  .notes-toggle { display: inline-flex !important; }
  .counter-prop { right: 4%; width: min(20%, 110px); }
  .shop-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .hide-sm { display: none; }
  .bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pair-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
  .drink-card { grid-template-columns: minmax(0, 1fr); }
  .drink-stage { position: static; max-width: 160px; margin: 0 auto; }
  .snack-card { grid-template-columns: 104px minmax(0, 1fr); }
  .opt { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .street-head { padding-block: 66px 0; }
  .moon { top: 70px; right: 4%; width: 66px; }
  .hud-xp { width: 80px; }
  .choices { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .choice { padding: 7px 12px 7px 7px; font-size: 0.94rem; }
  .line { min-height: 0; }
  .dbox { padding: 28px 14px 14px; }
  .speaker { left: 12px; right: 12px; }
  .speaker-face { width: 50px; height: 50px; }
  .items { grid-template-columns: 0.9fr 1.5fr 1.1fr; bottom: 7%; }
  .window { width: min(78%, 440px); top: 7%; }
}
@media (max-width: 480px) {
  .sign { font-size: 2.6rem; }
  .moon { top: 74px; right: 3%; width: 54px; }
  .speaker-name { white-space: nowrap; }
  .step-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6rem; padding: 2px 7px; letter-spacing: 0.08em; }
  .tc-front { grid-template-columns: 74px minmax(0, 1fr); padding: 12px 12px 14px; }
  .tc-cover { width: 58px; }
  .bc-title { font-size: 1.14rem; }
  .bc-hook { -webkit-line-clamp: 3; font-size: 0.94rem; }
  .tc-stats { grid-template-columns: minmax(0, 1fr); }
  .speaker-role { display: none; }
  .hud-title { font-size: 0.78rem; }
  .tt-label { font-size: 0.64rem; }
}
@media (max-height: 640px) and (min-width: 721px) {
  .owner-wrap { height: 72%; }
  .notes { display: none; }
}

/* =======================================================================
   V1: THE ENCHANTED NIGHT STREET (Lantern Alley, painted layers, mist)
   ======================================================================= */
.scene {
  background:
    radial-gradient(90% 46% at 50% 82%, rgba(122, 92, 220, 0.38) 0%, rgba(122, 92, 220, 0) 70%),
    radial-gradient(60% 40% at 18% 70%, rgba(80, 170, 220, 0.16) 0%, rgba(80, 170, 220, 0) 70%),
    linear-gradient(180deg, #06051a 0%, #0d0b2b 20%, #161241 42%, #211a58 60%, #2a2168 74%, #1c1648 100%);
}
.scene::after { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(130% 92% at 50% 42%, rgba(0, 0, 0, 0) 58%, rgba(5, 3, 18, 0.62) 100%); }
.moon::before { content: ''; position: absolute; left: 50%; top: 50%; width: 360%; height: 360%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(232, 214, 255, 0.24) 0%, rgba(190, 160, 255, 0.1) 34%, rgba(0, 0, 0, 0) 66%); pointer-events: none; }
.cloud { opacity: 0.42; filter: blur(1.4px); }
.street-head .eyebrow { color: #cdbdf5; }
.street { --bw: clamp(156px, 14vw, 206px); padding-top: 108px; }
.layer { left: -130px; right: auto; }
.layer svg { width: 100%; height: 100%; }
.layer-far { bottom: 150px; height: 300px; filter: blur(0.5px) saturate(1.05); }
.layer-mid { bottom: 112px; height: 240px; }
.street-row { padding: 0 48px; gap: 6px; }
.bldg::before { content: ''; position: absolute; left: -14%; right: -14%; top: 8%; bottom: -4%; z-index: -1; pointer-events: none; border-radius: 45% 45% 20% 20%; background: radial-gradient(ellipse at 50% 60%, rgba(255, 190, 110, 0.2), rgba(255, 190, 110, 0) 66%); }
.bldg:hover .bldg-art, .bldg:focus-visible .bldg-art { filter: brightness(1.1); }
.bldg::after { content: ''; position: absolute; left: 50%; bottom: -66px; width: 140%; height: 74px; transform: translateX(-50%); pointer-events: none; z-index: -1; background: radial-gradient(ellipse at center, rgba(255, 196, 110, 0.34), rgba(255, 196, 110, 0) 68%); mix-blend-mode: screen; }
.gate { position: relative; flex: none; width: calc(var(--bw) * 0.84); margin: 0 4px; pointer-events: none; }
.gate svg { display: block; width: 100%; height: auto; overflow: visible; }
.gate::after { content: ''; position: absolute; left: 50%; bottom: -52px; width: 170%; height: 60px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(200, 160, 255, 0.26), rgba(200, 160, 255, 0) 70%); }
.verge {
  border-top-color: #0b0920;
  background:
    radial-gradient(circle, #c9a6ff 2.2px, transparent 3px) 6px 10px / 46px 30px,
    radial-gradient(circle, #8fe3e0 1.8px, transparent 2.6px) 24px 20px / 38px 26px,
    radial-gradient(circle, #fff1c8 1.4px, transparent 2.2px) 34px 6px / 54px 34px,
    linear-gradient(180deg, #1b3340, #142632);
}
.lane { border-top-color: #0b0920; background-color: #221b4a; background-repeat: repeat-x; background-size: auto 100%; }
.street-help { background: #0e0b26; color: #b9aee0; }
.lamp::before { width: 170px; height: 170px; background: radial-gradient(circle, rgba(255, 210, 122, 0.45) 0%, rgba(255, 210, 122, 0) 62%); }
.fore { position: absolute; left: -130px; top: 0; bottom: 0; z-index: 5; pointer-events: none; will-change: transform; }
.canopy { position: absolute; top: -14px; height: 170px; }
.canopy-svg { display: block; overflow: visible; filter: drop-shadow(0 6px 10px rgba(4, 2, 16, 0.6)); }
.raceme { position: absolute; transform-origin: 50% 0; }
.raceme svg { display: block; overflow: visible; }
.clump { position: absolute; bottom: -8px; transform-origin: 50% 100%; }
.clump svg { display: block; filter: drop-shadow(0 0 6px rgba(143, 227, 224, 0.3)); }
#atmo { position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: 3; pointer-events: none; }
.callout {
  position: absolute; z-index: 6; display: flex; gap: 8px; align-items: center; width: max-content; max-width: min(300px, 74vw);
  padding: 7px 13px 7px 7px; border-radius: 16px; background: var(--card); color: var(--card-ink); border: 2.5px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink), 0 12px 26px rgba(4, 2, 16, 0.45); font-size: 0.86rem; line-height: 1.3; font-weight: 500;
  pointer-events: none; opacity: 0; transform: translate(-50%, -100%) scale(0.92); transform-origin: 50% 100%; transition: opacity 0.35s, transform 0.4s var(--bounce);
}
.callout.show { opacity: 1; transform: translate(-50%, calc(-100% - 8px)) scale(1); }
.callout::after { content: ''; position: absolute; left: var(--ax, 50%); bottom: -9px; width: 12px; height: 12px; margin-left: -6px; background: var(--card); border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); }
.co-face { flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #f3e6c4; border: 2px solid var(--ink); }
.co-face svg { display: block; width: 100%; height: 100%; }
.scroll-hint { bottom: 64px; }
@media (prefers-reduced-motion: no-preference) {
  .raceme { animation: sway var(--dur, 6s) ease-in-out var(--d, 0s) infinite alternate; }
  .clump { animation: swayClump 7s ease-in-out var(--d, 0s) infinite alternate; }
  .gate .wisteria { animation: sway 6s ease-in-out infinite alternate; animation-delay: var(--d); }
  .bldg .flag { animation: flagWave 1.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0 50%; }
  .bldg .neon { animation: neon 5s steps(1) infinite; }
  .owner-svg .o-parrot { animation: parrot 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 30% 90%; }
  .owner-svg .jelly { animation: jelly 2.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 30%; }
}
@keyframes swayClump { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
@keyframes flagWave { from { transform: skewY(-4deg) scaleX(0.94); } to { transform: skewY(4deg) scaleX(1.04); } }
@keyframes neon { 0%, 100% { opacity: 1; } 62% { opacity: 0.35; } 64% { opacity: 1; } 66% { opacity: 0.5; } 68% { opacity: 1; } }
@keyframes parrot { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-8deg) translateY(-2px); } 84% { transform: rotate(5deg); } }
@keyframes jelly { from { transform: translateY(0) scaleY(1); } to { transform: translateY(-3px) scaleY(0.88); } }
.neon path:first-child { filter: drop-shadow(0 0 4px #ff4fa0) drop-shadow(0 0 10px #ff4fa0); }
@media (max-width: 760px) {
  .street { padding-top: 110px; }
  .canopy { transform: scale(0.78); transform-origin: 0 0; }
  .clump { transform: scale(0.8); }
}

/* Shop interiors for Lantern Alley */
:root { --acc-literary: #f0b8c8; --acc-cozy: #ffc27a; --acc-adventure: #7ac8e8; --acc-nonfiction: #9fe0b0; --acc-ya: #c9a6ff; --acc-classics: #e8c878; }
[data-shop="literary"] { --acc: var(--acc-literary); }
[data-shop="cozy"] { --acc: var(--acc-cozy); }
[data-shop="adventure"] { --acc: var(--acc-adventure); }
[data-shop="nonfiction"] { --acc: var(--acc-nonfiction); }
[data-shop="ya"] { --acc: var(--acc-ya); }
[data-shop="classics"] { --acc: var(--acc-classics); }
.screen-shop[data-shop="literary"] { --wall: #2e3448; --counter: #3a2a2a; --counter-top: #c0a888; --shelf: #3a2a24; --shelf-back: #15121c; --wall-art: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 26px), repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 64px); --note-bg: #f6f1e6; --note-ink: #2a2530; --note-rot: -1.5deg; }
.screen-shop[data-shop="cozy"] { --wall: #7a5a3a; --counter: #a06a42; --counter-top: #f3d7a8; --shelf: #8a5a34; --shelf-back: #3a2614; --wall-art: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 50%, transparent 50%) 0 0 / 36px 36px, linear-gradient(rgba(255, 255, 255, 0.06) 50%, transparent 50%) 0 0 / 36px 36px; --note-bg: #fff6e6; --note-ink: #5a3a22; --note-rot: 2deg; }
.screen-shop[data-shop="adventure"] { --wall: #2a4a5a; --counter: #6b4428; --counter-top: #9a6a40; --shelf: #6b4428; --shelf-back: #14232a; --wall-art: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 3px, transparent 3px 34px); --note-bg: #ecdcb0; --note-ink: #3a2a1a; --note-font: var(--font-mono); --note-rot: -2deg; }
.screen-shop[data-shop="nonfiction"] { --wall: #2f4a3a; --counter: #5a4430; --counter-top: #c9b48a; --shelf: #5a4430; --shelf-back: #18241c; --wall-art: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 2px, transparent 2.5px) 0 0 / 22px 22px; --note-bg: #fbf6e8; --note-ink: #2a3a2a; --note-rot: 1deg; }
.screen-shop[data-shop="ya"] { --wall: #3f3478; --counter: #5a4aa8; --counter-top: #ffd45a; --shelf: #5a4aa8; --shelf-back: #1c1640; --wall-art: radial-gradient(circle at 30% 30%, rgba(255, 122, 182, 0.14) 4px, transparent 4.5px) 0 0 / 46px 46px, radial-gradient(circle at 70% 70%, rgba(90, 209, 180, 0.14) 3px, transparent 3.5px) 0 0 / 46px 46px; --note-bg: #fff4a8; --note-ink: #3a2a5a; --note-rot: -2.5deg; }
.screen-shop[data-shop="classics"] { --wall: #3a2a3a; --counter: #4a2e22; --counter-top: #8a5a3a; --shelf: #4a2e22; --shelf-back: #1a1014; --wall-art: repeating-linear-gradient(90deg, rgba(232, 200, 120, 0.06) 0 2px, transparent 2px 90px), linear-gradient(transparent 70%, rgba(0, 0, 0, 0.18) 70% 71.5%, transparent 71.5%); --note-bg: #f3e8cc; --note-ink: #3a2416; --note-font: var(--font-mono); --note-rot: -1deg; }
.cover-literary { background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 12px); }
.cover-cozy { background-image: radial-gradient(rgba(255, 255, 255, 0.2) 2px, transparent 2.6px); background-size: 14px 14px; }
.cover-adventure { background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.12) 0 4px, transparent 4px 16px); }
.cover-nonfiction { background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px); background-size: 12px 12px; }
.cover-ya { background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.25) 3px, transparent 3.5px), radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.18) 2px, transparent 2.5px); background-size: 22px 22px, 17px 17px; }
.cover-classics { background-image: linear-gradient(90deg, rgba(232, 200, 120, 0.22) 0 2px, transparent 2px calc(100% - 2px), rgba(232, 200, 120, 0.22) calc(100% - 2px)); }
.opt-chain .seg button { min-width: 0; }
.ticket-match { margin: 6px 0 0; font-size: 0.86rem; }
.ticket-match span { opacity: 0.75; }
.ticket-notes { margin: 8px 0 0; padding: 0 0 0 18px; font-size: 0.8rem; opacity: 0.85; }
.ticket-notes li { margin: 2px 0; }

/* =======================================================================
   V1: THE READING NOOK (full-screen scenes, fading interface, mixer)
   ======================================================================= */
.screen-read.nook { position: relative; display: block; height: 100%; min-height: 100vh; min-height: 100dvh; overflow: hidden; background: #07061a; color: var(--cream); }
.nook-scene { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.ns-stage { position: absolute; inset: -2%; transform-origin: 50% 55%; }
.ns-photo { position: absolute; inset: 0; background-size: cover; background-position: center; }
.ns-paint { position: absolute; inset: 0; }
.ns-svg { display: block; width: 100%; height: 100%; }
.ns-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ns-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 52%, rgba(4, 3, 14, 0.62) 100%), linear-gradient(180deg, rgba(6, 4, 20, 0.45) 0%, rgba(6, 4, 20, 0) 18%, rgba(6, 4, 20, 0) 70%, rgba(6, 4, 20, 0.55) 100%); }
.ns-flash { position: absolute; inset: 0; pointer-events: none; background: #e8eeff; opacity: 0; mix-blend-mode: screen; }
.ns-flash.go { animation: lightning 1.4s ease-out; }
.ns-flash.go.near { animation: lightningNear 1.2s ease-out; }
@keyframes lightning { 0% { opacity: 0; } 4% { opacity: 0.28; } 8% { opacity: 0.04; } 13% { opacity: 0.2; } 100% { opacity: 0; } }
@keyframes lightningNear { 0% { opacity: 0; } 3% { opacity: 0.55; } 7% { opacity: 0.1; } 11% { opacity: 0.45; } 100% { opacity: 0; } }
.nook-scene[data-kind="photo"] .ns-photo { filter: saturate(1.05); }
@media (prefers-reduced-motion: no-preference) {
  .nook-scene[data-kind="photo"] .ns-stage { animation: kenBurns 70s ease-in-out infinite alternate; }
  .nook-scene[data-kind="paint"] .ns-stage { animation: breathe 40s ease-in-out infinite alternate; }
  .ns-svg .ns-flame { animation: flameLick 0.9s ease-in-out var(--d, 0s) infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
  .ns-svg .ns-steam { animation: steamRise 4.5s ease-in-out infinite; }
  .ns-svg .ns-blink { animation: bulb 2.2s ease-in-out var(--d, 0s) infinite; }
  .ns-svg .ns-bulb { animation: bulb 3s ease-in-out var(--d, 0s) infinite; }
  .ns-svg .ns-swing { animation: lanternSwing 4.6s ease-in-out infinite alternate; transform-box: view-box; }
  .ns-svg .ns-wave { animation: waveRoll 6s ease-in-out var(--d, 0s) infinite alternate; }
  .ns-svg .ns-beam { animation: beamSweep 7s ease-in-out infinite alternate; transform-box: view-box; transform-origin: 588px 446px; }
  .ns-svg .ns-neon { animation: neon 6s steps(1) infinite; }
}
@keyframes kenBurns { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
@keyframes breathe { from { transform: scale(1.01); } to { transform: scale(1.045) translate(-0.5%, -0.4%); } }
@keyframes flameLick { from { transform: scaleY(0.88) skewX(-3deg); } to { transform: scaleY(1.08) skewX(3deg); } }
@keyframes steamRise { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: 0.4; } 100% { opacity: 0; transform: translateY(-26px); } }
@keyframes lanternSwing { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes waveRoll { from { transform: translate(-14px, 3px); } to { transform: translate(14px, -3px); } }
@keyframes beamSweep { from { transform: rotate(-10deg); opacity: 0.6; } to { transform: rotate(14deg); opacity: 1; } }

.nook .fade-ui { transition: opacity 0.9s ease, transform 0.9s ease; }
.nook.nook--idle .fade-ui { opacity: 0; pointer-events: none; }
.nook.nook--idle { cursor: none; }
.nook-top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-bottom: 10px; }
.nk-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; cursor: pointer; font: 600 0.86rem var(--font-ui); color: #f6f0ff;
  background: rgba(12, 9, 32, 0.5); border: 1.5px solid rgba(255, 255, 255, 0.22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background 0.2s, transform 0.15s;
}
.nk-btn:hover { background: rgba(30, 22, 70, 0.68); transform: translateY(-1px); }
.nk-btn[aria-expanded="true"] { background: rgba(255, 215, 122, 0.24); border-color: rgba(255, 215, 122, 0.6); }
.nk-btn svg { width: 18px; height: 18px; }
.nk-title { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.nk-scene-name { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: #d8ccff; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-book { font-family: var(--font-body); font-style: italic; font-size: 1.02rem; color: #fff4dc; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-tools { display: flex; gap: 8px; justify-content: flex-end; }
.nook-center { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; padding-top: 70px; padding-bottom: 150px; }
.nook-center > * { pointer-events: auto; }
.glass {
  background: rgba(14, 10, 36, 0.58); border: 1.5px solid rgba(255, 255, 255, 0.18); border-radius: 22px;
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.nook .t-setup, .nook .t-done { box-sizing: border-box; width: min(440px, 92vw); padding: 22px 24px; gap: 14px; max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); overflow-y: auto; overscroll-behavior: contain; }
.nook .t-run { align-items: center; text-align: center; gap: 12px; width: min(560px, 92vw); }
.nook .t-phase { margin: 0; font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: #e6dcff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }
.nook .t-clock { font-size: clamp(4.6rem, 15vw, 9rem); color: #fffaf0; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.55), 0 0 60px rgba(255, 230, 180, 0.25); letter-spacing: 0.01em; }
.nook .t-bar { width: min(420px, 80vw); height: 6px; border: 0; background: rgba(255, 255, 255, 0.18); }
.nook .t-bar span { background: linear-gradient(90deg, #ffd77a, #ffb46b); }
.nook .t-controls { justify-content: center; }
.nook .t-run .btn, .nook .t-run .btn-ghost { background: rgba(14, 10, 36, 0.55); color: #fff4dc; border: 1.5px solid rgba(255, 255, 255, 0.25); box-shadow: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nook .t-status { margin: 0; font-size: 0.82rem; color: #e6dcff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); max-width: 52ch; }
.nook .t-h { color: #fff4dc; }
.t-scene-hint { margin: 0; }
.nook-tray {
  position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 4;
  display: grid; grid-template-columns: 74px 120px 86px; align-items: end; gap: 10px; padding: 12px 14px 10px; border-radius: 20px;
  background: rgba(14, 10, 36, 0.42); border: 1.5px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.nook-tray .tt-label { font-size: 0.56rem; padding: 1px 6px; background: rgba(255, 248, 234, 0.92); border-width: 1.5px; }
.nook-tray .tt-book { margin-bottom: 0; }
.nook-panel { position: absolute; z-index: 6; right: max(16px, env(safe-area-inset-right, 0px)); top: 64px; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 90px); overflow-y: auto; padding: 16px 18px 18px; }
.np-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.np-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; color: #fff4dc; }
.np-x { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.nk-scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nk-scene { display: flex; flex-direction: column; gap: 5px; padding: 5px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1.5px solid rgba(255, 255, 255, 0.12); cursor: pointer; color: #f6f0ff; text-align: left; }
.nk-scene:hover { background: rgba(255, 255, 255, 0.12); }
.nk-scene[aria-pressed="true"] { border-color: #ffd77a; box-shadow: 0 0 0 2px rgba(255, 215, 122, 0.35); }
.nk-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #120e2e; }
.nk-thumb img, .nk-thumb svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.nk-thumb * { animation: none !important; }
.nk-sn { font-size: 0.78rem; font-weight: 600; padding: 0 3px 2px; }
.nk-scenes .fine { margin: 10px 2px 0; font-size: 0.72rem; color: #b9aee0; }
.mx-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px 2px; font-size: 0.86rem; color: #cfc4ee; }
.mx-row.on, .mx-master { color: #fff4dc; font-weight: 600; }
.mx-row input[type="range"] { width: 100%; accent-color: #ffd77a; }
.mx-master { border-bottom: 1px solid rgba(255, 255, 255, 0.14); padding-bottom: 10px; margin-bottom: 4px; }
.mx-actions { display: flex; gap: 8px; margin-top: 10px; }
.mx-actions .btn-ghost { color: #fff4dc; border-color: rgba(255, 255, 255, 0.3); }
.nook .read-back { justify-self: start; }
@media (max-width: 760px) {
  .nook-center { padding-top: 64px; padding-bottom: 130px; align-items: center; }
  .nook-tray { grid-template-columns: 56px 92px 64px; gap: 8px; padding: 9px 10px 8px; }
  .nk-tools .nk-btn { padding: 7px 11px; }
  .nk-book { font-size: 0.9rem; }
  .nook .t-setup, .nook .t-done { padding: 18px; max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px); }
  .nook-panel { top: 58px; left: 16px; right: 16px; width: auto; }
}
@media (max-height: 640px) {
  .nook-tray { display: none; }
  .nook-center { padding-bottom: 20px; }
}

/* =======================================================================
   MAIN STREET BUTTON (same top-left spot on every screen; H or Home key)
   ======================================================================= */
.home-btn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.home-btn svg { width: 17px; height: 17px; flex: none; }
.bar-left, .nk-left { display: flex; align-items: center; gap: 8px; justify-self: start; min-width: 0; }
.shop-bar .home-btn { justify-self: start; }
.hud-right { display: flex; align-items: center; gap: 10px; }
.hud-home {
  height: 46px; padding: 0 16px 0 13px; border-radius: 999px; cursor: pointer; color: var(--gold); font: 600 0.88rem var(--font-ui);
  background: rgba(26, 19, 54, 0.78); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink), inset 0 0 0 2px rgba(255, 215, 122, 0.35);
  backdrop-filter: blur(4px); transition: transform 0.15s var(--bounce);
}
.hud-home:hover { transform: translateY(-2px) scale(1.02); }
.hud-home svg { width: 19px; height: 19px; }
.nook .nk-home { transition: opacity 0.9s ease; }
.nook.nook--idle .nk-home { opacity: 0.38; }
.nook.nook--idle .nk-home:hover, .nook.nook--idle .nk-home:focus-visible { opacity: 1; }
@media (max-width: 760px) {
  .hud-home { width: 46px; padding: 0; justify-content: center; }
  .hud-home span { display: none; }
}

/* =======================================================================
   YOUR STUDY: a cozy room in CSS 3D. js/study.js sizes the faces and
   moves the camera; tapping the bookcase walks the camera up to it and
   the bookshelf below fades in where the bookcase was.
   ======================================================================= */
.screen-study { position: fixed; inset: 0; overflow: hidden; background: #160b13; color: var(--cream); --acc: var(--gold); }
.study-view { position: absolute; inset: 0; overflow: hidden; perspective-origin: 50% 50%; background: #1e1020; }
.st-cam { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(.62, 0, .24, 1) .1s; }
.zoomed .st-cam { transition-delay: 0s; }
.st-arriving .st-cam { transition: transform 1.8s cubic-bezier(.16, .7, .2, 1); }
.st-room { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.st-face { position: absolute; left: 0; top: 0; overflow: hidden; }
.st-face > div { position: absolute; }
.st-back { overflow: visible; background: #2c1828; }
.st-back::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 60% 55% at 50% 62%, rgba(255, 196, 120, 0.16), transparent 70%), linear-gradient(180deg, rgba(8, 3, 8, 0.5), transparent 26%); }
.st-paper { inset: 0; background:
  radial-gradient(circle, rgba(255, 214, 150, 0.1) 0 2.5px, transparent 3px) 0 0 / 46px 46px,
  radial-gradient(circle, rgba(255, 214, 150, 0.05) 0 9px, transparent 9.5px) 23px 23px / 46px 46px,
  linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 50%, transparent 50%) 0 0 / 92px 100%,
  linear-gradient(180deg, #3f2340, #2e1a2d 70%, #261424); }
.st-wains { left: 0; right: 0; bottom: 0; height: 26%; border-top: 3px solid var(--ink); background:
  linear-gradient(180deg, #8a5634 0 9px, #4a2a18 9px 13px, rgba(0, 0, 0, 0.18) 13px 22px, transparent 22px),
  repeating-linear-gradient(90deg, #4a2a18 0 5px, #6b4128 5px 13px, #74472c 13px 107px, #6b4128 107px 115px, #4a2a18 115px 120px),
  #6b4128; }
.st-left::after, .st-right::after, .st-floor::after, .st-ceil::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.st-left { background: #2c1828; }
.st-left::after { background: linear-gradient(90deg, rgba(6, 2, 6, 0.75), rgba(6, 2, 6, 0.2) 34%, transparent 58%, rgba(6, 2, 6, 0.32)); }
.st-right { background: #2c1828; }
.st-right::after { background: linear-gradient(270deg, rgba(6, 2, 6, 0.75), rgba(6, 2, 6, 0.2) 34%, transparent 58%, rgba(6, 2, 6, 0.32)); }
.st-floor { background:
  repeating-linear-gradient(90deg, #4f2f1c 0 3px, #7a4b2e 3px 50px, #6a4028 50px 53px, #84553a 53px 100px, #5a3622 100px 103px, #73462b 103px 150px); }
.st-floor::after { background: linear-gradient(180deg, rgba(8, 3, 8, 0.55), transparent 36%, transparent 70%, rgba(8, 3, 8, 0.6)); }
.st-ceil { background: repeating-linear-gradient(180deg, #2a160f 0 140px, #4a2a18 140px 168px, #1d0f0a 168px 172px), #2a160f; }
.st-ceil::after { background: linear-gradient(180deg, rgba(6, 2, 6, 0.85), rgba(6, 2, 6, 0.35) 60%, rgba(6, 2, 6, 0.6)); }
.st-rug { border-radius: 50%; border: 3px solid rgba(43, 29, 63, 0.8); box-shadow: 0 0 0 7px rgba(232, 214, 176, 0.35);
  background: radial-gradient(closest-side, #e2b866 0 7%, #7a2a3a 7% 30%, #e2b866 30% 32.5%, #5a1f3a 32.5% 60%, #c9a14a 60% 62.5%, #8a3040 62.5% 86%, #e2b866 86% 88.5%, #6a2436 88.5%); }
.st-moonpool { background: radial-gradient(closest-side, rgba(160, 182, 255, 0.24), rgba(160, 182, 255, 0)); }
.st-lamppool { background: radial-gradient(closest-side, rgba(255, 214, 140, 0.22), rgba(255, 214, 140, 0)); }
.st-firepool { background: radial-gradient(closest-side, rgba(255, 140, 50, 0.36), rgba(255, 140, 50, 0)); }
.st-fireglow { background: radial-gradient(closest-side, rgba(255, 150, 60, 0.4), rgba(255, 150, 60, 0)); }
.st-window svg, .st-fire svg, .st-painting svg, .st-hplant svg, .st-sconce svg, .st-lights svg, .st-prop svg { display: block; width: 100%; height: 100%; overflow: visible; }
.st-caseshadow { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)); }
.st-prop { position: absolute; left: 0; top: 0; pointer-events: none; transition: opacity 0.6s ease 0.45s, visibility 0s linear 0s; }
.zoomed .st-prop { opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s linear 0.35s; }
.st-cat { pointer-events: auto; cursor: pointer; padding: 0; margin: 0; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
.st-cat:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 12px; }

/* The bookcase on the back wall. Its inside is sized in em (1em = a fortieth of its height). */
.st-case { position: absolute; left: 0; top: 0; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink); font-family: var(--font-ui); line-height: 1.2; -webkit-tap-highlight-color: transparent; }
.st-case:focus-visible { outline: none; }
.sc-inner { position: absolute; inset: 0; box-sizing: border-box; display: flex; flex-direction: column; padding: 0 2.6em 0.9em; border: 0.2em solid var(--ink); border-radius: 0.5em 0.5em 0.2em 0.2em;
  background: linear-gradient(90deg, #3f2414, #6b4426 4%, #8f5c35 50%, #6b4426 96%, #3f2414); box-shadow: 0 0.5em 1.4em rgba(0, 0, 0, 0.55); }
.sc-crown { flex: none; height: 3.6em; margin: 0 -2.6em; display: grid; place-items: center; background: linear-gradient(#a06a3c, #6b4426); border-bottom: 0.2em solid var(--ink); border-radius: 0.3em 0.3em 0 0; }
.sc-plate { padding: 0.2em 1em 0.25em; border-radius: 0.4em; background: linear-gradient(#f7d98a, #c99a3e); border: 0.13em solid var(--ink); font-family: var(--font-display); font-size: 1.15em; white-space: nowrap; }
.sc-comp { position: relative; flex: 1; min-height: 0; margin-top: 0.7em; display: flex; align-items: flex-end; padding: 0 0.5em 0.85em; background: #26170e; border: 0.15em solid var(--ink);
  box-shadow: inset 0 1em 1.2em -0.7em rgba(0, 0, 0, 0.85), inset 0.9em 0 1em -0.9em rgba(0, 0, 0, 0.7), inset -0.9em 0 1em -0.9em rgba(0, 0, 0, 0.7); }
.sc-comp::after { content: ''; position: absolute; left: -0.15em; right: -0.15em; bottom: -0.15em; height: 0.85em; background: linear-gradient(#b8834f 0 30%, #7a4f2c 30%); border-top: 0.15em solid var(--ink); }
.sc-books { display: flex; align-items: flex-end; gap: 0.12em; width: 100%; height: 82%; overflow: hidden; }
.sc-sp { flex: none; display: block; width: var(--w); height: var(--h); box-sizing: border-box; border: 0.07em solid var(--ink); border-bottom: 0; border-radius: 0.12em 0.12em 0 0;
  background: linear-gradient(180deg, transparent 0 12%, var(--c2) 12% 17%, transparent 17% 80%, var(--c2) 80% 85%, transparent 85%), linear-gradient(90deg, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.12) 40%, rgba(0, 0, 0, 0.25)), var(--c1); }
.sc-face { flex: none; display: block; width: 3.4em; height: 5em; margin-right: 0.5em; box-sizing: border-box; border: 0.08em solid var(--ink); border-radius: 0.1em 0.25em 0.25em 0.1em; transform: rotate(-2deg);
  background: radial-gradient(circle at 50% 40%, var(--c2) 0 20%, transparent 22%), linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0 8%, transparent 8%), var(--c1); }
.sc-dec { flex: none; width: 2.4em; height: 3.8em; margin-left: auto; }
.sc-dec svg { display: block; width: 100%; height: 100%; }
.sc-tag { position: absolute; left: 50%; bottom: -0.5em; z-index: 1; transform: translateX(-50%); padding: 0.05em 0.7em; border-radius: 0.3em; background: linear-gradient(#f7d98a, #c99a3e); border: 0.12em solid var(--ink); font-size: 0.66em; font-weight: 600; white-space: nowrap; }
.sc-glow { position: absolute; inset: -0.5em; border-radius: 0.9em; pointer-events: none; box-shadow: 0 0 0 0.22em rgba(255, 215, 122, 0), 0 0 2.4em rgba(255, 215, 122, 0); transition: box-shadow 0.35s; }
.st-case:hover .sc-glow, .st-case:focus-visible .sc-glow { box-shadow: 0 0 0 0.22em rgba(255, 215, 122, 0.9), 0 0 2.6em rgba(255, 215, 122, 0.55); }
.zoomed .sc-glow { opacity: 0; }

.st-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 52%, transparent 50%, rgba(8, 3, 8, 0.62)); }
.st-shade::after { content: ''; position: absolute; inset: 0; background: rgba(14, 7, 12, 0.55); opacity: 0; transition: opacity 0.6s ease; }
.zoomed .st-shade::after { opacity: 1; transition-delay: 0.6s; }
.st-motes { position: absolute; inset: 0; pointer-events: none; }
.st-motes i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 240, 205, 0.85); box-shadow: 0 0 6px rgba(255, 228, 170, 0.8); opacity: 0; }
.st-motes i:nth-child(1) { left: 12%; top: 62%; } .st-motes i:nth-child(2) { left: 18%; top: 48%; } .st-motes i:nth-child(3) { left: 26%; top: 70%; }
.st-motes i:nth-child(4) { left: 34%; top: 40%; } .st-motes i:nth-child(5) { left: 46%; top: 58%; } .st-motes i:nth-child(6) { left: 58%; top: 36%; }
.st-motes i:nth-child(7) { left: 66%; top: 66%; } .st-motes i:nth-child(8) { left: 74%; top: 50%; } .st-motes i:nth-child(9) { left: 84%; top: 72%; } .st-motes i:nth-child(10) { left: 90%; top: 44%; }
.zoomed .st-motes { opacity: 0; transition: opacity 0.4s; }

.study-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 9; padding-top: max(10px, env(safe-area-inset-top, 0px)); padding-bottom: 24px; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  background: linear-gradient(rgba(16, 8, 14, 0.88), rgba(16, 8, 14, 0.55) 60%, rgba(16, 8, 14, 0)); }
.study-bar .bar-title { color: var(--gold); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); outline: none; }
.study-bar .bar-right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.study-bar .btn-ghost { padding: 6px 12px; font-size: 0.86rem; background: rgba(26, 12, 22, 0.6); }
.study-bar .btn-ghost svg { width: 18px; height: 18px; }
.st-snd .snd-off { display: none; }
.st-snd.off { color: var(--haze); }
.st-snd.off .snd-off { display: inline; }
.st-hint { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 4; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 8px 8px 8px 18px; border-radius: 999px; background: rgba(22, 10, 18, 0.74); border: 2px solid rgba(255, 215, 122, 0.35); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.st-hint p { margin: 0; display: flex; flex-direction: column; line-height: 1.25; }
.st-hint-p { font-weight: 600; font-size: 0.9rem; }
.st-hint-sum { font-size: 0.76rem; color: var(--haze); }

/* ---------- The bookshelf up close ---------- */
.shelf-ui { position: absolute; inset: 0; z-index: 6; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.zoomed .shelf-ui { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity 0.5s ease 0.95s, visibility 0s linear 0s; }
.st-instant .st-cam, .st-instant .shelf-ui, .st-instant .st-prop, .st-instant .st-shade::after, .st-instant .st-motes { transition: none !important; }
.sh-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; padding: 74px max(16px, env(safe-area-inset-right, 0px)) calc(36px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.bc-case { --brass-a: #f7d98a; --brass-b: #c99a3e; --pad: clamp(12px, 2.6vw, 26px);
  position: relative; box-sizing: border-box; width: min(860px, 100%); margin: 0 auto; padding: 0 var(--pad) clamp(14px, 2vw, 22px);
  background: linear-gradient(90deg, #3f2414, #6b4426 3%, #8f5c35 50%, #6b4426 97%, #3f2414); border: 3px solid var(--ink); border-radius: 12px 12px 6px 6px;
  box-shadow: 0 10px 0 var(--ink), 0 40px 90px rgba(0, 0, 0, 0.65); }
.bc-crown { margin: 0 calc(-1 * var(--pad)); padding: 12px 10px; display: grid; place-items: center; background: linear-gradient(#a06a3c, #6b4426); border-bottom: 3px solid var(--ink); border-radius: 9px 9px 0 0; }
.bc-title { margin: 0; outline: none; font-weight: 400; }
.bc-plate { display: inline-block; padding: 5px 22px 7px; border-radius: 10px; background: linear-gradient(var(--brass-a), var(--brass-b)); border: 2.5px solid var(--ink); color: var(--ink); font: 400 clamp(1.15rem, 3.6vw, 1.5rem) var(--font-display); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 3px 0 var(--ink); }
.bc-title:focus-visible .bc-plate { outline: 3px solid var(--gold); outline-offset: 3px; }
.bc-sum { margin: 10px 0 0; text-align: center; color: #f6e4c4; font-size: 0.9rem; font-weight: 500; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); }
.bc-sec { margin-top: 12px; padding: 10px 12px 0; background: linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent 7%, transparent 93%, rgba(0, 0, 0, 0.3)), #26170e; border: 3px solid var(--ink); border-radius: 5px; box-shadow: inset 0 16px 20px -12px rgba(0, 0, 0, 0.85); }
.bc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 4px; }
.bc-tag { margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 3px 6px 3px 12px; border-radius: 8px; background: linear-gradient(var(--brass-a), var(--brass-b)); border: 2px solid var(--ink); color: var(--ink); font: 600 0.92rem var(--font-ui); box-shadow: 0 2px 0 var(--ink); }
.bc-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box; border-radius: 11px; background: var(--ink); color: var(--gold); font-size: 0.78rem; }
.bc-sub { margin: 0; font-size: 0.82rem; color: #dcc6a6; }
.bc-row { --row: 166px; display: flex; flex-wrap: wrap; align-items: flex-end; align-content: flex-start; gap: 14px 3px; margin: 0 -12px; padding: 4px 16px 14px; min-height: calc(var(--row) - 14px);
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0, rgba(0, 0, 0, 0) 12px, rgba(0, 0, 0, 0) var(--row)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--row) - 14px), #b8834f calc(var(--row) - 14px) calc(var(--row) - 10px), #7a4f2c calc(var(--row) - 10px) calc(var(--row) - 2px), var(--ink) calc(var(--row) - 2px) var(--row));
  background-origin: content-box; }
.bc-sec[data-s="reading"] .bc-row { --row: 218px; }
.bk-slot { height: calc(var(--row) - 14px); display: flex; align-items: flex-end; }
.bk { position: relative; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; transition: transform 0.25s var(--bounce); -webkit-tap-highlight-color: transparent; }
.bk:hover, .bk:focus-visible { transform: translateY(-7px); }
.bk.bk-sel { transform: translateY(-16px); }
.bk:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.bk-spine { display: flex; flex-direction: column; align-items: center; width: var(--w); height: var(--h); box-sizing: border-box; padding: 15px 0 18px; border: 2px solid var(--ink); border-bottom: 0; border-radius: 4px 4px 1px 1px; overflow: hidden;
  background: linear-gradient(180deg, transparent 0 6px, var(--c2) 6px 10px, transparent 10px calc(100% - 14px), var(--c2) calc(100% - 14px) calc(100% - 10px), transparent calc(100% - 10px)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(255, 255, 255, 0.14) 30%, rgba(255, 255, 255, 0) 58%, rgba(0, 0, 0, 0.3)), var(--c1);
  box-shadow: 2px 0 0 rgba(0, 0, 0, 0.25); }
.bk-t { flex: 0 1 auto; min-height: 0; max-height: calc(100% - 26px); writing-mode: vertical-rl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 400 12px/1.05 var(--font-display); color: var(--tx); }
.bk-a { flex: none; margin-top: auto; max-height: 34px; writing-mode: vertical-rl; white-space: nowrap; overflow: hidden; font: 600 8.5px/1 var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--tx); opacity: 0.82; }
.bk-star { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 9px; line-height: 6px; color: #ffd36b; text-shadow: 0 1px 0 var(--ink); }
.bk-face { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 98px; }
.bk-face .cover { width: 94px; transform: rotate(-1.5deg); }
.bk-slot:nth-child(2n) .bk-face .cover { transform: rotate(1.2deg); }
.bk-ribbon { position: absolute; top: -5px; right: 20px; z-index: 2; width: 10px; height: 34px; background: #e2474f; border: 2px solid var(--ink); border-top: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.bk-prog { display: block; width: 86px; height: 7px; border-radius: 4px; background: rgba(255, 244, 220, 0.2); border: 1.5px solid var(--ink); overflow: hidden; }
.bk-prog span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffb46b); }
.bk-cap { max-width: 100%; min-height: 2.4em; font-size: 0.68rem; font-weight: 500; line-height: 1.2; text-align: center; color: #f3dfbe; }
.bk-empty { flex: 1 1 220px; max-width: 420px; align-self: center; align-items: center; padding: 0 6px; }
.bk-empty p { margin: 0; padding: 10px 14px; border-radius: 10px; background: #fff3d6; color: var(--card-ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: 0.86rem; line-height: 1.35; transform: rotate(-1deg); }
.bk-decor { width: 52px; justify-content: center; }
.bk-slot:not(.bk-decor) + .bk-decor { margin-left: auto; }
.bk-decor svg { display: block; width: 48px; height: auto; }
.bc-note { width: min(860px, 100%); margin: 22px auto 0; text-align: center; font-size: 0.8rem; color: var(--haze); }

/* One book, pulled off the shelf; and the add-a-book card. Cream paper like the library card. */
.bk-detail, .bk-add { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; box-sizing: border-box; padding: 74px 16px 16px; overflow-y: auto; background: rgba(12, 6, 10, 0.62); }
.bkd-card, .bka-card { position: relative; width: min(540px, 100%); box-sizing: border-box; padding: 22px 22px 20px; border-radius: 18px; color: var(--card-ink); background: var(--card); border: 3px solid var(--ink); box-shadow: 0 8px 0 var(--ink), 0 30px 60px rgba(10, 6, 24, 0.6); }
@media (prefers-reduced-motion: no-preference) { .bk-detail:not([hidden]) .bkd-card, .bk-add:not([hidden]) .bka-card { animation: cardIn 0.45s var(--bounce) both; } }
.bkd-top { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; align-items: center; padding-right: 40px; }
.bkd-cover .cover { transform: rotate(-3deg); }
.bkd-status { color: #7a6656; }
.bkd-status::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; border: 1.5px solid var(--ink); vertical-align: 0; }
.bkd-reading::before { background: #e2474f; } .bkd-tbr::before { background: #8fe3c0; } .bkd-finished::before { background: #ffd36b; }
.bkd-title { margin: 3px 0 4px; font: 400 1.45rem/1.12 var(--font-display); }
.bkd-by { margin: 0; color: #6a5646; font-size: 0.9rem; }
.bkd-hook { margin: 14px 0 0; font-family: var(--font-body); font-size: 1.04rem; line-height: 1.4; }
.bkd-facts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; font-size: 0.84rem; color: #5a4636; }
.bkd-facts li::before { content: '·'; margin-right: 6px; font-weight: 700; }
.bkd-prog { margin-top: 12px; }
.bkd-bar { height: 12px; border-radius: 7px; border: 2.5px solid var(--ink); background: rgba(43, 29, 63, 0.1); overflow: hidden; }
.bkd-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffb46b); }
.bkd-prog p { margin: 5px 0 0; font-size: 0.8rem; color: #6a5646; }
.bkd-rate { display: flex; align-items: center; gap: 2px; margin-top: 12px; }
.bkd-rl { margin-right: 8px; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #7a6656; }
.bkd-star { width: 38px; height: 38px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 1.7rem; line-height: 1; color: rgba(43, 29, 63, 0.22); transition: transform 0.15s var(--bounce); }
.bkd-star:hover { transform: scale(1.15); }
.bkd-star.on { color: #e8a02a; text-shadow: 0 2px 0 var(--ink); }
.bkd-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.bkd-card .btn-ghost, .bka-card .btn-ghost { color: var(--card-ink); background: rgba(43, 29, 63, 0.05); border-color: rgba(43, 29, 63, 0.35); box-shadow: 0 3px 0 rgba(43, 29, 63, 0.3); }
.bkd-card .btn-ghost:hover, .bka-card .btn-ghost:hover { border-color: var(--ink); background: rgba(43, 29, 63, 0.1); }
.bkd-card .bkd-remove { color: #8a2a2a; }
.bka-card .eyebrow { color: #7a6656; }
.bka-h { margin: 2px 0 6px; font: 400 1.6rem var(--font-display); }
.bka-sub { margin: 0 0 4px; font-size: 0.9rem; color: #5a4636; }
.bka-l { display: block; margin: 14px 0 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #7a6656; }
.bka-in { box-sizing: border-box; width: 100%; padding: 10px 12px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fffdf6; color: var(--card-ink); font: 500 1rem var(--font-ui); }
.bka-in:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.bka-res { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 290px; overflow-y: auto; }
.bka-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 5px 10px; align-items: center; padding: 6px 8px 7px 6px; border-radius: 12px; background: #fff3d6; border: 2px solid rgba(43, 29, 63, 0.2); }
.bka-cover { grid-row: span 2; }
.bka-cover .cover { width: 34px; }
.bka-meta b { display: block; font-size: 0.92rem; line-height: 1.2; }
.bka-meta span { font-size: 0.78rem; color: #6a5646; }
.bka-acts { display: flex; flex-wrap: wrap; gap: 5px; }
.bka-on { font-size: 0.8rem; font-weight: 600; color: #2f6b3f; }
.bka-tip { padding: 4px 2px; font-size: 0.84rem; color: #6a5646; }
.bka-own { margin-top: 16px; border-top: 2px dashed rgba(43, 29, 63, 0.25); }
.bka-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bka-own .bka-acts { margin-top: 10px; }
.bka-err { margin: 6px 0 0; color: #a12a2a; font-size: 0.82rem; font-weight: 600; }

/* Ways in: the cottage, the HUD, the library card, the footer */
.lc-shelf { margin: 2px 0 4px; }
.log-shelf { margin-top: 12px; }
.log-shelf svg, .lc-shelf svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: no-preference) {
  .screen-study .ns-flame { animation: flameLick 0.9s ease-in-out var(--d, 0s) infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
  .screen-study .ns-steam { animation: steamRise 4.5s ease-in-out infinite; }
  .screen-study .ns-bulb { animation: bulb 3s ease-in-out var(--d, 0s) infinite; }
  .screen-study .z { animation: zzz 3.6s ease-in-out infinite; opacity: 0; }
  .screen-study .z2 { animation-delay: 1.8s; }
  .st-fireglow, .st-firepool { animation: fireFlick 2.6s ease-in-out infinite; }
  .st-motes i { animation: mote 11s linear infinite; }
  .st-motes i:nth-child(2n) { animation-duration: 14s; animation-delay: -4s; } .st-motes i:nth-child(3n) { animation-delay: -7s; } .st-motes i:nth-child(5n) { animation-duration: 9s; animation-delay: -2s; }
  .st-case.st-hint-on .sc-glow { animation: casePulse 2.6s ease-in-out infinite; }
  .st-cat.st-purr svg { animation: purr 0.7s ease-in-out; transform-origin: 50% 100%; }
  .bk-just { animation: bookIn 0.6s var(--bounce) both; }
  .bldg-home .wst { transform-box: fill-box; transform-origin: 50% 0; animation: sway 4.6s ease-in-out var(--d, 0s) infinite alternate; }
}
@keyframes fireFlick { 0%, 100% { opacity: 0.85; } 22% { opacity: 1; } 46% { opacity: 0.68; } 70% { opacity: 0.95; } }
@keyframes casePulse { 0%, 100% { box-shadow: 0 0 0 0.18em rgba(255, 215, 122, 0.15), 0 0 1.2em rgba(255, 215, 122, 0.12); } 50% { box-shadow: 0 0 0 0.26em rgba(255, 215, 122, 0.75), 0 0 2.6em rgba(255, 215, 122, 0.45); } }
@keyframes purr { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.06, 0.94); } 60% { transform: scale(0.98, 1.03); } }
@keyframes bookIn { from { transform: translateY(-40px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 720px) {
  .study-bar .btn-ghost { padding: 6px 10px; }
  .st-hint { gap: 10px; padding: 6px 6px 6px 14px; max-width: calc(100vw - 24px); }
  .st-hint-p { display: none; }
  .st-hint-sum { font-size: 0.76rem; color: var(--cream); }
  .bc-row .bk-decor { display: none; }
  .bc-row .bk-empty + .bk-decor { display: flex; }
  .bk-empty { flex-basis: 160px; }
  .bc-row { gap: 14px 2px; padding-left: 12px; padding-right: 12px; }
  .bk-face { width: 86px; } .bk-face .cover { width: 82px; } .bk-prog { width: 76px; }
  .bc-sec[data-s="reading"] .bc-row { --row: 200px; }
  .bk-detail, .bk-add { place-items: end center; padding: 64px 0 0; }
  .bkd-card, .bka-card { width: 100%; max-height: 100%; overflow-y: auto; border-radius: 18px 18px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 40px rgba(10, 6, 24, 0.5); }
  .bkd-top { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .bkd-title { font-size: 1.25rem; }
  .bka-fields { grid-template-columns: 1fr; }
}
@media (max-height: 520px) {
  .st-hint { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); transform: none; padding: 5px; }
  .st-hint p { display: none; }
  .bk-detail, .bk-add { padding-top: 64px; }
}

/* =======================================================================
   ON-SCREEN ARROWS (touch screens): hold ◀ ▶ to walk, ▲ to go in at a door.
   Shown only when the page detects a touch screen (html.touch-ui).
   ======================================================================= */
.pad { position: absolute; left: max(14px, env(safe-area-inset-left, 0px)); bottom: 62px; z-index: 6; display: none; grid-template-columns: auto auto; grid-template-areas: "up up" "left right"; justify-items: center; gap: 8px; transition: opacity 0.25s ease; }
.touch-ui .pad { display: grid; }
.pad-left { grid-area: left; } .pad-right { grid-area: right; } .pad-up { grid-area: up; }
.pad.pad-ghost { opacity: 0.32; }
.pad-btn { position: relative; display: grid; place-items: center; width: 56px; height: 56px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer; color: var(--gold);
  background: rgba(26, 19, 54, 0.84); border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink), inset 0 0 0 2px rgba(255, 215, 122, 0.35);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s, color 0.15s, opacity 0.2s; }
.pad-btn svg { width: 26px; height: 26px; pointer-events: none; }
.pad-btn.down, .pad-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink), inset 0 0 0 2px rgba(255, 215, 122, 0.75); background: rgba(72, 54, 144, 0.94); }
.pad-up[aria-disabled="true"] { opacity: 0.55; }
.pad-up.ready { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--ink), 0 0 20px rgba(255, 215, 122, 0.65); }
.pad-up.ready:active { box-shadow: 0 1px 0 var(--ink), 0 0 20px rgba(255, 215, 122, 0.65); }
@media (prefers-reduced-motion: no-preference) {
  .pad-up.ready { animation: padReady 1.1s ease-in-out infinite alternate; }
  .pad-up.ready:active { animation: none; }
}
@keyframes padReady { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.touch-help { display: none; }
.touch-ui .touch-help { display: inline; }
.touch-ui .kb-help { display: none; }
@media (max-width: 480px) {
  .pad { gap: 6px; }
  .pad-btn { width: 50px; height: 50px; }
  .pad-btn svg { width: 24px; height: 24px; }
}
/* Keep "Begin the quest" in view when the setup panel has to scroll (small phones). */
.nook .t-setup .t-start { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 4px 0 var(--ink), 0 -14px 18px 6px rgba(14, 10, 36, 0.85); }

/* =======================================================================
   "An experiment by Oore": a faint spine label on the right edge, on every
   screen. It reads top to bottom like the book spines, sits in the margin
   and lets taps pass through. Modals, transitions and toasts cover it.
   ======================================================================= */
.made-by {
  position: fixed; top: calc(80px + env(safe-area-inset-top, 0px)); right: max(2px, env(safe-area-inset-right, 0px)); z-index: 90; margin: 0;
  writing-mode: vertical-rl; white-space: nowrap;
  padding: 10px 2px; border-radius: 7px; background: rgba(12, 8, 30, 0.34);
  font: 500 10px/1 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 244, 220, 0.5);
  pointer-events: none; -webkit-user-select: none; user-select: none;
}
.made-by-name { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.08em; text-transform: none; font-size: 11px; color: rgba(255, 215, 122, 0.72); }
@media (max-width: 480px) { .made-by { font-size: 9px; padding: 8px 1px; } .made-by-name { font-size: 10px; } }
.made-by-ver { letter-spacing: 0.1em; color: rgba(255, 244, 220, 0.42); }

/* Start fresh, at the foot of the library card */
.lc-fresh { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 16px; padding-top: 12px; border-top: 2px dashed rgba(43, 29, 63, 0.25); }
.library-card .lc-reset { color: #8a2a2a; background: rgba(43, 29, 63, 0.04); border-color: rgba(138, 42, 42, 0.45); box-shadow: 0 3px 0 rgba(43, 29, 63, 0.25); }
.library-card .lc-reset.armed { color: #fff4dc; background: #a8323a; border-color: var(--ink); }
.lc-reset-note { margin: 0; flex: 1 1 180px; font-size: 0.78rem; color: #6a5646; }

/* Beta feedback, between the street and the shop directory */
.feedback { padding-top: 28px; }
.fb-card { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; max-width: 1120px; margin: 0 auto; box-sizing: border-box;
  padding: 16px 20px; border-radius: 18px; background: rgba(255, 244, 220, 0.06); border: 2px dashed rgba(255, 215, 122, 0.4); }
.fb-text { flex: 1 1 260px; }
.fb-h { margin: 0 0 2px; font: 400 1.25rem var(--font-display); color: var(--gold); }
.fb-text p { margin: 0; color: var(--haze); font-size: 0.92rem; }
.fb-btn { flex: none; }

/* The street didn't build: a friendly reload card */
.boot-fail { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 16px; background: rgba(14, 8, 32, 0.86); }
.boot-card { width: min(420px, 100%); box-sizing: border-box; padding: 22px; border-radius: 18px; text-align: center; color: var(--card-ink); background: var(--card); border: 3px solid var(--ink); box-shadow: 0 8px 0 var(--ink); }
.boot-h { margin: 0 0 6px; font: 400 1.35rem var(--font-display); }
.boot-card p { margin: 0 0 14px; }

.mx-ios { margin: 10px 2px 0; font-size: 0.74rem; color: #b9aee0; }
/* Small phones: the reading timer's top bar keeps its buttons; the scene and book names live in the panel and tray. */
@media (max-width: 480px) { .nook .nk-title { display: none; } }

/* =======================================================================
   FIRST-SCREEN FIT: on shorter screens the title area tightens and the
   shops size themselves to the screen's height, so the whole street,
   reader included, is visible the moment the page opens.
   ======================================================================= */
@media (max-height: 920px) and (min-width: 761px) {
  .street-head { padding-block: 58px 0; }
  .sign { font-size: clamp(2.8rem, 8.5vh, 6rem); margin: 4px 0 8px; }
  .lede { max-width: 66ch; }
  .street { padding-top: 94px; --bw: clamp(130px, min(14vw, calc((100vh - 460px) * 0.545)), 206px); }
}
@media (max-width: 760px) and (max-height: 900px) {
  .street-head { padding-block: 70px 0; }
  .street-head .eyebrow { display: none; }
  .sign { margin: 2px 0 6px; }
  .lede { font-size: 0.98rem; line-height: 1.4; }
  .street { padding-top: 96px; --bw: clamp(130px, calc((100vh - 422px) * 0.545), 156px); }
}
@supports (height: 100svh) {
  @media (max-height: 920px) and (min-width: 761px) { .street { --bw: clamp(130px, min(14vw, calc((100svh - 460px) * 0.545)), 206px); } }
  @media (max-width: 760px) and (max-height: 900px) { .street { --bw: clamp(130px, calc((100svh - 422px) * 0.545), 156px); } }
}

/* Phones: the library-card badge shrinks to just the level circle, to keep the front page calm. */
@media (max-width: 480px) {
  .hud-card { padding: 4px; gap: 0; }
  .hud-card .hud-meta { display: none; }
}

/* Smoothness: off-screen street pieces stop animating; calm mode freezes the gentle loops. */
.street .off, .street .off *, #fore .off, #fore .off * { animation-play-state: paused !important; }
.calm .street .bldg-art *:not(.win-lit), .calm #fore .raceme, .calm #fore .clump, .calm .gate .wisteria,
.calm .cloud, .calm .lamp-glass, .calm .moon, .calm .moon * { animation-play-state: paused !important; }

/* =======================================================================
   ACCOUNT: the HUD button and the account card (only on the real website)
   ======================================================================= */
.hud-account { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.hud-account .acc-hud-avatar { display: none; width: 30px; height: 30px; margin-left: -6px; }
.hud-account .acc-hud-avatar svg, .acc-avatar svg, .acc-av-art svg, .lc-avatar-acct svg { display: block; width: 100%; height: 100%; }
.hud-account.signed .acc-hud-avatar { display: grid; }
.hud-account.signed .acc-hud-icon { display: none; }
.hud-account svg { width: 20px; height: 20px; }
.account-card .acc-lede { margin: 0 0 12px; color: #5a4636; font-size: 0.95rem; }
.acc-l { display: block; margin: 4px 0 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #7a6656; }
.acc-email-form .btn, .acc-code-form .acc-verify { margin-top: 10px; }
.acc-code { letter-spacing: 0.3em; font-size: 1.3rem; text-align: center; }
.acc-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
.account-card .btn-ghost { color: var(--card-ink); background: rgba(43, 29, 63, 0.05); border-color: rgba(43, 29, 63, 0.35); box-shadow: 0 3px 0 rgba(43, 29, 63, 0.3); }
.account-card .acc-delete { color: #8a2a2a; border-color: rgba(138, 42, 42, 0.45); }
.account-card .acc-delete.armed { color: #fff4dc; background: #a8323a; border-color: var(--ink); }
.acc-fine { margin: 14px 0 0; font-size: 0.78rem; color: #6a5646; }
.acc-fine a { color: #5a3fa8; }
.acc-who { display: flex; align-items: center; gap: 12px; }
.acc-avatar { flex: none; width: 60px; height: 60px; }
.acc-name { margin: 0; font: 400 1.2rem var(--font-display); }
.acc-email { margin: 0; font-size: 0.86rem; color: #6a5646; overflow-wrap: anywhere; }
.acc-status { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: #e9f6ec; color: #2f5a3a; font-size: 0.86rem; }
.acc-status[data-s="offline"] { background: #fbeee0; color: #7a4a1a; }
.acc-status[data-s="saving"], .acc-status[data-s="checking"], .acc-status[data-s="pending"] { background: #f3eedf; color: #5a4636; }
.acc-error { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: #fbe4e4; color: #8a2a2a; font-size: 0.86rem; font-weight: 600; }
@media (max-width: 760px) { .hud-account .acc-hud-label { display: none; } }

.acc-tabs { display: flex; gap: 4px; margin: 0 0 14px; padding: 4px; border-radius: 12px; background: rgba(43, 29, 63, 0.08); }
.acc-tab { flex: 1; padding: 8px 10px; border: 0; border-radius: 9px; background: none; cursor: pointer; font: 600 0.92rem var(--font-ui); color: #6a5646; }
.acc-tab.on { background: #fffdf6; color: var(--card-ink); box-shadow: 0 2px 0 rgba(43, 29, 63, 0.25); }
.acc-form-signin .bka-in, .acc-form-create .bka-in, .acc-form-forgot .bka-in, .acc-reset .bka-in { margin-bottom: 4px; }
.acc-pw { position: relative; }
.acc-pw .bka-in { padding-right: 64px; }
.acc-showpw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: -2px; padding: 4px 8px; border: 0; border-radius: 8px; background: rgba(43, 29, 63, 0.08); color: var(--card-ink); font: 600 0.78rem var(--font-ui); cursor: pointer; }
.acc-link { padding: 4px 2px; border: 0; background: none; color: #5a3fa8; font: 600 0.86rem var(--font-ui); text-decoration: underline; cursor: pointer; }
.acc-hint { margin: 0 0 6px; font-size: 0.76rem; color: #7a6656; }
.acc-avatars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 2px 0 10px; }
.acc-av { position: relative; display: block; padding: 3px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.acc-av input { position: absolute; opacity: 0; pointer-events: none; }
.acc-av-art { display: block; aspect-ratio: 1; }
.acc-av.on { border-color: var(--ink); background: var(--gold); }
.acc-av:focus-within { outline: 3px solid #5a3fa8; outline-offset: 1px; }
.acc-check { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 2px; font-size: 0.84rem; color: #5a4636; }
.acc-check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: #5a3fa8; }
.acc-check a { color: #5a3fa8; }
.acc-pick { margin-top: 8px; }
.acc-note { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: #e9f6ec; color: #2f5a3a; font-size: 0.86rem; }
.lc-avatar-acct { padding: 2px; }
@media (max-width: 420px) { .acc-avatars { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Account required on the real website: the sign-up card can't be dismissed. */
.modal.acc-required { background: rgba(14, 8, 32, 0.82); backdrop-filter: blur(6px); }
.stamp-tag.stamp-label { background: #ffd77a; }

/* Welcome note: opens once after a new account's first sign-in, and from the ? button */
.hud-help svg { width: 24px; height: 24px; }
.welcome-card { width: min(560px, 100%); }
.welcome-card .lc-h { padding-right: 44px; font-size: 1.7rem; }
.welcome-card p { margin: 0 0 12px; line-height: 1.5; }
.wel-sub { margin: 16px 0 4px; font: 700 0.95rem var(--font-ui); color: var(--card-ink); }
.wel-list { margin: 14px 0 12px; padding-left: 20px; font-size: 0.9rem; color: #5a4838; }
.wel-list li { margin-bottom: 4px; }
.wel-foot { font-size: 0.85rem; color: #6a5646; }
.welcome-card .wel-go { margin-top: 4px; }
@media (prefers-reduced-motion: no-preference) { .modal:not([hidden]) .welcome-card { animation: cardIn 0.5s var(--bounce) both; } }
