/* =========================================================================
   The Kintsugi Mender — Evening alley, gifts & atelier decor (F5)
   ========================================================================= */
.al-wrap {
  width: 100%;
  max-width: 980px;
  margin: var(--space-lg) auto var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.al-head { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }

.al-kicker {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold-ink);
}

.al-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  color: var(--text);
}

.al-lede {
  margin: 0;
  max-width: 600px;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text);
}

/* Map with lantern pins */
.al-map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
  background: #1b2433;
}

.al-map-svg,
.al-map-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.al-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #f6e3b4;
  background: radial-gradient(circle at 40% 35%, #fff4d6, #e9b54a 55%, #b8791f);
  box-shadow: 0 0 0 6px rgba(246, 227, 180, 0.18), 0 0 22px rgba(246, 210, 120, 0.7);
  cursor: pointer;
  display: grid;
  place-items: center;
  animation: alGlow 3.2s ease-in-out infinite;
}

.al-pin-place {
  background: radial-gradient(circle at 40% 35%, #ffe9e4, #d6553f 55%, #8f1f14);
  border-color: #ffd9cf;
}

.al-pin-k {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #2b1f1a;
}

.al-pin-place .al-pin-k { color: #fff6ef; }

.al-pin.is-locked {
  background: #4a4a4a;
  border-color: #777777;
  box-shadow: none;
  animation: none;
  opacity: 0.55;
  cursor: not-allowed;
}

.al-pin.is-locked .al-pin-k { color: #c9c3bb; }

.al-pin:not(.is-locked):hover,
.al-pin:not(.is-locked):focus-visible {
  transform: translate(-50%, -50%) scale(1.12);
}

@keyframes alGlow {
  0%, 100% { box-shadow: 0 0 0 6px rgba(246, 227, 180, 0.18), 0 0 18px rgba(246, 210, 120, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(246, 227, 180, 0.22), 0 0 30px rgba(246, 210, 120, 0.85); }
}

/* Place list (readable labels, works on any screen) */
.al-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-xs);
}

.al-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 64px;
  padding: 10px 14px;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.al-item:hover,
.al-item:focus-visible { border-color: var(--accent-gold); }

.al-item.is-locked { opacity: 0.55; cursor: not-allowed; }

.al-item-face {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.al-item-k {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #c13324;
  color: #fff6ef;
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.al-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.al-item-text strong { font-family: var(--font-serif); font-size: var(--text-base); }
.al-item-text span { font-size: var(--text-sm); color: var(--text-muted); }

.al-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.al-satchel {
  margin-right: auto;
  font-size: var(--text-base);
  color: var(--text-muted);
}

/* Scene */
.al-scene-art {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-md);
}

.al-scene-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.al-scene-head {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.al-scene-face {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-gold);
}

.al-scene-k {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #c13324;
  color: #fff6ef;
  font-family: var(--font-serif);
  font-size: 2rem;
}

.al-scene .al-title { font-size: var(--text-2xl); }

.al-hint {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-muted);
  font-style: italic;
}

.al-gift-box { display: flex; flex-direction: column; gap: var(--space-xs); }

.al-gifts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-xs);
}

.al-gift {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  text-align: left;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.al-gift:hover,
.al-gift:focus-visible { border-color: var(--accent-gold); }

.al-gift-k {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--accent-gold-ink);
}

.al-gift strong { display: block; font-family: var(--font-serif); font-size: var(--text-base); }
.al-gift small { display: block; font-size: var(--text-sm); color: var(--text-muted); }

.al-omikuji {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: #fbf6ec;
  border: 1px solid #d8c9b0;
  color: #2b2522;
  animation: rtIn 600ms ease-out both;
}

.al-omikuji-rank { font-family: var(--font-serif); font-size: 2.2rem; color: #c13324; }
.al-omikuji strong { font-family: var(--font-serif); font-size: var(--text-lg); }
.al-omikuji p { margin: 0; font-family: var(--font-serif); font-size: var(--text-lg); line-height: var(--leading-relaxed); }
.al-omikuji small { font-size: var(--text-sm); color: #6b5949; }

/* Atelier vignette */
.dv-dawn {
  margin: 0 0 var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dv-frame,
.dv-preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  line-height: 0;
}

.dv-svg { width: 100%; height: auto; display: block; }

.dv-dawn figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  color: var(--text-muted);
}

.dv-preview { margin-bottom: var(--space-md); }

.dv-slot { margin-bottom: var(--space-md); }

.dv-slot h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--text);
}

.dv-slot h3 span { color: var(--accent-gold-ink); }

.dv-options { display: flex; flex-wrap: wrap; gap: var(--space-xs); }

.dv-opt {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: var(--tap-min);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  cursor: pointer;
  text-align: left;
}

.dv-opt.is-on {
  border: 2px solid var(--accent-gold);
  background: var(--surface);
  font-weight: 700;
}

.dv-opt.is-locked { opacity: 0.6; cursor: not-allowed; }
.dv-opt small { font-family: var(--font-sans); font-size: var(--text-sm); color: var(--text-muted); font-weight: 400; }

.dv-swatch {
  width: 22px;
  height: 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
  .al-pin { width: 36px; height: 36px; border-width: 1.5px; }
  .al-pin-k { font-size: 1rem; }
  .al-title { font-size: var(--text-2xl); }
}

@media (prefers-reduced-motion: reduce) {
  .al-pin { animation: none; }
}

/* =========================================================================
   Image viewer (all illustrations expand)
   ========================================================================= */
.al-map-img,
.al-scene-art img,
.narrative-portrait-wrap img,
.rt-portrait,
.al-scene-face,
.cv-cameo-face,
.rt-companion-face,
.dv-frame,
.dv-preview {
  cursor: zoom-in;
}

.al-map,
.al-scene-art,
.dv-frame {
  position: relative;
}

.al-map::after,
.al-scene-art::after,
.dv-frame::after {
  content: "\2922";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 22, 30, 0.6);
  color: #f6eee2;
  font-size: 1.1rem;
  line-height: 1;
  pointer-events: none;
}

[data-lb]:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

html.lb-lock,
html.lb-lock body {
  overflow: hidden;
}

.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 24px;
  background: rgba(10, 12, 18, 0.92);
  touch-action: pinch-zoom;
}

.lb-overlay.is-open {
  display: flex;
  animation: lbIn 220ms ease-out both;
}

@keyframes lbIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lb-media img,
.lb-media .lb-svg {
  display: block;
  max-width: 94vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lb-media .lb-svg {
  width: min(94vw, 1100px);
  background: #f3e6d0;
}

.lb-caption {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  color: #f6eee2;
  text-align: center;
  max-width: 90vw;
}

.lb-caption:empty {
  display: none;
}

.lb-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(246, 238, 226, 0.4);
  background: rgba(246, 238, 226, 0.12);
  color: #f6eee2;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lb-close:hover,
.lb-close:focus-visible {
  background: rgba(246, 238, 226, 0.25);
}
