:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --primary: #466E6E;
  --border: #dbe3ee;
  --danger: #9f1239;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 800; color: var(--text); }
nav { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.container { width: min(920px, 100%); margin: 0 auto; padding: 20px 14px 50px; }
h1 { font-size: clamp(26px, 7vw, 42px); margin: 8px 0 8px; }
.muted { color: var(--muted); }
.card, .match-card, .ranking-row {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 22px;
}
.intro { padding: 22px; }
.form { display: grid; gap: 14px; margin-top: 18px; }
.form-card { padding:22px; }
label { display: grid; gap: 7px; font-weight: 650; }
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 16px;
  background: #fff;
}
input:disabled { background: #eef2f7; color: #64748b; }
button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}
button:active { transform: translateY(1px); }
.magic-link { word-break: break-all; font-weight: 700; }
.flash {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #e9f7ef;
  color: #14532d;
  border: 1px solid #bbf7d0;
}
.match-list { display: grid; gap: 14px; margin-top: 18px; }
.match-card { padding: 16px; }
.match-card.locked { opacity: .82; }
.match-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.tip-form { display: grid; gap: 8px; }
.team-row {
  display: grid;
  grid-template-columns: 1fr 76px;
  align-items: center;
  gap: 12px;
}
.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag {
  width: 34px;
  height: 24px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.versus { text-align: right; padding-right: 30px; font-weight: 900; color: var(--muted); }
.match-footer { margin-top: 12px; display: flex; justify-content: flex-end; color: var(--muted); font-weight: 650; }
.match-footer button { width: 100%; }
.ranking { display: grid; gap: 12px; margin-top: 18px; }
.ranking-row { padding: 16px; display: grid; gap: 3px; }
.ranking-row span { font-size: 20px; font-weight: 900; color: var(--primary); }
.ranking-row small { color: var(--muted); }
.admin-result-form { display: grid; grid-template-columns: 72px auto 72px; align-items: center; gap: 9px; }
.admin-result-form button { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .match-footer button { width: auto; }
  .admin-result-form { grid-template-columns: 80px auto 80px 1fr; }
  .admin-result-form button { grid-column: auto; justify-self: end; }
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.group-card,
.empty-state,
.admin-form,
.compact-list {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.group-card h2 {
    margin-top: 0;
    font-size: 1.1rem;
}
.team-list {
    display: grid;
    gap: .75rem;
}
.team-list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.team-list-item small {
    display: block;
    color: #64748b;
    margin-top: .1rem;
}
.admin-form {
    display: grid;
    gap: .9rem;
    margin: 1rem 0 1.5rem;
}
.admin-form label {
    display: grid;
    gap: .35rem;
    font-weight: 700;
}
.admin-form input,
.admin-form select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: .65rem .75rem;
    font: inherit;
    background: #fff;
}
.compact-list {
    display: grid;
    gap: .7rem;
}
.compact-row {
    display: grid;
    gap: .15rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: .7rem;
}
.compact-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.compact-row span,
.compact-row small {
    color: #64748b;
}
.empty-state {
    text-align: center;
}


.grouped-match-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.1rem;
}
.match-group {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.match-group summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem;
    font-weight: 900;
}
.match-group summary::-webkit-details-marker { display: none; }
.match-group summary::before {
    content: "▾";
    margin-right: .25rem;
    color: var(--primary);
}
.match-group:not([open]) summary::before { content: "▸"; }
.match-group .match-list {
    margin: 0;
    padding: 0 1rem 1rem;
}
.match-group .match-card {
    box-shadow: none;
}
.group-progress {
    border-radius: 999px;
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}
.group-progress.complete { background: #dcfce7; color: #166534; }
.group-progress.attention { background: #fef3c7; color: #92400e; }
.group-progress.neutral { background: #e2e8f0; color: #475569; }
.status-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: -.35rem 0 .85rem;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .28rem .6rem;
    font-size: .78rem;
    font-weight: 900;
}
.status-pill.open { background: #fee2e2; color: #991b1b; }
.status-pill.tipped { background: #dcfce7; color: #166534; }
.status-pill.closed-tipped { background: #e0f2fe; color: #075985; }
.status-pill.missing { background: #f1f5f9; color: #475569; }
.status-pill.done { background: #ede9fe; color: #5b21b6; }
.own-tip {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 750;
}
.status-open {
    border-color: #fecaca;
}
.status-tipped {
    border-color: #bbf7d0;
}
@media (max-width: 430px) {
    .match-group summary {
        align-items: flex-start;
        flex-direction: column;
    }
    .group-progress {
        width: fit-content;
    }
}

/* v7: Gruppen-Statistik */
.group-tables {
  display: grid;
  gap: 18px;
}
.group-table-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}
.group-table-card h2 {
  margin: 0 0 12px;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 690px;
}
.standings-table th,
.standings-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  white-space: nowrap;
}
.standings-table th {
  font-size: 12px;
  color: #6b7280;
  font-weight: 700;
  text-transform: uppercase;
}
.standings-table .team-col {
  text-align: left;
  min-width: 230px;
}
.standings-table .rank-col {
  width: 38px;
}
.standing-team {
  display: flex;
  align-items: center;
  gap: 10px;
}
.standing-team small {
  display: block;
  color: #6b7280;
  margin-top: 2px;
}
.qualified-row {
  background: linear-gradient(90deg, rgba(70,110,110,.10), transparent 70%);
}
.group-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: #6b7280;
}

/* v7: K.O.-Bracket */
.empty-state {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 20px;
  color: #475569;
}
.bracket-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 18px;
}
.bracket-grid {
  display: grid;
  grid-template-columns: repeat(var(--stage-count), minmax(260px, 1fr));
  gap: 28px;
  min-width: max-content;
  align-items: start;
}
.bracket-stage h2 {
  font-size: 16px;
  margin: 0 0 14px;
  color: #111827;
}
.bracket-games {
  display: grid;
  gap: 16px;
}
.bracket-games-8 { gap: 26px; padding-top: 28px; }
.bracket-games-4 { gap: 58px; padding-top: 84px; }
.bracket-games-2 { gap: 150px; padding-top: 190px; }
.bracket-games-1 { padding-top: 350px; }
.bracket-match {
  position: relative;
  min-width: 260px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}
.bracket-time {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 10px;
}
.bracket-team {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-weight: 700;
}
.bracket-team span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flag-placeholder {
  width: 24px;
  height: 24px;
  display: inline-block;
  border-radius: 50% 50% 45% 45%;
  background: #cbd5e1;
}
.admin-match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.admin-match-grid input[type="text"] {
  margin-top: 8px;
}
.admin-list {
  display: grid;
  gap: 10px;
}
.admin-list-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
}
.admin-list-item span {
  display: block;
  color: #6b7280;
  font-size: 13px;
  margin-top: 3px;
}

@media (max-width: 720px) {
  .group-table-card {
    padding: 14px 10px;
  }
  .bracket-grid {
    grid-template-columns: repeat(var(--stage-count), 250px);
    gap: 18px;
  }
  .bracket-match {
    min-width: 250px;
  }
  .admin-match-grid {
    grid-template-columns: 1fr;
  }
}

/* v8: ausgerichtetes Bracket + Spielbearbeitung */
.bracket-grid-aligned {
  grid-template-columns: repeat(var(--stage-count), minmax(230px, 250px));
  gap: 24px;
  align-items: start;
}
.bracket-stage {
  min-width: 230px;
}
.bracket-stage h2 {
  min-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bracket-lane {
  display: grid;
  grid-template-rows: repeat(var(--bracket-rows), 38px);
  min-height: calc(var(--bracket-rows) * 38px);
  position: relative;
}
.bracket-lane .bracket-match {
  align-self: center;
  min-width: 0;
}
.bracket-lane .bracket-match::after {
  content: "";
  position: absolute;
  right: -25px;
  top: 50%;
  width: 25px;
  border-top: 1px solid #cbd5e1;
  opacity: .75;
}
.bracket-stage:last-child .bracket-match::after {
  display: none;
}
.bracket-edit {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #466e6e;
  text-decoration: none;
  font-weight: 700;
}
.bracket-edit:hover,
.admin-edit-link:hover,
.button-secondary:hover {
  text-decoration: underline;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.button-secondary,
.admin-edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid #dbe3ec;
}
.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.admin-list-item > div {
  min-width: 0;
}
.admin-list-item strong {
  display: block;
}
@media (max-width: 720px) {
  .bracket-grid-aligned {
    grid-template-columns: repeat(var(--stage-count), 220px);
    gap: 18px;
  }
  .bracket-lane {
    grid-template-rows: repeat(var(--bracket-rows), 34px);
    min-height: calc(var(--bracket-rows) * 34px);
  }
  .bracket-lane .bracket-match::after {
    right: -19px;
    width: 19px;
  }
  .admin-list-item {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v9: Bracket-Korrektur
   Die Karten der Runde der 32 waren zu dicht auf einem zu kleinen Grid.
   Größere Grid-Zeilen + top-align verhindern Überlappungen und halten den Bearbeiten-Link sichtbar. */
.bracket-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0 0 24px;
}
.bracket-grid-aligned {
  grid-template-columns: repeat(var(--stage-count), minmax(280px, 300px));
  gap: 42px;
  align-items: start;
  padding: 0 18px 28px 0;
}
.bracket-stage {
  min-width: 280px;
  overflow: visible;
}
.bracket-stage h2 {
  position: sticky;
  left: 0;
  z-index: 2;
  min-height: 30px;
  margin-bottom: 14px;
  padding-bottom: 2px;
  overflow: visible;
  text-overflow: clip;
}
.bracket-lane {
  grid-template-rows: repeat(var(--bracket-rows), 70px);
  min-height: calc(var(--bracket-rows) * 70px);
  overflow: visible;
}
.bracket-lane .bracket-match {
  align-self: start;
  width: 100%;
  min-width: 0;
  z-index: 1;
  box-sizing: border-box;
}
.bracket-lane .bracket-match::after {
  right: -43px;
  width: 43px;
}
.bracket-edit {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: 10px;
}
@media (max-width: 720px) {
  .bracket-grid-aligned {
    grid-template-columns: repeat(var(--stage-count), 260px);
    gap: 28px;
  }
  .bracket-stage {
    min-width: 260px;
  }
  .bracket-lane {
    grid-template-rows: repeat(var(--bracket-rows), 66px);
    min-height: calc(var(--bracket-rows) * 66px);
  }
  .bracket-lane .bracket-match::after {
    right: -29px;
    width: 29px;
  }
}

.result-reset-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.result-reset-row p {
  margin: 0;
}
.button-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.button-danger:hover {
  background: #fecaca;
}

/* v11: Drittplatzierte / Qualifikationsstatus */
.third-place-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  margin: 20px 0 24px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}
.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-heading-row h2 {
  margin: 0 0 4px;
}
.small-text {
  font-size: 13px;
}
.status-pill.success {
  background: #dcfce7;
  color: #166534;
}

.status-pill.pending {
  background: #f1f5f9;
  color: #475569;
}
.empty-state-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #475569;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.45;
}
.qualification-badge.pending {
  background: #f8fafc;
  color: #64748b;
}
.third-qualified-row {
  background: linear-gradient(90deg, rgba(244, 167, 167, .16), transparent 70%);
}
.qualification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.qualification-badge.qualified-direct {
  background: #dbeafe;
  color: #1d4ed8;
}
.qualification-badge.qualified-third {
  background: #fce7f3;
  color: #be185d;
}
.qualification-badge.not-qualified {
  background: #f1f5f9;
  color: #475569;
}
.third-place-table {
  min-width: 760px;
}
@media (max-width: 720px) {
  .section-heading-row {
    flex-direction: column;
  }
  .third-place-card {
    padding: 14px;
    margin-top: 16px;
  }
}

/* v14: Treffer-Feedback & finale Feier */
.match-card.result-wrong {
  border-color: var(--border);
}
.match-card.result-tendency {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, #cbd5e1, #22c55e, #e5e7eb) border-box;
  box-shadow: 0 10px 28px rgba(34, 197, 94, .12);
}
.match-card.result-exact {
  position: relative;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    conic-gradient(from var(--rainbow-angle, 0deg), #ef4444, #f97316, #facc15, #22c55e, #06b6d4, #3b82f6, #a855f7, #ef4444) border-box;
  animation: rainbow-border-spin 3s linear infinite;
  box-shadow: 0 12px 34px rgba(168, 85, 247, .16), 0 8px 24px rgba(34, 197, 94, .12);
}
@supports (property(--rainbow-angle)) {
  @property --rainbow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
  }
}
@keyframes rainbow-border-spin {
  to { --rainbow-angle: 360deg; }
}
@media (prefers-reduced-motion: reduce) {
  .match-card.result-exact { animation: none; }
}
.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 18px 0 22px;
}
.demo-match-list {
  margin-bottom: 26px;
}
.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}
.fanfare-fallback {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .22);
}
.podium-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  margin: 18px 0 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.podium-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.podium-heading-row h2 {
  margin: 0 0 4px;
}
.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 230px;
}
.podium-place {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  min-width: 0;
}
.podium-place strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-place span {
  color: var(--muted);
  font-weight: 750;
  font-size: 13px;
}
.medal {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(15, 23, 42, .12));
}
.podium-block {
  width: 100%;
  border-radius: 18px 18px 8px 8px;
  color: #172033;
  font-weight: 950;
  font-size: 34px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 14px 28px rgba(15, 23, 42, .12);
}
.podium-gold .podium-block {
  height: 118px;
  background: linear-gradient(160deg, #fde68a, #fbbf24, #f59e0b);
}
.podium-silver .podium-block {
  height: 86px;
  background: linear-gradient(160deg, #f8fafc, #cbd5e1, #94a3b8);
}
.podium-bronze .podium-block {
  height: 66px;
  background: linear-gradient(160deg, #fed7aa, #c2410c, #92400e);
  color: #fff7ed;
}
.podium-card.celebrating .podium-gold {
  animation: winner-pop 900ms ease both;
}
@keyframes winner-pop {
  0% { transform: translateY(10px) scale(.98); }
  60% { transform: translateY(-6px) scale(1.035); }
  100% { transform: translateY(0) scale(1); }
}
.ranking-row.rank-1 {
  border-color: #fbbf24;
  box-shadow: 0 10px 26px rgba(251, 191, 36, .14);
}
.ranking-row.rank-2 {
  border-color: #cbd5e1;
}
.ranking-row.rank-3 {
  border-color: #fdba74;
}
@media (max-width: 560px) {
  .podium-card { padding: 14px; }
  .podium-heading-row { flex-direction: column; }
  .podium { gap: 6px; min-height: 205px; }
  .podium-place strong { font-size: 13px; }
  .podium-place span { font-size: 12px; }
  .medal { font-size: 28px; }
  .podium-block { font-size: 28px; border-radius: 14px 14px 8px 8px; }
  .podium-gold .podium-block { height: 108px; }
  .podium-silver .podium-block { height: 78px; }
  .podium-bronze .podium-block { height: 60px; }
}


.ranking-locked {
    margin: 18px 0;
}
.ranking-row.rank-pending {
    border-color: rgba(130, 150, 170, .32);
    box-shadow: none;
}
.ranking-row.rank-pending strong::before {
    content: "⏳ ";
    opacity: .75;
}


/* v18: Ajax-Tipps ohne Seitenreload */
.match-card.ajax-saving {
  opacity: .88;
}
.match-card.ajax-saving input,
.match-card.ajax-saving button {
  pointer-events: none;
}
.match-card.ajax-saved {
  animation: tip-save-pulse 1.25s ease-out;
}
.match-card.ajax-error {
  animation: tip-error-shake .42s ease-in-out;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, .28), var(--shadow);
}
.tip-inline-feedback {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 850;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .18s ease, transform .18s ease;
}
.tip-inline-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}
.tip-inline-feedback.error {
  background: #ffe4e6;
  color: #9f1239;
}
@keyframes tip-save-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(70, 110, 110, .55), inset 5px 0 0 #22c55e, var(--shadow);
    border-color: #86efac;
  }
  55% {
    box-shadow: 0 0 0 9px rgba(70, 110, 110, 0), inset 5px 0 0 #22c55e, var(--shadow);
    border-color: #22c55e;
  }
  100% {
    box-shadow: var(--shadow);
  }
}
@keyframes tip-error-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@media (max-width: 700px) {
  .match-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }
  .tip-inline-feedback {
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .match-card.ajax-saved,
  .match-card.ajax-error {
    animation: none;
  }
}

