/* Dillydally Street — night palette. Brand colours come from tokens.css; the
   rest are street-only shades of the brand's dark ink. */
:root {
  --st-night: #1B1D23;
  --st-night-2: #2C303A;
  --st-night-3: #3A3F4B;
  --st-shutter: #5E6370;
  --st-lamp-post: #14161B;
  --st-mist: #B9BDC7;
  --st-mist-2: #E1E3E8;
  --st-grey: #9E9E9E;
  --st-glass: rgba(37, 40, 48, .85);
  --st-ghost: rgba(255, 255, 255, .14);
}

html, body { margin: 0; height: 100%; overflow: hidden; background: var(--st-night); }
a { color: var(--dd-cream); }
a:hover { color: var(--dd-white); }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

@keyframes ddSteam { 0% { transform: translateY(0) scale(.6); opacity: 0 } 30% { opacity: .5 } 100% { transform: translateY(-90px) scale(1.4); opacity: 0 } }
@keyframes ddFlicker { 0%, 100% { opacity: 1 } 47% { opacity: 1 } 48% { opacity: .55 } 50% { opacity: 1 } }
@keyframes ddPrompt { 0%, 100% { transform: translate(-50%, 0) } 50% { transform: translate(-50%, -6px) } }
@keyframes ddLoad { from { width: 0 } to { width: 100% } }
@keyframes ddBlink { 0%, 100% { opacity: 1 } 50% { opacity: 0 } }

.stage {
  position: fixed; inset: 0; overflow: hidden; background: var(--st-night);
  font-family: var(--font-body); color: var(--dd-pearl); outline: none;
  user-select: none; -webkit-user-select: none; touch-action: none;
}

/* ── World ─────────────────────────────────────────────────────────── */
.scaler { position: absolute; left: 0; bottom: 0; width: 100%; height: 800px; transform-origin: 0 100%; }
.layer { position: absolute; left: 0; will-change: transform; }
.layer-far { bottom: 250px; height: 420px; width: 7000px; }
.layer-mid { bottom: 150px; height: 560px; width: 7000px; }
.layer-ground { bottom: 70px; height: 6px; width: 7000px; display: flex; gap: 80px; }
.layer-front { bottom: 0; height: 800px; width: 9000px; pointer-events: none; }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; background: var(--dd-dark); border-top: 4px solid var(--st-night-3); }
.dash { flex: 0 0 60px; height: 6px; border-radius: 3px; background: var(--st-night-3); }

.building {
  position: absolute; bottom: 0; background: var(--st-night-2); border-radius: 4px 4px 0 0;
  display: grid; gap: 10px; padding: 16px 14px; box-sizing: border-box; align-content: start;
}
.building span { height: 12px; border-radius: 2px; }

.lamp { position: absolute; bottom: 150px; width: 10px; height: 420px; background: var(--st-lamp-post); }
.lamp::before { content: ""; position: absolute; top: -6px; left: -26px; width: 62px; height: 18px; border-radius: 9px; background: var(--st-lamp-post); }
.lamp::after {
  content: ""; position: absolute; top: 10px; left: -18px; width: 46px; height: 12px; border-radius: 0 0 12px 12px;
  background: var(--dd-cream); box-shadow: 0 0 40px 18px rgba(255, 252, 222, .25); animation: ddFlicker 7s infinite;
}

/* ── Shops ─────────────────────────────────────────────────────────── */
.shop { position: absolute; bottom: 0; }
.shop-wall { position: absolute; inset: 0; background: var(--wall); border-radius: 6px 6px 0 0; box-shadow: inset 0 -12px 0 rgba(0, 0, 0, .15); }
.shop-sign-wrap { position: absolute; left: 50%; top: -56px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.shop-sign {
  padding: 12px 22px; border-radius: 10px; background: var(--sign-bg); color: var(--sign-ink);
  box-shadow: 0 0 24px 2px rgba(255, 252, 222, .12); transition: box-shadow 500ms var(--ease-out);
  display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap;
}
.shop.has-steam .shop-sign { animation: ddFlicker 9s infinite; }
.shop.is-near .shop-sign { box-shadow: 0 0 0 4px rgba(255, 252, 222, .35), 0 0 60px 14px rgba(255, 252, 222, .35); }
.shop-sign-ko { font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1; }
.shop-sign-en { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.shop-awning { position: absolute; left: 24px; right: 24px; top: 70px; height: 44px; background: var(--awning); border-radius: 6px 6px 14px 14px; box-shadow: 0 10px 0 rgba(0, 0, 0, .18); }
.shop-window {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); height: 300px;
  border-radius: 12px 12px 0 0; overflow: hidden; background: var(--st-night-3);
  border: 6px solid var(--st-night); border-bottom: 0; color: var(--st-mist);
}
.shop-light { position: absolute; inset: 0; background: rgba(0, 0, 0, .25); pointer-events: none; mix-blend-mode: soft-light; transition: background 500ms; }
.shop.is-near .shop-light { background: rgba(255, 252, 222, .25); }
.shop-shutter {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(180deg, var(--st-shutter) 0 14px, var(--dd-ink-2) 14px 16px);
}
.shop-shutter span { padding: 8px 14px; border-radius: 6px; background: var(--dd-cream); color: var(--dd-dark); font-size: 13px; font-weight: 600; transform: rotate(-4deg); }
.shop-cart { position: absolute; left: 30px; bottom: 60px; width: 70px; height: 40px; border-radius: 8px 8px 0 0; background: var(--dd-dark); }
.shop-cart span { position: absolute; bottom: 36px; width: 22px; height: 22px; border-radius: 50%; background: rgba(247, 247, 247, .35); animation: ddSteam 2.6s ease-out infinite; }
.shop-prompt {
  position: absolute; left: 50%; top: -130px; display: none; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius-pill); background: var(--dd-white); color: var(--dd-dark);
  font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .5);
  animation: ddPrompt 1.6s ease-in-out infinite;
}
.shop.is-near .shop-prompt { display: flex; }
.key-cobalt { padding: 3px 8px; border-radius: 6px; background: var(--dd-cobalt); color: var(--dd-white); font-size: 11px; letter-spacing: .08em; }
.shop-met { position: absolute; left: 50%; bottom: -38px; transform: translateX(-50%); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--dd-cream); white-space: nowrap; }

