:root {
  --paper: #f4f0e8;
  --ink: #14181b;
  --muted: #5c6365;
  --line: #b9c5c9;
  --panel: #0f1518;
  --accent: #ff3c8a;
  --accent-soft: rgba(255, 60, 138, 0.32);
  --water: #a8c9d7;
}

* { box-sizing: border-box; }

html { background: #fbfbfa; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(255,255,255,.9), transparent 30rem),
    #fbfbfa;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }

a {
  color: inherit;
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
}

a:hover { color: #ad0f51; }

.page-shell {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 410px);
  gap: 12px 40px;
  align-items: end;
  margin: 0 0 22px;
}

.eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  color: #ad0f51;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1 {
  max-width: 950px;
  margin: 0;
  font-size: clamp(2rem, 4.1vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 650;
}

.intro-copy {
  margin: 0 0 .35rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.55;
}

.poster {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(28, 38, 42, .09);
}

.poster-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 2px 14px;
}

.poster-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2.25rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.poster-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.basemap-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #c5ccca;
  border-radius: 999px;
  background: rgba(255,255,255,.48);
}

.map-mode {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #4e5555;
  background: transparent;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.map-mode:hover { background: rgba(255,255,255,.72); }

.map-mode.is-active {
  color: #fff;
  background: #151b1e;
}

.poster-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(390px, .94fr);
  grid-template-rows: repeat(3, minmax(196px, 1fr));
  gap: 9px;
  min-height: 710px;
}

.overview-card,
.detail-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
  isolation: isolate;
}

.overview-card {
  grid-row: 1 / -1;
  border-radius: 15px 3px 3px 15px;
}

.detail-card:first-of-type { border-radius: 3px 15px 3px 3px; }
.detail-card:last-child { border-radius: 3px 3px 15px 3px; }

.map {
  position: absolute;
  inset: 0;
  background: #112027;
}

.map::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 70px rgba(7, 10, 12, .18);
}

.map-overlay {
  position: absolute;
  z-index: 4;
  border: 1px solid rgba(255,255,255,.42);
  color: #111719;
  background: rgba(247, 244, 236, .92);
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  backdrop-filter: blur(9px);
}

.overview-title {
  top: 15px;
  left: 15px;
  display: grid;
  gap: 3px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 10px;
}

.overview-title strong {
  font-size: 1.08rem;
  letter-spacing: -.02em;
}

.overview-title > span:last-child {
  color: #626869;
  font-size: .72rem;
}

.overlay-kicker {
  color: #ad0f51;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legend-card {
  right: 14px;
  bottom: 14px;
  width: 198px;
  padding: 12px;
  border-radius: 9px;
}

.legend-title {
  margin-bottom: 10px;
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.bubble-key {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  min-height: 74px;
  color: #555d5e;
  font-size: .68rem;
}

.bubble {
  display: inline-block;
  place-self: center;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.bubble-lg { width: 25px; height: 25px; }
.bubble-md { width: 19px; height: 19px; }
.bubble-sm { width: 14px; height: 14px; }

.legend-line {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #cfd2cf;
  color: #555d5e;
  font-size: .65rem;
}

.legend-line span {
  width: 26px;
  border-top: 3px solid var(--accent);
}

.season-card {
  left: 14px;
  bottom: 14px;
  width: 236px;
  padding: 12px 14px 16px;
  border-radius: 9px;
}

.season-card p {
  margin: 0 0 3px;
  color: #666b6b;
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .11em;
}

.season-card strong { font-size: 1.45rem; letter-spacing: -.04em; }

.mini-timeline {
  position: relative;
  height: 18px;
  margin: 12px 4px 0;
  border-top: 2px solid #2d3638;
}

.mini-timeline span {
  position: absolute;
  top: -6px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px var(--accent);
}

.mini-timeline span::after {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 70px;
  color: #6a7071;
  content: attr(data-label);
  font-size: .52rem;
  transform: translateX(-50%);
  white-space: nowrap;
}

.mini-timeline span:first-child::after { left: 0; transform: none; }
.mini-timeline span:last-child::after { left: auto; right: 0; transform: none; }

.rank-badge {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 5;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 7px;
  color: #fff;
  background: #111719;
  font-size: .83rem;
  font-weight: 900;
}

.detail-copy {
  top: 10px;
  left: 49px;
  max-width: calc(100% - 95px);
  padding: 9px 11px 8px;
  border-radius: 7px;
}

.detail-copy p {
  overflow: hidden;
  margin: 0 0 2px;
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-copy h3 {
  margin: 0;
  color: #ad0f51;
  font-size: 1.02rem;
  letter-spacing: -.025em;
}

.detail-copy div {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 9px;
  margin-top: 4px;
  color: #565e5f;
  font-size: .61rem;
}

.detail-copy div span:not(:last-child)::after {
  margin-left: 9px;
  color: #9da3a3;
  content: "·";
}

.recenter {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 5;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 50%;
  color: #111719;
  background: rgba(247,244,236,.9);
  font-size: .9rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.recenter:hover { background: #fff; transform: translateY(-1px); }

.poster-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 8px 28px;
  align-items: start;
  padding: 14px 3px 1px;
  color: #596061;
  font-size: .7rem;
  line-height: 1.5;
}

.poster-footer p { margin: 0; }
.sources { text-align: right; }

.data-status {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid #d0d3ce;
  color: #687071;
}

.data-status.is-ready { color: #4e2340; }
.data-status.is-error { color: #9c351b; }

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right { opacity: .66; }

.maplibregl-ctrl-attrib {
  font-size: 9px;
  background: rgba(247,244,236,.8) !important;
}

.maplibregl-popup-content {
  padding: 11px 13px;
  border-radius: 8px;
  color: #151b1e;
  font: 12px/1.4 Inter, ui-sans-serif, sans-serif;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.maplibregl-popup-content strong { display: block; margin-bottom: 2px; }
.maplibregl-popup-content span { color: #5d6566; }

@media (max-width: 980px) {
  .page-intro { grid-template-columns: 1fr; }
  .poster-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(540px, 68vh) repeat(3, 310px);
  }
  .overview-card { grid-row: auto; border-radius: 15px 15px 4px 4px; }
  .detail-card:first-of-type,
  .detail-card:last-child { border-radius: 4px; }
  .detail-card:last-child { border-radius: 4px 4px 15px 15px; }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 18px, 1480px); padding-top: 18px; }
  .page-intro { margin-bottom: 16px; }
  .poster { padding: 10px; border-radius: 20px; }
  .poster-head { align-items: start; flex-direction: column; padding: 4px 3px 12px; }
  .poster-head p { line-height: 1.4; }
  .poster-grid { grid-template-rows: minmax(510px, 72vh) repeat(3, 285px); gap: 7px; }
  .overview-title { max-width: calc(100% - 30px); }
  .legend-card { right: 10px; bottom: 10px; width: 164px; }
  .season-card { left: 10px; bottom: 10px; width: 176px; }
  .season-card strong { font-size: 1.2rem; }
  .mini-timeline span::after { display: none; }
  .poster-footer { grid-template-columns: 1fr; font-size: .73rem; }
  .sources { text-align: left; }
  .detail-copy { max-width: calc(100% - 96px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
