:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --ink: #17211c;
  --muted: #647067;
  --panel: #ffffff;
  --line: #dbe2dc;
  --green: #0f7a5f;
  --red: #c0323e;
  --gold: #d69b1d;
  --blue: #1769aa;
  --shadow: 0 20px 50px rgba(25, 39, 31, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  background: #dbe6df;
  outline-offset: 1px;
}

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

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  filter: inherit;
  visibility: hidden;
}

.leaflet-tile-loaded {
  visibility: inherit;
}

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

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

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

.leaflet-shadow-pane {
  z-index: 500;
}

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

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

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

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: visiblePainted;
  pointer-events: auto;
}

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

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  pointer-events: none;
}

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

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

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

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 122, 95, 0.08), transparent 360px),
    var(--bg);
  color: var(--ink);
}

button {
  font: inherit;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  padding: 20px 0 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 5vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.intro {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.now-panel {
  min-width: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(25, 39, 31, 0.08);
}

.now-panel span,
.now-panel small {
  display: block;
  color: var(--muted);
}

.now-panel strong {
  display: block;
  margin: 2px 0 4px;
  font-size: 2.1rem;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  min-height: 610px;
}

.map-wrap,
.venue-panel,
.matches {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-wrap {
  position: relative;
  overflow: hidden;
}

.map {
  width: 100%;
  min-height: 610px;
  height: 100%;
}

.map-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  max-width: calc(100% - 32px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 0.88rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.match {
  background: var(--red);
}

.dot.venue {
  background: var(--green);
}

.venue-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.panel-header,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.section-title h2 {
  margin: 0;
  font-size: 1.2rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--green);
}

.fit-icon {
  position: relative;
}

.fit-icon::before,
.fit-icon::after {
  position: absolute;
  inset: 10px;
  content: "";
}

.fit-icon::before {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.fit-icon::after {
  inset: 17px;
  border-radius: 999px;
  background: currentColor;
}

.venue-list {
  overflow: auto;
  padding: 8px;
}

.venue-item {
  width: 100%;
  margin: 0;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.venue-item:hover,
.venue-item.active {
  border-color: rgba(15, 122, 95, 0.35);
  background: rgba(15, 122, 95, 0.07);
}

.venue-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.venue-time {
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.venue-item span,
.venue-item small {
  display: block;
}

.venue-item > span:nth-child(2),
.venue-item small {
  color: var(--muted);
}

.venue-marker span {
  display: block;
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(23, 33, 28, 0.26);
}

.venue-marker span.has-match {
  background: var(--red);
}

.matches {
  margin-top: 20px;
  overflow: hidden;
}

.data-stamp {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.match-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.match-controls label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.match-controls input {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  color: var(--ink);
  font: inherit;
}

.match-controls input:focus {
  border-color: var(--green);
  outline: 2px solid rgba(15, 122, 95, 0.16);
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.match-card {
  min-height: 210px;
  padding: 18px;
  background: var(--panel);
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
}

.status.live {
  background: var(--red);
}

.status.upcoming {
  background: var(--blue);
}

.status.finished {
  background: var(--muted);
}

.match-card h3 {
  margin: 24px 0 16px;
  font-size: 1.35rem;
  line-height: 1.18;
}

.match-card h3 span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 160px;
  padding: 34px 18px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.kickoff-times {
  display: grid;
  gap: 8px;
}

.kickoff-times span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.kickoff-times small,
.kickoff-times em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.25;
}

.kickoff-times small {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kickoff-times strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.kickoff-times em {
  font-size: 0.84rem;
}

.map-link {
  margin-top: 18px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.map-link:hover {
  border-color: var(--green);
  color: var(--green);
}

.map-link.disabled {
  display: inline-block;
  cursor: default;
}

.map-link.disabled:hover {
  border-color: var(--line);
  color: var(--ink);
}

.venue-note {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  border-radius: 8px;
}

@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .venue-panel {
    max-height: 430px;
  }

  .match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 16px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3rem;
  }

  .now-panel {
    width: 100%;
  }

  .map {
    min-height: 480px;
  }

  .panel-header,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-stamp {
    white-space: normal;
  }

  .match-controls {
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
  }

  .match-controls input {
    width: 100%;
  }

  .match-grid {
    grid-template-columns: 1fr;
  }
}
