:root {
  --bg: #050811;
  --panel: rgba(5, 12, 24, 0.78);
  --panel-strong: rgba(5, 12, 24, 0.94);
  --gold: #cba25b;
  --gold-bright: #f3cf7a;
  --ice: #7be8ff;
  --ice-soft: rgba(123, 232, 255, 0.24);
  --text: #edf8ff;
  --muted: #9eb7c8;
  --line: rgba(203, 162, 91, 0.42);
  --shadow: rgba(0, 0, 0, 0.48);
}

/* Leaflet essentials are repeated here so the map stays usable if the CDN CSS
   is slow during local preview. */
.leaflet-container {
  position: relative;
  overflow: hidden;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  top: 0;
  left: 0;
}

.leaflet-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  float: left;
  clear: both;
  pointer-events: auto;
}

.leaflet-top .leaflet-control {
  margin-top: 14px;
}

.leaflet-left .leaflet-control {
  margin-left: 338px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 25% 12%, rgba(55, 129, 170, 0.24), transparent 32%),
    radial-gradient(circle at 79% 8%, rgba(203, 162, 91, 0.13), transparent 28%),
    linear-gradient(145deg, #02040a 0%, #07111f 46%, #03050b 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(123, 232, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 232, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.5px);
  background-position:
    center,
    center,
    18px 28px;
  background-size:
    74px 74px,
    74px 74px,
    150px 150px;
  opacity: 0.28;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 102px;
  padding: 18px 30px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(5, 8, 17, 0.98), rgba(8, 18, 31, 0.9) 56%, rgba(5, 8, 17, 0.94)),
    radial-gradient(circle at 30% 0%, rgba(123, 232, 255, 0.16), transparent 40%);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

.hero::after {
  position: absolute;
  right: 28px;
  bottom: -1px;
  left: 28px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(243, 207, 122, 0.72), transparent);
}

.hero-mark {
  position: relative;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(243, 207, 122, 0.72);
  transform: rotate(45deg);
  background:
    linear-gradient(135deg, rgba(243, 207, 122, 0.18), transparent 48%),
    radial-gradient(circle, rgba(123, 232, 255, 0.24), transparent 58%);
  box-shadow:
    0 0 22px rgba(123, 232, 255, 0.18),
    inset 0 0 22px rgba(203, 162, 91, 0.16);
}

.hero-mark::before,
.hero-mark::after {
  position: absolute;
  inset: 11px;
  content: "";
  border: 1px solid rgba(123, 232, 255, 0.44);
}

.hero-mark::after {
  inset: 22px;
  border-color: rgba(243, 207, 122, 0.65);
  background: rgba(123, 232, 255, 0.18);
  box-shadow: 0 0 16px rgba(123, 232, 255, 0.32);
}

.hero-copy {
  min-width: 0;
}

.kicker {
  margin: 0 0 7px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.03;
  letter-spacing: 0;
  color: #f6d78a;
  text-shadow:
    0 0 18px rgba(123, 232, 255, 0.38),
    0 0 34px rgba(203, 162, 91, 0.22);
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.45vw, 18px);
}

.site-notice {
  position: relative;
  z-index: 1001;
  padding: 5px 18px 6px;
  border-top: 1px solid rgba(203, 162, 91, 0.22);
  color: rgba(158, 183, 200, 0.68);
  background: rgba(2, 6, 14, 0.96);
  font-size: 9px;
  line-height: 1.3;
  text-align: center;
}

.site-notice p {
  margin: 0;
}

.site-notice span {
  margin-left: 8px;
}

.site-notice a {
  color: rgba(243, 207, 122, 0.76);
  text-decoration: none;
}

.site-notice a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.map-stage {
  position: relative;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) minmax(320px, 390px);
  min-height: 0;
}

#map {
  position: relative;
  z-index: 1;
  grid-column: 1 / 4;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: #020611;
  border: 1px solid rgba(201, 160, 90, 0.24);
  box-shadow:
    inset 0 0 60px rgba(42, 198, 255, 0.12),
    inset 0 0 120px rgba(0, 0, 0, 0.28);
}

#map::before,
#map::after {
  position: absolute;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  content: "";
}

#map::before {
  background:
    radial-gradient(ellipse at 58% 48%, rgba(231, 178, 70, 0.28), transparent 38%),
    radial-gradient(ellipse at 43% 58%, rgba(203, 134, 40, 0.2), transparent 34%),
    radial-gradient(circle at 17% 40%, rgba(0, 137, 190, 0.32), transparent 32%),
    radial-gradient(circle at 90% 50%, rgba(0, 126, 185, 0.28), transparent 28%),
    radial-gradient(ellipse at 48% 46%, transparent 0 62%, rgba(1, 4, 10, 0.18) 84%, rgba(0, 0, 0, 0.38) 100%),
    linear-gradient(90deg, rgba(1, 5, 12, 0.12), transparent 18%, transparent 76%, rgba(1, 5, 12, 0.2));
  mix-blend-mode: soft-light;
}

