/* Comp Sheets – keine Webfonts, keine externen Dateien. */

:root {
  --bg: #f5f6f8;
  --flaeche: #ffffff;
  --flaeche-2: #f0f2f5;
  --text: #1b1f24;
  --text-2: #5b6470;
  --linie: #dde1e6;
  --akzent: #e8590c;
  --akzent-text: #ffffff;
  --akzent-weich: #fff1e8;
  --ok: #2b8a3e;
  --ok-weich: #e6f4ea;
  --warn: #b35c00;
  --warn-weich: #fff4e0;
  --fehler: #c92a2a;
  --fehler-weich: #fdeaea;
  --info: #1c7ed6;
  --info-weich: #e7f1fb;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --flaeche: #1a1e24;
    --flaeche-2: #222831;
    --text: #e8eaed;
    --text-2: #9aa3ae;
    --linie: #2e353f;
    --akzent: #ff7a2f;
    --akzent-text: #111418;
    --akzent-weich: #3a2416;
    --ok: #51cf66;
    --ok-weich: #17301d;
    --warn: #ffa94d;
    --warn-weich: #33270f;
    --fehler: #ff6b6b;
    --fehler-weich: #3a1a1a;
    --info: #4dabf7;
    --info-weich: #152a3d;
    --schatten: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.leise { color: var(--text-2); }
.klein { font-size: .85rem; }

/* Kopf */
.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 10; }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 1rem; min-height: 56px; flex-wrap: wrap; }
.marke { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
.marke:hover { text-decoration: none; }
.logo { background: var(--akzent); color: var(--akzent-text); border-radius: 6px; padding: 2px 6px; font-size: .8rem; letter-spacing: .5px; }
.menue { display: flex; align-items: center; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.menue a, .menue .link { color: var(--text-2); padding: .4rem .7rem; border-radius: 8px; font-size: .95rem; }
.menue a:hover, .menue .link:hover { background: var(--flaeche-2); color: var(--text); text-decoration: none; }
.menue a.aktiv { color: var(--text); background: var(--flaeche-2); font-weight: 600; }
.menue-trenner { width: 1px; height: 22px; background: var(--linie); margin: 0 .35rem; }
.abmelden { margin: 0; }
.menue-schalter, .menue-knopf { display: none; }
.abzeichen { background: var(--akzent-weich); color: var(--akzent); font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; vertical-align: 1px; }

@media (max-width: 760px) {
  .menue-knopf { display: block; margin-left: auto; width: 40px; height: 40px; position: relative; cursor: pointer; }
  .menue-knopf span, .menue-knopf span::before, .menue-knopf span::after { position: absolute; left: 10px; width: 20px; height: 2px; background: var(--text); content: ""; }
  .menue-knopf span { top: 19px; }
  .menue-knopf span::before { top: -6px; left: 0; }
  .menue-knopf span::after { top: 6px; left: 0; }
  .menue { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: .75rem; }
  .menue-schalter:checked ~ .menue { display: flex; }
  .menue-trenner { width: 100%; height: 1px; margin: .35rem 0; }
  .menue .link { text-align: left; }
}

/* Inhalt */
.inhalt { max-width: 1200px; width: 100%; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
.fuss { border-top: 1px solid var(--linie); color: var(--text-2); font-size: .85rem; padding: 16px; text-align: center; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px; box-shadow: var(--schatten); margin-bottom: 16px; }
.karte.schmal { max-width: 420px; margin: 8vh auto 0; }
.karte > :last-child { margin-bottom: 0; }

.kopfzeile { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 1rem 0 1.5rem; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; }
.kennzahl b { display: block; font-size: 1.4rem; line-height: 1.2; }
.kennzahl span { color: var(--text-2); font-size: .85rem; }

.cup-reiter { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.cup-reiter a { padding: .4rem .9rem; border-radius: 99px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); font-size: .9rem; }
.cup-reiter a:hover { border-color: var(--akzent); text-decoration: none; }

.stage-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .stage-raster { grid-template-columns: 1fr; } }
.stage { display: flex; flex-direction: column; }
.stage h3 a { color: var(--text); }
.stage .regel { color: var(--text-2); font-size: .85rem; margin-bottom: .75rem; }
.slot-liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linie); }
.slot-liste li { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; padding: .5rem 0; border-bottom: 1px solid var(--linie); font-size: .9rem; }
.slot-liste li:last-child { border-bottom: 0; }
.slot-name { font-weight: 600; }
.slot-emp { color: var(--text-2); grid-column: 1; }
.slot-team { grid-row: 1 / span 2; grid-column: 2; align-self: center; text-align: right; font-size: .85rem; }
.stage .mehr { margin-top: auto; padding-top: .75rem; font-size: .9rem; }

.marke-zahl { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 99px; background: var(--flaeche-2); color: var(--text-2); text-align: center; font-weight: 600; }
.marke-zahl.voll { background: var(--ok-weich); color: var(--ok); }

.unsicher { color: var(--warn); cursor: help; }
.hinweis { background: var(--warn-weich); color: var(--text); border-left: 3px solid var(--warn); padding: .6rem .8rem; border-radius: 6px; font-size: .9rem; margin: .5rem 0 1rem; }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { background: var(--flaeche-2); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.bester td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.leer { color: var(--text-2); font-style: italic; }

.slot-block { margin-bottom: 22px; }
.slot-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; margin-bottom: .5rem; }
.slot-kopf h3 { margin: 0; }
.slot-kopf .emp { color: var(--text-2); font-size: .9rem; }

.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.status-geplant { background: var(--info-weich); color: var(--info); }
.status-ergebnis { background: var(--warn-weich); color: var(--warn); }
.status-eingereicht { background: var(--ok-weich); color: var(--ok); }

