/* Farben kommen aus config.php (theme.css). Hier nur Gestaltung.
   Schriften: nur Systemschriften, nichts wird von fremden Servern geladen (DSGVO). */
:root {
  --font-display: "Bahnschrift", "DIN Condensed", "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --deep: color-mix(in srgb, var(--primary) 72%, #000);
  --border: color-mix(in srgb, var(--text) 10%, transparent);
  --muted: color-mix(in srgb, var(--text) 62%, var(--bg));
  --soft: color-mix(in srgb, var(--text) 5%, var(--surface));
  --stripes: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 72px, transparent 72px 144px);
  --radius-s: 8px;
  --radius-m: 16px;
  --wrap: 1040px;
}
@media (prefers-color-scheme: dark) { :root { --deep: color-mix(in srgb, var(--primary) 30%, var(--bg)); } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.55; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); margin: 0 0 1.25rem; }
h2 { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.7rem); margin: 0 0 1rem; }
p { max-width: 68ch; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Kopf: dunkles Grün, Wappen ragt in die Seite ---------- */
.top { background: var(--stripes), var(--deep); color: #fff; border-bottom: 4px solid var(--accent); position: relative; z-index: 5; }
.top-inner { max-width: var(--wrap); margin: 0 auto; padding: .75rem clamp(1rem, 3vw, 2rem); min-height: 84px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; }
.brand { display: flex; align-items: center; gap: 1rem; color: #fff; text-decoration: none; }
.crest { flex: none; width: 76px; height: 76px; margin-bottom: -38px; align-self: flex-start; background: #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--accent), 0 6px 18px rgba(0,0,0,.18); }
.crest img { width: 52px; height: auto; display: block; }
.wordmark { display: flex; flex-direction: column; font-family: var(--font-display); line-height: 1; }
.w1 { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.75rem); font-weight: 700; letter-spacing: -0.01em; }
.w2 { font-size: clamp(.95rem, .85rem + .4vw, 1.1rem); font-weight: 600; color: var(--accent); margin-top: .2rem; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-left: auto; gap: .15rem .25rem; }
.top nav a, .top nav .link { color: #fff; text-decoration: none; padding: .5rem .75rem; font-weight: 600; font-size: .95rem; border-radius: 6px; position: relative; }
.top nav a:hover, .top nav .link:hover { background: rgba(255,255,255,.1); }
.top nav a[aria-current="page"]::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: .15rem; height: 3px; border-radius: 2px; background: var(--accent); }
.top nav .link { opacity: .8; }

main { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: clamp(2.5rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2rem) 3rem; flex: 1; }
footer { display: flex; justify-content: center; gap: 1.5rem; padding: 1.5rem 1rem; font-size: .9rem; background: var(--deep); }
footer a { color: rgba(255,255,255,.8); }
@media (max-width: 640px) {
  .crest { width: 60px; height: 60px; margin-bottom: 0; align-self: center; }
  .crest img { width: 40px; }
  main { padding-top: 1.5rem; }
}

/* ---------- Startseite: Anzeigetafel auf dem Rasen ---------- */
.hero { position: relative; overflow: hidden; color: #fff; margin: calc(-1 * clamp(2.5rem, 5vw, 3.5rem)) calc(50% - 50vw) 2.25rem; padding: clamp(3rem, 6vw, 4.5rem) clamp(1rem, 3vw, 2rem) clamp(2rem, 4vw, 3rem); background: var(--stripes), var(--primary); }
.hero-inner { position: relative; max-width: var(--wrap); margin: 0 auto; padding-left: clamp(0px, 7vw, 92px); }
.pitch-lines { position: absolute; inset: 0; pointer-events: none; }
.pitch-lines::before { content: ""; position: absolute; top: 50%; right: max(-90px, calc(50% - 50vw - 90px)); width: 320px; height: 320px; transform: translateY(-50%); border: 3px solid rgba(255,255,255,.22); border-radius: 50%; }
.pitch-lines::after { content: ""; position: absolute; top: 0; bottom: 0; right: 70px; border-left: 3px solid rgba(255,255,255,.22); }
.hero-hello { margin: 0 0 1rem; font-weight: 600; opacity: .85; }
.hero h1 { color: #fff; margin: 0; max-width: 20ch; }
.scoreboard { display: flex; align-items: stretch; gap: clamp(1rem, 3vw, 2rem); }
.sb-date { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 7.5rem; padding: .9rem 1rem; background: var(--deep); border-radius: var(--radius-m); border: 2px solid rgba(255,255,255,.18); font-family: var(--font-display); line-height: 1; }
.sb-day { font-size: clamp(3.2rem, 2.4rem + 3vw, 4.75rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-mon { margin-top: .35rem; font-size: .95rem; opacity: .85; white-space: nowrap; }
.sb-body { display: flex; flex-direction: column; justify-content: center; }
.sb-count { margin: 0 0 .7rem; align-self: flex-start; font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: #10200a; background: var(--accent); padding: .2rem .7rem; border-radius: 999px; }
.sb-meta { margin: .6rem 0 0; opacity: .9; }
.sb-edit { display: inline-block; margin-top: 1rem; color: #fff; font-weight: 600; }
@media (max-width: 560px) { .scoreboard { flex-direction: column; } .sb-date { flex-direction: row; gap: .75rem; align-self: flex-start; min-width: 0; padding: .6rem 1rem; } .sb-day { font-size: 2.6rem; } .sb-mon { margin: 0; } }
@media (prefers-color-scheme: dark) {
  .hero { background: var(--stripes), color-mix(in srgb, var(--primary) 18%, var(--bg)); color: var(--text); }
  .hero h1, .sb-edit { color: var(--text); }
}

/* ---------- Anmelden: geteilt, links Rasen mit Wappen ---------- */
.bare main { max-width: none; padding: 0; display: flex; }
.login { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: calc(100vh - 60px); }
.login-pitch { position: relative; overflow: hidden; background: var(--stripes), var(--primary); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 1.5rem; }
.login-pitch .pitch-lines::before { right: auto; left: 50%; transform: translate(-50%, -50%); width: 380px; height: 380px; }
.login-pitch .pitch-lines::after { right: auto; left: 0; right: 0; top: 50%; bottom: auto; border-left: 0; border-top: 3px solid rgba(255,255,255,.22); }
.login-crest { position: relative; width: clamp(130px, 16vw, 190px); height: auto; padding: 18px; background: #fff; border-radius: 28px; box-shadow: 0 0 0 5px var(--accent), 0 12px 32px rgba(0,0,0,.2); }
.login-w1 { position: relative; margin: 1.75rem 0 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); line-height: 1; }
.login-w2 { position: relative; margin: .4rem 0 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 1rem + .8vw, 1.6rem); color: var(--accent); }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 4rem); max-width: 520px; width: 100%; margin: 0 auto; }
.login-form h1 { margin-bottom: .35rem; }
.login-form > p.muted { margin: 0 0 1.75rem; }
@media (max-width: 800px) { .login { grid-template-columns: 1fr; min-height: 0; } .login-pitch { padding: 2.25rem 1rem; } .login-crest { width: 110px; padding: 12px; border-radius: 22px; } .login-w1 { margin-top: 1.1rem; } }
@media (prefers-color-scheme: dark) { .login-pitch { background: var(--stripes), color-mix(in srgb, var(--primary) 18%, var(--bg)); } }

/* ---------- Flächen ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: clamp(1.1rem, 2.5vw, 1.6rem); margin-bottom: 1.25rem; }
.card.flush { padding-top: .4rem; padding-bottom: .4rem; }
.narrow { max-width: 480px; margin: 0 auto; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.head h1, .head h2 { margin: 0; }

/* ---------- Terminliste ---------- */
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: grid; grid-template-columns: 4.25rem 1fr auto; gap: .2rem 1.1rem; align-items: center; padding: 1rem 0; border-top: 1px solid var(--border); }
.events li:first-child { border-top: 0; }
.badge { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--primary); color: var(--primary-text); border-radius: 12px; padding: .45rem 0 .5rem; line-height: 1; font-family: var(--font-display); align-self: start; }
.badge-wd, .badge-mon { font-size: .8rem; font-weight: 600; opacity: .85; }
.badge-day { font-size: 1.8rem; font-weight: 700; margin: .12rem 0; font-variant-numeric: tabular-nums; }
.title-row strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; gap: 0 1rem; color: var(--muted); font-size: .93rem; }
.tags { margin-top: .45rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { display: inline-block; font-size: .8rem; font-weight: 600; padding: .12rem .6rem; border-radius: 999px; background: var(--soft); }
.tag.team { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
.desc { margin-top: .5rem; font-size: .95rem; }
.edit { font-size: .9rem; white-space: nowrap; }
.empty { color: var(--muted); margin: 0; }
@media (max-width: 560px) { .events li { grid-template-columns: 3.6rem 1fr; } .edit { grid-column: 2; } }

/* ---------- Formulare ---------- */
label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .95rem; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: .35rem; padding: .75rem .9rem; font: inherit; font-weight: 400; border: 1.5px solid color-mix(in srgb, var(--text) 18%, transparent); border-radius: 10px; background: var(--surface); color: inherit; transition: border-color .15s; }
input:not([type=checkbox]):hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 38%, transparent); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent); outline-offset: 0; border-color: var(--primary); }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 400; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; accent-color: var(--primary); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; background: var(--primary); color: var(--primary-text); border: 0; border-radius: 10px; padding: .6rem 1.35rem; font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; cursor: pointer; text-decoration: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.wide { width: 100%; }
.btn.small { min-height: 36px; padding: .35rem .95rem; font-size: .95rem; }
.btn.danger { background: #b42318; color: #fff; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
form.inline { display: inline; }
.actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.25rem; }
form.danger { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem 0; border-top: 1px solid var(--border); }
.inline-form:first-of-type { border-top: 0; }
.inline-form input:not([type=checkbox]) { width: auto; flex: 1 1 220px; margin: 0; }
.inline-form label.check { margin: 0; }
.filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; align-items: center; }
.filter select { width: auto; margin: 0; }