#map::after {
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(123, 232, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 232, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 17% 26%, rgba(243, 207, 122, 0.22) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 42%, rgba(243, 207, 122, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.48) 0 1px, transparent 1.5px);
  background-size:
    88px 88px,
    88px 88px,
    auto,
    auto,
    180px 180px;
}

.leaflet-tile {
  opacity: 1;
  filter: sepia(0.16) saturate(1.58) brightness(0.86) contrast(1.18);
}

.leaflet-control-attribution {
  color: rgba(237, 248, 255, 0.52);
  background: rgba(3, 7, 19, 0.54);
}

.leaflet-control-attribution a {
  color: rgba(123, 232, 255, 0.78);
}

.game-panel {
  z-index: 520;
  border: 1px solid rgba(201, 160, 90, 0.46);
  background:
    linear-gradient(180deg, rgba(9, 17, 31, 0.9), rgba(4, 9, 19, 0.84)),
    radial-gradient(circle at 20% 0%, rgba(123, 232, 255, 0.12), transparent 34%);
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 0 34px rgba(203, 162, 91, 0.08),
    inset 0 0 58px rgba(42, 198, 255, 0.05);
  backdrop-filter: blur(14px);
}

.game-panel::before {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(243, 207, 122, 0.58), transparent);
}

.filter-panel {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  margin: 24px 0 24px 24px;
  padding: 22px 16px 18px;
  border-radius: 0;
}

