/* =========================================================================
 * style.css — modernes Design für Anzeige & Admin
 * ========================================================================= */
:root {
  --bg: #0f1729;
  --bg-2: #16213e;
  --surface: #1c2541;
  --surface-2: #243156;
  --border: #2e3d63;
  --text: #eef2ff;
  --text-dim: #9aa9d0;
  --primary: #3ddc84;
  --primary-dark: #29b86a;
  --accent: #ffd24a;
  --danger: #ff5d6c;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #1d2b50 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 80px;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand .logo {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 24px;
}
.brand .logo img { width: 48px; height: 48px; display: block; }
.brand h1 { font-size: 1.35rem; margin: 0; line-height: 1.1; }
.brand .sub { color: var(--text-dim); font-size: 0.82rem; margin-top: 2px; }

.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.club-logo { display: inline-flex; align-items: center; margin-left: 6px; }
.club-logo img { height: 44px; width: auto; display: block; }
.nav-link {
  text-decoration: none; color: var(--text-dim); font-weight: 600; font-size: 0.9rem;
  padding: 8px 12px; border-radius: 10px; border: 1px solid transparent;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--primary); }
.mode-badge {
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.mode-badge.cloud { color: var(--primary); border-color: var(--primary-dark); }
.save-status { font-size: 0.78rem; font-weight: 600; transition: opacity .2s ease; }
.save-status.dirty  { color: #e0a23c; }
.save-status.saving { color: var(--text-dim); }
.save-status.saved  { color: var(--primary); }

/* ---------- Verlauf / Änderungslog ---------- */
.history-list { display: flex; flex-direction: column; }
.hist-row {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.hist-row:last-child { border-bottom: none; }
.hist-when { color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 128px; }
.hist-action { font-weight: 600; flex: 1; min-width: 160px; }
.hist-tour { color: var(--text-dim); font-size: 0.82rem; }
.hist-who { color: var(--text-dim); font-size: 0.8rem; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:hover { background: #2a3a66; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #06210f; border-color: var(--primary-dark); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: #4a2730; }
.btn.danger:hover { background: rgba(255,93,108,.12); }
.btn.small { padding: 6px 11px; font-size: 0.8rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .12s ease;
}
.tab:hover { transform: translateY(-1px); }
.tab:active { transform: translateY(0); }
.tab.active { background: var(--primary); color: #06210f; border-color: var(--primary-dark); }

/* Gleitender Tab-Indikator */
.tabs.has-glider { position: relative; }
.tabs.has-glider .tab { background: transparent; border-color: transparent; z-index: 1; }
.tabs.has-glider .tab.active { background: transparent; border-color: transparent; }
.tab-glider {
  position: absolute; left: 0; top: 0; height: 100%; z-index: 0;
  background: var(--primary); border-radius: 999px; box-shadow: var(--shadow-sm);
  opacity: 0; pointer-events: none; will-change: transform, width;
  transition: transform .32s var(--ease), width .32s var(--ease), height .15s var(--ease), opacity .2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .tab-glider { transition: opacity .2s ease; }
}

/* Sanfter Einblende-Übergang beim Tab-/Beamer-Wechsel */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-page.page-enter { animation: pageEnter .35s cubic-bezier(.22, .61, .36, 1); }
@media (prefers-reduced-motion: reduce) {
  .tab-page.page-enter { animation: none; }
}
.main-tabs { margin-bottom: 20px; }
.main-tab { font-size: 0.98rem; padding: 11px 20px; }

/* ---------- Cards / Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.panel h2 { margin: 0 0 4px; font-size: 1.1rem; }
.panel .hint { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 16px; }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea, .styled-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus, .styled-input:focus { outline: 2px solid var(--primary); outline-offset: 0; }
.check-label { display: flex; align-items: center; gap: 9px; font-size: 0.95rem; color: var(--text); font-weight: 600; cursor: pointer; }
.check-label input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); cursor: pointer; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

/* ---------- Group editor ---------- */
.group-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.group-card .group-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.group-card .group-head input { font-weight: 700; }
.group-card .group-head .g-name { flex: 1; min-width: 0; }
.team-row .styled-input { min-width: 0; }
.team-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.team-row input { flex: 1; }
.team-row .drag { color: var(--text-dim); cursor: grab; font-size: 0.8rem; user-select: none; }
.team-row .drag:active { cursor: grabbing; }
.team-row.dragging { opacity: .5; }
.team-row.drop-target { outline: 2px dashed var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- QR-Code (Admin) ---------- */
.qr-box { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.qr-box img { background: #fff; border-radius: 10px; padding: 6px; flex: 0 0 auto; }

/* ---------- Kategorie-Editor ---------- */
.cat-edit { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cat-edit .cat-name { flex: 1; }
.cat-edit .pill { flex: 0 0 auto; }

/* ---------- Event-/Inselifest-Editor ---------- */
.ev-item { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.ev-item .ev-time { flex: 0 0 120px; }
.ev-item .ev-text { flex: 1; min-width: 150px; }
.ev-item .ev-tour { flex: 0 0 190px; }
@media (max-width: 600px) { .ev-item .ev-time, .ev-item .ev-text, .ev-item .ev-tour { flex: 1 1 100%; } }

/* ---------- Table (standings) ---------- */
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
table.standings, table.matches {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.standings th, .standings td, .matches th, .matches td {
  padding: 10px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.standings th { color: var(--text-dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .03em; }
.standings td.team, .standings th.team { text-align: left; font-weight: 600; }
.standings td.pts { font-weight: 800; color: var(--primary); }
.standings tr td.rank { color: var(--text-dim); width: 30px; }
.standings tr.qualify td.rank { color: var(--primary); }
.standings tr.qualify { background: rgba(61,220,132,.06); }
/* Teams, die nur ins Spiel um Platz 3 kommen (nicht ins Finale): Akzentfarbe */
.standings tr.qualify.third td.rank { color: var(--accent); }
.standings tr.qualify.third { background: rgba(255,210,74,.07); }
.rank-badge {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface-2); font-size: 0.78rem; font-weight: 700;
}
.qualify .rank-badge { background: var(--primary); color: #06210f; }
.qualify.third .rank-badge { background: var(--accent); color: #3a2c00; }

/* ---------- Match list ---------- */
.match {
  display: grid;
  grid-template-columns: 64px 1fr auto 1fr 70px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-2);
  margin-bottom: 10px;
}
.match .time { color: var(--text-dim); font-size: 0.82rem; line-height: 1.2; }
.match .time .field { display: block; color: var(--accent); font-weight: 600; font-size: 0.74rem; }
.match .home { text-align: right; font-weight: 600; }
.match .away { text-align: left; font-weight: 600; }
.match .home.win, .match .away.win { color: var(--primary); }
.match .score { text-align: center; font-weight: 800; min-width: 64px; }
.match .score .vs { color: var(--text-dim); font-weight: 600; }
.match .badge { font-size: 0.7rem; color: var(--text-dim); text-align: right; }
.match .badge-inline { display: none; }
.match.live { border-color: var(--primary-dark); }

/* Drag & Drop (Admin) */
.match.editable { grid-template-columns: 24px 64px 1fr auto 1fr 70px; }
.drag-handle {
  cursor: grab; color: var(--text-dim); font-size: 1.1rem; line-height: 1;
  align-self: center; user-select: none; text-align: center;
}
.drag-handle:active { cursor: grabbing; }
.match.dragging { opacity: .5; }
.match.drop-target { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.hint .grip { color: var(--text-dim); }
.lane-drop {
  border: 1.5px dashed var(--border); border-radius: 12px;
  padding: 14px; margin-bottom: 10px; text-align: center;
  color: var(--text-dim); font-size: 0.82rem; background: transparent;
}
.lane-drop.drop-target { border-color: var(--primary); color: var(--primary); background: rgba(61,220,132,.06); }

.score-input { display: flex; gap: 6px; align-items: center; justify-content: center; }
.score-input input {
  width: 46px; padding: 7px 6px; text-align: center;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: 1rem;
}
.score-input .sep { color: var(--text-dim); }

.section-label {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim); margin: 26px 0 12px; font-weight: 700;
}

.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.team-filter {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-weight: 600; font-size: 0.9rem;
  max-width: 240px;
}

/* ---------- Bracket / Finals ---------- */
.bracket { display: flex; gap: 26px; overflow-x: auto; padding-bottom: 8px; }
.bracket-round { min-width: 230px; }
.bracket-round h3 { font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 12px; }
.bracket-match {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; margin-bottom: 14px;
}
.bracket-match .bm-label { font-size: 0.72rem; color: var(--accent); margin-bottom: 8px; font-weight: 700; text-transform: uppercase; }
.bracket-match .bm-meta { color: var(--text-dim); font-weight: 600; text-transform: none; }
.bracket-team { display: flex; justify-content: space-between; padding: 6px 4px; font-weight: 600; }
.bracket-team .sc { color: var(--text-dim); font-weight: 800; }
.bracket-team.win { color: var(--primary); }
.bracket-team.win .sc { color: var(--primary); }
.bracket-team.placeholder { color: var(--text-dim); font-weight: 500; font-style: italic; }

/* ---------- Finals-Layout + Siegerpodest ---------- */
.finals-layout { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.finals-layout .bracket { flex: 1 1 320px; min-width: 0; }
.podium, .final-rank { flex: 0 0 230px; }
.final-rank .rank-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 9px;
}
.final-rank .rmedal { font-size: 1.4rem; line-height: 1; }
.final-rank .rpos { font-weight: 800; color: var(--text-dim); width: 22px; }
.final-rank .rname { font-weight: 700; }
.final-rank .rank-row.r1 { border-color: #e7b62f; }
.final-rank .rank-row.placeholder .rname { color: var(--text-dim); font-weight: 500; font-style: italic; }
.podium-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); font-weight: 700; margin-bottom: 16px; }
.podium-stand { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.podium-col { display: flex; flex-direction: column; align-items: center; width: 68px; }
.podium-col .who {
  font-size: 0.82rem; font-weight: 700; text-align: center; line-height: 1.15;
  margin-bottom: 8px; min-height: 2.6em; display: flex; align-items: flex-end; justify-content: center;
  word-break: break-word;
}
.podium-col .who.placeholder { color: var(--text-dim); font-weight: 500; font-style: italic; }
.podium-col .step {
  width: 100%; border-radius: 9px 9px 0 0; display: grid; place-items: center;
  font-weight: 800; font-size: 1.3rem; color: #06210f;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
}
.podium-col.p1 .step { height: 96px; background: linear-gradient(180deg, #ffe27a, #e7b62f); }
.podium-col.p2 .step { height: 70px; background: linear-gradient(180deg, #e2e8f1, #aab6c6); }
.podium-col.p3 .step { height: 52px; background: linear-gradient(180deg, #efb277, #cd8b46); }
@media (max-width: 640px) { .podium { flex-basis: 100%; margin-top: 18px; } }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 50px 20px; color: var(--text-dim);
}
.empty .big { font-size: 2.4rem; margin-bottom: 10px; }

/* ---------- Skeleton (Ladezustand) ---------- */
.skel-card { opacity: .85; }
.skel-line {
  height: 14px; border-radius: 7px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--surface-2) 25%, #2c3c66 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: skel 1.4s ease infinite;
}
.skel-line:last-child { margin-bottom: 0; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 48px));
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow);
  transition: transform .25s ease, opacity .25s ease; z-index: 50; font-weight: 600;
  opacity: 0; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.ok { border-color: var(--primary-dark); }
.toast.err { border-color: var(--danger); }

/* ---------- Lock screen ---------- */
.lock { max-width: 380px; margin: 80px auto; }

/* ---------- Misc ---------- */
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.gen-info { color: var(--text-dim); font-size: 0.85rem; }
.muted { color: var(--text-dim); }
.spacer { height: 10px; }
.center { text-align: center; }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); font-size: 0.74rem; color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ---------- Turnier-Leiste (Admin) ---------- */
.tournament-bar { padding: 14px 18px; }
.tbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; }
.tbar-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); font-weight: 700; }
.tbar-left select {
  flex: 1; max-width: 360px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  font-size: 0.95rem; font-weight: 600;
}
.tbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-link {
  margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--text-dim);
}
.share-link code {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; color: var(--primary); font-size: 0.82rem;
  max-width: 100%; overflow: auto; white-space: nowrap;
}

/* ---------- Social-Share (schlanke weiße Icons, neben den Tabs) ---------- */
.tab-share { margin-left: auto; display: flex; align-items: center; gap: 0; }
.tab-share .share-lbl { color: var(--text-dim); font-weight: 600; font-size: 0.85rem; margin-right: 6px; }
.share-btn {
  width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent;
  color: #fff; opacity: .85; cursor: pointer; padding: 0;
  display: inline-grid; place-items: center; text-decoration: none;
  transition: opacity .15s ease, background .15s ease;
}
.share-btn svg { width: 21px; height: 21px; fill: currentColor; }
.share-btn:hover { opacity: 1; background: var(--surface-2); }
@media (max-width: 768px) {
  .tab-share { flex: 1 0 100%; margin-left: 0; margin-top: 8px; justify-content: flex-start; }
}

/* ---------- Turnier-Übersicht (Besucher) ---------- */
.t-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .t-list { grid-template-columns: 1fr; } }
.t-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .15s ease, background .15s ease;
}
.t-card:hover { transform: translateY(-4px); border-color: var(--primary-dark); background: var(--surface-2); box-shadow: var(--shadow-lg); }
.t-card:active { transform: translateY(-1px); }
.t-card .go { transition: transform .2s var(--ease); }
.t-card:hover .go { transform: translateX(3px); }
.t-card .t-card-name { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.t-card .t-card-meta { color: var(--text-dim); font-size: 0.86rem; margin-bottom: 14px; }
.t-card .t-card-foot { display: flex; align-items: center; justify-content: space-between; }
.t-card .status {
  font-size: 0.74rem; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim);
}
.t-card .status.live { color: var(--primary); border-color: var(--primary-dark); }
.t-card .status.done { color: var(--accent); border-color: #5a4d1e; }
.t-card .go { color: var(--primary); font-weight: 700; font-size: 0.9rem; }

/* ---------- Info-Leiste (Reglement / Anmeldung) ---------- */
.info-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.info-text { margin: 0 0 14px; color: var(--text); line-height: 1.6; }

/* PAUSE-Banner im Spielplan */
.pause-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 10px 16px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(255, 210, 74, 0.08);
}
.pause-row .pause-label {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.pause-row .pause-time,
.pause-row .pause-dur { color: var(--text-dim); font-size: 0.85rem; font-weight: 600; }
body.kiosk .pause-row .pause-label { font-size: 1.6rem; }

/* Pausen-Editor (Admin) */
.break-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.break-row .brk-time { width: 130px; flex: 0 0 auto; }
.break-row .brk-min { width: 100px; flex: 0 0 auto; }
.break-row .brk-label { flex: 1 1 160px; min-width: 140px; }

/* Aufklappbares Panel (z.B. Anfahrt) – zugeklappt by default */
.collapsible > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary::after {
  content: "▸";
  color: var(--text-dim);
  transition: transform .2s ease;
}
.collapsible[open] > summary::after { transform: rotate(90deg); }
.collapsible-body { margin-top: 14px; }

/* Eingebettete Karte (Anfahrt) – responsiv 16:9 */
.map-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Live / Beamer ---------- */
.live-block { border-width: 1px; }
.live-block.now { border-color: var(--primary-dark); box-shadow: 0 0 0 2px rgba(61,220,132,.25) inset, var(--shadow); }
.live-head {
  font-size: 1.1rem; font-weight: 800; margin-bottom: 16px;
  display: inline-flex; align-items: center; gap: 10px;
}
.live-block.now .live-head::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 4px rgba(61,220,132,.25);
  animation: livepulse 1.6s ease-in-out infinite;
}
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.live-match {
  display: grid; grid-template-columns: 90px 1fr 130px 1fr 120px;
  align-items: center; gap: 12px; padding: 16px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); margin-bottom: 12px;
}
.live-match .lm-field { color: var(--accent); font-weight: 800; font-size: 1rem; }
.live-match .lm-team { font-size: 1.5rem; font-weight: 800; }
.live-match .lm-team.home { text-align: right; }
.live-match .lm-team.away { text-align: left; }
.live-match .lm-score { text-align: center; font-size: 1.6rem; font-weight: 800; }
.live-match .lm-score .vs { color: var(--text-dim); font-weight: 600; }
.live-match .lm-badge { text-align: right; color: var(--text-dim); font-size: 0.85rem; }
.live-block.next .live-match .lm-team { font-size: 1.2rem; }
@media (max-width: 720px) {
  .live-match { grid-template-columns: 60px 1fr auto 1fr; }
  .live-match .lm-badge { display: none; }
  .live-match .lm-team { font-size: 1.1rem; }
}

/* ---------- Beamer-/Kiosk-Modus ---------- */
body.kiosk .app-header,
body.kiosk #viewTabs,
body.kiosk #infoBar,
body.kiosk .site-footer { display: none !important; }
body.kiosk { overflow: hidden; }
body.kiosk .container { max-width: 100%; padding: 0; }
body.kiosk #detail .tab-page {
  padding: 104px 34px 34px;
  box-sizing: border-box;
  height: 100vh;
  overflow: hidden;
}
body.kiosk #detail .tab-page > * { transform-origin: top center; }
body.kiosk .panel { padding: 26px 30px; margin-bottom: 22px; }
body.kiosk h2 { font-size: 1.9rem; }
body.kiosk .section-label { font-size: 1rem; }
/* Tabellen groß */
body.kiosk .standings td, body.kiosk .standings th { padding: 14px 12px; font-size: 1.5rem; }
body.kiosk .standings th { font-size: 1rem; }
body.kiosk .rank-badge { width: 32px; height: 32px; font-size: 1.15rem; }
/* Live groß */
body.kiosk .live-match { padding: 22px 18px; }
body.kiosk .live-match .lm-team { font-size: 2.4rem; }
body.kiosk .live-match .lm-score { font-size: 2.6rem; }
body.kiosk .live-match .lm-field { font-size: 1.3rem; }
body.kiosk .live-head { font-size: 1.7rem; }
/* Finalbaum groß */
body.kiosk .bracket-team { font-size: 1.4rem; padding: 10px 6px; }
body.kiosk .final-rank .rname { font-size: 1.3rem; }
body.kiosk .final-rank .rmedal { font-size: 1.9rem; }

#kioskBar {
  position: fixed; top: 0; left: 0; right: 0; height: 84px; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; background: var(--bg-2); border-bottom: 1px solid var(--border);
}
#kioskBar .kb-title { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
#kioskBar .kb-sub { color: var(--text-dim); font-size: 1rem; margin-top: 2px; }
#kioskBar .kb-right { display: flex; align-items: center; gap: 14px; }
#kioskBar .kb-scan { text-align: right; color: var(--text-dim); font-size: 0.95rem; font-weight: 600; line-height: 1.2; }
#kioskBar .kb-qr { background: #fff; border-radius: 8px; padding: 4px; width: 66px; height: 66px; }
.kiosk-exit { position: fixed; bottom: 14px; right: 16px; z-index: 101; opacity: .45; }
.kiosk-exit:hover { opacity: 1; }

/* ---------- Footer / Impressum ---------- */
.site-footer {
  margin-top: 50px; padding: 26px 0 10px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.85rem; line-height: 1.6;
}
.site-footer .foot-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer h4 { margin: 0 0 6px; color: var(--text); font-size: 0.92rem; }
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .foot-logo img { height: 54px; opacity: .9; }

/* ---------- Flyer / Inselifest ---------- */
@font-face {
  font-family: "FreeFatFont";
  src: url("../assets/fonts/FREEFATFONT-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
.flyer {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, #51637f 0%, #3f5274 55%, #354864 100%);
  box-shadow: var(--shadow); margin-bottom: 26px;
  padding: 48px 40px 36px; min-height: 360px;
  display: flex; flex-direction: column; justify-content: center;
}
.flyer .flyer-logo { position: absolute; top: 26px; right: 30px; }
.flyer .flyer-logo img { height: 72px; opacity: .95; }
.flyer .flyer-title {
  font-family: "FreeFatFont", "Anton", Impact, "Arial Narrow", sans-serif;
  color: #fff; text-transform: uppercase; line-height: .78;
  font-size: clamp(64px, 13vw, 150px); letter-spacing: 1px; margin: 0;
}
.flyer .flyer-date {
  color: #fff; font-weight: 800; font-size: clamp(22px, 4vw, 40px);
  margin: 22px 0 4px; letter-spacing: .5px;
}
.flyer .flyer-loc { color: #e7ecf5; font-size: clamp(15px, 2vw, 20px); font-weight: 600; }
.flyer .flyer-title, .flyer .flyer-date, .flyer .flyer-loc { position: relative; z-index: 2; }
.flyer-photo {
  position: absolute; right: -8px; bottom: 0;
  height: 96%; width: auto; max-width: 52%;
  object-fit: contain; object-position: bottom right;
  pointer-events: none; user-select: none; z-index: 1;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .28));
}
@media (max-width: 620px) {
  .flyer-photo { height: 56%; max-width: 46%; }
}
.flyer .flyer-ball {
  position: absolute; right: -30px; bottom: -40px; width: 220px; height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0%, #f0f0f0 55%, #d9d9d9 100%);
  box-shadow: inset -16px -16px 40px rgba(0,0,0,.18);
  opacity: .9;
}
@media (max-width: 620px) { .flyer .flyer-ball { display: none; } .flyer { padding: 36px 24px; } .flyer .flyer-logo img { height: 52px; } }

/* Programm */
.program-day { margin-bottom: 22px; }
.program-day h3 {
  margin: 0 0 12px; font-size: 1.05rem; color: var(--text);
  border-left: 3px solid var(--primary); padding-left: 10px;
}
.program-item {
  display: flex; gap: 14px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.program-item .time {
  flex: 0 0 78px; color: var(--accent); font-weight: 800; font-size: 0.95rem;
}
.program-item .what { flex: 1; }
.program-item .what a { color: var(--primary); font-weight: 600; }
.prog-link {
  display: inline-block; margin-left: 10px; color: var(--primary); font-weight: 600;
  font-size: 0.85rem; text-decoration: none; border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px;
}
.prog-link:hover { background: var(--surface-2); }
.program-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Mobile-Optimierung ---------- */
@media (max-width: 560px) {
  .container { padding: 16px 14px 60px; }

  /* Spielplan: kompakter, Gruppe unter dem Feld */
  .match { grid-template-columns: 56px 1fr auto 1fr; font-size: 0.9rem; padding: 10px 10px; gap: 7px; }
  .match .badge { display: none; }
  .match .badge-inline { display: block; color: var(--text-dim); font-size: 0.66rem; margin-top: 3px; line-height: 1.1; }
  .match .time { font-size: 0.72rem; }
  .match .home, .match .away { font-size: 0.9rem; }
  .match .score { min-width: 46px; font-size: 0.95rem; }
  .sched-head .team-filter { max-width: 100%; width: 100%; }

  /* Live: kleinere Schrift */
  .live-match { grid-template-columns: 46px 1fr auto 1fr; gap: 8px; padding: 11px 9px; }
  .live-match .lm-field { font-size: 0.78rem; }
  .live-match .lm-team { font-size: 1rem; }
  .live-match .lm-score { font-size: 1.05rem; }
  .live-block.next .live-match .lm-team { font-size: 0.92rem; }
  .live-head { font-size: 1rem; }

  /* Inselifest: Anmeldung/Reglement unter den Text */
  .t-links { display: block; margin-top: 6px; }
  .prog-link { margin-left: 0; margin-right: 8px; }

  /* Tabellen kompakter, damit sie ohne Überlauf in 100% passen */
  .standings th, .standings td { padding: 7px 4px; font-size: 0.8rem; }
  .standings td.team, .standings th.team { font-size: 0.8rem; }
  .standings th { font-size: 0.66rem; letter-spacing: 0; }
  .rank-badge { width: 18px; height: 18px; font-size: 0.68rem; }
  .panel { padding: 16px 14px; }
}

/* ---------- Anzeige (Beamer) ---------- */
body.display .container { max-width: 1320px; }
body.display .match { font-size: 1.05rem; }

/* ---------- Bezahlt (Admin) ---------- */
.pay-config {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 18px;
}
.pay-config label { font-weight: 600; }
.pay-config input { width: 130px; }
.pay-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pay-summary .pill-open { background: rgba(229, 160, 60, .18); color: #e0a23c; }
.pay-summary .pill-done { background: rgba(60, 200, 130, .18); color: #46c88a; }
.pay-group { margin-bottom: 18px; }
.pay-group-name { font-weight: 700; margin: 4px 0 8px; color: var(--text); }
.pay-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; transition: background .15s, border-color .15s;
}
.pay-row:hover { border-color: var(--primary); }
.pay-row input.pay-check { width: 20px; height: 20px; flex: 0 0 auto; cursor: pointer; accent-color: var(--primary); }
.pay-row .pay-team { flex: 1; font-weight: 600; }
.pay-amount-wrap { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; color: var(--text-dim); font-size: .9rem; }
.pay-amount-wrap input.pay-amount { width: 80px; text-align: right; }
.pay-row .pay-status { font-size: .85rem; color: #e0a23c; font-weight: 600; min-width: 190px; text-align: right; }
.pay-row.paid { background: rgba(60, 200, 130, .1); border-color: rgba(60, 200, 130, .4); }
.pay-row.paid .pay-status { color: #46c88a; }