/* ---------- Meldungen ---------- */
.flash { padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; border: 1px solid; border-left-width: 5px; }
.flash.ok { background: color-mix(in srgb, #12b76a 10%, var(--surface)); border-color: color-mix(in srgb, #12b76a 45%, transparent); }
.flash.warn { background: color-mix(in srgb, #f79009 12%, var(--surface)); border-color: color-mix(in srgb, #f79009 50%, transparent); }
.flash.error { background: color-mix(in srgb, #f04438 10%, var(--surface)); border-color: color-mix(in srgb, #f04438 50%, transparent); }

.small { font-size: .9rem; }
.muted { color: var(--muted); }

/* ---------- Tabellen ---------- */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .85rem; font-weight: 600; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tr.inactive td { opacity: .55; }
.scroll { overflow-x: auto; }
table.roles td:not(:first-child), table.roles th:not(:first-child) { text-align: center; }
@media (max-width: 700px) {
  table.list thead { display: none; }
  table.list tr { display: block; padding: .6rem 0; border-bottom: 1px solid var(--border); }
  table.list td { display: block; border: 0; padding: .1rem 0; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* ---------- Kader ---------- */
.kader-teams select { margin: 0; min-width: 9rem; }
.kader-teams input[type=checkbox] { margin: 0; }
.kader-teams td { vertical-align: middle; }
.head .actions { margin-top: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.kader-teams td.perms label.check { margin: 0 0 .25rem; font-size: .9em; }
ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.plain li { padding: .35rem 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
label.check.inline { display: inline-flex; margin: 0; }
.trash-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.trash-actions form.inline { display: inline-flex; gap: .5rem; align-items: center; }
#move { margin-top: 1rem; }