.panel-eyebrow {
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.filter-title {
  margin: 7px 0 16px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  color: #f7fbff;
  font-size: 22px;
  font-weight: 800;
}

.filter-list {
  display: grid;
  gap: 9px;
}

.filter-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(203, 162, 91, 0.22);
  border-radius: 2px;
  color: var(--muted);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(123, 232, 255, 0.02));
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.filter-button:hover,
.filter-button.is-active {
  color: var(--text);
  border-color: rgba(243, 207, 122, 0.78);
  background:
    linear-gradient(90deg, rgba(203, 162, 91, 0.2), rgba(123, 232, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    0 0 22px rgba(123, 232, 255, 0.12),
    inset 3px 0 0 rgba(243, 207, 122, 0.78);
}

.filter-button:hover {
  transform: translateX(2px);
}

.filter-symbol {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(123, 232, 255, 0.28);
  color: var(--gold-bright);
  background: rgba(2, 8, 16, 0.72);
  box-shadow: inset 0 0 12px rgba(123, 232, 255, 0.08);
}

.filter-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.filter-count {
  min-width: 26px;
  color: rgba(237, 248, 255, 0.82);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.story-panel {
  position: relative;
  z-index: 530;
  grid-column: 3;
  grid-row: 1;
  align-self: stretch;
  min-height: 0;
  margin: 24px 24px 24px 0;
  padding: 20px 18px;
  overflow: hidden;
}

#storyPanel {
  height: 100%;
  overflow-y: auto;
  padding-right: 6px;
}

#storyPanel::-webkit-scrollbar,
.story-events::-webkit-scrollbar {
  width: 6px;
}

#storyPanel::-webkit-scrollbar-thumb,
.story-events::-webkit-scrollbar-thumb {
  background: rgba(203, 162, 91, 0.42);
}

.story-empty {
  display: grid;
  min-height: 100%;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.story-empty h2,
.story-city {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  color: var(--gold-bright);
  font-size: 27px;
  line-height: 1.2;
}

.story-empty p {
  margin: 0;
  line-height: 1.8;
}

.story-hint,
.story-places,
.story-count {
  color: var(--muted);
  font-size: 13px;
}

.story-places {
  margin-top: 8px;
}

.story-count {
  display: inline-flex;
  width: fit-content;
  margin: 14px 0 18px;
  padding: 5px 10px;
  border: 1px solid rgba(123, 232, 255, 0.22);
  color: var(--gold-bright);
  background: rgba(123, 232, 255, 0.055);
  font-weight: 900;
}

.story-events {
  display: grid;
  gap: 14px;
}

.story-event {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(201, 160, 90, 0.35);
  background:
    linear-gradient(180deg, rgba(5, 12, 24, 0.72), rgba(5, 12, 24, 0.56)),
    radial-gradient(circle at 0% 0%, rgba(123, 232, 255, 0.06), transparent 42%);
  box-shadow: inset 0 0 18px rgba(123, 232, 255, 0.035);
}

.story-event:first-child {
  border-top: 1px solid rgba(201, 160, 90, 0.35);
}

.event-year {
  display: grid;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(203, 162, 91, 0.48);
  color: var(--gold-bright);
  background: rgba(5, 8, 17, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.event-body h3 {
  margin: 0 0 7px;
  color: var(--gold-bright);
  font-size: 15px;
  line-height: 1.42;
}

.event-body p {
  margin: 0;
  color: #c5d7e4;
  font-size: 13px;
  line-height: 1.72;
}

.event-source {
  margin-top: 8px;
  color: rgba(158, 183, 200, 0.82);
  font-size: 12px;
  line-height: 1.5;
}

.event-source a {
  color: #9feeff;
  text-decoration: none;
  border-bottom: 1px solid rgba(123, 232, 255, 0.32);
}

.record-ribbon {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(243, 207, 122, 0.54);
  background:
    linear-gradient(90deg, rgba(203, 162, 91, 0.18), rgba(123, 232, 255, 0.04)),
    rgba(5, 12, 24, 0.5);
  box-shadow: inset 3px 0 0 rgba(243, 207, 122, 0.78);
}

.record-ribbon span {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 900;
}

.record-ribbon p {
  color: #d8e5ed;
  font-size: 12px;
}

.record-ribbon.is-pending {
  border-color: rgba(181, 140, 255, 0.5);
  box-shadow: inset 3px 0 0 rgba(181, 140, 255, 0.8);
}

.city-marker {
  position: relative;
  display: block;
  width: 104px;
  height: 44px;
  --core-size: 28px;
  animation: floatMarker 4.2s ease-in-out infinite;
}

.marker-aura,
.marker-core,
.marker-symbol {
  position: absolute;
  top: 50%;
  left: 22px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
}

.marker-aura {
  z-index: 1;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(123, 232, 255, 0.22);
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--marker-color) 22%, transparent), transparent 67%);
  box-shadow:
    0 0 14px color-mix(in srgb, var(--marker-color) 42%, transparent),
    0 0 28px rgba(123, 232, 255, 0.13);
  animation: pulseAura 3.2s ease-in-out infinite;
}

.marker-core {
  z-index: 3;
  width: var(--core-size);
  height: var(--core-size);
  border: 1px solid rgba(244, 214, 147, 0.74);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 45%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--marker-color) 78%, #ffffff 16%), rgba(7, 14, 24, 0.96) 70%);
  box-shadow:
    0 0 12px color-mix(in srgb, var(--marker-color) 72%, transparent),
    inset 0 0 14px rgba(255, 255, 255, 0.12),
    inset 0 0 0 4px rgba(3, 9, 18, 0.52);
  clip-path: polygon(50% 0%, 88% 22%, 88% 78%, 50% 100%, 12% 78%, 12% 22%);
}

.marker-core::before {
  position: absolute;
  inset: 4px;
  content: "";
  border: 1px solid rgba(123, 232, 255, 0.22);
  clip-path: inherit;
}

.marker-symbol {
  z-index: 4;
  width: 100%;
  height: 100%;
  color: #f8fbff;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 0 8px var(--marker-color);
}

.marker-label {
  position: absolute;
  top: 9px;
  left: 40px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 92px;
  min-height: 25px;
  padding: 4px 7px;
  border: 1px solid rgba(201, 160, 90, 0.52);
  color: #f1d188;
  background:
    linear-gradient(90deg, rgba(5, 12, 24, 0.92), rgba(8, 18, 31, 0.78)),
    rgba(5, 12, 24, 0.8);
  box-shadow:
    0 0 14px rgba(0, 0, 0, 0.42),
    inset 0 0 12px rgba(123, 232, 255, 0.05);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.marker-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.marker-count {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid rgba(123, 232, 255, 0.34);
  border-radius: 999px;
  color: #07111f;
  background: linear-gradient(135deg, #fff1bd, #d6a95a);
  box-shadow: 0 0 10px rgba(243, 207, 122, 0.28);
  font-size: 11px;
}

.marker-record {
  color: #f7d987;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.city-marker.multi {
  --core-size: 31px;
}

.city-marker.has-featured .marker-aura {
  opacity: 0.9;
}

.city-marker.record-personal,
.city-marker.record-team {
  --marker-color: #f6c967;
}

.city-marker.record-personal .marker-aura,
.city-marker.record-team .marker-aura {
  border-color: rgba(243, 207, 122, 0.82);
  animation:
    pulseAura 3.2s ease-in-out infinite,
    recordPulse 1.85s ease-out infinite;
}

.city-marker.record-personal .marker-aura {
  width: 56px;
  height: 56px;
  box-shadow:
    0 0 20px rgba(243, 207, 122, 0.58),
    0 0 42px rgba(243, 207, 122, 0.18);
}

.city-marker.record-team .marker-aura {
  width: 50px;
  height: 50px;
}

.city-marker.record-pending .marker-core {
  animation: pending-blink 2.4s ease-in-out infinite;
}

.city-marker.active .marker-core {
  border-color: #fff1bd;
  box-shadow:
    0 0 18px color-mix(in srgb, var(--marker-color) 88%, transparent),
    0 0 34px rgba(243, 207, 122, 0.22),
    inset 0 0 16px rgba(255, 255, 255, 0.18);
}

.city-marker.filtered .marker-label {
  border-color: rgba(123, 232, 255, 0.46);
}

.city-tooltip {
  width: max-content;
  max-width: none;
  padding: 6px 10px;
  border: 1px solid rgba(203, 162, 91, 0.64);
  color: #f7fbff;
  background: rgba(5, 8, 17, 0.9);
  box-shadow: 0 0 18px rgba(123, 232, 255, 0.16);
  font-weight: 800;
  white-space: nowrap;
}

.city-tooltip.leaflet-tooltip {
  width: max-content;
  max-width: none;
  white-space: nowrap;
}

@keyframes floatMarker {
  0%,
  100% {
    transform: translateY(-2px);
  }
  50% {
    transform: translateY(3px);
  }
}

@keyframes pulseAura {
  0%,
  100% {
    opacity: 0.48;
    transform: translate(-50%, -50%) scale(0.92);
  }
  50% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes recordPulse {
  0% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(0.72);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55);
  }
}

@keyframes pending-blink {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 1060px) and (min-width: 981px) {
  .map-stage {
    grid-template-columns: 248px minmax(0, 1fr) minmax(280px, 340px);
  }

  .filter-panel {
    margin-left: 16px;
  }

  .story-panel {
    margin-right: 16px;
  }

  .leaflet-left .leaflet-control {
    margin-left: 292px;
  }
}

@media (max-width: 980px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
  }

  .hero {
    min-height: 112px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 18px 14px 14px;
  }

  .hero-mark {
    width: 42px;
    height: 42px;
  }

  .hero-mark::before {
    inset: 8px;
  }

  .hero-mark::after {
    inset: 16px;
  }

  .subtitle {
    max-width: 18em;
  }

  .map-stage {
    display: block;
    min-height: 0;
  }

  #map {
    height: 100%;
    min-height: 0;
  }

  .filter-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    margin: 0;
    padding: 10px;
  }

  .filter-panel::before {
    display: none;
  }

  .panel-eyebrow,
  .filter-title {
    display: none;
  }

  .filter-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .filter-button {
    flex: 0 0 auto;
    grid-template-columns: 24px auto auto;
    min-height: 38px;
    width: auto;
    min-width: max-content;
    padding: 7px 9px;
  }

  .filter-symbol {
    width: 22px;
    height: 22px;
  }

  .story-panel {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-height: 38vh;
    min-height: 168px;
    margin: 0;
    padding: 14px 14px 12px;
  }

  .story-empty {
    min-height: 138px;
  }

  .story-empty h2,
  .story-city {
    font-size: 22px;
  }

  .story-event {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .city-marker {
    width: 96px;
  }

  .marker-label {
    max-width: 76px;
    font-size: 11px;
  }

  .leaflet-left .leaflet-control {
    margin-top: 78px;
    margin-left: 12px;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .hero {
    min-height: 104px;
    padding: 16px 20px 14px;
  }

  .filter-panel {
    right: 16px;
    left: 16px;
  }

  .story-panel {
    right: 16px;
    left: 16px;
    max-height: 34vh;
  }
}

/* Reference-style pass: clearer world map, compact panels, sharper fantasy UI. */
.app-shell {
  grid-template-rows: 86px minmax(0, 1fr);
}

.hero {
  min-height: 86px;
  grid-template-columns: 58px minmax(220px, auto) 1fr;
  gap: 14px;
  padding: 10px 18px;
  background:
    linear-gradient(180deg, rgba(2, 7, 13, 0.94), rgba(4, 10, 18, 0.74)),
    radial-gradient(circle at 50% 100%, rgba(67, 201, 255, 0.12), transparent 40%);
}

.hero-mark {
  width: 52px;
  height: 52px;
  border-color: rgba(231, 178, 89, 0.9);
  box-shadow:
    0 0 20px rgba(231, 178, 89, 0.22),
    inset 0 0 18px rgba(75, 220, 255, 0.12);
}

h1 {
  font-size: clamp(26px, 2.35vw, 38px);
  color: #e9c878;
}

.subtitle {
  margin-top: 5px;
  color: #d5b979;
  font-size: 13px;
}

.map-stage {
  grid-template-columns: 124px minmax(0, 1fr) 260px;
}

#map {
  min-height: 0;
  border-color: rgba(201, 160, 90, 0.38);
  box-shadow:
    inset 0 0 42px rgba(42, 198, 255, 0.14),
    inset 0 0 110px rgba(0, 0, 0, 0.26);
}

