/* =========================================================================
   Phönix Miles — Stylesheet
   Vereinsfarben FC Phönix Neckarzimmern: Schwarz & Rot.
   Bebas Neue als kantige Display-Schrift, Spline Sans für den Fließtext.
   ========================================================================= */

:root {
  --black-950: #0a0a0c;
  --black-900: #121214;
  --black-850: #18181c;
  --black-800: #1f1f24;
  --red-700:   #b81020;
  --red-600:   #d4111f;
  --red-500:   #e01e2a;
  --red-400:   #ee3742;
  --red-glow:  #ff4d57;
  --cream:     #f4f1ee;
  --muted:     rgba(244,241,238,.62);
  --line:      rgba(224,30,42,.28);
  --line-soft: rgba(255,255,255,.08);
  --ok:        #46c97a;
  --warn:      #e8a23c;
  --err:       #e0414f;
  --shadow:    0 18px 40px -22px rgba(0,0,0,.85);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Spline Sans', system-ui, sans-serif;
  background: var(--black-950);
  color: var(--cream);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px;
}

/* Hintergrund: Rot-Schimmer auf Schwarz */
.pitch-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(224,30,42,.20), transparent 60%),
    radial-gradient(700px 520px at -5% 110%, rgba(224,30,42,.10), transparent 55%),
    repeating-linear-gradient(0deg, transparent, transparent 78px, rgba(255,255,255,.012) 78px, rgba(255,255,255,.012) 156px),
    var(--black-950);
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, var(--black-900), rgba(18,18,20,.86));
  border-bottom: 2px solid var(--red-600);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-logo { height: 38px; width: 38px; border-radius: 50%; object-fit: cover; }
.brand-text {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.7rem; letter-spacing: 2px;
  color: var(--cream); line-height: 1;
}
.brand-text em { color: var(--red-500); font-style: normal; }

.topnav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.topnav a {
  color: var(--cream); text-decoration: none; font-weight: 500; font-size: .92rem;
  padding: 7px 14px; border-radius: 999px; transition: .18s;
  border: 1px solid transparent;
}
.topnav a:hover { background: rgba(224,30,42,.14); border-color: var(--line); }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; font-size: .9rem; }
.role-tag {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 1px; font-size: .8rem;
  padding: 3px 10px; border-radius: 6px; text-transform: uppercase;
}
.role-admin    { background: var(--red-500); color: #fff; }
.role-betreuer { background: var(--cream); color: var(--black-950); }
.role-spieler  { background: rgba(224,30,42,.18); color: var(--red-400); border: 1px solid var(--line); }
.logout {
  text-decoration: none; color: var(--cream); font-size: 1.2rem; line-height: 1;
  padding: 4px 8px; border-radius: 8px; transition: .15s;
}
.logout:hover { background: rgba(224,30,42,.28); color: #fff; }

/* ---------------- Layout ---------------- */
.container { max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 40px); }

.page-head { margin-bottom: 28px; }
.page-head h1 {
  font-family: 'Bebas Neue', sans-serif; font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 2px; line-height: .95; color: var(--cream);
}
.page-head h1 em { color: var(--red-500); font-style: normal; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 60ch; }

/* ---------------- Cards / Grids ---------------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: linear-gradient(165deg, var(--black-800), var(--black-900));
  border: 1px solid var(--line-soft);
  border-radius: 16px; padding: 22px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 1.5px; font-size: 1.5rem;
  color: var(--red-500); margin-bottom: 14px;
}

.stat {
  background: linear-gradient(165deg, var(--black-800), var(--black-900));
  border: 1px solid var(--line-soft); border-radius: 16px; padding: 22px;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -20px; bottom: -20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224,30,42,.22), transparent 70%);
}
.stat .num {
  font-family: 'Bebas Neue', sans-serif; font-size: 3rem; color: var(--red-500);
  line-height: 1;
}
.stat .lbl { color: var(--muted); font-size: .92rem; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line-soft); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
  background: var(--black-950); text-align: left; padding: 12px 14px;
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 1px; font-size: .95rem;
  color: var(--red-500); white-space: nowrap;
}
td { padding: 11px 14px; border-top: 1px solid var(--line-soft); }
tr:hover td { background: rgba(224,30,42,.06); }
.tr-sum td { background: rgba(224,30,42,.12); font-weight: 700; }

/* ---------------- Badges / Status ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
}
.badge-ok   { background: rgba(70,201,122,.18); color: var(--ok); border: 1px solid rgba(70,201,122,.4); }
.badge-warn { background: rgba(232,162,60,.18); color: var(--warn); border: 1px solid rgba(232,162,60,.4); }
.badge-off  { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line-soft); }
.badge-typ-spiel    { background: var(--red-500); color: #fff; }
.badge-typ-training { background: rgba(255,255,255,.1); color: var(--cream); border: 1px solid var(--line-soft); }

.match-pills { display: flex; gap: 6px; }
.pill {
  font-size: .72rem; padding: 2px 8px; border-radius: 6px; font-weight: 600;
  border: 1px solid var(--line-soft);
}
.pill.on  { background: rgba(70,201,122,.2); color: var(--ok); border-color: rgba(70,201,122,.4); }
.pill.off { background: rgba(255,255,255,.04); color: var(--muted); }

/* ---------------- Forms / Buttons ---------------- */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
input, select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-soft); background: var(--black-950); color: var(--cream);
  font-family: inherit; font-size: .95rem; margin-bottom: 14px;
}
input:focus, select:focus { outline: none; border-color: var(--red-500); background: #000; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 1.2px; font-size: 1rem;
  padding: 10px 20px; border-radius: 10px; border: none;
  background: var(--red-500); color: #fff; font-weight: 400;
  text-decoration: none; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--red-600); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--cream); border: 1px solid var(--line-soft); }
