/* SC Moosen – Strafenkatalog · modern & sportlich, mobile-first
   Farbwelt nach Vereinswappen: Blau / Gelb / Anthrazit */

:root {
  --ink: #33322e;          /* Anthrazit aus dem Wappen */
  --ink-dark: #26251f;
  --blue: #2380c3;         /* Wappenblau */
  --blue-dark: #1b659c;
  --blue-deep: #14496f;
  --yellow: #f8c40a;       /* Wappengelb */
  --yellow-dark: #d9a800;
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #23282c;
  --muted: #64707a;
  --line: #e4e8ec;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --blue-bg: #dbeefc;
  --amber-bg: #fef3c7;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(20, 73, 111, .08);
}

* { 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: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }

main.wrap { flex: 1; padding-top: 20px; padding-bottom: 40px; }

/* ---------- Kopfbereich ---------- */
.topbar {
  background: linear-gradient(135deg, var(--ink-dark) 0%, var(--blue-deep) 60%, var(--blue-dark) 100%);
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 10px; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; min-width: 0; }
.brand-crest {
  height: 46px; width: auto; flex: 0 0 auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 17px; letter-spacing: .3px; }
.brand-text small { font-size: 11.5px; color: var(--yellow); text-transform: uppercase; letter-spacing: 1.5px; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-name { font-size: 13px; color: #cfe4f4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.mainnav { background: rgba(0,0,0,.3); }
.nav-inner { display: flex; gap: 4px; overflow-x: auto; }
.mainnav a {
  color: #bcd6e8; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 11px 14px; white-space: nowrap; border-bottom: 3px solid transparent;
}
.mainnav a.active { color: #fff; border-bottom-color: var(--yellow); }
.mainnav a:active { background: rgba(255,255,255,.06); }

/* ---------- Laufband: Kabinendienst ---------- */
.duty-ticker {
  background: linear-gradient(90deg, var(--yellow) 0%, #ffd541 100%);
  color: var(--ink-dark);
  padding: 8px 0 9px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .12);
}
.duty-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.duty-week { font-weight: 600; letter-spacing: .3px; text-transform: none; opacity: .65; font-size: 11px; }
.duty-empty { font-size: 14px; font-weight: 600; opacity: .7; margin-top: 2px; }

.ticker-viewport { overflow: hidden; margin-top: 1px; }
.ticker-track { display: flex; width: max-content; animation: ticker-scroll 22s linear infinite; }
.ticker-item {
  font-size: 16px; font-weight: 800; white-space: nowrap;
  /* großzügiger Abstand, damit die zweite (nahtlose) Kopie auf breiten
     Bildschirmen nicht wie doppelter Text wirkt */
  padding-right: clamp(56px, 30vw, 320px);
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.duty-ticker:hover .ticker-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-viewport { overflow-x: auto; }
}

/* ---------- Karten & Listen ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 17px; }
.card h2 .sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.card a { color: var(--blue-dark); }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; border-top: 3px solid var(--yellow);
}
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 800; margin-top: 2px; }
.stat .value.red { color: var(--red); }
.stat .value.green { color: var(--green); }

.player-list { display: flex; flex-direction: column; gap: 10px; }
.player-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; text-decoration: none; color: var(--text);
}
.player-item:active { transform: scale(.995); }
.shirt {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: var(--yellow); font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.player-main { flex: 1; min-width: 0; }
.player-main .name { font-weight: 700; font-size: 15px; }
.player-main .pos { font-size: 12px; color: var(--muted); }
.player-sum { text-align: right; }
.player-sum .open { font-weight: 800; font-size: 16px; }
.player-sum .open.zero { color: var(--green); }
.player-sum .open.due { color: var(--red); }
.player-sum .count { font-size: 11px; color: var(--muted); }

/* ---------- Strafen ---------- */
.penalty {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.penalty:first-of-type { border-top: 0; }
.penalty .info { flex: 1; min-width: 0; }
.penalty .title { font-weight: 600; font-size: 14px; }
.penalty .meta { font-size: 12px; color: var(--muted); }
.penalty .amount { font-weight: 800; font-size: 15px; white-space: nowrap; }
.penalty.is-paid .title, .penalty.is-paid .amount { color: var(--muted); text-decoration: line-through; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px;
  padding: 2px 9px; vertical-align: middle; text-decoration: none;
}
.badge-open { background: var(--red-bg); color: var(--red); }
.badge-paid { background: var(--green-bg); color: var(--green); }
.badge-admin { background: var(--yellow); color: var(--ink-dark); }

.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Sammelauswahl ---------- */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f0f4f8; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 9px 12px; margin-bottom: 12px;
}
.bulk-bar .check { margin: 0; font-size: 13px; }
.pen-check {
  width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px;
  accent-color: var(--blue); cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- Bezahlte Strafen (Dropdown) ---------- */
.paid-details {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.paid-details summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px; cursor: pointer; font-weight: 700; font-size: 15px;
  list-style: none; user-select: none;
}
.paid-details summary::-webkit-details-marker { display: none; }
.paid-details summary::after {
  content: '▾'; color: var(--muted); font-size: 14px;
  transition: transform .2s; margin-left: 4px;
}
.paid-details[open] summary::after { transform: rotate(180deg); }
.paid-details summary .sub { font-weight: 600; color: var(--green); font-size: 13px; margin-left: auto; }
.paid-details summary:active { background: #f5f8fa; }
.paid-body { padding: 0 18px 14px; border-top: 1px solid var(--line); }

/* ---------- Einmalige Strafen (Chips) ---------- */
.chip-group { display: flex; flex-direction: column; gap: 8px; }
.chip-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.chip-label.done { color: var(--green); }
.chip-label.open { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip {
  display: inline-block; font-size: 13px; font-weight: 600;
  border-radius: 999px; padding: 5px 12px; text-decoration: none;
}
.chip-done { background: var(--green-bg); color: #14532d; }
.chip-open { background: #eef1f4; color: var(--muted); }

/* ---------- Arbeitsdienste ---------- */
.duty-week-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden;
}
.duty-week-card summary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer; font-weight: 700; font-size: 14.5px;
  list-style: none; user-select: none;
}
.duty-week-card summary::-webkit-details-marker { display: none; }
.duty-week-card summary::after {
  content: '▾'; color: var(--muted); font-size: 13px; transition: transform .2s;
}
.duty-week-card[open] summary::after { transform: rotate(180deg); }
.duty-week-card summary:active { background: #f5f8fa; }
.dw-title { flex: 1; min-width: 0; }
.dw-count {
  font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.dw-count.ok    { background: var(--green-bg); color: var(--green); }
.dw-count.warn  { background: var(--amber-bg, #fef3c7); color: #92400e; }
.dw-count.empty { background: #eef1f4; color: var(--muted); }
.badge-now { background: var(--blue); color: #fff; }

.duty-body { padding: 4px 16px 14px; border-top: 1px solid var(--line); }
.duty-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.duty-row:last-of-type { border-bottom: 0; }
.duty-name { flex: 1; font-weight: 600; font-size: 14px; min-width: 0; }
.duty-add { display: flex; gap: 8px; margin-top: 12px; }
.duty-add select { flex: 1; min-width: 0; }
.duty-add .btn { flex: 0 0 auto; padding-left: 18px; padding-right: 18px; font-size: 18px; }

/* ---------- Buttons & Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: 14px; padding: 11px 16px; line-height: 1.1;
  background: var(--blue); color: #fff;
  transition: filter .15s;
}
.btn:active { filter: brightness(.92); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; }
.btn-light { background: #e8edf1; color: var(--text); }
.btn-danger { background: var(--red); }
.btn-block { width: 100%; }

form.inline { display: inline; }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
label.check {
  display: flex; align-items: center; gap: 9px; font-weight: 500;
  margin-top: 14px; font-size: 13.5px;
}
label.check input { width: 18px; height: 18px; accent-color: var(--blue); flex: 0 0 auto; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: 12px 12px; font-size: 16px; /* 16px = kein iOS-Zoom */
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font-family: inherit; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35,128,195,.18);
}
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }

.flash {
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; font-weight: 600;
}
.flash-ok { background: var(--blue-bg); color: var(--blue-deep); }
.flash-err { background: var(--red-bg); color: #7f1d1d; }

.hint { font-size: 12.5px; color: var(--muted); }

/* ---------- Login ---------- */
.login-hero {
  text-align: center; padding: 30px 0 20px;
}
.login-crest { height: 110px; width: auto; filter: drop-shadow(0 4px 10px rgba(20,73,111,.25)); }
.login-hero h1 { margin: 10px 0 2px; font-size: 24px; }
.login-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.login-card { max-width: 420px; margin: 0 auto; }

/* ---------- Katalog-Zeilen ---------- */
.type-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-top: 1px solid var(--line);
}
.type-row:first-of-type { border-top: 0; }
.type-row .t-name { flex: 1; font-weight: 600; font-size: 14px; }
.type-row .t-amount { font-weight: 800; color: var(--blue-deep); white-space: nowrap; }

/* Häkchen "von Spielern selbst eintragbar" */
.self-toggle {
  display: inline-flex; align-items: center; gap: 5px; margin: 0;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; cursor: pointer;
  background: #eef1f4; color: var(--muted);
  border-radius: 999px; padding: 5px 11px 5px 8px;
  user-select: none; transition: background .15s, color .15s;
}
.self-toggle.on { background: var(--blue-bg); color: var(--blue-deep); }
.self-toggle input {
  width: 15px; height: 15px; margin: 0; flex: 0 0 auto; accent-color: var(--blue);
}

.footer {
  background: var(--ink-dark); color: #9aa5ad; font-size: 12px;
  text-align: center; padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  margin-top: auto;
}

/* ---------- Größere Screens ---------- */
@media (min-width: 640px) {
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .brand-text strong { font-size: 19px; }
  .brand-crest { height: 52px; }
}