#map::before {
  background:
    radial-gradient(ellipse at 60% 46%, rgba(231, 178, 70, 0.24), transparent 38%),
    radial-gradient(ellipse at 43% 60%, rgba(203, 134, 40, 0.17), transparent 34%),
    radial-gradient(circle at 20% 42%, rgba(0, 137, 190, 0.26), transparent 32%),
    radial-gradient(circle at 88% 50%, rgba(0, 126, 185, 0.23), transparent 28%),
    radial-gradient(ellipse at 50% 46%, transparent 0 68%, rgba(1, 4, 10, 0.14) 86%, rgba(0, 0, 0, 0.32) 100%),
    linear-gradient(90deg, rgba(1, 5, 12, 0.06), transparent 18%, transparent 78%, rgba(1, 5, 12, 0.14));
  mix-blend-mode: soft-light;
}

#map::after {
  opacity: 0.16;
}

.leaflet-tile {
  opacity: 1;
  filter: sepia(0.16) saturate(1.58) brightness(0.86) contrast(1.18);
}

.filter-panel {
  margin: 14px 0 14px 4px;
  padding: 12px 8px;
  border-color: rgba(201, 160, 90, 0.52);
  background: linear-gradient(180deg, rgba(5, 13, 25, 0.86), rgba(2, 7, 14, 0.74));
}