/* v20: Mobile Content-Navigation + eingeklappte Drittplatziertenliste */
.content-nav {
  position: sticky;
  top: 48px;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 12px;
  margin: 12px 0 8px;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(241, 245, 249, .94) 78%, rgba(241, 245, 249, 0) 100%);
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 12px;
}
.content-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}
.content-nav a:hover,
.content-nav a:focus {
  border-color: var(--primary);
  color: var(--primary);
}
.group-table-card,
.third-place-card {
  scroll-margin-top: 74px;
}
.team-collapsible {
  padding: 0;
  overflow: hidden;
}
.team-collapsible > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}
.team-collapsible > summary::-webkit-details-marker {
  display: none;
}
.team-collapsible > summary::after {
  content: 'aufklappen';
  flex: 0 0 auto;
  align-self: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #e2e8f0;
}
.team-collapsible[open] > summary::after {
  content: 'zuklappen';
}
.team-collapsible .summary-main {
  min-width: 0;
}
.team-collapsible .summary-main h2,
.team-collapsible .summary-main p {
  margin-left: 0;
}
.team-collapsible .collapsible-body {
  padding: 0 16px 16px;
}
.status-pill.info,
.qualification-badge.provisional {
  background: #e0f2fe;
  color: #0369a1;
}
.third-place-summary-line {
  margin: 2px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  line-height: 1.4;
}
@media (max-width: 720px) {
  .content-nav {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .content-nav a {
    font-size: 12px;
    padding: 7px 10px;
  }
  .team-collapsible > summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .team-collapsible > summary::after {
    justify-self: start;
  }
}


.profile-card { max-width: 620px; }
.profile-form { max-width: 520px; }
.admin-users-card { padding: 10px; }
.admin-users-list { display: grid; gap: 10px; }
.admin-user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 260px) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
}
.admin-user-meta { display: grid; gap: 4px; align-self: center; min-width: 0; }
.admin-user-meta strong { overflow-wrap: anywhere; }
.admin-user-meta small { color: var(--muted); }
.admin-user-nickname span { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .admin-user-row { grid-template-columns: 1fr; align-items: stretch; }
  .admin-user-row button { width: 100%; }
}
