/* /world — Jordan's night street. Everything is drawn in js/world.js as
   SVG; this file only frames it (layers, camera, UI, the room overlay). */
.world-body {
  margin: 0;
  overflow: hidden;
  background: #070404;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Hebrew", Arial, sans-serif;
}

.world {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.world-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,240,220,0.7), transparent),
    radial-gradient(1px 1px at 28% 9%, rgba(255,240,220,0.5), transparent),
    radial-gradient(1.5px 1.5px at 47% 22%, rgba(255,240,220,0.6), transparent),
    radial-gradient(1px 1px at 63% 12%, rgba(255,240,220,0.5), transparent),
    radial-gradient(1px 1px at 81% 27%, rgba(255,240,220,0.55), transparent),
    radial-gradient(1.5px 1.5px at 91% 8%, rgba(255,240,220,0.6), transparent),
    radial-gradient(1px 1px at 38% 33%, rgba(255,240,220,0.35), transparent),
    radial-gradient(1px 1px at 7% 38%, rgba(255,240,220,0.35), transparent),
    radial-gradient(ellipse 60% 40% at 72% 16%, rgba(233,221,200,0.16), transparent 70%),
    radial-gradient(ellipse 90% 55% at 30% 0%, rgba(110,28,34,0.55), transparent 75%),
    linear-gradient(180deg, #1c070a 0%, #120507 45%, #080404 100%);
}

.world-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  will-change: transform;
}
.world-layer svg { display: block; width: 100%; height: 100%; }
.world-street { cursor: pointer; }

/* Light rain — cheap: one animated repeating gradient, no particles. */
.world-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: repeating-linear-gradient(105deg, transparent 0 22px, rgba(233,221,200,0.35) 22px 23px, transparent 23px 61px);
  background-size: 200px 200px;
  animation: world-rain 0.9s linear infinite;
  mix-blend-mode: screen;
}
@keyframes world-rain {
  to { background-position: -40px 200px; }
}
.world .grain-overlay { position: absolute; }

/* Buildings */
.bld { cursor: pointer; outline: none; }
.bld .bld-sign { transition: opacity 0.4s ease; }
.bld:hover .bld-sign,
.bld:focus-visible .bld-sign,
.bld.near .bld-sign { opacity: 1; }
.bld .bld-sign { opacity: 0.86; }
.bld:focus-visible .bld-facade { stroke: #ffd76a; stroke-width: 4; }
.bld .bld-enter {
  opacity: 0;
  transition: opacity 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Hebrew", Arial, sans-serif;
}
.bld:hover .bld-enter,
.bld:focus-visible .bld-enter,
.bld.near .bld-enter { opacity: 1; }
@keyframes neon-flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.55; }
  95% { opacity: 1; }
  97% { opacity: 0.7; }
}
.neon-flicker { animation: neon-flicker 7s infinite; }

/* The walker */
.walker-leg-a,
.walker-leg-b,
.walker-arm-a,
.walker-arm-b { transform-box: fill-box; transform-origin: 50% 0%; }
.walker.walking .walker-leg-a { animation: leg 0.52s ease-in-out infinite; }
.walker.walking .walker-leg-b { animation: leg 0.52s ease-in-out infinite reverse; }
.walker.walking .walker-arm-a { animation: arm 0.52s ease-in-out infinite; }
.walker.walking .walker-arm-b { animation: arm 0.52s ease-in-out infinite reverse; }
.walker.walking .walker-body { animation: bob 0.26s ease-in-out infinite alternate; }
@keyframes leg { 0% { transform: rotate(24deg); } 50% { transform: rotate(-24deg); } 100% { transform: rotate(24deg); } }
@keyframes arm { 0% { transform: rotate(-18deg); } 50% { transform: rotate(18deg); } 100% { transform: rotate(-18deg); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }

.world-marker { animation: marker 0.7s ease-out forwards; }
@keyframes marker { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(1.4); } }

@media (prefers-reduced-motion: reduce) {
  .world-rain, .neon-flicker, .walker * { animation: none !important; }
}