.filter-title {
  margin: 4px 0 10px;
  font-size: 13px;
  color: #dabb74;
}

.panel-eyebrow {
  font-size: 10px;
  color: #dabb74;
}

.filter-list {
  gap: 5px;
}

.filter-button {
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 35px;
  padding: 6px 7px;
}

.filter-count {
  display: none;
}

.filter-symbol {
  width: 23px;
  height: 23px;
  color: #72dcff;
  border-color: rgba(82, 213, 255, 0.4);
}

.filter-button.is-active {
  background:
    linear-gradient(90deg, rgba(38, 129, 214, 0.45), rgba(8, 24, 40, 0.64)),
    rgba(9, 20, 34, 0.88);
  border-color: rgba(82, 213, 255, 0.75);
  box-shadow:
    0 0 18px rgba(82, 213, 255, 0.28),
    inset 3px 0 0 rgba(82, 213, 255, 0.9);
}

.story-panel {
  margin: 14px 6px 14px 0;
  padding: 16px 13px;
  border-color: rgba(201, 160, 90, 0.58);
  background:
    linear-gradient(180deg, rgba(5, 13, 25, 0.9), rgba(2, 7, 14, 0.82)),
    radial-gradient(circle at 70% 8%, rgba(201, 160, 90, 0.12), transparent 32%);
}

.story-city {
  font-size: 20px;
}

.story-count {
  margin: 10px 0 12px;
  border-color: rgba(201, 160, 90, 0.48);
  color: #f3cf7a;
}

.story-events {
  gap: 9px;
}

.story-event {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  background: rgba(5, 12, 24, 0.72);
  border-color: rgba(201, 160, 90, 0.35);
}

.event-year {
  height: 29px;
  font-size: 11px;
}

.event-body h3 {
  color: #f0cf86;
  font-size: 13px;
}

.event-body p {
  font-size: 12px;
  line-height: 1.58;
}

.city-marker {
  width: 96px;
  height: 42px;
}

.marker-aura,
.marker-core,
.marker-symbol {
  left: 20px;
}

.marker-core {
  --core-size: 26px;
}

.city-marker.multi .marker-core {
  --core-size: 30px;
}

.marker-label {
  top: 8px;
  left: 38px;
  max-width: 82px;
  min-height: 23px;
  padding: 4px 7px;
  color: #f4d48c;
  border-color: rgba(201, 160, 90, 0.62);
}

.marker-count {
  min-width: 17px;
  height: 17px;
  font-size: 10px;
}

@media (min-width: 721px) and (max-width: 980px) {
  .app-shell {
    grid-template-rows: 82px minmax(0, 1fr);
  }

  .hero {
    grid-template-columns: 46px minmax(190px, auto) 1fr;
    padding: 10px 14px;
  }

  .hero-mark {
    width: 44px;
    height: 44px;
  }

  .map-stage {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) 250px;
  }

  .filter-panel {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    margin: 12px 0 12px 4px;
    padding: 10px 7px;
  }

  .story-panel {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    max-height: none;
    margin: 12px 6px 12px 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-rows: 112px minmax(0, 1fr);
  }
}

/* Esports adventure-map pass: original gold UI, shuttle markers, clearer quest legend. */
:root {
  --quest-gold: #f1c66f;
  --quest-gold-soft: rgba(241, 198, 111, 0.42);
  --quest-gold-dim: rgba(160, 111, 47, 0.38);
  --quest-dark: rgba(8, 9, 17, 0.88);
  --quest-blue: #56d7ff;
}

