:root {
  --grund: #f3f7fb;
  --flaeche: #ffffff;
  --text: #13253a;
  --leise: #5b6b7d;
  --linie: #d9e3ee;
  --akzent: #1266b3;
  --offen: #0f7a4a;
  --offen-grund: #e3f5ec;
  --spaeter: #8a5a00;
  --spaeter-grund: #fdf1d8;
  --warnung-grund: #fff4e5;
  --kopf-grund: #dcecfa;
  --eis-von: #0b4f94;
  --eis-bis: #3b9be0;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0e1824;
    --flaeche: #16222f;
    --text: #e6eef6;
    --leise: #9aabbd;
    --linie: #26374a;
    --akzent: #6cb3f5;
    --offen: #5fd39b;
    --offen-grund: #143427;
    --spaeter: #f0c064;
    --spaeter-grund: #3a2e14;
    --warnung-grund: #33280f;
    --kopf-grund: #15304a;
    --eis-von: #8cc8ff;
    --eis-bis: #d4ecff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--kopf-grund), var(--grund) 11rem) no-repeat, var(--grund);
  color: var(--text);
}
a { color: var(--akzent); }

.kopf, main, .fuss { max-width: 60rem; margin: 0 auto; padding-inline: 1rem; }
.kopf { padding-block: 1.25rem 0.5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.reiter { display: flex; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 0.6rem; padding: 0.2rem; }
.reiter a { padding: 0.3rem 0.9rem; border-radius: 0.45rem; text-decoration: none; color: var(--leise); font-weight: 600; font-size: 0.95rem; }
.reiter a[aria-current] { background: var(--akzent); color: var(--flaeche); }
.marke { display: flex; align-items: center; gap: 0.75rem; }
.marke-bild { flex: none; display: block; line-height: 0; border-radius: 50%; }
.marke-bild img { display: block; width: 3.5rem; height: 3.5rem; filter: drop-shadow(0 2px 6px rgb(18 102 179 / 0.25)); transition: transform 0.3s ease; }
.marke:hover .marke-bild img { transform: rotate(-8deg) scale(1.05); }
.marke-name { margin: 0; font-weight: 800; font-size: 1.7rem; line-height: 1.1; letter-spacing: -0.02em; }
.marke-name a { color: var(--text); text-decoration: none; }
.marke-name .heute {
  color: var(--eis-von);
  background: linear-gradient(120deg, var(--eis-von), var(--eis-bis));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.unterzeile { margin: 0.15rem 0 0; color: var(--leise); font-size: 0.95rem; }
@media (max-width: 30rem) {
  .marke-bild img { width: 2.75rem; height: 2.75rem; }
  .marke-name { font-size: 1.4rem; }
  .unterzeile { font-size: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) { .marke-bild img { transition: none; } }

.titelzeile { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; }
h1 { font-size: 1.6rem; margin: 1rem 0 0.5rem; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--leise); margin: 1.75rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 0; }
h3 a { color: var(--text); text-decoration: none; }
h3 a:hover { text-decoration: underline; }


.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.springen { display: flex; align-items: center; gap: 0.5rem; }
.springen input {
  font: inherit; color: var(--text); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 0.5rem; padding: 0.3rem 0.5rem;
}
.knopf {
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--akzent); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 0.5rem; padding: 0.3rem 0.75rem;
  text-decoration: none; cursor: pointer;
}
.knopf:hover { border-color: var(--akzent); }

.woche { display: flex; align-items: stretch; gap: 0.25rem; margin: 0.5rem 0 0.75rem; }
.woche ol { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.woche-pfeil {
  flex: 0 0 2rem; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; text-decoration: none; color: var(--akzent); border-radius: 0.5rem;
}
a.woche-pfeil:hover { background: var(--flaeche); }
.woche ol a {
  display: flex; flex-direction: column; align-items: center; padding: 0.4rem 0.1rem;
  border: 1px solid var(--linie); border-radius: 0.6rem; background: var(--flaeche);
  color: var(--text); text-decoration: none; line-height: 1.2;
}
.woche ol a:hover { border-color: var(--akzent); }
.woche .wt { font-size: 0.75rem; color: var(--leise); text-transform: uppercase; letter-spacing: 0.04em; }
.woche .tg { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.woche .anzahl {
  margin-top: 0.2rem; min-width: 1.4rem; text-align: center; font-size: 0.75rem; font-weight: 700;
  border-radius: 1rem; padding: 0 0.3rem; background: var(--offen-grund); color: var(--offen);
}
.woche a.zu .anzahl { background: none; color: var(--leise); font-weight: 400; }
.woche a.heute .wt { color: var(--akzent); font-weight: 700; }
.woche a.gewaehlt { border-color: var(--akzent); box-shadow: inset 0 0 0 1px var(--akzent); }
.leer { color: var(--leise); }

.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.75rem; }
.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.karte > * { margin: 0; }
.meta, .geprueft { color: var(--leise); font-size: 0.875rem; margin: 0.15rem 0 0; }
.geprueft { margin-top: auto; font-size: 0.8rem; }

.live { font-weight: 600; font-size: 0.95rem; padding: 0.3rem 0.6rem; border-radius: 0.4rem; justify-self: start; align-self: flex-start; }
.live.jetzt { background: var(--offen-grund); color: var(--offen); }
.live.spaeter { background: var(--spaeter-grund); color: var(--spaeter); }
.live.vorbei { color: var(--leise); padding-inline: 0; }

.zeiten { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.zeiten li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.5rem; }
.zeit { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.art { font-size: 0.8rem; font-weight: 600; background: var(--grund); border: 1px solid var(--linie); border-radius: 1rem; padding: 0 0.5rem; }
.hinweis { flex-basis: 100%; color: var(--leise); font-size: 0.85rem; }
.zeiten li.vorbei { opacity: 0.45; }
.zeiten li.vorbei .zeit { text-decoration: line-through; }
.zeiten li.jetzt .zeit { color: var(--offen); }

.naechster { color: var(--leise); }
.warnung { background: var(--warnung-grund); border-radius: 0.4rem; padding: 0.4rem 0.6rem; font-size: 0.85rem; }

.gruppe-geschlossen .karte, .gruppe-ausser_saison .karte { padding-block: 0.75rem; }

.fuss { color: var(--leise); font-size: 0.85rem; padding-block: 2rem; }

[hidden] { display: none !important; }

@media (max-width: 30rem) {
  .woche-pfeil { flex-basis: 1.4rem; }
  .woche .tg { font-size: 0.8rem; }
  .woche ol a { padding-inline: 0; }
}

/* Listenansicht */
.auswahl details { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 0.6rem; padding: 0.5rem 0.75rem; margin: 0.5rem 0 0.75rem; }
.auswahl summary { cursor: pointer; font-weight: 600; }
.auswahl .anzahl-auswahl { font-weight: 400; color: var(--leise); font-size: 0.9rem; margin-left: 0.25rem; }
.auswahl ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.25rem 1rem; }
.auswahl label { display: flex; align-items: baseline; gap: 0.5rem; cursor: pointer; padding: 0.2rem 0; }
.auswahl label input { width: 1.1rem; height: 1.1rem; align-self: center; flex: none; }
.auswahl .ort { color: var(--leise); font-size: 0.85rem; }
.auswahl-knoepfe { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.liste-tag { margin-top: 1.25rem; }
.liste-tag h2 {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1;
  margin: 0; padding: 0.5rem 0; background: var(--grund);
  text-transform: none; letter-spacing: 0; font-size: 1.05rem; color: var(--text);
  border-bottom: 1px solid var(--linie);
}
.liste-tag h2 .relativ { color: var(--akzent); }
.liste-tag h2 a { color: inherit; text-decoration: none; }
.liste-tag h2 a:hover { text-decoration: underline; }
.liste-tag ul { list-style: none; margin: 0; padding: 0; }
.liste-tag li {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.1rem 0.75rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--linie);
}
.liste-tag li .zeit { font-size: 1rem; }
.liste-tag li .bahn a { color: var(--text); font-weight: 600; text-decoration: none; }
.liste-tag li .bahn a:hover { text-decoration: underline; }
.liste-tag li .ort { color: var(--leise); font-size: 0.875rem; }
.liste-tag li .extra { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; }
.liste-tag li .hinweis { flex-basis: auto; }
.liste-tag li.vorbei { opacity: 0.45; }
.liste-tag li.vorbei .zeit { text-decoration: line-through; }
.liste-tag li.jetzt .zeit { color: var(--offen); }
.liste-tag li .jetzt-marke { display: none; font-size: 0.8rem; font-weight: 700; color: var(--offen); }
.liste-tag li.jetzt .jetzt-marke { display: inline; }
.liste-tag .keine { color: var(--leise); padding: 0.55rem 0; margin: 0; }
.weiter { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 30rem) {
  .liste-tag li { grid-template-columns: 1fr; }
  .liste-tag li .extra { grid-column: 1; }
}
