:root {
  --bg: #07110d;
  --panel: #101e17;
  --panel2: #162b21;
  --text: #f6f7f2;
  --muted: #b8c7bd;
  --line: rgba(255,255,255,.13);
  --accent: #d7f36b;
  --accent2: #8de0b3;
  --warning: #ffdca8;
  --danger: #ffd2d2;
  --shadow: 0 24px 80px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(141, 224, 179, .14), transparent 34rem),
    linear-gradient(180deg, #08130f 0%, var(--bg) 100%);
  color: var(--text);
}

a { color: var(--accent); }

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,.25);
  color: var(--accent);
}

.hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    var(--panel);
  background-size: 28px 28px;
}

.hero__inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 34px 20px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.languageSwitch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.22);
}

.langBtn {
  padding: 7px 10px;
  min-width: 42px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--muted);
}

.langBtn.active {
  background: var(--accent);
  color: #07110d;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: .95;
  letter-spacing: -0.06em;
}

.subtitle {
  max-width: 850px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats div {
  min-width: 130px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.2);
}

.stats strong {
  display: block;
  font-size: 25px;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.app {
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px 20px 32px;
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 215px);
}

.sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), transparent),
    rgba(16, 30, 23, .92);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.panelTitle {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.panelTitle h2 { margin: 0; }

.panelTitle span {
  color: var(--muted);
  font-size: 13px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

select, input, button { font: inherit; }

select, input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #09140f;
  color: var(--text);
  padding: 12px 13px;
  font-size: 15px;
  outline: none;
}

select:focus, input:focus { border-color: var(--accent2); }

input[type="range"] {
  padding: 0;
  border: none;
  background: transparent;
  accent-color: var(--accent2);
  height: 22px;
}

.radiusLabel span {
  color: var(--text);
  font-weight: 700;
}

.radiusLabel span span {
  color: var(--accent2);
}

.buttons, .teamActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.teamActions {
  margin: -4px 0 12px;
}

button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel2);
  padding: 10px 13px;
  font-weight: 800;
}

button:hover { border-color: var(--accent2); }

button.isActive {
  background: var(--accent);
  color: #07110d;
  border-color: var(--accent);
}

#todosDoTimeBtn {
  width: 100%;
  justify-content: center;
  background: rgba(141,224,179,.10);
}

#todosDoTimeBtn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.periodInfo {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(215,243,107,.35);
  border-radius: 14px;
  color: var(--accent);
  background: rgba(215,243,107,.08);
  font-size: 13px;
  font-weight: 800;
}

.teamInfo {
  border-color: rgba(141,224,179,.38);
  color: var(--accent2);
  background: rgba(141,224,179,.08);
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.mapWrap {
  position: sticky;
  top: 14px;
  min-height: 720px;
  height: calc(100vh - 120px);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0f1e17;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 720px;
}

.mapStatus {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 500;
  max-width: 680px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 17, 13, .88);
  color: var(--muted);
  padding: 10px 14px;
  font-size: 13px;
  backdrop-filter: blur(6px);
}

.calendarList {
  display: grid;
  gap: 14px;
  max-height: 660px;
  overflow: auto;
  padding-right: 4px;
}

.dayGroup { display: grid; gap: 8px; }

.dayTitle {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 9px 10px;
  border-radius: 12px;
  background: #09140f;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.matchCard {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
  padding: 12px;
}

.matchCard:hover { border-color: rgba(215,243,107,.45); }

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

.competition {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.time {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.teams {
  margin: 0 0 9px;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.badge {
  display: inline-flex;
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(141,224,179,.12);
  color: var(--accent2);
  font-size: 11px;
  font-weight: 900;
}

.badge.noMap {
  color: var(--warning);
  background: rgba(255,220,168,.12);
}

.badge--pais {
  color: #ffe37a;
  background: rgba(255,227,122,.12);
}

.estimated {
  color: var(--muted);
  font-style: italic;
  font-size: 11px;
}

.empty {
  color: var(--muted);
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0f1e17;
  color: var(--text);
}

.leaflet-popup-content a { color: var(--accent); }

.popupTitle {
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 6px;
}

.popupMeta {
  color: var(--muted);
  line-height: 1.45;
}

.footer {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px 36px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1050px) {
  .hero__inner { grid-template-columns: 1fr; }
  .stats { justify-content: flex-start; }
  .app { grid-template-columns: 1fr; }
  .mapWrap {
    position: relative;
    top: 0;
    height: auto;
    min-height: 540px;
  }
  #map { min-height: 540px; }
  .calendarList { max-height: none; }
}

@media (max-width: 560px) {
  .hero__inner { padding: 30px 16px 24px; }
  .topbar { align-items: flex-start; }
  .app { padding: 14px 12px 28px; }
  .stats div { min-width: calc(50% - 8px); }
  .panel { border-radius: 20px; }
  .mapWrap, #map {
    min-height: 470px;
    border-radius: 22px;
  }
}
