/* Editorial project / district panel and the full city map. The world stays visible behind. */

.modal {
  width: min(760px, calc(100% - 32px));
  max-height: min(86vh, 900px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(32, 16, 46, 0.95);
  color: var(--text);
  box-shadow: 0 40px 100px rgba(10, 4, 24, 0.6);
  overflow: hidden;
}
.modal[open] { animation: modal-in 0.4s cubic-bezier(0.25, 1.35, 0.45, 1); }
.modal::backdrop { background: rgba(20, 10, 36, 0.45); backdrop-filter: blur(5px); }
@keyframes modal-in { 0% { opacity: 0; transform: translateY(30px) scale(0.96); } 100% { opacity: 1; transform: none; } }

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(27, 22, 48, 0.75);
  color: var(--text);
  font-size: 18px;
}
.modal__close:hover { background: rgba(27, 22, 48, 0.95); }
.modal__body { max-height: min(86vh, 900px); overflow-y: auto; }

/* ---------- Sheet (mission / district page) ---------- */
.sheet { padding-bottom: 28px; }
.sheet > :not(.sheet__head) { margin-left: clamp(20px, 4vw, 40px); margin-right: clamp(20px, 4vw, 40px); }
.sheet__head {
  position: relative;
  padding: 46px clamp(20px, 4vw, 40px) 26px;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #1b1630));
  color: var(--navy);
}
.sheet__head::after {
  content: '';
  position: absolute;
  left: clamp(20px, 4vw, 40px);
  right: 70px;
  top: 14px;
  height: 10px;
  background: radial-gradient(circle at 10px 5px, rgba(255, 255, 255, 0.55) 5px, transparent 5.5px) 0 0 / 22px 10px repeat-x;
}
.sheet__head .eyebrow { color: var(--navy) !important; opacity: 0.8; }
.sheet__title { margin: 0; font-size: clamp(30px, 5vw, 52px); color: var(--navy); }
/* Mission key art (square logo) under the colored header */
.sheet__art {
  margin-top: 22px !important;
  margin-bottom: 0;
}
.sheet__art-img {
  display: block;
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--line), 0 24px 50px rgba(10, 4, 24, 0.5);
}
.sheet__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  font-weight: 700;
  color: var(--muted);
}
.sheet__meta .chip { color: var(--yellow); }
.sheet__lead { margin-top: 18px; font-size: 19px; line-height: 1.5; }
.sheet__section h3 { margin: 22px 0 6px; font-size: 14px; letter-spacing: 0.1em; color: var(--teal); }
.sheet__section p { color: var(--muted); }
.sheet__gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 20px; }
.sheet__gallery img { width: 100%; border-radius: 12px; display: block; }
.sheet__empty {
  margin-top: 22px;
  padding: 22px;
  border-radius: 14px;
  border: 2px dashed rgba(255, 212, 71, 0.55);
  background: rgba(255, 212, 71, 0.06);
  text-align: center;
}
.sheet__empty-title { margin: 0 0 4px; font-family: var(--display); color: var(--yellow); }
.sheet__empty p:last-child { margin: 0; color: var(--muted); }
.sheet__placeholder { margin-top: 18px; font-family: var(--display); color: var(--yellow); }
.sheet__nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 28px; }
.sheet__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 22px; }
.sheet__list { display: grid; gap: 10px; margin-top: 20px; }
.sheet__item-text { display: grid; gap: 2px; }
.sheet__item-logo { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.sheet__item {
  --c: var(--pink);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--c);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
  transition: transform 0.15s ease, background 0.15s ease;
}
.sheet__item:hover { transform: translateX(4px); background: rgba(255, 255, 255, 0.12); }
.sheet__item strong { font-family: var(--display); font-weight: 400; font-size: 18px; }
.sheet__item span:last-child { color: var(--muted); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 13px; font-weight: 600; }

/* ---------- Full city map ---------- */
.modal--map { width: min(900px, calc(100% - 32px)); }
.map { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; padding: 28px; overflow-y: auto; max-height: min(86vh, 900px); }
.map__head { grid-column: 1 / -1; }
.map__head h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); }
.map__canvas { width: 100%; aspect-ratio: 1; border-radius: 16px; border: 3px solid #fff7fb; background: var(--navy); }
.map__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.map__item {
  --c: var(--pink);
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'dot name status' 'dot label status';
  align-items: center;
  column-gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
}
.map__item:hover { background: rgba(255, 255, 255, 0.12); }
.map__item .district__dot { grid-area: dot; }
.map__item strong { grid-area: name; font-family: var(--display); font-weight: 400; font-size: 14px; }
.map__item span:nth-of-type(2) { grid-area: label; color: var(--muted); font-size: 13px; }
.map__status { grid-area: status; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: var(--yellow); }
.map__item.is-visited .map__status { color: var(--teal); }

@media (max-width: 820px) {
  .modal { width: 100%; max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .modal__body { max-height: 100%; height: 100%; }
  .map { grid-template-columns: 1fr; max-height: 100%; padding: 22px 16px; }
}
