:root {
  --bg: #f6f7f8;
  --card: #fff;
  --text: #1f2937;
  --muted: #667085;
  --line: #e5e7eb;
  --danger: #b42318;
  --warning: #f79009;
  --week: #fdb022;
  --season: #1570ef;
  --old: #98a2b3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

header {
  padding: 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 12px;
  padding: 12px;
}

#map {
  width: 100%;
  height: calc(100vh - 124px);
  min-height: 620px;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #ddd;
}

aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 1px 8px rgba(16,24,40,.05);
}

.filters,
.map-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.filters {
  margin-bottom: 10px;
}

.map-options {
  margin-top: 10px;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}

.filters button,
.map-options .toggle-button {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 8px;

  display: flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  white-space: nowrap;
}

.map-options .toggle-button {
  grid-column: span 2;
}

button.active {
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 700;
}

.toggle-button {
  border-color: #d0d5dd;
  background: #f9fafb;
  color: #344054;
}

.toggle-button.active {
  border-color: #b42318;
  background: #fff4f3;
  color: #b42318;
  font-weight: 700;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  line-height: 1.6;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
  background: var(--old);
}

.legend .new::before { background: var(--danger); }
.legend .recent::before { background: var(--warning); }
.legend .week::before {
  background: var(--week);
  border: 1px solid #111827;
}
.legend .season::before {
  background: var(--season);
  opacity: .55;
}

.heat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 275px);
  overflow: auto;
}

.item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
}

.item:hover { border-color: #d0d5dd; }
.item.old { opacity: .56; }
.item.season {
  opacity: .78;
  border-style: dashed;
}

.item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.badge {
  flex: 0 0 auto;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  background: var(--old);
}

.badge.new { background: var(--danger); }
.badge.recent { background: var(--warning); }
.badge.week { background: var(--week); }
.badge.season { background: var(--season); }

.loc {
  color: #344054;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
}

.time,
.body {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.body {
  margin-top: 6px;
  white-space: pre-wrap;
  color: #344054;
}

.links {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.links a {
  color: #175cd3;
  text-decoration: none;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

.custom-marker {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 4px solid #fff;
  outline: 2px solid rgba(0,0,0,.72);
  box-shadow:
    0 2px 10px rgba(0,0,0,.42),
    0 0 0 3px rgba(255,255,255,.25);
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.custom-marker span {
  display: block;
  font-size: 13px;
  line-height: 1;
  transform: translateX(-0.04em);
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.custom-marker.new {
  width: 40px;
  height: 40px;
  background: var(--danger);
  border-width: 5px;
  outline-color: rgba(180,35,24,.95);
  animation: markerPulse 1.8s ease-out infinite;
}

.custom-marker.new span {
  font-size: 16px;
}

.custom-marker.recent {
  width: 34px;
  height: 34px;
  background: var(--warning);
  color: #111827;
  outline-color: rgba(17,24,39,.85);
}

.custom-marker.recent span,
.custom-marker.week span {
  text-shadow: none;
}

.custom-marker.week {
  width: 31px;
  height: 31px;
  background: var(--week);
  color: #111827;
  outline-color: rgba(17,24,39,.75);
}

.custom-marker.season {
  width: 25px;
  height: 25px;
  background: var(--season);
  color: #fff;
  border-width: 3px;
  outline-color: rgba(21,112,239,.9);
  box-shadow:
    0 2px 8px rgba(0,0,0,.32),
    0 0 0 3px rgba(21,112,239,.22);
}

.custom-marker.season span {
  font-size: 12px;
}

.custom-marker.old {
  width: 23px;
  height: 23px;
  background: #667085;
  color: #fff;
  border-width: 3px;
  outline-color: rgba(71,84,103,.75);
}

.custom-marker.old span {
  font-size: 11px;
}

@keyframes markerPulse {
  0% {
    box-shadow:
      0 2px 10px rgba(0,0,0,.42),
      0 0 0 0 rgba(180,35,24,.50);
  }

  72% {
    box-shadow:
      0 2px 10px rgba(0,0,0,.42),
      0 0 0 13px rgba(180,35,24,0);
  }

  100% {
    box-shadow:
      0 2px 10px rgba(0,0,0,.42),
      0 0 0 0 rgba(180,35,24,0);
  }
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(17,24,39,.35);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: #111827;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  font-weight: 800;
}

.sponsor-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.sponsor-panel a {
  display: block;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #f9fafb;
  color: #111827;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid #e5e7eb;
}

.sponsor-panel a:hover {
  background: #fff7ed;
  border-color: #fdba74;
}

.seo-content {
  max-width: 980px;
  margin: 0 auto 32px;
  padding: 16px;
  color: #344054;
}

.seo-content h2 {
  margin: 22px 0 8px;
  font-size: 18px;
  color: #111827;
}

.seo-content p,
.seo-content li {
  font-size: 14px;
  line-height: 1.8;
}

.seo-content ul {
  padding-left: 1.4em;
}

.seo-note {
  color: #667085;
  font-size: 13px;
}

.footer {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: #667085;
}

.footer a {
  color: #667085;
  text-decoration: none;
}

.footer a:hover {
  color: #111827;
}

.latest-alert {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  color: #fff;
  box-shadow: 0 4px 18px rgba(127,29,29,.25);
}

.latest-label {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.latest-time {
  font-size: 13px;
  opacity: .92;
}

.latest-location {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}

@media (max-width: 900px) {

  .wrap {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  #map {
    height: 58vh;
    min-height: 420px;
    margin-bottom: 10px;
  }

  .list {
    max-height: none;
  }

  header {
    padding: 8px 10px 6px;
  }

  h1 {
    font-size: 17px;
    line-height: 1.3;
    margin-bottom: 2px;
  }

  .lead {
    font-size: 11px;
    line-height: 1.45;
  }

  .panel {
    padding: 12px;
  }

  .filters,
  .map-options {
    gap: 8px;
  }

  .filters {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .filters button,
  .map-options .toggle-button {
    height: 40px;
    font-size: 13px;
  }

  .map-options {
    margin-top: 8px;
  }

  .legend {
    margin-top: 6px;
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    gap: 4px 8px;
    font-size: 10px;
  }

  .legend span::before {
    width: 8px;
    height: 8px;
    margin-right: 4px;
  }

  .meta {
    font-size: 11px;
    line-height: 1.4;
    margin: 4px 0 0;
  }

  .heat-note {
    display: none;
  }

  .item {
    padding: 12px;
  }

  .sponsor-panel {
    margin-top: 8px;
  }
}