/* Formulare */
form { margin: 0; }
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.feld { display: flex; flex-direction: column; gap: 4px; }
.feld.breit { grid-column: 1 / -1; }
label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=password], input[type=url], input[type=search], select, textarea {
  font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: .5rem .65rem; width: 100%;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: -1px; border-color: transparent; }
.hilfe { font-size: .8rem; color: var(--text-2); font-weight: 400; }
.knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 14px; align-items: center; }
button, .knopf {
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; border-radius: 8px; padding: .5rem 1rem; border: 1px solid transparent;
  background: var(--akzent); color: var(--akzent-text); display: inline-block; line-height: 1.3;
}
button:hover, .knopf:hover { filter: brightness(1.07); text-decoration: none; }
button.zweit, .knopf.zweit { background: var(--flaeche); color: var(--text); border-color: var(--linie); }
button.gefahr { background: var(--fehler); color: #fff; }
button.klein, .knopf.klein { padding: .25rem .6rem; font-size: .8rem; }
button.link { background: none; border: 0; padding: 0; color: var(--akzent); font-weight: 400; }
.inline { display: inline; }
.aktionen { display: flex; gap: .4rem; white-space: nowrap; }
.haken { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; color: var(--text); font-size: .9rem; margin: .3rem 0; }
.haken input { margin-top: .25rem; }
.haken small { display: block; color: var(--text-2); }

.meldung { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 16px; font-size: .95rem; }
.meldung.ok { background: var(--ok-weich); color: var(--ok); }
.meldung.fehler { background: var(--fehler-weich); color: var(--fehler); }
.meldung.info { background: var(--info-weich); color: var(--info); }

details.aufklapp { margin-bottom: 16px; }
details.aufklapp > summary { cursor: pointer; font-weight: 600; padding: .25rem 0; }
details.aufklapp[open] > summary { margin-bottom: .75rem; }

.zwei-spalten { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .zwei-spalten { grid-template-columns: 1fr; } }

/* Uebersicht als Sheet */
table.sheet { font-size: .88rem; }
table.sheet th { position: sticky; top: 0; z-index: 1; }
table.sheet td { padding: .45rem .65rem; }
table.sheet tbody.stage-block { border-top: 2px solid var(--linie); }
table.sheet tbody.stage-abstand td { height: 22px; padding: 0; background: var(--bg); border: 0; border-left: 1px solid var(--bg); border-right: 1px solid var(--bg); }
table.sheet tr.slot-start td { border-top: 1px solid var(--linie); }
table.sheet tr:not(.slot-start) td { border-top: 0; }
table.sheet td.sheet-stage { min-width: 190px; max-width: 260px; background: var(--flaeche-2); }
table.sheet td.sheet-stage a { color: var(--text); }
.nowrap { white-space: nowrap; }
td.bester-score { font-weight: 700; }

/* Bearbeitbare Tabelle (My entries) */
.sheet-input { font: inherit; font-size: .88rem; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: .3rem .45rem; width: 100%; min-width: 7rem; }
.sheet-input:hover { border-color: var(--linie); }
.sheet-input:focus { background: var(--flaeche); border-color: transparent; outline: 2px solid var(--akzent); outline-offset: -1px; }
.sheet-input.geaendert { background: var(--warn-weich); }
select.sheet-input { min-width: 9rem; }
.link-zeile { display: flex; align-items: center; gap: .35rem; }
.link-zeile a { white-space: nowrap; }

.speicherleiste { position: sticky; bottom: 0; z-index: 5; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 14px; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.speicherleiste.offen { border-color: var(--akzent); }
.speicherleiste .stand { font-size: .9rem; color: var(--text-2); }
.speicherleiste.offen .stand { color: var(--text); font-weight: 600; }

/* Comp-Leiste */
.comp-leiste { background: var(--flaeche-2); border-bottom: 1px solid var(--linie); }
.comp-leiste-innen { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: thin; }
.comp-leiste a { padding: .6rem .9rem; color: var(--text-2); white-space: nowrap; border-bottom: 2px solid transparent; font-size: .92rem; }
.comp-leiste a:hover { color: var(--text); text-decoration: none; }
.comp-leiste a.aktiv { color: var(--text); font-weight: 600; border-bottom-color: var(--akzent); }
.comp-leiste a.comp-neu { margin-left: auto; color: var(--akzent); font-weight: 600; }

/* Competitions / Anleitung */
.schritt { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.schritt h3 { margin-top: 4px; }
.schritt ol, .schritt ul { margin: .25rem 0 .5rem; padding-left: 1.2rem; }
.schritt li { margin: .3rem 0; }
.schritt-nr { width: 40px; height: 40px; border-radius: 50%; background: var(--akzent); color: var(--akzent-text); font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; }
kbd { font: inherit; font-size: .8rem; background: var(--flaeche-2); border: 1px solid var(--linie); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
code { font-size: .85em; background: var(--flaeche-2); padding: 1px 5px; border-radius: 4px; }
.lesezeichen-zeile { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; flex-wrap: wrap; }
.lesezeichen-knopf { display: inline-block; background: var(--akzent); color: var(--akzent-text); font-weight: 700; padding: .55rem 1rem; border-radius: 8px; cursor: grab; border: 2px dashed rgba(255,255,255,.6); }
.lesezeichen-knopf:hover { text-decoration: none; filter: brightness(1.07); }
details.loeschen summary { list-style: none; }
details.loeschen summary::-webkit-details-marker { display: none; }
details.loeschen[open] .loeschen-form { margin-top: 8px; padding: 10px; border: 1px solid var(--fehler); border-radius: 8px; min-width: 240px; }
@media (max-width: 600px) { .schritt { grid-template-columns: 1fr; } }
