/* BSC Biendorf — Termine: Umschalter und Kalender
   ===================================================================
   Bildsprache wie überall (ui.css): weiße Karten mit Ring, Sinnbilder,
   grün für Spiele. Die Detailtafel links ist dunkelgrün mit Glaskarten —
   dieselben wie die Spielzentrale im Hero der Startseite.
   =================================================================== */

/* ---------- Umschalter Liste / Kalender ----------
   Ein Schieber wie beim Hell/Dunkel-Schalter: der grüne Daumen gleitet
   unter den gewählten Knopf. */

.ansicht-schalter {
  position: relative;
  z-index: 3;
  display: flex;
  width: max-content;
  margin: -27px auto clamp(28px, 4vw, 40px);
  padding: 5px;
  border-radius: 99px;
  background: #fff;
  box-shadow: var(--schwebt), var(--ring);
}
.ansicht-schalter[hidden] { display: none; }

.ansicht-schalter button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 146px;
  padding: 11px 18px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: var(--grau);
  cursor: pointer;
  transition: color .3s ease;
}
.ansicht-schalter button svg { width: 18px; height: 18px; }
.ansicht-schalter button[aria-pressed="true"] { color: #fff; }
.ansicht-schalter button:focus-visible { outline: 2px solid var(--gruen-hell); outline-offset: 2px; }

.as-daumen {
  position: absolute;
  top: 5px; left: 5px;
  width: 146px;
  height: calc(100% - 10px);
  border-radius: 99px;
  background: linear-gradient(145deg, var(--gruen-hell), var(--gruen));
  box-shadow: 0 6px 16px -6px rgba(0, 72, 36, .6);
  transition: transform .38s cubic-bezier(.5, 1.6, .4, 1);
}
.ansicht-schalter[data-aktiv="kalender"] .as-daumen { transform: translateX(146px); }

@media (max-width: 400px) {
  .ansicht-schalter button, .as-daumen { width: 128px; }
  .ansicht-schalter[data-aktiv="kalender"] .as-daumen { transform: translateX(128px); }
}

/* ---------- Aufbau: Detailtafel links, Monat rechts ---------- */

.kalender {
  display: grid;
  grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

/* ---------- Monat ---------- */

.kal-monat {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--heben), var(--ring);
  padding: clamp(14px, 2vw, 22px);
}

.kal-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.kal-titel { margin: 0; font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -.02em; }
.kal-pfeil {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--sand);
  color: var(--gruen);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.kal-pfeil:hover:not(:disabled) { background: var(--gruen); color: #fff; }
.kal-pfeil:disabled { opacity: .35; cursor: default; }

.kal-wochentage,
.kal-raster {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.kal-wochentage { margin-bottom: 6px; }
.kal-wochentage span {
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grau);
}

/* Ein Tag */
.kal-tag {
  position: relative;
  min-height: 92px;
  padding: 8px 9px;
  border: 0;
  border-radius: 10px;
  background: #F7F7F4;
  color: var(--text);
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  cursor: default;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.kal-tag.fremd { opacity: .35; }
.kt-nr { font-size: .95rem; font-weight: 800; color: #9A9A93; line-height: 1; }

/* Tage mit Termin sind anfassbar */
.kal-tag.hat-spiel,
.kal-tag.hat-termin { cursor: pointer; }
.kal-tag.hat-spiel:hover,
.kal-tag.hat-termin:hover { transform: translateY(-2px); box-shadow: var(--schwebt); }

/* Spieltag: grün, Wappen des Gegners groß rechts unten */
.kal-tag.hat-spiel {
  background: linear-gradient(150deg, #0A7A3D, #004824 75%);
  color: #fff;
}
.kal-tag.hat-spiel .kt-nr { color: #fff; }
.kal-tag.hat-spiel.vorbei:not(.gewaehlt) { opacity: .72; }

.kt-wappen {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, .35);
}
.kt-wappen img { width: 26px; height: 26px; object-fit: contain; }
.kt-wappen.leer { font-weight: 800; color: var(--gruen); }

.kt-text { position: relative; z-index: 1; display: block; max-width: calc(100% - 40px); line-height: 1.15; }
.kt-text b { display: block; font-size: .62rem; letter-spacing: .04em; text-transform: uppercase; }
.kt-mannschaft { display: block; font-size: .62rem; opacity: .75; margin-top: 2px; overflow-wrap: anywhere; }

/* Mannschaft + Heim/Auswärts als zwei kleine Sinnbilder unten links */
.kt-zeichenreihe { position: relative; z-index: 1; display: flex; gap: 3px; }
.kt-zeichenreihe i {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: var(--hellgruen);
}
.kt-zeichenreihe svg { width: 12px; height: 12px; }

.kt-zeit,
.kt-ergebnis {
  position: absolute;
  top: 7px; right: 7px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .16);
}
.kt-ergebnis.ausgang-s { background: var(--hellgruen); color: #0b2b19; }
.kt-ergebnis.ausgang-u { background: rgba(255, 255, 255, .85); color: var(--text); }
.kt-ergebnis.ausgang-n { background: #ffb3ab; color: #5c140f; }

/* Vereinstermin: hellgrün mit Vereinszeichen */
.kal-tag.hat-termin { background: var(--gruen-zart); box-shadow: inset 0 0 0 1px #d3e8dc; }
.kal-tag.hat-termin .kt-nr { color: var(--gruen); }
.kt-zeichen {
  position: absolute;
  right: 8px; top: 7px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--gruen);
}
.kt-zeichen svg { width: 15px; height: 15px; }
.kal-tag.hat-termin .kt-text { max-width: 100%; }
.kal-tag.hat-termin .kt-text b {
  font-size: .66rem;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gruen);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* „Vorstandssitzung" ist ein einziges langes Wort: an Silbengrenzen
     trennen, nicht mitten im Wort abhacken. */
  hyphens: auto;
  overflow-wrap: break-word;
}

.kt-mehr {
  position: absolute;
  left: 8px; top: 26px;
  font-size: .64rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--hellgruen);
  color: #0b2b19;
}

/* Heute und der gewählte Tag */
.kal-tag.heute { box-shadow: inset 0 0 0 2px var(--gruen-hell); }
.kal-tag.heute .kt-nr::after {
  content: "Heute";
  margin-left: 5px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gruen-hell);
}
.kal-tag.hat-spiel.heute { box-shadow: inset 0 0 0 2px var(--hellgruen); }
.kal-tag.hat-spiel.heute .kt-nr::after { color: var(--hellgruen); }
.kal-tag.gewaehlt { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gruen-hell), var(--schwebt); }

.kal-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 14px 0 0;
  font-size: .8rem;
  color: var(--grau);
}
.kal-legende span { display: inline-flex; align-items: center; gap: 7px; }
.kal-legende i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.kl-spiel  { background: linear-gradient(150deg, #0A7A3D, #004824); }
.kl-termin { background: var(--gruen-zart); box-shadow: inset 0 0 0 1px #d3e8dc; }
.kl-heute  { box-shadow: inset 0 0 0 2px var(--gruen-hell); background: #F7F7F4; }

/* ---------- Detailtafel (links) ---------- */

.kal-detail {
  position: sticky;
  top: calc(var(--kopf-hoehe, 88px) + 18px);
  min-height: 420px;
  padding: 22px 18px 18px;
  border-radius: 14px;
  background: linear-gradient(170deg, #00552d, #002d15);
  color: #fff;
  box-shadow: var(--schwebt);
  overflow: hidden;
}
/* leises Wappen wie im Seitenkopf */
.kal-detail::after {
  content: "";
  position: absolute;
  right: -70px; bottom: -60px;
  width: 240px; height: 240px;
  background: url("bilder/bsc-biendorf3d.png") center/contain no-repeat;
  opacity: .05;
  pointer-events: none;
}

.kd-wochentag {
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--hellgruen);
}
.kd-datum { margin: 4px 0 18px; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }

.kd-karte {
  position: relative;
  z-index: 1;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  animation: kd-rein .25s ease;
}
.kd-karte + .kd-karte { margin-top: 12px; }
@keyframes kd-rein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.kd-oben { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kd-mannschaft {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hellgruen);
}
.kd-mannschaft svg { width: 16px; height: 16px; }
.kd-marke {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  background: rgba(255, 255, 255, .12);
}
.kd-marke.bald      { background: var(--hellgruen); color: #0b2b19; }
.kd-marke.ausgang-s { background: rgba(142, 224, 173, .2);  color: var(--hellgruen); }
.kd-marke.ausgang-u { background: rgba(255, 255, 255, .14); color: #fff; }
.kd-marke.ausgang-n { background: rgba(255, 120, 108, .2);  color: #ffb3ab; }

.kd-tafel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.kd-team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.kd-team span:last-child { font-size: .78rem; line-height: 1.2; color: rgba(255, 255, 255, .75); overflow-wrap: anywhere; }
.kd-team.ist-wir span:last-child { color: #fff; font-weight: 700; }
.kd-wappen {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.kd-wappen img { width: 34px; height: 34px; object-fit: contain; }
.kd-wappen.leer { font-weight: 800; color: rgba(255, 255, 255, .7); }
.kd-team.ist-wir .kd-wappen { background: rgba(142, 224, 173, .16); box-shadow: inset 0 0 0 2px var(--hellgruen); }
.kd-mitte { text-align: center; }
.kd-mitte b { display: block; font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.kd-mitte small {
  display: block;
  margin-top: 5px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.kd-titel { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }

.kd-fakten {
  list-style: none;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: grid;
  gap: 6px;
  font-size: .82rem;
  color: rgba(255, 255, 255, .78);
}
.kd-fakten li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; }
.kd-fakten svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--hellgruen); }
.kd-fakten a, .kd-link { color: var(--hellgruen); font-weight: 700; text-decoration: none; }
.kd-fakten a:hover, .kd-link:hover { text-decoration: underline; }
.kd-link { display: inline-block; margin-top: 10px; font-size: .82rem; }

.kd-leer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 36px 8px;
  color: rgba(255, 255, 255, .7);
}
.kd-leer svg { width: 40px; height: 40px; color: var(--hellgruen); opacity: .7; }
.kd-leer p { margin: 10px 0 4px; font-weight: 700; color: #fff; }
.kd-leer small { font-size: .8rem; }

/* ---------- Kleinere Bildschirme ---------- */

@media (max-width: 900px) {
  .kalender { grid-template-columns: 1fr; }
  /* Monat zuerst, Details darunter */
  /* relative statt static: sonst bezieht sich das leise Wappen (::after,
     right: -70px) auf die Seite statt auf die Tafel — und schiebt sie
     auf dem Handy 70 px zu breit */
  .kal-detail { order: 2; position: relative; top: 0; min-height: 0; }
}

@media (max-width: 600px) {
  .kal-monat { padding: 12px 10px; }
  .kal-wochentage, .kal-raster { gap: 4px; }
  .kal-wochentage span { letter-spacing: .04em; font-size: .64rem; }
  .kal-tag { min-height: 54px; padding: 5px; border-radius: 8px; align-items: center; justify-content: flex-start; }
  .kt-nr { font-size: .78rem; }
  .kal-tag.heute .kt-nr::after { display: none; }
  /* auf dem Handy nur das Wappen — die Details stehen darunter */
  .kt-text, .kt-zeit, .kt-mehr, .kt-zeichenreihe { display: none; }
  .kt-wappen { position: static; margin-top: 4px; width: 28px; height: 28px; }
  .kt-wappen img { width: 19px; height: 19px; }
  .kt-ergebnis { top: auto; bottom: 3px; right: 50%; transform: translateX(50%); font-size: .56rem; padding: 1px 5px; }
  .kt-zeichen { position: static; margin-top: 4px; width: 24px; height: 24px; }
  .kal-tag.gewaehlt { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gruen-hell); }
}

/* ---------- Trainings: klein, damit Spiele und Termine vorne bleiben ----------
   Im Raster nur Punkte oben rechts (einer je Training), in der
   Detailtafel eine kompakte Liste unter den Terminen. */

.kal-tag.hat-training { cursor: pointer; }
.kal-tag.hat-training:not(.hat-spiel):not(.hat-termin):hover { box-shadow: inset 0 0 0 1px #cfe3d6; }

.kt-training {
  display: inline-flex;
  gap: 3px;
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.kt-training i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gruen-hell);
  opacity: .75;
}
.kal-tag.hat-spiel .kt-training i { background: var(--hellgruen); opacity: 1; }

.kl-training {
  width: 8px !important; height: 8px !important;
  border-radius: 50% !important;
  background: var(--gruen-hell);
  opacity: .75;
}

.kd-training { position: relative; z-index: 1; margin-top: 14px; animation: kd-rein .25s ease; }
.kd-training:first-of-type:nth-child(3) { margin-top: 0; }
.kd-training-titel {
  margin: 0 0 8px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}
.kd-training ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kd-training a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  text-decoration: none;
  transition: background .18s ease;
}
.kd-training a:hover { background: rgba(255, 255, 255, .12); }
.kd-training i {
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: var(--hellgruen);
}
.kd-training i svg { width: 15px; height: 15px; }
.kd-training span { display: grid; line-height: 1.25; }
.kd-training b { font-size: .88rem; }
.kd-training small { font-size: .76rem; color: rgba(255, 255, 255, .65); }

@media (max-width: 560px) {
  .kt-training { gap: 2px; margin-left: 3px; }
  .kt-training i { width: 5px; height: 5px; }
}