/* Image frame: real photo when supplied, labelled empty frame otherwise. */
.slot { position: absolute; inset: 0; overflow: hidden; background: rgba(127, 127, 127, .08); }
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 12px; box-sizing: border-box; text-align: center; font: 500 13px/1.3 system-ui, -apple-system, sans-serif;
}
.slot-empty svg { opacity: .45; }
.slot-empty span { max-width: 90%; opacity: .75; letter-spacing: .01em; }
.slot-empty::after { content: ""; position: absolute; inset: 0; border: 1.5px dashed currentColor; opacity: .35; pointer-events: none; }

/* ── Player ────────────────────────────────────────────────────────── */
.player { position: absolute; left: 0; bottom: 118px; width: 84px; height: 120px; will-change: transform; }
.player-body { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; }
.player-head { width: 64px; height: 64px; border-radius: 50%; background: var(--dd-cream); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px var(--dd-cobalt); }
.player-head img { width: 40px; height: 40px; object-fit: contain; }
.player-torso { margin-top: -4px; width: 46px; height: 40px; border-radius: 12px 12px 8px 8px; background: var(--dd-cobalt); }
.player-case { position: absolute; right: -6px; bottom: 6px; width: 30px; height: 38px; border-radius: 7px; background: var(--dd-cream); border: 3px solid var(--dd-dark); box-sizing: border-box; }
.player-case span { position: absolute; left: 8px; top: -10px; width: 8px; height: 10px; border: 3px solid var(--dd-dark); border-bottom: 0; border-radius: 4px 4px 0 0; }
.player-shadow { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); width: 70px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, .35); }
.player-label { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); font-size: 11px; font-weight: 600; letter-spacing: .14em; color: var(--dd-cream); }

/* ── HUD ───────────────────────────────────────────────────────────── */
.hud { position: absolute; top: 0; left: 0; right: 0; padding: 16px clamp(14px, 3vw, 28px); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-spacer { flex: 1; pointer-events: none; }
.hud-back { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--dd-pearl); }
.hud-back img { height: 30px; }
.hud-back:hover { text-decoration: none; }
.hud-met { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-pill); background: var(--st-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 12px; font-weight: 600; }
.hud-dots { display: flex; gap: 4px; }
.hud-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--st-night-3); color: var(--st-grey); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 11px; transition: background 400ms; }
.hud-dot.is-met { background: var(--dd-cream); color: var(--dd-dark); }
.hud-btn { all: unset; pointer-events: auto; cursor: pointer; padding: 9px 12px; border-radius: var(--radius-pill); background: var(--st-glass); color: var(--dd-pearl); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: background 300ms; }
.hud-btn:focus-visible, .pad-btn:focus-visible, .pad-talk:focus-visible, .intro button:focus-visible { outline: 2px solid var(--dd-cream); outline-offset: 2px; }
.hud-sound.is-on { background: var(--dd-cream); color: var(--dd-dark); }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq span { width: 3px; height: 3px; border-radius: 1px; background: currentColor; transition: height 300ms; }
.hud-sound.is-on .eq span:nth-child(1) { height: 6px; }
.hud-sound.is-on .eq span:nth-child(2) { height: 11px; }
.hud-sound.is-on .eq span:nth-child(3) { height: 8px; }
.hud-sound.is-on .eq span:nth-child(4) { height: 12px; }