body {
  background:
    radial-gradient(circle at 20% 15%, rgba(47, 126, 148, 0.28), transparent 30%),
    radial-gradient(circle at 76% 18%, rgba(178, 124, 45, 0.16), transparent 25%),
    linear-gradient(145deg, #020407 0%, #07111a 46%, #04050a 100%);
}

.hero {
  background:
    linear-gradient(180deg, rgba(3, 6, 11, 0.96), rgba(8, 13, 19, 0.82)),
    radial-gradient(circle at 18% 0%, rgba(241, 198, 111, 0.14), transparent 35%),
    radial-gradient(circle at 60% 100%, rgba(86, 215, 255, 0.1), transparent 42%);
}

.map-stage {
  grid-template-columns: 184px minmax(0, 1fr) 260px;
}

#map {
  border-color: rgba(241, 198, 111, 0.52);
  background: #05070c;
  box-shadow:
    inset 0 0 48px rgba(86, 215, 255, 0.16),
    inset 0 0 110px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(241, 198, 111, 0.12);
}

#map::before {
  background:
    radial-gradient(ellipse at 58% 46%, rgba(231, 178, 70, 0.23), transparent 36%),
    radial-gradient(circle at 18% 45%, rgba(0, 137, 190, 0.25), transparent 30%),
    radial-gradient(circle at 86% 48%, rgba(0, 126, 185, 0.22), transparent 28%),
    radial-gradient(ellipse at 52% 48%, transparent 0 64%, rgba(1, 3, 7, 0.16) 84%, rgba(0, 0, 0, 0.38) 100%),
    linear-gradient(90deg, rgba(1, 4, 8, 0.1), transparent 22%, transparent 78%, rgba(1, 4, 8, 0.2));
  mix-blend-mode: soft-light;
}

#map::after {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(86, 215, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 215, 255, 0.038) 1px, transparent 1px),
    radial-gradient(circle at 24% 30%, rgba(241, 198, 111, 0.28) 0 1px, transparent 2px),
    radial-gradient(circle at 67% 43%, rgba(241, 198, 111, 0.22) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.38) 0 1px, transparent 1.6px);
  background-size:
    78px 78px,
    78px 78px,
    auto,
    auto,
    170px 170px;
}

.leaflet-tile {
  opacity: 1;
  filter: sepia(0.16) saturate(1.58) brightness(0.86) contrast(1.18);
}

.filter-panel {
  width: 172px;
  margin: 16px 0 16px 10px;
  padding: 14px 12px;
  border-color: rgba(241, 198, 111, 0.62);
  background:
    linear-gradient(180deg, rgba(11, 11, 18, 0.9), rgba(5, 9, 15, 0.82)),
    radial-gradient(circle at 28% 0%, rgba(241, 198, 111, 0.12), transparent 35%);
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 0 24px rgba(241, 198, 111, 0.08);
}

.filter-title {
  font-size: 15px;
}

.filter-list {
  gap: 7px;
}

.filter-button {
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  min-height: 42px;
  padding: 7px 9px;
  border-color: rgba(241, 198, 111, 0.26);
  color: #d9d0bd;
  background:
    linear-gradient(90deg, rgba(12, 13, 21, 0.88), rgba(9, 19, 24, 0.6)),
    rgba(3, 7, 12, 0.8);
}

.filter-button:hover,
.filter-button.is-active {
  border-color: rgba(241, 198, 111, 0.86);
  color: #fff4d4;
  background:
    linear-gradient(90deg, rgba(97, 64, 24, 0.72), rgba(15, 31, 37, 0.72)),
    rgba(10, 13, 19, 0.9);
  box-shadow:
    0 0 18px rgba(241, 198, 111, 0.18),
    inset 3px 0 0 rgba(241, 198, 111, 0.9);
}

.filter-symbol {
  position: relative;
  width: 30px;
  height: 30px;
  color: var(--quest-gold);
  border-color: rgba(241, 198, 111, 0.62);
  background:
    radial-gradient(circle, rgba(241, 198, 111, 0.18), transparent 62%),
    rgba(5, 8, 13, 0.9);
  transform: rotate(45deg);
  box-shadow:
    0 0 12px rgba(241, 198, 111, 0.16),
    inset 0 0 12px rgba(86, 215, 255, 0.08);
}

.filter-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-45deg);
  filter: drop-shadow(0 0 5px rgba(241, 198, 111, 0.42));
}

.filter-label {
  overflow: visible;
  color: inherit;
  font-size: 13px;
  text-overflow: clip;
}

.filter-count {
  display: block;
  min-width: 24px;
  color: rgba(241, 198, 111, 0.88);
  text-align: right;
}

.leaflet-left .leaflet-control {
  margin-left: 210px;
}

.city-marker {
  width: 24px;
  height: 34px;
  --marker-color: var(--quest-gold);
  --core-width: 9.4px;
  --core-height: 17.7px;
  transform-origin: 12px 17px;
  animation: floatMarker 4.3s ease-in-out infinite;
}

.marker-aura,
.marker-core,
.marker-symbol {
  left: 12px;
}

.marker-aura {
  width: calc(18.2px * var(--marker-scale));
  height: calc(26px * var(--marker-scale));
  border: 1px solid rgba(241, 198, 111, 0.44);
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(241, 198, 111, 0.28), transparent 68%);
  box-shadow:
    0 0 10px rgba(241, 198, 111, 0.36),
    0 0 18px rgba(241, 198, 111, 0.14);
  animation: pulseAura 3.4s ease-in-out infinite;
}