.btn-ghost:hover { background: rgba(224,30,42,.14); border-color: var(--line); }
.btn-green { background: var(--red-500); color: #fff; }
.btn-green:hover { background: var(--red-600); }
.btn-danger { background: transparent; border: 1px solid rgba(224,65,79,.5); color: var(--err); }
.btn-danger:hover { background: rgba(224,65,79,.18); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-gap { margin-top: 32px; }

/* inline-form innerhalb Tabellen */
.inline-form { display: inline; }

/* ---------------- Flash ---------------- */
.flash-stack { margin-bottom: 22px; display: grid; gap: 10px; }
.flash {
  padding: 13px 16px; border-radius: 12px; font-weight: 500;
  border-left: 4px solid; animation: slideIn .3s ease;
}
.flash-success { background: rgba(70,201,122,.14); border-color: var(--ok); color: #cdf5dd; }
.flash-error   { background: rgba(224,65,79,.14);  border-color: var(--err); color: #f7d4d7; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: linear-gradient(165deg, var(--black-800), var(--black-950));
  border: 1px solid var(--line); border-radius: 22px; padding: 40px 34px;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .crest { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; box-shadow: 0 8px 24px -8px rgba(224,30,42,.6); }
.login-logo h1 {
  font-family: 'Bebas Neue', sans-serif; font-size: 2.6rem; letter-spacing: 2px;
  margin-top: 14px;
}
.login-logo h1 em { color: var(--red-500); font-style: normal; }
.login-logo p { color: var(--muted); font-size: .9rem; }

/* ---------------- Event-Liste (Spieler/Betreuer) ---------------- */
.event-list { display: grid; gap: 14px; }
.event-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(165deg, var(--black-800), var(--black-900));
  border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px 20px;
  transition: .15s;
}
.event-row:hover { border-color: var(--line); }
.event-date {
  font-family: 'Bebas Neue', sans-serif; text-align: center; line-height: 1;
  min-width: 56px;
}
.event-date .d { font-size: 2rem; color: var(--red-500); }
.event-date .m { font-size: .85rem; color: var(--muted); letter-spacing: 1px; }
.event-info { flex: 1; min-width: 160px; }
.event-info .t { font-weight: 600; }
.event-info .sub { font-size: .85rem; color: var(--muted); }
.event-cta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.footer {
  text-align: center; padding: 24px; color: rgba(244,241,238,.38); font-size: .8rem;
}

.notice {
  background: rgba(224,30,42,.08); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; font-size: .9rem;
  color: rgba(244,241,238,.85); margin-bottom: 20px;
}
.notice strong { color: var(--red-500); }

details.help { margin-top: 10px; }
details.help summary { cursor: pointer; color: var(--red-500); font-size: .85rem; }
details.help div { margin-top: 8px; font-size: .85rem; color: var(--muted); }

@media (max-width: 640px) {
  .topnav { order: 3; width: 100%; }
  .brand { order: 1; }
  .user-chip { order: 2; margin-left: auto; }
}

/* =========================================================================
   Ergänzungen v2 — Key User, Rollenvergabe, Einstellungen, Fortschritt
   ========================================================================= */

.role-keyuser { background: var(--red-700); color: #fff; }

.nav-admin { border-color: var(--line) !important; background: rgba(224,30,42,.10); }

.section-title {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 1.5px;
  color: var(--red-500); font-size: 1.6rem; margin-bottom: 14px;
}
.mini-title {
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 1.2px;
  color: var(--red-500); font-size: 1.15rem; margin-bottom: 10px; font-weight: 400;
}

.hint { font-size: .8rem; color: var(--muted); margin: -8px 0 14px; line-height: 1.45; }
.hint-inline { font-size: .78rem; color: var(--muted); font-weight: 400; }

/* Rollen-Mehrfachauswahl */
.rollen-wahl { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--black-950); border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 7px 15px 7px 11px; margin: 0;
  font-size: .9rem; color: var(--cream); transition: .15s;
}
.check:hover { border-color: var(--line); }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--red-500); }
.check:has(input:checked) { background: rgba(224,30,42,.16); border-color: var(--red-500); }

/* Kompakte Kennzahlentabelle */
.mini-table { font-size: .92rem; }
.mini-table td { padding: 7px 0; border-top: 1px solid var(--line-soft); }
.mini-table tr:first-child td { border-top: none; }
.mini-table td:last-child { text-align: right; }
.mini-table tr:hover td { background: transparent; }

/* Detailzeile in Benutzerlisten */
.tr-detail td { background: rgba(0,0,0,.28); padding: 6px 14px 14px; }
.tr-detail:hover td { background: rgba(0,0,0,.28); }
.tr-detail .grid-2 { gap: 26px; }
.tr-detail form { padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; }

/* Fortschrittsbalken Trainings-Soll */
.progress {
  margin-top: 12px; height: 7px; border-radius: 99px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: 99px; max-width: 100%;
  background: linear-gradient(90deg, var(--red-700), var(--red-glow));
  transition: width .3s ease;
}

code {
  background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 5px;
  font-size: .88em;
}

/* =========================================================================
   Footer, Cookie-Banner und Rechtstexte
   ========================================================================= */

body { padding-bottom: 0; }

.footer {
  text-align: center; padding: 28px 20px 34px;
  border-top: 1px solid var(--line-soft); margin-top: 48px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.35));
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 6px 26px;
  justify-content: center; margin-bottom: 12px;
}
.footer-links a {
  color: var(--cream); text-decoration: none; font-size: .88rem;
  padding-bottom: 2px; border-bottom: 1px solid transparent; transition: .15s;
}
.footer-links a:hover { color: var(--red-400); border-bottom-color: var(--red-500); }
.footer-verein { color: rgba(244,241,238,.42); font-size: .8rem; }
.footer-verein a { color: inherit; text-decoration: none; }
.footer-verein a:hover { color: var(--red-400); }

