/* LSV Bergen 1990 – VereinsPilot | gemeinsames Stylesheet für Login und App */
:root {
  --ink: #152b26;
  --muted: #5d6f69;
  --line: #dfe6e3;
  --bg: #f2f5f4;
  --card: #fff;
  --green: #176e51;
  --green-dark: #10372e;
  --green-soft: #e7f3ee;
  --blue: #0b3166;
  --blue-soft: #e6edf7;
  --red: #9c2e21;
  --red-soft: #fff0ed;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.hidden { display: none !important; }
p { color: var(--muted); line-height: 1.5; font-size: 14px; }
h1 { font-size: 24px; margin: 8px 0 6px; }

/* ---------- Login ---------- */
body.login-page { display: grid; place-items: center; padding: 22px;
  background: linear-gradient(180deg, var(--blue) 0 210px, var(--bg) 210px); }
.login-card { width: min(100%, 440px); background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 12px 35px #10372e1f; padding: 28px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 56px; height: 56px; }
.brand .club { font-weight: 800; font-size: 17px; line-height: 1.2; }
.brand .sub { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
label { display: block; font-size: 13px; font-weight: 650; margin: 18px 0 7px; }
input { display: block; width: 100%; padding: 12px 13px; border: 1px solid #b9c9c2; border-radius: 9px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
input:focus { outline: 3px solid #c4e7dc; border-color: var(--green); }
.btn { display: inline-block; width: 100%; border: 0; border-radius: 9px; background: var(--green); color: #fff;
  padding: 13px; font: inherit; font-weight: 700; cursor: pointer; margin-top: 18px; text-align: center; }
.btn.secondary { background: #e9f0ed; color: #234a3d; }
.btn:disabled { opacity: .55; cursor: wait; }
.notice { font-size: 13px; border-radius: 9px; padding: 12px; margin: 16px 0 0; background: var(--blue-soft);
  color: #1d3b63; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice.error { background: var(--red-soft); color: var(--red); }
.notice.success { background: var(--green-soft); color: #16623e; }
.small { font-size: 12px; }
.meta { padding: 12px; background: #f3f6f5; border-radius: 9px; overflow-wrap: anywhere; font-size: 13px;
  line-height: 1.8; font-family: ui-monospace, Menlo, Consolas, monospace; }
.selectall { user-select: all; }
.qr { display: block; width: 210px; height: 210px; max-width: 100%; margin: 14px auto; border: 1px solid var(--line);
  border-radius: 9px; padding: 8px; background: #fff; }
footer { margin-top: 22px; color: #8a9a95; font-size: 11px; text-align: center; }

/* ---------- App ---------- */
body.no-scroll { overflow: hidden; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; height: 60px; padding: 8px 14px; background: var(--blue); color: #fff; }
.topbar .brand { color: #fff; text-decoration: none; }
.topbar .brand img { width: 38px; height: 38px; }
.topbar .club { font-size: 15px; }
.topbar .sub { color: #c7d3e6; }
.btn.ghost { width: auto; margin: 0; padding: 9px 14px; font-size: 14px; background: #ffffff1f; color: #fff; }
/* Menü (☰): Schublade von links, standardmäßig geschlossen */
.menu-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: #ffffff1f;
  cursor: pointer; display: grid; place-items: center; }
.menu-btn:hover { background: #ffffff33; }
.burger { display: grid; gap: 5px; width: 22px; }
.burger span { display: block; height: 2.5px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
body.menu-open .burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.topbar .brand { flex: 1; min-width: 0; }
.topbar .brand .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { position: fixed; top: 60px; left: 0; bottom: 0; z-index: 30; width: min(280px, 82vw);
  display: flex; flex-direction: column; gap: 4px; padding: 14px 10px; overflow-y: auto;
  background: var(--green-dark); box-shadow: 8px 0 30px #0004;
  transform: translateX(-105%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
body.menu-open .nav { transform: none; visibility: visible; transition: transform .22s ease; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 10px; color: #d7e8e1;
  text-decoration: none; font-weight: 650; font-size: 16px; }
.nav a:hover, .nav a:focus-visible { background: #ffffff14; outline: none; }
.nav a.active { background: #ffffff26; color: #fff; }
.nav-icon { width: 22px; text-align: center; }
.nav-backdrop { position: fixed; inset: 60px 0 0 0; z-index: 25; background: #0b1f1a66; opacity: 0;
  pointer-events: none; transition: opacity .2s; }
body.menu-open .nav-backdrop { opacity: 1; pointer-events: auto; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
.app-footer { text-align: center; color: #8a9a95; font-size: 11px; padding: 14px; }
@media (max-width: 760px) { .wrap { padding: 14px 12px 50px; } }
@media (prefers-reduced-motion: reduce) { .nav, .burger span, .nav-backdrop { transition: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.page-head .btn { width: auto; margin: 0; }
.section-title { font-size: 16px; margin: 22px 0 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .filters input[type=search] { width: auto; flex: 1 1 180px; padding: 10px 12px; border: 1px solid #b9c9c2;
  border-radius: 9px; font: inherit; font-size: 15px; background: #fff; color: var(--ink); }
.filters .check-label { flex: 1 1 100%; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: inherit; }
a.card.link { text-decoration: none; }
a.card.link:hover { border-color: var(--green); }
.card h2 { font-size: 16px; margin: 0 0 8px; }
.metric { font-size: 30px; font-weight: 800; color: var(--green); }
.cards { display: grid; gap: 8px; }
.cards.grid2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card.item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.card.item:hover { border-color: var(--green); }
.item-main { flex: 1; min-width: 0; }
.chevron { font-size: 26px; color: #9fb1aa; line-height: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  background: #eef2f0; color: #34524a; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.red { background: var(--red-soft); color: var(--red); }
.section { margin-top: 14px; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list li:first-child { border-top: 0; }
.muted { color: var(--muted); font-size: 13px; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }

/* Knöpfe */
.btn.small { width: auto; margin: 0; padding: 8px 12px; font-size: 13px; }
.btn.danger { background: var(--red); }
.btn.outline { background: transparent; border: 1px solid currentColor; }
.btn.danger.outline { color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.actions .btn { width: auto; margin: 0; }
.actions.inline { margin: 0; }
.actions.start { justify-content: flex-start; }
.actions .btn.danger.outline:first-child { margin-right: auto; }

/* Dialog */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: #0b1f1a8c; display: flex; align-items: flex-start;
  justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.modal { width: min(100%, 520px); background: var(--card); border-radius: 16px; box-shadow: 0 20px 60px #0005; }
.modal.wide { width: min(100%, 760px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); border-radius: 16px 16px 0 0; z-index: 1; }
.modal-head h2 { margin: 0; font-size: 18px; }
.icon-btn { border: 0; background: #eef2f0; width: 38px; height: 38px; border-radius: 50%; font-size: 16px; cursor: pointer; color: var(--ink); }
.modal-body { padding: 4px 18px 18px; }
.modal-body h3 { font-size: 15px; margin: 20px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.modal-body h3:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 560px) { .modal-bg { padding: 0; } .modal, .modal.wide { min-height: 100vh; border-radius: 0; } .modal-head { border-radius: 0; } }

/* Formulare */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full, .form-grid .field.full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field label { margin: 12px 0 5px; }
.field select, .inline-form select { display: block; width: 100%; padding: 12px 13px; border: 1px solid #b9c9c2;
  border-radius: 9px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.field input:disabled, .field select:disabled { background: #f1f4f3; color: #7d8d88; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin: 10px 0 4px; cursor: pointer; }
.check-label input { width: 20px; height: 20px; flex: none; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.checklist.scroll { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: 4px 10px; }
.checklist .check-label { font-weight: 500; }
.subsection { margin-top: 10px; }
.subsection h3 { font-size: 15px; margin: 20px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.stack { display: grid; gap: 8px; }
.contact { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.inline-form { margin-top: 12px; padding: 12px; border: 1px solid var(--green); border-radius: 12px; background: #f7fbf9; }
.inline-form h4 { margin: 0 0 4px; }
.confirm-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Meldung */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(20px); z-index: 80;
  max-width: calc(100% - 24px); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 8px 24px #0004; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

.mt-6 { margin-top: 6px; }
.card.nominated, .contact.nominated { border: 2px solid #31985e; background: #f1fbf4; }
.card .actions { margin-top: 12px; }

.contact.unread { border-color: var(--red); background: #fff8f6; }
.stat-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr 52px 44px; align-items: center; gap: 10px; }
.bar { height: 10px; background: #eef2f0; border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr 1fr 44px 40px; } }

/* ---------- Spieltage / Turniere ---------- */
.segmented { display: inline-flex; background: #e6ece9; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.segmented button { border: 0; background: none; padding: 8px 16px; border-radius: 8px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #0002; }
.tag.gold { background: #fff4d6; color: #8a6100; }
.games { margin-top: 10px; border-top: 1px solid var(--line); }
.game-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.games > .btn { margin-top: 10px; }
.game-title { flex: 1; min-width: 150px; font-weight: 600; font-size: 14px; }
.score-chip { font-weight: 800; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 8px; background: #eef2f0; }
.score-chip.win { background: var(--green-soft); color: var(--green); }
.score-chip.loss { background: var(--red-soft); color: var(--red); }
.score-chip.draw { background: #fff4d6; color: #8a6100; }
.score-chip.live { background: #fde8e8; color: #b42318; }
a.btn { text-decoration: none; display: inline-block; text-align: center; }

/* ---------- Live-Modus ---------- */
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start;
  grid-template-areas: "clock feld" "tore feld" "minuten feld"; grid-template-rows: auto auto 1fr; }
.live-grid > .card { margin: 0; }
.area-clock { grid-area: clock; } .area-feld { grid-area: feld; } .area-tore { grid-area: tore; } .area-minuten { grid-area: minuten; }
@media (max-width: 900px) {
  .live-grid { grid-template-columns: 1fr; grid-template-areas: "clock" "feld" "tore" "minuten"; gap: 10px; }
  .clock-card { padding: 12px; }
  .live-score { font-size: 42px; }
  .clock { font-size: 48px; margin-top: 2px; }
  .clock-buttons { margin-top: 10px; gap: 6px; }
  .clock-buttons .btn { padding: 11px 8px; font-size: 14px; }
  .btn.big { font-size: 18px; padding: 13px; }
}
.clock-card { text-align: center; background: #eaf6ef; }
.clock-card.finished { background: #f1f4f3; }
.live-teams { font-weight: 750; font-size: 16px; }
.live-score { font-size: clamp(44px, 12vw, 72px); font-weight: 850; color: #124d3d; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 4px 0; }
.clock { font-size: clamp(48px, 14vw, 80px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -2px; line-height: 1; margin-top: 8px; }
.jc-center { justify-content: center; }
.clock-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.clock-buttons .btn { margin: 0; width: 100%; }
.clock-buttons .btn.big { grid-column: 1 / -1; }
.btn.big { font-size: 20px; padding: 16px; }
.sync-badge { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 99px; background: #eef2f0; color: var(--muted); }
.sync-badge.ok { background: var(--green-soft); color: var(--green); }
.sync-badge.busy { background: #fff4d6; color: #8a6100; }
.sync-badge.offline { background: var(--red-soft); color: var(--red); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.inline-select select { padding: 6px 8px; border: 1px solid #b9c9c2; border-radius: 8px; font: inherit; background: #fff; }
.pitch { position: relative; aspect-ratio: 3 / 4; max-height: 600px; width: 100%; margin: 10px 0; border-radius: 12px; overflow: hidden;
  background: repeating-linear-gradient(0deg, #247a4d 0%, #247a4d 12.5%, #2a8553 12.5%, #2a8553 25%);
  border: 3px solid #fff; box-shadow: inset 0 0 0 2px #ffffffb3; touch-action: pan-y; }
.pitch-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pitch-player { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px;
  z-index: 2; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; min-width: 66px; border: 0; background: none; padding: 0; color: #fff; }
.pitch-player .shirt { display: grid; place-items: center; width: 46px; height: 46px; border: 2px solid #103b30; background: #fff; color: #103b30;
  border-radius: 50%; font-weight: 850; font-size: 17px; box-shadow: 0 3px 8px #062b2390; }
.pitch-player .pname { font-size: 11px; font-weight: 750; background: #103c31ed; border-radius: 6px; padding: 3px 5px; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitch-player.dragging { z-index: 15; opacity: .85; cursor: grabbing; }
.pitch-player:focus-visible, .bench-player:focus-visible { outline: 3px solid #f9c04a; outline-offset: 3px; }
.pitch .drop-indicator { position: absolute; inset: 0; pointer-events: none; border: 4px dashed transparent; border-radius: 9px; }
.pitch.drag-target .drop-indicator { border-color: #fce78b; }
.bench-drop { min-height: 80px; border: 2px dashed #bed6c9; border-radius: 12px; padding: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bench-drop.drag-target { background: #e2f4e8; border-color: #178354; }
.bench-player { display: flex; align-items: center; gap: 7px; border: 1px solid #c8dfd1; border-radius: 11px; background: #fff; padding: 10px 12px;
  font: inherit; font-weight: 700; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; color: var(--ink); }
.bench-player.dragging { opacity: .6; position: relative; z-index: 15; }
.bench-player .mini { display: grid; place-items: center; width: 26px; height: 26px; background: #e2f1e9; border-radius: 50%; font-size: 13px; }
@media (max-width: 520px) { .pitch-player .shirt { width: 40px; height: 40px; } .pitch-player .pname { font-size: 10px; } .pitch { aspect-ratio: 3 / 4.3; } }

/* ---------- Statistik ---------- */
.table-wrap { overflow-x: auto; padding: 6px 10px; }
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stats th, table.stats td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.stats th { font-size: 12px; color: var(--muted); font-weight: 700; }
table.stats .num { text-align: right; font-variant-numeric: tabular-nums; }
table.stats tr.highlight td { background: #f1fbf4; font-weight: 700; }
button.sort { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; }
button.sort.active { color: var(--green); }
.small-tag { font-size: 10px; padding: 1px 6px; margin-left: 6px; }

/* ---------- Fotos ---------- */
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center;
  background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 15px; }
.avatar.big { width: 84px; height: 84px; font-size: 26px; }
.foto-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.foto-box p { flex-basis: 100%; margin: 0; }
.row-start { display: flex; align-items: center; gap: 12px; }
.row-start h2 { margin: 0; }

/* ---------- Abmeldungen / Altersklasse ---------- */
.contact.disabled { background: #f3f5f4; border-style: dashed; color: #8a9a95; }
.contact.disabled b { color: #6d7d78; }
.contact.muted-row { background: #fdf6f5; }
.small-note { font-size: 12px; font-style: italic; }
.ak-info { background: var(--blue-soft); color: #1d3b63; padding: 8px 10px; border-radius: 8px; margin-top: 10px; font-size: 13px; }