.marker-core {
  width: calc(var(--core-width) * var(--marker-scale));
  height: calc(var(--core-height) * var(--marker-scale));
  border: 1px solid rgba(255, 232, 165, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 248, 215, 0.92) 0 5%, transparent 5% 95%, rgba(255, 248, 215, 0.9) 95%),
    linear-gradient(135deg, rgba(255, 249, 213, 0.52), transparent 42%),
    radial-gradient(ellipse at 50% 50%, #ffd982 0 34%, #b8772e 68%, rgba(35, 19, 8, 0.98) 100%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow:
    0 0 9px rgba(241, 198, 111, 0.78),
    0 0 16px rgba(241, 198, 111, 0.22),
    inset 0 0 8px rgba(255, 255, 255, 0.16);
}

.marker-core::before {
  inset: 3px 2px;
  border-color: rgba(52, 28, 10, 0.62);
}

.marker-symbol {
  color: #2d1808;
  font-size: calc(6.5px * var(--marker-scale));
  text-shadow: 0 1px 5px rgba(255, 236, 174, 0.72);
}

.marker-label {
  display: none;
  top: 50px;
  left: 50%;
  max-width: 82px;
  min-height: 21px;
  padding: 4px 8px;
  border-color: rgba(241, 198, 111, 0.74);
  color: #ffe3a0;
  background:
    linear-gradient(90deg, rgba(50, 28, 14, 0.9), rgba(9, 10, 15, 0.86)),
    rgba(6, 8, 12, 0.88);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 8px 100%, 0 50%);
  box-shadow:
    0 0 16px rgba(0, 0, 0, 0.48),
    inset 0 0 12px rgba(241, 198, 111, 0.08);
  transform: translateX(-50%);
}

