:root {
  color-scheme: light dark;
  --fg: #1c2526;
  --bg: #f7f5f0;
  --karta: #ffffff;
  --muted: #5f6b6d;
  --linka: #e2ddd2;
  --akcent: #0f766e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #ecefee;
    --bg: #121817;
    --karta: #1b2322;
    --muted: #9aa6a4;
    --linka: #2c3634;
    --akcent: #2dd4bf;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}
header, main, footer { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
header { padding-top: 2rem; }
h1 { font-size: 2.4rem; margin: 0; letter-spacing: -0.02em; }
h2 { margin: 2rem 0 0.5rem; }
h3 { margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.podtitul { color: var(--muted); margin: 0.25rem 0; font-size: 1.1rem; }
.pozor {
  display: inline-block;
  margin: 0.75rem 0 0;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  font-size: 0.95rem;
}

.faze {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.faze > div, .sloupce > section {
  background: var(--karta);
  border: 1px solid var(--linka);
  border-radius: 0.75rem;
  padding: 1rem;
}
.faze h2 { margin: 0; font-size: 1.2rem; }
.faze p { margin: 0.4rem 0 0; }
.kdy { color: var(--akcent); font-weight: 600; font-size: 0.9rem; }

.mapa-obal {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 760px) {
  .mapa-obal { grid-template-columns: 1fr; }
}
#mapa {
  height: min(75vh, 44rem);
  border-radius: 0.75rem;
  border: 1px solid var(--linka);
  z-index: 0;
}
@media (max-width: 760px) {
  /* Ostrov je široký a nízký: vysoká mapa na úzkém displeji by byla hlavně moře. */
  #mapa { height: max(55vh, 22rem); }
}

#legenda {
  background: var(--karta);
  border: 1px solid var(--linka);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
}
#legenda fieldset { border: 0; margin: 0 0 0.9rem; padding: 0; }
#legenda fieldset:last-child { margin-bottom: 0; }
#legenda legend {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.3rem;
  padding: 0;
}
#legenda label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  cursor: pointer;
}
#legenda label input { margin: 0; accent-color: var(--akcent); }
#legenda .pocet { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
#legenda .podklad { display: flex; flex-wrap: wrap; gap: 0 1rem; }
#legenda .podklad legend { width: 100%; }
#legenda .klic span { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0; color: var(--muted); }
.vzor { display: inline-block; width: 1.6rem; flex: none; border-top: 3px solid var(--fg); }
.vzor.carkovana { border-top-style: dashed; }
.vzor.teckovana { border-top-style: dotted; }
.cislo-dne.vzor-noci { width: 20px; height: 20px; background: var(--muted); font-style: normal; font-size: 11px; margin: 0 0.3rem; }
.napoveda { color: var(--muted); font-size: 0.85rem; margin: 0.4rem 0 0; }

.sloupce {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1rem;
}
.sloupce ul, .sloupce ol { margin: 0; padding-left: 1.2rem; }
.sloupce li { margin-bottom: 0.75rem; }
.sloupce li p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.92rem; }
.sloupce .noc { color: var(--fg); font-weight: 500; }
.trek > p { margin-top: 0; }

button.misto, button.den {
  font: inherit;
  color: var(--akcent);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}
button.den strong { color: var(--fg); margin-right: 0.25rem; }
button.misto:hover, button.den:hover { text-decoration: underline; }
.stitek {
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
  border-radius: 1rem;
  background: color-mix(in srgb, #f59e0b 25%, transparent);
}

.tecka { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; flex: none; }
.cara { display: inline-block; width: 1.2rem; height: 0.3rem; border-radius: 0.2rem; vertical-align: middle; }
.cislo-dne {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  color: #fff;
  font: 700 12px/1 system-ui, sans-serif;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
}
.leaflet-popup-content p { margin: 0.4rem 0 0; }

footer { color: var(--muted); font-size: 0.85rem; padding: 2rem 1rem 3rem; }