/* Top bar */
.world-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: calc(0.6rem + var(--safe-t)) 0.9rem 0.6rem;
  background: linear-gradient(180deg, rgba(7,4,4,0.75), transparent);
  pointer-events: none;
}
.world-bar > * { pointer-events: auto; }
.world-title {
  margin: 0;
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--cream);
  text-align: center;
}
.world-bar-link {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--cream);
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(233,221,200,0.25);
  border-radius: 999px;
  background: rgba(7,4,4,0.55);
  white-space: nowrap;
}
.world-bar-link:hover,
.world-bar-link:focus-visible { border-color: var(--gold); color: #fff; }
@media (max-width: 420px) {
  .world-title { display: none; }
}

.world-hint {
  position: absolute;
  left: 50%;
  bottom: calc(1.2rem + var(--safe-b));
  z-index: 5;
  transform: translateX(-50%);
  margin: 0;
  max-width: calc(100% - 2rem);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(7,4,4,0.7);
  border: 1px solid rgba(233,221,200,0.18);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  text-align: center;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.world-hint:empty { opacity: 0; }

/* Inside a building */
.world-room {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5,3,3,0.78);
  animation: room-in 0.35s ease-out;
}
.world-room[hidden] { display: none; }
@keyframes room-in { from { opacity: 0; } to { opacity: 1; } }
.world-room-inner {
  position: relative;
  width: min(30rem, 100%);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 2.4rem 1.3rem 1.6rem;
  border-radius: 22px;
  border: 1px solid var(--room-accent, rgba(233,221,200,0.2));
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, var(--room-glow, rgba(110,28,34,0.35)), transparent 70%),
    #0b0808;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7), 0 0 40px var(--room-glow, transparent);
  text-align: center;
  font-family: var(--font-ui);
  color: #fff;
}
.world-room-close {
  position: absolute;
  top: 0.6rem;
  inset-inline-end: 0.6rem;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.world-room-close:hover,
.world-room-close:focus-visible { background: rgba(255,255,255,0.18); }
.world-room-title {
  margin: 0 0 0.3rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--room-accent, var(--cream));
  text-shadow: 0 0 18px var(--room-glow, transparent);
}
.world-room-title.hand {
  font-family: var(--font-hand);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  font-size: 1.8rem;
}
.world-room-sub { margin: 0 0 1.2rem; font-size: 0.9rem; color: #a49c90; }
.world-room-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.room-embed { display: block; width: 100%; border: 0; border-radius: 12px; }
.room-embed-spotify { height: 152px; }
.room-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.room-video .room-embed { position: absolute; inset: 0; height: 100%; border-radius: 0; }
.room-cover { display: block; width: min(100%, 18rem); height: auto; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,0.6); }
.room-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}
.room-open:hover,
.room-open:focus-visible { background: var(--cream); }
.room-text { margin: 0; color: #cfc6b8; font-size: 0.95rem; line-height: 1.7; }

.world-arrow svg { width: 1.3rem; height: 1.3rem; display: block; margin: auto; }
.world-arrow {
  position: absolute;
  bottom: 30%;
  z-index: 5;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1px solid rgba(233,221,200,0.3);
  background: rgba(7,4,4,0.6);
  color: var(--cream);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  animation: nudge 1.8s ease-in-out infinite;
}
.world-arrow[hidden] { display: none; }
.world-arrow-l { left: 0.6rem; }
.world-arrow-r { right: 0.6rem; }
.world-arrow:hover,
.world-arrow:focus-visible { border-color: var(--gold); }
@keyframes nudge { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .world-arrow { animation: none; } }

/* The moon is also the music player. */
.world-moon {
  position: absolute;
  z-index: 6;
  top: calc(15% - 34px);
  left: calc(76% - 34px);
  width: 68px;
  height: 68px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 42% 38%, #fbf4e4 0%, #efe3c8 55%, #d9c9a6 100%);
  box-shadow: 0 0 22px rgba(246,236,214,0.45), 0 0 60px rgba(246,236,214,0.18);
  color: rgba(42,10,13,0.55);
  animation: moon-glow 4.5s ease-in-out infinite;
}
.world-moon-icon { width: 26px; height: 26px; display: block; margin: auto; }
.world-moon.playing .world-moon-icon { color: rgba(110,28,34,0.75); }
.world-moon:focus-visible { outline: 3px solid #ffd76a; outline-offset: 4px; }
@keyframes moon-glow {
  50% { box-shadow: 0 0 30px rgba(246,236,214,0.65), 0 0 80px rgba(246,236,214,0.28); opacity: 0.88; }
}
@media (prefers-reduced-motion: reduce) { .world-moon { animation: none; } }

.world-music {
  position: absolute;
  z-index: 6;
  top: calc(15% + 46px);
  left: 76%;
  transform: translateX(-50%);
  padding: 0.7rem 0.9rem 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(233,221,200,0.22);
  background: rgba(10,6,6,0.88);
  box-shadow: 0 14px 40px rgba(0,0,0,0.6);
  text-align: center;
  font-family: var(--font-ui);
  color: var(--cream);
}
.world-music[hidden] { display: none; }
@media (max-width: 520px) {
  .world-music { left: auto; right: 0.8rem; transform: none; }
}
.world-music-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-hand);
  font-style: italic;
  font-size: 1.05rem;
  white-space: nowrap;
}
.world-music-row { display: flex; gap: 0.5rem; justify-content: center; direction: ltr; }
.world-music-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(233,221,200,0.3);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.world-music-btn:hover,
.world-music-btn:focus-visible { border-color: var(--gold); }
.world-music-btn:disabled { opacity: 0.35; cursor: default; }
.world-music-play { background: #fff; color: #000; font-size: 1rem; }
.world-music-meter {
  display: flex;
  gap: 3px;
  justify-content: center;
  align-items: flex-end;
  height: 16px;
  margin-top: 0.6rem;
  direction: ltr;
}
.world-music-meter span {
  width: 5px;
  border-radius: 2px;
  background: rgba(233,221,200,0.18);
}
.world-music-meter span:nth-child(1) { height: 30%; }
.world-music-meter span:nth-child(2) { height: 38%; }
.world-music-meter span:nth-child(3) { height: 46%; }
.world-music-meter span:nth-child(4) { height: 54%; }
.world-music-meter span:nth-child(5) { height: 62%; }
.world-music-meter span:nth-child(6) { height: 70%; }
.world-music-meter span:nth-child(7) { height: 78%; }
.world-music-meter span:nth-child(8) { height: 86%; }
.world-music-meter span:nth-child(9) { height: 93%; }
.world-music-meter span:nth-child(10) { height: 100%; }
.world-music-meter span.on { background: var(--gold); }

/* The regulars */
.npc { cursor: pointer; outline: none; }
.npc .walker-body { animation: breathe 3.6s ease-in-out infinite; transform-box: fill-box; }
.npc:nth-of-type(2n) .walker-body { animation-delay: -1.4s; }
@keyframes breathe { 50% { transform: translateY(-2px); } }
.npc:hover .walker-body path,
.npc:focus-visible .walker-body path { stroke: #ffd76a; }
.passers { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .npc .walker-body { animation: none; } }

.world-bubble {
  position: absolute;
  z-index: 7;
  max-width: min(17rem, calc(100vw - 16px));
  padding: 0.65rem 0.9rem 0.6rem;
  border-radius: 14px;
  background: #f4ecdc;
  color: #1a0b0d;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  cursor: pointer;
  animation: bubble-in 0.22s ease-out;
}
.world-bubble[hidden] { display: none; }
.world-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: calc(var(--tail, 50%) - 8px);
  border: 8px solid transparent;
  border-bottom: 0;
  border-top-color: #f4ecdc;
}
.world-bubble-name {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #6e1c22;
}
.world-bubble-text { display: block; }
.world-bubble-more {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: #7a6b60;
}
.world-bubble-more[hidden] { display: none; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* "you can talk to me" cue */
.npc-cue { animation: cue 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.npc.talking .npc-cue { display: none; }
@keyframes cue { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .npc-cue { animation: none; } }

.world-bubble { overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 2.2rem; }
.world-bubble.wide { max-width: min(22rem, calc(100vw - 16px)); }
.world-bubble-text { white-space: pre-wrap; }
.world-bubble-close {
  position: absolute;
  top: 0.3rem;
  inset-inline-end: 0.3rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(26,11,13,0.08);
  color: #1a0b0d;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.world-bubble-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.world-bubble-choices[hidden] { display: none; }
.world-bubble-choices.tracks { display: grid; grid-template-columns: 1fr 1fr; }
.world-bubble-choice {
  min-height: 2.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(26,11,13,0.25);
  background: transparent;
  color: #1a0b0d;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
}
.world-bubble-choices.tracks .world-bubble-choice { border-radius: 10px; font-size: 0.8rem; padding: 0.4rem 0.5rem; }
.world-bubble-choice.primary { background: #1a0b0d; color: #f4ecdc; border-color: #1a0b0d; }
.world-bubble-choice:hover,
.world-bubble-choice:focus-visible { border-color: #6e1c22; outline: none; box-shadow: 0 0 0 2px rgba(110,28,34,0.35); }