.minimap { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(520px, 70vw); height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.map-pin { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, .35); }
.map-pin.is-met { background: var(--dd-cream); }
.map-you { position: absolute; top: -6px; left: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--dd-cream); box-shadow: 0 0 0 3px var(--dd-cobalt); transform: translateX(-50%); }

.pad { position: absolute; left: 0; right: 0; bottom: 44px; padding: 0 16px; display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.pad-arrows { display: flex; gap: 10px; pointer-events: auto; }
.pad-btn { all: unset; cursor: pointer; width: 64px; height: 64px; border-radius: 50%; background: var(--st-ghost); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--dd-pearl); touch-action: none; }
.pad-talk { all: unset; pointer-events: auto; cursor: pointer; height: 64px; padding: 0 24px; border-radius: var(--radius-pill); background: var(--st-ghost); color: var(--dd-white); font-size: 15px; font-weight: 600; display: flex; align-items: center; transition: background 300ms; }
.pad-talk.is-near { background: var(--dd-cobalt); }

/* ── Dialog ────────────────────────────────────────────────────────── */
.dialog {
  position: absolute; left: 50%; bottom: clamp(20px, 6vh, 64px); transform: translateX(-50%);
  width: min(860px, calc(100vw - 24px)); display: flex; flex-wrap: wrap; border-radius: var(--radius-xl); overflow: hidden;
  background: var(--dd-white); color: var(--dd-dark); box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .6); cursor: pointer;
}
.dialog-portrait { flex: 0 0 clamp(110px, 22vw, 200px); position: relative; min-height: clamp(140px, 22vw, 220px); background: var(--st-night-2); color: var(--st-mist); }
.dialog-body { flex: 1 1 280px; min-width: 0; padding: clamp(18px, 3vw, 28px); display: flex; flex-direction: column; gap: 12px; }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.dialog-name { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.6vw, 30px); }
.dialog-role { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--dd-cobalt); }
.dialog-text { margin: 0; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.6; min-height: 4.8em; }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--dd-cobalt); vertical-align: -3px; margin-left: 2px; animation: ddBlink 1s step-end infinite; }
.dialog-ctas { display: flex; gap: 8px; flex-wrap: wrap; }
.dialog-ctas a, .dialog-ctas button { font-size: 13px; font-weight: 600; padding: 11px 16px; border-radius: var(--radius-md); text-decoration: none; }
.cta-primary { background: var(--dd-cobalt); color: var(--dd-white); }
.cta-primary:hover { background: var(--dd-cobalt-hover); color: var(--dd-white); text-decoration: none; }
.cta-quiet { background: var(--dd-pearl); color: var(--dd-dark); }
.cta-quiet:hover { color: var(--dd-dark); text-decoration: none; }
.dialog-ctas button { all: unset; cursor: pointer; font-size: 13px; font-weight: 600; padding: 11px 16px; border-radius: var(--radius-md); border: 1px solid var(--dd-line-strong); }
.dialog-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--st-grey); }
.dialog-foot > span:last-child { display: flex; align-items: center; gap: 6px; }
.key-light { padding: 3px 8px; border-radius: 6px; background: var(--dd-pearl); color: var(--dd-dark); font-weight: 600; }

/* ── Intro / outro ─────────────────────────────────────────────────── */
.intro { position: absolute; inset: 0; background: rgba(27, 29, 35, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.intro-inner { width: min(520px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--dd-cream); }
.intro h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -.03em; }
.intro p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--st-mist); }
.intro-load { width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.intro-load div { height: 4px; background: var(--dd-cream); animation: ddLoad 1.4s var(--ease-out) forwards; }
.intro-keys { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--st-mist-2); }
.intro-keys span { display: flex; align-items: center; gap: 8px; }
.intro-keys kbd { font: inherit; padding: 4px 9px; border-radius: 6px; background: var(--st-night-3); font-weight: 600; }
.intro-sound { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--st-mist-2); }
.switch { width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--dd-ink-2); position: relative; transition: background 200ms; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--dd-white); transition: left 200ms var(--ease-out); }
.intro-sound[aria-checked="true"] .switch { background: var(--dd-cobalt); }
.intro-sound[aria-checked="true"] .switch span { left: 19px; }
.intro-start { all: unset; cursor: pointer; margin-top: 8px; padding: 14px 26px; border-radius: var(--radius-md); background: var(--dd-white); color: var(--dd-cobalt); font-size: 15px; font-weight: 600; }
.intro-list { font-size: 13px; }

.outro {
  position: absolute; left: 50%; top: 84px; transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); box-sizing: border-box;
  padding: 20px 22px; border-radius: 16px; background: var(--dd-cobalt); color: var(--dd-white);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .6);
}
.outro span { font-size: 15px; font-weight: 600; }
.outro a { font-size: 13px; font-weight: 600; padding: 10px 14px; border-radius: var(--radius-md); background: var(--dd-white); color: var(--dd-cobalt); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .shop-prompt, .shop-sign, .lamp::after, .shop-cart span, .caret { animation: none !important; }
}
