/* Dart Team Organizer – Dartboard-Design, mobile-first */

:root {
  --bg: #0e1310;            /* dunkles Flanell-Grün/Schwarz */
  --bg-card: #171e19;
  --bg-card-2: #1d2620;
  --line: #2a3a2f;
  --text: #f2eddc;          /* Sisal-Creme */
  --muted: #9aa89c;
  --red: #d33a35;           /* Dart-Rot */
  --red-dark: #a52a26;
  --green: #23934f;         /* Dart-Grün */
  --green-dark: #1a7440;
  --gold: #c9a227;          /* Zahlenkranz-Gold */
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -200px, #1a2a1e 0%, var(--bg) 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ---------- Kopfzeile ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(10, 14, 11, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.3px;
  min-width: 0;
}

.brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-board { flex-shrink: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }

.topbar-user { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

/* ---------- Layout ---------- */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

.page-title { font-size: 1.5rem; margin: 8px 0 14px; }

.section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin: 22px 0 10px;
}

.card {
  background: linear-gradient(180deg, var(--bg-card-2), var(--bg-card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

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

/* ---------- Login ---------- */

.login-hero { text-align: center; margin: 28px 0 18px; }
.login-hero h1 { margin: 12px 0 4px; font-size: 1.5rem; }
.login-hero .logo-board { width: 96px; height: 96px; }

/* ---------- Formulare ---------- */

label { display: block; margin-bottom: 12px; font-size: 0.9rem; color: var(--muted); }

input[type="text"], input[type="password"], input[type="datetime-local"], textarea {
  width: 100%;
  margin-top: 5px;
  padding: 12px;
  font-size: 1rem;
  color: var(--text);
  background: #0d120f;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

input:focus, textarea:focus { border-color: var(--gold); }

.checkbox-label { display: flex; align-items: center; gap: 8px; color: var(--text); }
.checkbox-label input { width: 20px; height: 20px; accent-color: var(--green); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  color: var(--text);
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--green); border-color: var(--green-dark); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-gold { background: var(--gold); border-color: #a3831c; color: #14100a; }
.btn-danger { background: var(--red); border-color: var(--red-dark); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { display: block; width: 100%; }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }

/* ---------- Abstimmung ---------- */

.vote-form { display: flex; gap: 10px; margin-top: 10px; }

.vote-btn {
  flex: 1;
  padding: 12px 8px;
  font-size: 0.95rem;
  opacity: 0.75;
}

.vote-btn .count {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  font-size: 0.8rem;
}

.vote-yes { background: rgba(35,147,79,0.18); border-color: var(--green); color: #7ddfa4; }
.vote-no  { background: rgba(211,58,53,0.15); border-color: var(--red); color: #f1948f; }

.vote-yes.chosen { background: var(--green); color: #fff; opacity: 1; box-shadow: 0 0 0 2px rgba(35,147,79,0.4); }
.vote-no.chosen  { background: var(--red);  color: #fff; opacity: 1; box-shadow: 0 0 0 2px rgba(211,58,53,0.4); }

.vote-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.pill-yes { background: rgba(35,147,79,0.2); color: #7ddfa4; }
.pill-no { background: rgba(211,58,53,0.18); color: #f1948f; }
.pill-muted { background: rgba(255,255,255,0.07); color: var(--muted); }

.voter-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.voter-list li {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid var(--line);
}
.voter-list .v-yes { color: #7ddfa4; border-color: rgba(35,147,79,0.5); }
.voter-list .v-no { color: #f1948f; border-color: rgba(211,58,53,0.45); }
.voter-list .v-none { color: var(--muted); border-style: dashed; }

/* ---------- Termine ---------- */

.event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.event-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
}

.event-title-big { margin: 0; font-size: 1.3rem; }
.event-note { color: var(--muted); font-size: 0.9rem; }

.date-row {
  border-top: 1px dashed var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.date-info { display: flex; flex-direction: column; gap: 2px; }

.date-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  font-weight: 700;
}

.date-big { font-size: 1.05rem; font-weight: 700; margin-top: 2px; }

.date-card { border-left: 4px solid var(--line); }
.fixed-card { border-left: 4px solid var(--gold); }
.fixed-date { margin-top: 10px; font-size: 1.05rem; }

.details-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; display: inline-block; margin-bottom: 10px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.badge-open { background: rgba(211,58,53,0.2); color: #f1948f; }
.badge-fixed { background: rgba(35,147,79,0.25); color: #7ddfa4; }
.badge-cancelled { background: rgba(211,58,53,0.25); color: #f1948f; }
.badge-gold { background: rgba(201,162,39,0.2); color: var(--gold); }
.badge-muted { background: rgba(255,255,255,0.08); color: var(--muted); }

/* ---------- Verwaltung ---------- */

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.user-row.inactive .user-name { opacity: 0.5; }
.user-name { font-weight: 600; }

.user-actions { width: 100%; }
.user-actions summary { list-style: none; display: inline-block; }
.user-actions summary::-webkit-details-marker { display: none; }
.user-actions-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin-top: 8px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
}
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input { width: auto; flex: 1; min-width: 160px; margin-top: 0; padding: 8px 10px; font-size: 0.9rem; }

.admin-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.admin-danger { border-color: rgba(211,58,53,0.35); }

/* ---------- Mitbringliste ---------- */

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
}
.item-row.item-open { border-color: rgba(211,58,53,0.5); border-style: dashed; }
.item-row.item-claimed { border-color: rgba(35,147,79,0.45); }

.item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-title { font-weight: 700; }
.item-claimer { font-size: 0.82rem; color: #7ddfa4; }
.item-missing { font-size: 0.82rem; color: #f1948f; font-weight: 700; }
.item-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item-all-done { color: #7ddfa4; font-weight: 700; }

/* Kompakte Mitbringliste auf der Übersicht */
.mini-items {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
}
.mini-items-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.mini-items-state { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.4px; }
.mini-items-state.state-open { background: rgba(211,58,53,0.2); color: #f1948f; }
.mini-items-state.state-done { background: rgba(35,147,79,0.25); color: #7ddfa4; }

.mini-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  margin: 10px 0 6px;
}
.mini-group-label.label-open { color: #f1948f; }
.mini-group-label.label-done { color: #7ddfa4; }

.mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
}
.mini-item.open {
  background: rgba(211,58,53,0.1);
  border: 1px dashed rgba(211,58,53,0.55);
}
.mini-item.done {
  background: rgba(35,147,79,0.08);
  border: 1px solid rgba(35,147,79,0.3);
}
.mini-item-title { font-size: 0.95rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.mini-claimer {
  font-size: 0.82rem;
  color: #7ddfa4;
  white-space: nowrap;
  font-weight: 700;
  background: rgba(35,147,79,0.18);
  padding: 3px 10px;
  border-radius: 999px;
}

.btn-tiny { padding: 6px 12px; font-size: 0.8rem; white-space: nowrap; }

.mini-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.add-item summary { list-style: none; display: inline-block; cursor: pointer; }
.add-item summary::-webkit-details-marker { display: none; }
.add-item { margin-top: 12px; }

/* ---------- Aufstellung ---------- */

.lineup-parallel {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.lineup-games { display: flex; flex-direction: column; gap: 10px; }

.lineup-game {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
}

.lineup-game-name {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  font-weight: 700;
  min-width: 76px;
}

.lineup-game select, select {
  flex: 1;
  min-width: 130px;
  padding: 10px 12px;
  font-size: 1rem;
  color: var(--text);
  background: #0d120f;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
select:focus { border-color: var(--gold); }

.lineup-view-round { margin-top: 12px; }
.lineup-view-games { display: flex; gap: 8px; margin-top: 4px; }
.lineup-view-game {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  min-width: 0;
}
.lineup-view-game strong { font-size: 0.9rem; overflow-wrap: anywhere; }
.lineup-view-game.me { border-color: var(--gold); background: rgba(201,162,39,0.08); }
.lineup-view-game.empty strong { color: var(--muted); font-weight: 500; }

.card-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Aufklappbare Terminkarten (Übersicht) ---------- */

.collapsible summary {
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.collapsible summary::-webkit-details-marker { display: none; }

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.summary-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.chev {
  display: inline-block;
  color: var(--gold);
  font-size: 1.05rem;
  transition: transform 0.2s ease;
}
.collapsible[open] .chev { transform: rotate(90deg); }

.summary-date {
  margin-top: 8px;
  font-weight: 700;
  font-size: 1.02rem;
}

.collapse-body {
  border-top: 1px dashed var(--line);
  margin-top: 12px;
  padding-top: 10px;
}

/* ---------- Sonstiges ---------- */

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.92rem;
  font-weight: 600;
}
.flash-success { background: rgba(35,147,79,0.18); border: 1px solid var(--green); color: #7ddfa4; }
.flash-error { background: rgba(211,58,53,0.15); border: 1px solid var(--red); color: #f1948f; }

.empty-state { text-align: center; padding: 32px 16px; }
.empty-state p { color: var(--muted); }

.archive summary { cursor: pointer; }

code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

/* ---------- Untere Navigation (Mobile-App-Gefühl) ---------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  background: rgba(10, 14, 11, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}
.tab-icon { font-size: 1.25rem; line-height: 1.2; }
.tab.active { color: var(--gold); background: rgba(201,162,39,0.1); }

/* ---------- Größere Bildschirme ---------- */

@media (min-width: 700px) {
  .page-title { font-size: 1.8rem; }
  body { padding-bottom: 90px; }
}
