:root {
  --paper:      #F4F2EC;
  --card:       #FBFAF6;
  --ink:        #1C231E;
  --muted:      #5F675E;
  --green:      #1F5133;
  --green-dark: #163B25;
  --green-tint: #E7EEE7;
  --red:        #9E2B2B;
  --line:       rgba(28,35,30,0.12);
  --line-soft:  rgba(28,35,30,0.07);
  --radius:     10px;
  --font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Kopf --------------------------------------------------------- */
.top {
  background: var(--green);
  color: #fff;
  padding: 18px 20px;
  border-bottom: 4px solid var(--green-dark);
}
.top .wrap { max-width: 720px; margin: 0 auto; }
.kopf-zeile { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  height: 46px;
  width: auto;
  flex: none;
  display: block;
  background: #fff;
  padding: 5px;
  border-radius: 8px;
}
.brand {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
}
.brand-sub {
  margin: 2px 0 0;
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  font-weight: 400;
}

/* ---- Container ---------------------------------------------------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 8px; padding-bottom: 40px; }

/* ---- Liga-Abschnitt ----------------------------------------------- */
.liga {
  margin-top: 26px;
}
/* Standard-Dreieck von <summary> entfernen */
.liga > summary { list-style: none; cursor: pointer; }
.liga > summary::-webkit-details-marker { display: none; }
.liga-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green);
  -webkit-tap-highlight-color: transparent;
}
.liga-titel { flex: 1 1 auto; min-width: 0; }
.liga-kuerzel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius);
  flex: none;
}
.liga-name { font-size: 20px; font-weight: 700; margin: 0; }
.liga-tag  { color: var(--muted); font-size: 14px; }
.liga-chevron {
  flex: none;
  color: var(--green);
  font-size: 26px;
  line-height: 1;
  transform: rotate(90deg);      /* zeigt nach unten, wenn zu */
  transition: transform 0.18s ease;
}
.liga[open] > summary .liga-chevron { transform: rotate(-90deg); }  /* nach oben, wenn offen */
.liga-inhalt { padding-top: 2px; }

/* ---- Kategorie ---------------------------------------------------- */
.kat { margin-top: 18px; }
.kat-titel {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 8px;
}

/* ---- Dokument-Zeile (großer Tap-Bereich) -------------------------- */
.dok {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--ink);
  min-height: 56px;
}
.dok:active { background: var(--green-tint); }
.dok-icon {
  flex: none;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  border: 1.5px solid var(--red);
  border-radius: 6px;
}
.dok-text { flex: 1 1 auto; min-width: 0; }
.dok-titel { font-weight: 600; }
.dok-meta { font-size: 13px; color: var(--muted); }
.dok-pfeil { flex: none; color: var(--green); font-size: 20px; }

.leer {
  color: var(--muted);
  font-size: 15px;
  padding: 6px 2px 2px;
}

/* ---- Fuß ---------------------------------------------------------- */
/* ---- Tagessieger-Gesamtwertung ------------------------------------ */
.wertung {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.wertung thead th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 14px;
  background: var(--green-tint);
  border-bottom: 1px solid var(--line);
}
.wertung td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  vertical-align: middle;
}
.wertung tr:last-child td { border-bottom: none; }
.wertung .rang { width: 34px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wertung .num  { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wertung th.num { text-align: right; }
.w-name { font-weight: 600; }
.w-team { color: var(--muted); font-size: 13px; margin-left: 8px; }
/* Podest dezent hervorheben */
.wertung tbody tr:nth-child(1) .num { color: var(--red); }

/* ---- Fuß ---------------------------------------------------------- */
.fuss {
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding: 22px 20px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.fuss a { color: var(--muted); }
.fuss-links { margin-bottom: 4px; }

/* ---- Sponsorleiste (oben, unter dem Kopf) ------------------------- */
.sponsor-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.sponsor-strip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  font-weight: 700;
}
.sponsor-strip-logo {
  height: 40px;
  width: auto;
  display: block;
}

.signatur { margin-top: 10px; font-size: 13px; }
.signatur a { color: var(--green); font-weight: 600; text-decoration: none; }
.signatur a:hover { text-decoration: underline; }
.signatur .trumpf { color: var(--red); font-weight: 700; }

/* ---- Formulare / Admin -------------------------------------------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 18px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=file], select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }

.btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 18px;
  font-family: var(--font);
}
.btn:hover { background: var(--green-dark); }
.btn-klein { padding: 8px 14px; font-size: 14px; margin: 0; }
.btn-rot { background: var(--red); }
.btn-rot:hover { background: #7f2020; }

.hinweis {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  margin-top: 16px;
}
.hinweis-ok  { background: var(--green-tint); color: var(--green-dark); }
.hinweis-err { background: #F6E5E5; color: #7f2020; }

.admin-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.admin-bar .who { color: rgba(255,255,255,0.85); font-size: 14px; }
.admin-bar a.logout { color: #fff; font-size: 14px; }

.tabelle { width: 100%; border-collapse: collapse; margin-top: 6px; }
.tabelle td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); font-size: 15px; vertical-align: middle; }
.tabelle .re { text-align: right; }

.login-box { max-width: 380px; margin: 40px auto; }

@media (min-width: 640px) {
  .brand { font-size: 30px; }
  body { font-size: 17px; }
}