/* ---------------- Cookie-Banner ---------------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, var(--black-850), var(--black-950));
  border-top: 2px solid var(--red-600);
  box-shadow: 0 -14px 40px -18px rgba(0,0,0,.9);
  animation: cookieIn .35s ease;
}
.cookie-banner[hidden] { display: none; }
@keyframes cookieIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cookie-text {
  flex: 1; min-width: 260px; font-size: .88rem;
  color: rgba(244,241,238,.82); line-height: 1.55;
}
.cookie-text strong:first-child {
  display: block; font-family: 'Bebas Neue', sans-serif; letter-spacing: 1.4px;
  font-size: 1.1rem; color: var(--red-500); margin-bottom: 3px; font-weight: 400;
}
.cookie-text a { color: var(--red-400); }
.cookie-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------------- Rechtstexte ---------------- */
.rechtstext { max-width: 760px; }
.rechtstext .card { margin-bottom: 18px; }
.rechtstext p { margin-bottom: 12px; font-size: .93rem; color: rgba(244,241,238,.86); }
.rechtstext p:last-child { margin-bottom: 0; }
.rechtstext ul { margin: 0 0 12px 20px; font-size: .93rem; color: rgba(244,241,238,.86); }
.rechtstext li { margin-bottom: 5px; }
.rechtstext a { color: var(--red-400); }

.anschrift { line-height: 1.75; }
.mini-table.wide td:first-child {
  width: 38%; color: var(--muted); vertical-align: top; padding-right: 18px;
}
.mini-table.wide td { text-align: left !important; font-size: .9rem; }

/* Nicht ausgefüllte Pflichtangaben sichtbar machen */
.todo {
  background: rgba(224,65,79,.18); color: #ffb3b9;
  border: 1px dashed rgba(224,65,79,.6); border-radius: 6px;
  padding: 1px 8px; font-size: .88em; font-weight: 600;
}

@media (max-width: 640px) {
  .cookie-banner { flex-direction: column; align-items: stretch; }
  .cookie-actions .btn { flex: 1; justify-content: center; }
}