.marker-count {
  border-color: rgba(255, 232, 165, 0.76);
  color: #241207;
  background: linear-gradient(135deg, #fff2bd, #d99c45);
  box-shadow: 0 0 11px rgba(241, 198, 111, 0.34);
}

.marker-record {
  color: #fff1bd;
  text-shadow: 0 0 8px rgba(241, 198, 111, 0.72);
}

.city-marker.size-single {
  --core-width: 8.8px;
  --core-height: 16.6px;
}

.city-marker.size-paired {
  --core-width: 9.1px;
  --core-height: 17.2px;
}

.city-marker.size-strong {
  --core-width: 9.4px;
  --core-height: 17.7px;
}

.city-marker.size-major {
  --core-width: 9.6px;
  --core-height: 18.2px;
}

.city-marker.size-legend {
  --core-width: 9.9px;
  --core-height: 18.7px;
}

.city-marker.record-personal .marker-aura,
.city-marker.record-team .marker-aura,
.city-marker.record-pending .marker-aura {
  width: calc(20.8px * var(--marker-scale));
  height: calc(31.2px * var(--marker-scale));
  border-color: rgba(255, 230, 155, 0.9);
  background:
    radial-gradient(ellipse, rgba(255, 220, 122, 0.34), transparent 66%),
    radial-gradient(ellipse, rgba(255, 255, 255, 0.16), transparent 44%);
  animation:
    pulseAura 3.2s ease-in-out infinite,
    recordPulse 1.75s ease-out infinite;
}

.city-marker.record-personal .marker-core,
.city-marker.record-team .marker-core,
.city-marker.record-pending .marker-core {
  box-shadow:
    0 0 20px rgba(255, 218, 115, 0.88),
    0 0 46px rgba(255, 218, 115, 0.28),
    inset 0 0 14px rgba(255, 255, 255, 0.2);
}

.city-marker.record-pending .marker-core {
  animation: pending-blink 2.2s ease-in-out infinite;
}

.city-marker.active .marker-core {
  border-color: #fff6ce;
  box-shadow:
    0 0 24px rgba(255, 224, 132, 0.92),
    0 0 52px rgba(255, 224, 132, 0.3),
    inset 0 0 18px rgba(255, 255, 255, 0.26);
}

.city-marker.active .marker-label {
  border-color: rgba(255, 239, 192, 0.95);
}

@keyframes floatMarker {
  0%,
  100% {
    transform: translateY(-2px) scale(var(--marker-scale));
  }
  50% {
    transform: translateY(3px) scale(var(--marker-scale));
  }
}

@media (max-width: 1060px) and (min-width: 981px) {
  .map-stage {
    grid-template-columns: 170px minmax(0, 1fr) 250px;
  }

  .filter-panel {
    width: 158px;
    margin-left: 8px;
  }

  .filter-label {
    font-size: 12px;
  }

  .leaflet-left .leaflet-control {
    margin-left: 194px;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .map-stage {
    grid-template-columns: 164px minmax(0, 1fr) 250px;
  }

  .filter-panel {
    width: 154px;
    margin-left: 6px;
  }

  .filter-button {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .filter-count {
    display: none;
  }
}

@media (max-width: 720px) {
  .filter-panel {
    width: auto;
  }

  .filter-button {
    grid-template-columns: 30px auto;
  }

  .filter-count {
    display: none;
  }

  .marker-label {
    max-width: 86px;
  }
}

/* Title emblem: image-based crest replacing the old decorative CSS diamond. */
.brand-emblem {
  position: relative;
  z-index: 1;
  display: flex;
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  align-items: center;
  justify-content: center;
}

.brand-emblem::before {
  position: absolute;
  inset: 8px;
  z-index: -1;
  content: "";
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(74, 210, 255, 0.18), transparent 62%),
    radial-gradient(circle, rgba(218, 176, 92, 0.16), transparent 72%);
  filter: blur(2px);
}

.site-emblem {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(74, 210, 255, 0.45))
    drop-shadow(0 0 14px rgba(218, 176, 92, 0.35));
}

.hero {
  grid-template-columns: 78px minmax(220px, auto) 1fr;
}

.hero-mark {
  display: none;
}

@media (max-width: 980px) {
  .brand-emblem {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .site-emblem {
    width: 60px;
    height: 60px;
  }

  .hero {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .hero {
    grid-template-columns: 64px minmax(190px, auto) 1fr;
  }
}

@media (max-width: 720px) {
  .brand-emblem {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .site-emblem {
    width: 48px;
    height: 48px;
  }

  .hero {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
  }

  h1 {
    font-size: clamp(22px, 7vw, 30px);
  }

  .subtitle {
    font-size: 12px;
  }
}

/* Header and map stage share the viewport without introducing page scroll. */
.app-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.hero {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  min-height: 96px;
  padding: 12px 26px 10px;
}

.map-stage {
  grid-template-columns: 202px minmax(0, 1fr) minmax(300px, 360px);
  height: 100%;
}

.filter-panel {
  width: 190px;
  margin: 14px 0 14px 12px;
}

.filter-title {
  margin-bottom: 18px;
}

.filter-button {
  grid-template-columns: 34px minmax(72px, 1fr) 34px;
}

.leaflet-left .leaflet-control {
  margin-left: 228px;
}

@media (max-width: 1060px) and (min-width: 981px) {
  .map-stage {
    grid-template-columns: 190px minmax(0, 1fr) minmax(270px, 330px);
  }

  .filter-panel {
    width: 178px;
    margin-left: 10px;
  }

  .leaflet-left .leaflet-control {
    margin-left: 214px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .map-stage {
    display: block;
    height: 100%;
  }

  .hero {
    min-height: 82px;
    padding: 9px 14px 8px;
  }

  .filter-panel {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    margin: 0;
  }

  .filter-button {
    grid-template-columns: 30px auto auto;
  }

  .leaflet-left .leaflet-control {
    margin-top: 76px;
    margin-left: 12px;
  }
}

@media (max-width: 720px) {
  .hero {
    min-height: 68px;
    padding: 7px 10px 6px;
  }

  .kicker {
    display: none;
  }

  .subtitle {
    margin-top: 3px;
    font-size: 9px;
    white-space: nowrap;
  }

  .site-notice {
    padding: 4px 8px 5px;
    font-size: 8px;
    line-height: 1.25;
  }

  .site-notice span {
    display: block;
    margin-left: 0;
  }

  .filter-button {
    grid-template-columns: 30px auto;
  }

  .story-panel {
    max-height: 40vh;
  }
}

/* Compact side panels: the left legend fits four categories, and the story board mirrors its height. */
@media (min-width: 981px) {
  .map-stage {
    grid-template-columns: 238px minmax(0, 1fr) minmax(300px, 360px);
  }

  .filter-panel,
  .story-panel {
    align-self: start;
    height: 320px;
    margin-top: 18px;
    margin-bottom: 0;
  }

  .filter-panel {
    width: 220px;
    margin-left: 14px;
    padding: 16px 14px 14px;
  }

  .story-panel {
    margin-right: 18px;
  }

  .filter-button {
    grid-template-columns: 34px minmax(86px, 1fr) 36px;
  }

  .leaflet-left .leaflet-control {
    margin-left: 262px;
  }
}

@media (max-width: 1060px) and (min-width: 981px) {
  .map-stage {
    grid-template-columns: 224px minmax(0, 1fr) minmax(270px, 330px);
  }

  .filter-panel {
    width: 208px;
    margin-left: 12px;
  }

  .leaflet-left .leaflet-control {
    margin-left: 246px;
  }
}

/* Centered side panels. */
@media (min-width: 981px) {
  .filter-panel,
  .story-panel {
    align-self: center;
    margin-top: 0;
    margin-bottom: 0;
  }
}

@media (min-width: 981px) {
  .story-panel {
    height: 480px;
  }
}
