/* ==========================================================================
   TURNIERPORTAL - Design System
   AAA-UI/UX · Light Theme (SVP 1974) · Red/White Sports Club Style
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --bg-tertiary: #edf0f3;
    --bg-hover: #e2e5e9;
    --bg-glass: rgba(255,255,255,.85);

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --accent: #dc2626;
    --accent-light: #ef4444;
    --accent-dark: #b91c1c;
    --accent-bg: #fef2f2;
    --accent-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --accent-green: #16a34a;
    --accent-green-light: #22c55e;
    --accent-green-bg: #f0fdf4;
    --accent-red: #dc2626;
    --accent-red-light: #ef4444;
    --accent-amber: #d97706;
    --accent-amber-light: #f59e0b;
    --accent-amber-bg: #fffbeb;

    --border-color: #e5e7eb;
    --border-light: #d1d5db;

    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #fff;
    --sidebar-border: #1e293b;
    --sidebar-hover: #1e293b;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
    --shadow-glow-red: 0 0 20px rgba(220,38,38,.15);
    --shadow-glow-green: 0 0 20px rgba(22,163,74,.15);

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Inter', system-ui, -apple-system, sans-serif;

    --transition: 200ms cubic-bezier(.4, 0, .2, 1);
    --transition-slow: 400ms cubic-bezier(.4, 0, .2, 1);
    --transition-spring: 500ms cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { color: var(--text-primary); font-weight: 700; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

.text-muted { color: var(--text-muted); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-blue { color: var(--accent); }
.text-amber { color: var(--accent-amber); }
.mt-2 { margin-top: .75rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: .75rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
.btn:active { transform: scale(.97); }

.btn--primary { background: var(--accent-gradient); color: #fff; }
.btn--primary:hover { background: linear-gradient(135deg, var(--accent-dark) 0%, #991b1b 100%); transform: translateY(-1px); box-shadow: var(--shadow-md), var(--shadow-glow-red); }

.btn--secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn--secondary:hover { background: var(--bg-hover); }

.btn--success { background: linear-gradient(135deg, var(--accent-green) 0%, #15803d 100%); color: #fff; }
.btn--success:hover { background: linear-gradient(135deg, #15803d 0%, #166534 100%); transform: translateY(-1px); box-shadow: var(--shadow-md), var(--shadow-glow-green); }

.btn--danger { background: var(--accent-red); color: #fff; }
.btn--danger:hover { background: #b71c1c; }

.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn--ghost.btn--danger { color: var(--accent-red); background: transparent; }
.btn--ghost.btn--danger:hover { background: rgba(198,40,40,.08); }

.btn--sm { padding: 6px 12px; font-size: .8rem; }
.btn--xs { padding: 3px 8px; font-size: .75rem; }
.btn--block { width: 100%; justify-content: center; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-group label,
.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: .9rem;
    font-family: inherit;
    background: #fff;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
}
.form-input:hover {
    border-color: var(--border-light);
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(220,38,38,.1);
    background: #fff;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input--sm { padding: 6px 10px; font-size: .85rem; }

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8aa0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    background-color: #fff;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.form-inline { display: flex; gap: .5rem; align-items: flex-start; }
.form-inline .form-input { flex: 1; }

.form-actions { margin-top: 1.5rem; display: flex; gap: .5rem; justify-content: flex-end; }

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-grid { display: grid; gap: 1.25rem; }
.card__header { margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border-color); }
.card__header h3 { font-size: .95rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.card__body { display: flex; flex-direction: column; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: var(--radius-full);
    line-height: 1.4;
}
.badge--scheduled { background: var(--accent-bg); color: var(--accent); }
.badge--live { background: linear-gradient(135deg, rgba(22,163,74,.15) 0%, rgba(34,197,94,.1) 100%); color: var(--accent-green); animation: pulse-badge 1.5s infinite; box-shadow: 0 0 8px rgba(22,163,74,.12); }
.badge--finished { background: rgba(138,138,160,.12); color: var(--text-muted); }
.badge--waiting { background: rgba(245,127,23,.12); color: var(--accent-amber); }
.badge--draft { background: rgba(138,138,160,.12); color: var(--text-muted); }
.badge--active { background: rgba(46,125,50,.12); color: var(--accent-green); }

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .65; transform: scale(.97); }
}

/* ---------- Tabs ---------- */
.tabs { margin-bottom: 1.5rem; }
.tabs__nav {
    display: flex;
    gap: 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tabs__btn {
    flex: 1;
    padding: 10px 16px;
    font-size: .85rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    min-width: max-content;
}
.tabs__btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.tabs__btn--active { color: #fff; background: var(--accent); }

.tab-content { display: none; animation: fadeIn .3s ease; }
.tab-content--active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Standings Table ---------- */
.standings-table-wrap {
    margin-bottom: 1.5rem;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}
.standings-table__title {
    margin: 0;
    padding: .8rem 1.25rem;
    color: #fff;
    font-size: .82rem;
    background: var(--accent-gradient);
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: var(--font-display);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    background: #fff;
}
.standings-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}
.standings-table th {
    padding: 8px 10px;
    text-align: center;
    font-weight: 700;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
}
.standings-table td {
    padding: 10px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-variant-numeric: tabular-nums;
}
.standings-table th.standings-table__team,
.standings-table td.standings-table__team {
    text-align: left;
    font-weight: 600;
    word-break: break-word;
    line-height: 1.25;
}
.standings-table th.standings-table__pos,
.standings-table td.standings-table__pos {
    width: 36px;
    font-weight: 800;
    color: var(--text-muted);
    font-size: .9em;
}
.standings-table td.standings-table__points {
    font-weight: 900;
    color: var(--accent);
    font-size: 1em;
    font-family: var(--font-display);
}

.standings-row { transition: background var(--transition); }
.standings-row:hover { background: var(--accent-bg); }
.standings-row:nth-child(even) { background: rgba(0,0,0,.018); }
.standings-row--qualified {
    background: linear-gradient(90deg, var(--accent-green-bg) 0%, rgba(240,253,244,.3) 60%, transparent 100%);
    border-left: 3px solid var(--accent-green);
}
.standings-row--qualified:nth-child(even) {
    background: linear-gradient(90deg, rgba(240,253,244,.7) 0%, rgba(240,253,244,.2) 60%, transparent 100%);
    border-left: 3px solid var(--accent-green);
}
.standings-row--qualified td.standings-table__pos {
    color: var(--accent-green);
    font-weight: 900;
}
.standings-row--qualified td.standings-table__team {
    color: var(--accent-green);
    font-weight: 700;
}
.standings-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Match Cards ---------- */
.match-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.match-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.match-card--live {
    border-color: var(--accent-green);
    border-left: 3px solid var(--accent-green);
    box-shadow: var(--shadow-sm), var(--shadow-glow-green);
    background: linear-gradient(135deg, #fff 0%, var(--accent-green-bg) 100%);
}
.match-card--finished { opacity: .7; }
.match-card--finished:hover { opacity: 1; }

.match-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: .75rem;
    font-size: .8rem;
    color: var(--text-muted);
}
.match-card__time { font-weight: 700; color: var(--text-secondary); }
.match-card__group { margin-left: auto; }
.match-card__edit {
    padding: 2px 6px;
    font-size: .8rem;
    line-height: 1;
    opacity: .4;
    transition: opacity var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-secondary);
}
.match-card:hover .match-card__edit { opacity: .8; }
.match-card__edit:hover { opacity: 1; color: var(--accent); }

.match-card__body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .5rem;
}
.match-card__team {
    font-weight: 600;
    font-size: .95rem;
    word-break: break-word;
    line-height: 1.25;
}
.match-card__team--away { text-align: right; }
.match-card__score { text-align: center; }
.match-card__score-value {
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}
.match-card__score-value--live {
    color: var(--accent-green);
    animation: pulse-score 2s infinite;
}
.match-card__score-value--pending { color: var(--text-muted); }

@keyframes pulse-score {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(1.05); }
}

.match-card__actions {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border-color);
}

/* ---------- Match Status Groups ---------- */
.match-status-group { margin-bottom: 1.5rem; }
.match-status-group__label {
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    padding: .5rem 0 .25rem;
    margin-bottom: .5rem;
    border-bottom: 2px solid var(--accent);
}

/* ---------- Match Timeslots ---------- */
.match-timeslot { margin-bottom: 1.5rem; }
.match-timeslot__time {
    font-size: .85rem;
    font-weight: 700;
    color: var(--accent);
    padding-bottom: .5rem;
    margin-bottom: .75rem;
    border-bottom: 1px solid var(--border-color);
}
.match-timeslot__matches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: .75rem;
}

/* ---------- KO-Bracket ---------- */
.ko-bracket {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
}
.ko-bracket__stage { min-width: 250px; flex-shrink: 0; }
.ko-bracket__stage-title {
    text-align: center;
    margin-bottom: 1rem;
    font-size: .9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent-bg);
}
.ko-bracket__matches {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    min-height: 100%;
}

.ko-match {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
}
.ko-match:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(211,47,47,.1);
    transform: translateY(-1px);
}
.ko-match--live {
    border-color: var(--accent-green);
    box-shadow: 0 4px 20px rgba(46,125,50,.12);
}
.ko-match--live::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-green);
}
.ko-match--finished { opacity: .8; }

.ko-match__team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: .88rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
}
.ko-match__team:last-of-type { border-bottom: none; }
.ko-match__team--winner {
    background: linear-gradient(90deg, rgba(46,125,50,.06) 0%, rgba(46,125,50,.02) 100%);
    font-weight: 700;
}
.ko-match__team--winner .ko-match__name { color: var(--accent-green); }

.ko-match__name {
    font-weight: 600;
    color: var(--text-primary);
}
.ko-match__score {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    min-width: 28px;
    text-align: center;
    font-size: .95rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.ko-match__team--winner .ko-match__score {
    background: rgba(46,125,50,.1);
    color: var(--accent-green);
}

.ko-match__info {
    padding: 8px 16px;
    font-size: .75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}
.ko-match__live-indicator {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-green);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 0 var(--radius-lg) 0 var(--radius-sm);
    letter-spacing: .5px;
    animation: pulse-badge 1.5s infinite;
    box-shadow: 0 2px 8px rgba(46,125,50,.3);
}
.ko-match__edit { margin: 8px; width: calc(100% - 16px); }

/* ---------- KO-Bracket Tree (Enhanced with Connector Lines) ---------- */
.ko-bracket-tree {
    display: flex;
    gap: 3rem;
    overflow-x: auto;
    padding: 2rem 1rem;
    -webkit-overflow-scrolling: touch;
    align-items: stretch;
}

.ko-bracket-tree__round {
    display: flex;
    flex-direction: column;
    min-width: 250px;
    flex-shrink: 0;
}

.ko-bracket-tree__round-title {
    text-align: center;
    margin-bottom: 1.25rem;
    font-size: .8rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: .5rem .75rem;
    background: var(--accent-bg);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
}

/* Finale-Runde hervorheben */
.ko-bracket-tree__round:last-child .ko-bracket-tree__round-title {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-amber) 0%, #e65100 100%);
    font-size: .85rem;
    box-shadow: 0 4px 14px rgba(245,127,23,.25);
}

.ko-bracket-tree__matches {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: space-around;
    flex: 1;
}

.ko-bracket-tree__match {
    position: relative;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
}
.ko-bracket-tree__match:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), var(--shadow-glow-red);
    transform: translateY(-2px);
}

/* Live-Match hervorheben */
.ko-bracket-tree__match--live {
    border-color: var(--accent-green);
    box-shadow: var(--shadow-md), var(--shadow-glow-green);
}

/* Finale-Match hervorheben */
.ko-bracket-tree__round:last-child .ko-bracket-tree__match {
    border-color: var(--accent-amber-light);
    box-shadow: 0 4px 20px rgba(245,127,23,.12);
    border-width: 2px;
}
.ko-bracket-tree__round:last-child .ko-bracket-tree__match::after { display: none; }

/* Connector lines: horizontal line going right from each match */
.ko-bracket-tree__match::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -1.5rem;
    width: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, var(--border-light), var(--border-color));
}

/* Connector lines: vertical line on the left coming from previous round */
.ko-bracket-tree__match::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -1.5rem;
    width: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, var(--border-color), var(--border-light));
}

/* First round has no left connector */
.ko-bracket-tree__round:first-child .ko-bracket-tree__match::before { display: none; }

/* Last round has no right connector */
.ko-bracket-tree__round:last-child .ko-bracket-tree__match::after { display: none; }

/* Tree Match Team Rows */
.ko-bracket-tree__team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition);
}
.ko-bracket-tree__team:last-of-type { border-bottom: none; }
.ko-bracket-tree__team--winner {
    background: linear-gradient(90deg, rgba(22,163,74,.07) 0%, rgba(22,163,74,.02) 100%);
}
.ko-bracket-tree__team--winner .ko-bracket-tree__name {
    color: var(--accent-green);
    font-weight: 800;
}
.ko-bracket-tree__name {
    font-weight: 600;
    font-size: .88rem;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.25;
}
.ko-bracket-tree__score {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 28px;
    text-align: center;
    font-size: .9rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 3px 10px;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
}
.ko-bracket-tree__team--winner .ko-bracket-tree__score {
    background: linear-gradient(135deg, rgba(22,163,74,.12) 0%, rgba(22,163,74,.06) 100%);
    color: var(--accent-green);
    font-weight: 900;
}
.ko-bracket-tree__info {
    font-size: .6rem;
    color: var(--text-muted);
    text-align: center;
    padding: 2px 6px 4px;
    letter-spacing: .3px;
}
.ko-bracket-tree__live {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-light) 100%);
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 0 var(--radius-lg) 0 var(--radius-md);
    letter-spacing: 1px;
    animation: pulse-badge 1.5s infinite;
    box-shadow: 0 2px 8px rgba(22,163,74,.3);
}

/* Third Place Match */
.ko-third-place {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--border-color);
}
.ko-third-place__title {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ---------- KO-Bracket Cards (Multi-Bracket Management) ---------- */
.ko-bracket-card {
    position: relative;
    border-left: 3px solid var(--accent);
}
.ko-bracket-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.ko-bracket-card__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -.2px;
}
.ko-bracket-card__actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}
.ko-bracket-card__toggle {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-color);
}
.ko-bracket-card__content { min-height: 60px; }

/* KO-Spielplan nach Runde */
.ko-schedule-stage { margin-bottom: 1.5rem; }
.ko-schedule-stage__title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent);
}

/* ---------- Tournament Cards ---------- */
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.tournament-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.tournament-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px 0 0 4px;
    opacity: 0;
    transition: opacity var(--transition);
}
.tournament-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow-red);
}
.tournament-card:hover::before {
    opacity: 1;
}
.tournament-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .75rem;
}
.tournament-card__name { font-size: 1.1rem; font-weight: 800; font-family: var(--font-display); }
.tournament-card__meta {
    display: flex;
    gap: 1rem;
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: .5rem;
}
.tournament-card__footer { font-size: .8rem; color: var(--text-muted); }

/* ---------- Section Header ---------- */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.section-header h2, .section-header h3 {
    flex: 1;
    min-width: 200px;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -.3px;
}
.section-header__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Groups ---------- */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.group-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.group-card__header h4 { color: var(--accent); font-family: var(--font-display); font-weight: 800; }

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: .9rem;
}
.participant-item:last-child { border-bottom: none; }

/* ---------- Fields ---------- */
.fields-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.field-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: .85rem;
    transition: background var(--transition);
}
.field-item:hover { background: var(--bg-hover); }

/* ---------- Field-Group Matrix ---------- */
.field-group-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.field-group-matrix th,
.field-group-matrix td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}
.field-group-matrix th {
    background: var(--bg-secondary);
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
}
.field-group-matrix th:first-child,
.field-group-matrix td:first-child { text-align: left; font-weight: 600; }
.field-group-matrix td:last-child,
.field-group-matrix th:last-child { border-right: none; }
.field-group-matrix tbody tr:last-child td { border-bottom: none; }
.field-group-matrix tbody tr:hover { background: var(--bg-secondary); }
.field-group-matrix input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ---------- Result Input ---------- */
.result-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 0;
}
.result-input__team { text-align: center; flex: 1; }
.result-input__team span {
    display: block;
    margin-bottom: .5rem;
    font-weight: 600;
    font-size: .95rem;
}
.result-input__score {
    width: 80px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 12px;
}
.result-input__separator {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    transition: opacity .25s ease;
}
.modal-overlay--visible { opacity: 1; }

.modal {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp .35s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes slideUp {
    from { transform: translateY(24px) scale(.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.modal__title { font-size: 1.1rem; font-weight: 700; font-family: var(--font-display); }
.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: all var(--transition);
    border-radius: var(--radius-sm);
}
.modal__close:hover { color: var(--accent); background: var(--accent-bg); }

.modal__body { padding: 1.5rem; }
.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 380px;
}
.toast {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    font-size: .875rem;
    transform: translateX(120%);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.toast--visible { transform: translateX(0); }
.toast--success { border-left: 4px solid var(--accent-green); }
.toast--error { border-left: 4px solid var(--accent-red); }
.toast--info { border-left: 4px solid var(--accent); }
.toast__message { flex: 1; }
.toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

/* ---------- Spinner ---------- */
.spinner { display: flex; justify-content: center; padding: 3rem; }
.spinner__ring {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Skeleton ---------- */
.skeleton { padding: 1rem; }
.skeleton__line {
    height: 14px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    margin-bottom: .75rem;
    animation: shimmer 1.5s infinite;
}
.skeleton__line:nth-child(2) { width: 80%; }
.skeleton__line:nth-child(3) { width: 60%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state__text { font-size: 1rem; }

/* ---------- Footer ---------- */
/* ---------- Dashboard ---------- */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.dashboard-stat {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}
.dashboard-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}
.dashboard-stat__value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.dashboard-stat__label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: .35rem;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 1.5rem;
}
.dashboard-match {
    display: grid;
    grid-template-columns: 8px 1fr auto auto;
    align-items: center;
    gap: .6rem;
    padding: .55rem .25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: .85rem;
}
.dashboard-match:last-child { border-bottom: none; }
.dashboard-match__status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-tertiary);
}
.dashboard-match__status--live { background: var(--accent-green); animation: pulse-badge 1.5s infinite; }
.dashboard-match__status--finished { background: var(--text-muted); }
.dashboard-match__status--scheduled { background: var(--accent-amber); }
.dashboard-match__teams {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-match__teams span { color: var(--text-muted); font-weight: 400; font-size: .75rem; }
.dashboard-match__score {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 44px;
    text-align: center;
    color: var(--text-primary);
    white-space: nowrap;
}
.dashboard-match__meta {
    font-size: .72rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
    min-width: 60px;
}
.dashboard-login {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: .85rem;
}
.dashboard-login:last-child { border-bottom: none; }
.dashboard-login__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .7rem;
    flex-shrink: 0;
    text-transform: uppercase;
}
.dashboard-login__info { flex: 1; min-width: 0; }
.dashboard-login__name { font-weight: 700; }
.dashboard-login__club { font-size: .72rem; color: var(--text-muted); }
.dashboard-login__time {
    font-size: .72rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}
.app-footer a { color: var(--text-secondary); transition: color var(--transition); }
.app-footer a:hover { color: var(--accent); }
.app-footer--visitor {
    padding: .5rem .75rem;
    font-size: .58rem;
    border-top: none;
    letter-spacing: .4px;
}
.app-footer--presentation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1d27;
    border-top: 1px solid rgba(255,255,255,.06);
    z-index: 50;
}
.app-footer--presentation p { color: rgba(255,255,255,.3); }
.app-footer--presentation a { color: rgba(255,255,255,.5); }
.app-footer--presentation a:hover { color: var(--accent-light); }

/* Presentation Footer: minimal, nur Branding */
.presentation-footer {
    flex-shrink: 0;
    background: #1a1d27;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(.25rem, .4vh, .45rem) var(--pres-pad-x);
}
.presentation-footer__brand {
    font-size: clamp(.45rem, .5vw, .6rem);
    color: rgba(255,255,255,.25);
    white-space: nowrap;
}
.presentation-footer__brand a {
    color: rgba(255,255,255,.35);
    transition: color var(--transition);
}
.presentation-footer__brand a:hover {
    color: var(--accent-light);
}

/* Sponsor-Showcase: eigener Slide, Grid mit Logos */
.presentation-sponsor-showcase {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.presentation-sponsor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(180px, 16vw, 300px), 1fr));
    gap: clamp(.8rem, 1.5vw, 2rem);
    flex: 1;
    align-content: center;
}
.presentation-sponsor-grid__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(.4rem, .6vh, .8rem);
    padding: clamp(.6rem, 1vh, 1rem) clamp(.6rem, 1vw, 1.2rem);
    background: #1a1d27;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all .3s ease;
}
.presentation-sponsor-grid__item:hover {
    background: #1f2333;
    border-color: rgba(255,255,255,.15);
}
/* Category sizes */
.presentation-sponsor-grid__item--premium {
    border-color: rgba(255,215,0,.25);
    background: linear-gradient(135deg, #1a1d27 0%, rgba(255,215,0,.04) 100%);
}
.presentation-sponsor-grid__item--premium .presentation-sponsor-grid__img {
    max-height: clamp(60px, 10vh, 140px);
}
.presentation-sponsor-grid__item--gold {
    border-color: rgba(255,193,7,.15);
}
.presentation-sponsor-grid__item--gold .presentation-sponsor-grid__img {
    max-height: clamp(50px, 8vh, 110px);
}
.presentation-sponsor-grid__item--silver .presentation-sponsor-grid__img {
    max-height: clamp(40px, 6vh, 90px);
}
.presentation-sponsor-grid__item--bronze .presentation-sponsor-grid__img {
    max-height: clamp(30px, 5vh, 70px);
}
.presentation-sponsor-grid__img {
    max-height: clamp(50px, 8vh, 120px);
    max-width: 80%;
    object-fit: contain;
    filter: brightness(1.05);
}
.presentation-sponsor-grid__name {
    font-size: clamp(.55rem, .7vw, .9rem);
    color: rgba(255,255,255,.55);
    font-weight: 600;
    text-align: center;
    letter-spacing: .3px;
}

/* Persistent sponsor ticker bar (above footer) */
/* Presentation sponsor ticker: static card, one sponsor at a time */
.presentation-sponsor-ticker {
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(26,29,39,.95) 0%, #13151c 100%);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: clamp(.5rem, 1vh, 1rem) var(--pres-pad-x);
    position: relative;
}
.presentation-sponsor-ticker__inner {
    position: relative;
    height: clamp(60px, 8vh, 110px);
}
/* Ticker card: QR left, logo exact center, name+url right */
.ticker-card {
    display: none;
    position: absolute;
    inset: 0;
}
.ticker-card--active {
    display: block;
    animation: tickerFadeIn .6s ease;
}
.ticker-card--out {
    opacity: 0;
    transition: opacity .6s ease;
}
/* Logo: absolute center of the ticker */
.ticker-card__center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ticker-card__logo {
    max-height: clamp(44px, 7vh, 95px);
    max-width: clamp(180px, 30vw, 500px);
    object-fit: contain;
    filter: brightness(1.1);
}
/* QR: absolute left */
.ticker-card__qr {
    position: absolute;
    left: clamp(1rem, 2vw, 3rem);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}
/* Name + URL: absolute right */
.ticker-card__right {
    position: absolute;
    right: clamp(1rem, 2vw, 3rem);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
}
.ticker-card__name {
    font-size: clamp(.8rem, 1.1vw, 1.4rem);
    color: rgba(255,255,255,.7);
    font-weight: 700;
    white-space: nowrap;
}
.ticker-card__url {
    font-size: clamp(.55rem, .7vw, .9rem);
    color: rgba(255,255,255,.35);
    white-space: nowrap;
}
@keyframes tickerFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- CupPilot Promo Slide (Presentation) ---------- */
.presentation-promo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: clamp(.8rem, 1.5vh, 1.5rem);
    text-align: center;
}
.presentation-promo__logo {
    height: clamp(48px, 8vh, 100px);
    object-fit: contain;
    filter: drop-shadow(0 4px 24px rgba(99,102,241,.3));
}
.presentation-promo__title {
    font-size: clamp(1.2rem, 2vw, 2.5rem);
    font-weight: 900;
    color: #fff;
    font-family: var(--font-display);
    letter-spacing: -.5px;
}
.presentation-promo__subtitle {
    font-size: clamp(.7rem, 1vw, 1.2rem);
    color: rgba(255,255,255,.5);
    font-weight: 500;
}
.presentation-promo__qr {
    background: #fff;
    padding: clamp(.5rem, 1vh, 1rem);
    border-radius: var(--radius-lg);
    display: inline-block;
}
.presentation-promo__url {
    font-size: clamp(.7rem, .9vw, 1.1rem);
    color: var(--accent-light);
    font-weight: 700;
    letter-spacing: .5px;
}

/* ---------- CupPilot Promo (Visitor) ---------- */
.visitor-promo {
    background: linear-gradient(135deg, #1a1d27 0%, #13151c 100%);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-lg);
    margin: 1.5rem 1rem;
    padding: 1.25rem;
    text-align: center;
}
.visitor-promo__content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.visitor-promo__logo {
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 12px rgba(99,102,241,.3));
}
.visitor-promo__text {
    flex: 1;
    min-width: 150px;
}
.visitor-promo__title {
    font-size: .95rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}
.visitor-promo__subtitle {
    font-size: .72rem;
    color: rgba(255,255,255,.45);
    font-weight: 500;
    margin: .15rem 0 0;
}
.visitor-promo__qr {
    background: #fff;
    padding: .4rem;
    border-radius: var(--radius-md);
    display: inline-block;
    flex-shrink: 0;
}
.visitor-promo__link {
    display: inline-block;
    margin-top: .75rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--accent-light);
    text-decoration: none;
    letter-spacing: .3px;
}
.visitor-promo__link:hover {
    text-decoration: underline;
}

/* ---------- Sponsor Header (Veranstalter + Hauptsponsor) ---------- */
.sponsor-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: .35rem 1rem;
    gap: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}
.sponsor-header--single {
    justify-content: center;
}
.sponsor-header__logo {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}
.sponsor-header__img {
    max-height: 26px;
    max-width: 80px;
    object-fit: contain;
    opacity: .85;
    transition: opacity var(--transition);
}
.sponsor-header__img:hover { opacity: 1; }
.sponsor-header__label {
    font-size: .5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    opacity: .7;
}
.sponsor-header__divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* Presentation: dark broadcast theme */
.sponsor-header--presentation {
    padding: clamp(.25rem, .4vh, .5rem) clamp(1rem, 2vw, 2rem);
    gap: clamp(.75rem, 1.5vw, 1.5rem);
    background: linear-gradient(180deg, #1a1d27 0%, #13151c 100%);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sponsor-header--presentation .sponsor-header__img {
    max-height: clamp(22px, 3vh, 40px);
    max-width: clamp(70px, 8vw, 140px);
    opacity: .9;
    filter: brightness(1.1);
}
.sponsor-header--presentation .sponsor-header__label {
    font-size: clamp(.42rem, .5vw, .6rem);
    color: rgba(255,255,255,.4);
}
.sponsor-header--presentation .sponsor-header__divider {
    height: clamp(18px, 2.5vh, 30px);
    background: rgba(255,255,255,.1);
}

/* ---------- Sponsor-Slideshow (automatisch wechselnd, ein Sponsor groß) ---------- */
.sponsor-slideshow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .75rem;
    min-height: 80px;
    background: #fff;
}
.sponsor-slideshow__item {
    display: none;
    width: 100%;
    max-width: 600px;
    text-decoration: none;
    border-radius: var(--radius-md);
    overflow: hidden;
}
.sponsor-slideshow__item--active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    animation: sponsorFadeIn .6s ease;
}
.sponsor-slideshow__item--out {
    opacity: 0;
    transition: opacity .6s ease;
}
a.sponsor-slideshow__item:hover {
    transform: scale(1.02);
}
.sponsor-slideshow__img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-md);
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.05));
}

.sponsor-slideshow__info {
    text-align: center;
}
.sponsor-slideshow__name {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
}
.sponsor-slideshow__url {
    font-size: .6rem;
    color: var(--text-muted);
    display: block;
}

/* Visitor: slideshow info dark */
.sponsor-slideshow--visitor .sponsor-slideshow__name {
    color: rgba(255,255,255,.6);
    font-size: .7rem;
}
.sponsor-slideshow--visitor .sponsor-slideshow__url {
    color: rgba(255,255,255,.3);
    font-size: .55rem;
}

/* Presentation: proportional zur Bildschirmgröße */
.sponsor-slideshow--presentation .sponsor-slideshow__item { max-width: 800px; }
.sponsor-slideshow--presentation .sponsor-slideshow__img { max-height: clamp(70px, 8vw, 150px); }

@keyframes sponsorFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fff 40%, var(--bg-secondary) 100%);
    position: relative;
}
.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(220,38,38,.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.login-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}
.login-card__logo { text-align: center; margin-bottom: 2rem; }
.login-card__icon { font-size: 3.5rem; display: block; margin-bottom: .75rem; }
.login-card__icon-img { width: 80px; height: 80px; border-radius: 20px; object-fit: cover; margin: 0 auto .75rem; box-shadow: var(--shadow-md); }
.login-card__logo h1 { font-size: 1.6rem; margin-bottom: .25rem; font-family: var(--font-display); font-weight: 900; }
.login-card__register {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .85rem;
    color: var(--text-muted);
}
.login-card__register a { color: var(--accent); font-weight: 600; }

/* ==========================================================================
   ADMIN LAYOUT
   ========================================================================== */
.admin-layout { display: flex; flex-direction: column; min-height: 100vh; }
.admin-app { display: flex; flex: 1; min-height: 0; }

/* Sidebar (stays dark for contrast) */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1a2744 100%);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
}
.admin-sidebar__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.admin-sidebar__logo { font-size: 1.5rem; }
.admin-sidebar__logo-img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.admin-sidebar__title { font-weight: 800; font-size: 1rem; color: var(--sidebar-text-active); letter-spacing: -.3px; }

.admin-sidebar__nav { flex: 1; padding: .75rem; overflow-y: auto; }
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: .88rem;
    transition: all var(--transition);
    margin-bottom: 2px;
}
.admin-nav-item:hover { background: rgba(255,255,255,.06); color: var(--sidebar-text-active); }
.admin-nav-item--active {
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220,38,38,.25);
}
.admin-nav-item__icon { font-size: 1.1rem; }

.admin-sidebar__footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.06); }
.admin-sidebar__user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    color: var(--sidebar-text);
}

/* Content */
.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-height: 100vh;
    background: var(--bg-secondary);
}
.admin-section { animation: fadeIn .3s ease; }

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--sidebar-border);
    }
    .admin-sidebar__nav {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: .5rem;
        gap: 4px;
    }
    .admin-nav-item { white-space: nowrap; min-height: 44px; }
    .admin-app { flex-direction: column; }
    .admin-content { padding: 1rem; max-height: none; }
    .section-header { flex-direction: column; align-items: stretch; gap: .5rem; }
    .section-header__actions { justify-content: flex-start; flex-wrap: wrap; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PRESENTATION LAYOUT — TV/Beamer Broadcast Style, 100vh, kein Scrollen
   ========================================================================== */
.presentation-layout {
    overflow: hidden;
    background: #0f1117;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #e8eaed;
}
.presentation-layout--static {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

/* --- Broadcast Header: dunkler Balken mit Akzent-Linie --- */
.presentation-layout {
    --pres-pad-x: clamp(1.25rem, 2vw, 2.5rem);
}
.presentation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(.6rem, 1.2vh, 1.1rem) var(--pres-pad-x);
    background: linear-gradient(180deg, #1a1d27 0%, #13151c 100%);
    border-bottom: 3px solid var(--accent);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    gap: clamp(.5rem, 1vw, 1.5rem);
}
.presentation-header__left {
    display: flex;
    align-items: center;
    gap: clamp(.6rem, 1vw, 1.25rem);
    flex: 1;
    min-width: 0;
}
.presentation-header__right {
    display: flex;
    align-items: center;
    gap: clamp(.5rem, 1vw, 1.25rem);
    flex-shrink: 0;
}

/* Veranstalter-Logo: groß, links vom Turniernamen */
.presentation-header__org-logo {
    flex-shrink: 0;
}
.presentation-header__org-img {
    height: clamp(48px, 7vh, 88px);
    max-width: clamp(80px, 12vw, 180px);
    object-fit: contain;
    border-radius: var(--radius-sm);
    filter: brightness(1.1);
}

/* Hauptsponsor: rechts, kleiner */
.presentation-header__sponsor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.presentation-header__sponsor-label {
    font-size: clamp(.35rem, .4vw, .5rem);
    color: rgba(255,255,255,.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.presentation-header__sponsor-img {
    height: clamp(48px, 7vh, 88px);
    max-width: clamp(100px, 14vw, 220px);
    object-fit: contain;
    filter: brightness(1.05);
    opacity: .9;
}

.presentation-header__info { min-width: 0; }
.presentation-header__title {
    font-size: clamp(1.3rem, 1.8vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -.5px;
    color: #fff;
    font-family: var(--font-display);
    line-height: 1.1;
    padding-bottom: .25em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.presentation-header__meta {
    color: rgba(255,255,255,.5);
    font-size: clamp(.6rem, .7vw, .85rem);
    margin-top: -.1rem;
    font-weight: 500;
    letter-spacing: .3px;
}
.presentation-header__qr {
    text-align: center;
    flex-shrink: 0;
    background: rgba(255,255,255,.08);
    border-radius: var(--radius-md);
    padding: clamp(.3rem, .4vh, .5rem);
    border: 1px solid rgba(255,255,255,.1);
}
.presentation-header__cp-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.presentation-header__cp-img {
    height: clamp(80px, 8vw, 120px);
    max-width: clamp(80px, 10vw, 160px);
    object-fit: contain;
    opacity: .9;
}
.presentation-layout .qr-code-img { border-radius: var(--radius-sm); }
.presentation-layout .qr-label {
    font-size: .5rem;
    color: rgba(255,255,255,.4);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* --- Presentation Schedule Table (tabellarische Darstellung) --- */
.presentation-schedule-table {
    width: 100%;
    overflow: hidden;
}
.presentation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(.7rem, .85vw, 1rem);
}
.presentation-table thead th {
    padding: clamp(.4rem, .5vh, .7rem) clamp(.5rem, .7vw, 1rem);
    text-align: left;
    font-size: clamp(.5rem, .6vw, .7rem);
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.02);
}
.presentation-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background .2s ease;
}
.presentation-table tbody tr:hover { background: rgba(255,255,255,.03); }
.presentation-table tbody td {
    padding: clamp(.45rem, .6vh, .8rem) clamp(.5rem, .7vw, 1rem);
}
.presentation-table__time {
    font-weight: 700;
    color: rgba(255,255,255,.5);
    width: 6%;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.presentation-table__team {
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    width: 32%;
}
.presentation-table__team--home { text-align: right; }
.presentation-table__vs,
.presentation-table__score {
    color: rgba(255,255,255,.3);
    text-align: center;
    width: 6%;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding-left: clamp(.3rem, .5vw, .75rem);
    padding-right: clamp(.3rem, .5vw, .75rem);
    white-space: nowrap;
}
.presentation-table__field {
    color: rgba(255,255,255,.35);
    font-size: clamp(.55rem, .65vw, .8rem);
    font-weight: 600;
    width: 8%;
    white-space: nowrap;
}
.presentation-table__group {
    color: var(--accent-light);
    font-size: clamp(.55rem, .65vw, .8rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    width: 8%;
    white-space: nowrap;
    text-align: right;
}
.presentation-table__row--live {
    background: rgba(22,163,74,.08);
}
.presentation-table__row--live td { color: var(--accent-green-light); }
.presentation-table__row--live .presentation-table__score {
    color: #fff;
    font-weight: 900;
    font-size: clamp(.8rem, .95vw, 1.15rem);
}
.presentation-table__live-badge {
    display: inline-block;
    background: var(--accent-green);
    color: #fff;
    font-size: clamp(.4rem, .45vw, .55rem);
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    letter-spacing: 1px;
    margin-left: .4em;
    vertical-align: middle;
    animation: pulse-badge 1.5s infinite;
}
.presentation-table__row--finished {
    opacity: .55;
}
.presentation-table__row--finished .presentation-table__score {
    color: rgba(255,255,255,.6);
    font-weight: 800;
}

/* --- Main Content Area --- */
.presentation-main {
    padding: clamp(.6rem, 1vh, 1.25rem) var(--pres-pad-x);
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

/* --- Slide System --- */
.presentation-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .8s ease;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.presentation-slide--active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}
.presentation-slide__title {
    font-size: clamp(.8rem, 1vw, 1.2rem);
    margin-bottom: clamp(.5rem, .8vh, .9rem);
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-display);
}
.presentation-slide__title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- Match Grid --- */
.presentation-match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 44vw), 1fr));
    gap: clamp(.5rem, .8vw, 1rem);
}

/* --- Match Card: Broadcast-Style --- */
.presentation-match {
    background: #1a1d27;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius-md);
    padding: clamp(.5rem, .8vh, .9rem) clamp(.7rem, 1vw, 1.2rem);
    position: relative;
    overflow: hidden;
}
.presentation-match::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: rgba(255,255,255,.08);
    border-radius: 3px 0 0 3px;
}
.presentation-match--live {
    border-color: rgba(22,163,74,.4);
    background: linear-gradient(135deg, #1a1d27 0%, rgba(22,163,74,.08) 100%);
    box-shadow: 0 0 20px rgba(22,163,74,.1);
}
.presentation-match--live::before {
    background: var(--accent-green);
    animation: pulse-bar 2s infinite;
}
@keyframes pulse-bar {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(22,163,74,.4); }
    50% { opacity: .4; box-shadow: 0 0 2px rgba(22,163,74,.1); }
}
.presentation-match--finished { opacity: .45; }
.presentation-match--finished::before { background: rgba(255,255,255,.04); }

.presentation-match__time {
    display: flex;
    justify-content: space-between;
    font-size: clamp(.6rem, .7vw, .8rem);
    color: rgba(255,255,255,.35);
    margin-bottom: clamp(.25rem, .4vh, .5rem);
    font-weight: 500;
}
.presentation-match__field {
    background: rgba(255,255,255,.06);
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: clamp(.5rem, .6vw, .7rem);
    font-weight: 600;
    color: rgba(255,255,255,.4);
}
.presentation-match__teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(.3rem, .6vw, .75rem);
}
.presentation-match__team {
    font-size: clamp(.8rem, .95vw, 1.15rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.presentation-match__team:last-child { text-align: right; }
.presentation-match__score {
    font-size: clamp(1.1rem, 1.4vw, 1.8rem);
    font-weight: 900;
    text-align: center;
    min-width: clamp(46px, 3.5vw, 72px);
    font-variant-numeric: tabular-nums;
    color: #fff;
    letter-spacing: 2px;
    background: rgba(255,255,255,.06);
    padding: clamp(2px, .3vh, 5px) clamp(6px, .8vw, 14px);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.presentation-match--scheduled .presentation-match__score {
    color: rgba(255,255,255,.3);
    font-size: clamp(.85rem, 1vw, 1.2rem);
    letter-spacing: 0;
    background: transparent;
}
.presentation-match--live .presentation-match__score {
    color: var(--accent-green-light);
    background: rgba(22,163,74,.12);
    animation: pulse-score 2s infinite;
    font-weight: 900;
}
.presentation-match__group {
    font-size: clamp(.5rem, .55vw, .65rem);
    color: var(--accent-light);
    text-align: center;
    margin-top: clamp(.2rem, .3vh, .4rem);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
}
.presentation-match__live-badge {
    display: inline-flex;
    align-items: center;
    background: var(--accent-green);
    color: #fff;
    font-size: clamp(.4rem, .45vw, .55rem);
    font-weight: 800;
    padding: clamp(1px, .2vh, 3px) clamp(5px, .6vw, 10px);
    border-radius: var(--radius-full);
    letter-spacing: 1px;
    animation: pulse-badge 1.5s infinite;
    flex-shrink: 0;
    margin-left: auto;
}

/* --- Standings in Presentation (Dark Theme) --- */
.presentation-standings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 22vw), 1fr));
    gap: clamp(.6rem, 1vw, 1.25rem);
}
.presentation-layout .standings-table-wrap { background: #1a1d27; border-radius: var(--radius-md); overflow: hidden; border: 1px solid rgba(255,255,255,.06); }
.presentation-layout .standings-table__title { background: rgba(255,255,255,.04); color: rgba(255,255,255,.7); padding: clamp(.4rem, .5vh, .7rem) clamp(.5rem, .7vw, 1rem); font-size: clamp(.6rem, .65vw, .8rem); border-bottom: 1px solid rgba(255,255,255,.06); }
.presentation-layout .standings-table { font-size: clamp(.65rem, .7vw, .82rem); color: rgba(255,255,255,.8); background: transparent; }
.presentation-layout .standings-table thead { background: rgba(255,255,255,.03); }
.presentation-layout .standings-table th { padding: clamp(4px, .4vh, 7px) clamp(4px, .4vw, 8px); font-size: clamp(.5rem, .55vw, .65rem); color: rgba(255,255,255,.4); background: rgba(255,255,255,.02); border-bottom-color: rgba(255,255,255,.06); }
.presentation-layout .standings-table td { padding: clamp(5px, .5vh, 8px) clamp(4px, .4vw, 8px); border-bottom-color: rgba(255,255,255,.04); }
.presentation-layout .standings-table__points strong { color: #fff; }
.presentation-layout .standings-row { border-left-color: transparent; }
.presentation-layout .standings-row:hover { background: rgba(255,255,255,.04); }
.presentation-layout .standings-row:nth-child(even) { background: rgba(255,255,255,.02); }
.presentation-layout .standings-row--qualified { border-left-color: var(--accent-green); background: rgba(22,163,74,.06); }
.presentation-layout .standings-row--qualified:nth-child(even) { background: rgba(22,163,74,.08); }
.presentation-layout .text-green { color: var(--accent-green-light); }
.presentation-layout .text-red { color: var(--accent-light); }
.presentation-layout .ko-match { background: #1a1d27; border-color: rgba(255,255,255,.06); }
.presentation-layout .ko-match__name { color: rgba(255,255,255,.8); }
.presentation-layout .ko-match__score { color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); }
.presentation-layout .ko-match__info { background: rgba(255,255,255,.04); color: rgba(255,255,255,.4); }

/* --- Static Presentation View --- */
.presentation-static {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
}
.presentation-static__section { min-width: 0; }
.presentation-static__section h3 {
    font-size: clamp(.8rem, 1vw, 1.2rem);
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin-bottom: .75rem;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.presentation-static__section h3::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}
.presentation-static__full { grid-column: 1 / -1; }
.presentation-static .text-muted { color: rgba(255,255,255,.3); }
.presentation-matches { width: 100%; }
.presentation-ko { width: 100%; overflow: hidden; }

/* --- Presentation Responsive Scaling --- */
html:has(.presentation-layout) {
    font-size: clamp(14px, 0.52vw + 7.3px, 22px);
}

@media (max-width: 1280px) {
    .presentation-static { grid-template-columns: 1fr; }
    .presentation-match-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .presentation-standings-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .presentation-layout { --pres-pad-x: clamp(1rem, 2vw, 2rem); }
    .presentation-sponsor-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* KO-Bracket im Präsentationsmodus: Dark Theme, MUSS in den Viewport passen */
.presentation-layout .ko-bracket-tree {
    gap: clamp(.5rem, 1vw, 2rem);
    padding: clamp(.25rem, .5vw, 1rem) 0;
    overflow: hidden;
    width: 100%;
    flex-wrap: nowrap;
}
.presentation-layout .ko-bracket-tree__round {
    min-width: 0;
    flex: 1;
    flex-shrink: 1;
}
.presentation-layout .ko-bracket-tree__matches {
    gap: clamp(.5rem, .8vw, 1.25rem);
}
.presentation-layout .ko-bracket-tree__match {
    border-radius: clamp(4px, .4vw, 10px);
    background: #1a1d27;
    border-color: rgba(255,255,255,.06);
}
.presentation-layout .ko-bracket-tree__team {
    padding: clamp(4px, .5vw, 10px) clamp(6px, .6vw, 12px);
    border-color: rgba(255,255,255,.04);
}
.presentation-layout .ko-bracket-tree__name {
    font-size: clamp(0.6rem, 0.75vw, .95rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    color: rgba(255,255,255,.8);
}
.presentation-layout .ko-bracket-tree__score {
    font-size: clamp(0.65rem, 0.8vw, 1rem);
    padding: clamp(1px, .15vw, 3px) clamp(4px, .4vw, 8px);
    min-width: clamp(18px, 1.8vw, 28px);
    flex-shrink: 0;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.7);
}
.presentation-layout .ko-bracket-tree__team--winner .ko-bracket-tree__name { color: var(--accent-green-light); }
.presentation-layout .ko-bracket-tree__team--winner .ko-bracket-tree__score { background: rgba(22,163,74,.15); color: var(--accent-green-light); }
.presentation-layout .ko-bracket-tree__round-title {
    font-size: clamp(0.55rem, 0.65vw, 0.8rem);
    padding: clamp(2px, .25vw, 5px) clamp(4px, .5vw, 10px);
    margin-bottom: clamp(.4rem, .6vw, 1rem);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.5);
    border-color: rgba(255,255,255,.06);
}
.presentation-layout .ko-bracket-tree__match::after {
    right: calc(clamp(.5rem, 1vw, 2rem) * -0.5);
    width: calc(clamp(.5rem, 1vw, 2rem) * 0.5);
    border-color: rgba(255,255,255,.1);
}
.presentation-layout .ko-bracket-tree__match::before {
    left: calc(clamp(.5rem, 1vw, 2rem) * -0.5);
    width: calc(clamp(.5rem, 1vw, 2rem) * 0.5);
    border-color: rgba(255,255,255,.1);
}
.presentation-layout .ko-bracket-tree__info {
    font-size: clamp(.4rem, .5vw, .6rem);
    color: rgba(255,255,255,.35);
}
.presentation-layout .ko-bracket-tree__live {
    font-size: clamp(.4rem, .45vw, .55rem);
    padding: clamp(1px, .1vw, 2px) clamp(3px, .4vw, 6px);
}
.presentation-layout .ko-bracket-tree__round:last-child .ko-bracket-tree__match {
    border-width: 1px;
    border-color: rgba(217,119,6,.3);
}
.presentation-layout .ko-third-place {
    margin-top: clamp(.5rem, .8vw, 1rem);
    padding-top: clamp(.5rem, .8vw, 1rem);
    border-top-color: rgba(255,255,255,.06);
}
.presentation-layout .ko-third-place .ko-match__name {
    font-size: clamp(.6rem, .75vw, .95rem);
}
.presentation-layout .ko-third-place .ko-match__score {
    font-size: clamp(.65rem, .8vw, 1rem);
}

/* ==========================================================================
   VISITOR LAYOUT — Dark Premium Sport App (Mobile-first)
   Matching the presentation broadcast theme for cohesive branding
   ========================================================================== */
.visitor-layout {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0f1117;
    display: flex;
    flex-direction: column;
    color: #e8eaed;
    overflow-x: hidden;
}

/* Visitor Topbar: Veranstalter | CupPilot | Hauptsponsor */
.visitor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .4rem .75rem;
    background: linear-gradient(180deg, #1a1d27 0%, #13151c 100%);
    border-bottom: 1px solid rgba(255,255,255,.06);
    gap: .5rem;
    min-height: 42px;
}
.visitor-topbar__left,
.visitor-topbar__right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
}
.visitor-topbar__left { align-items: flex-start; }
.visitor-topbar__right { align-items: flex-end; }
.visitor-topbar__center {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.visitor-topbar__app-logo {
    height: 44px;
    max-width: 120px;
    object-fit: contain;
    filter: drop-shadow(0 1px 6px rgba(99,102,241,.25));
    transition: transform .2s ease;
}
.visitor-topbar__app-logo:active { transform: scale(.95); }
.visitor-topbar__label {
    font-size: .4rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.3);
    font-weight: 700;
}
.visitor-topbar__logo-img {
    height: 44px;
    max-width: 120px;
    object-fit: contain;
    filter: brightness(1.1);
    opacity: .85;
}

.visitor-header {
    text-align: center;
    padding: .65rem 1rem .5rem;
    background: linear-gradient(180deg, #13151c 0%, #0f1117 100%);
    position: relative;
    border-bottom: 3px solid var(--accent);
}
.visitor-header__title {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -.3px;
    line-height: 1.15;
    font-family: var(--font-display);
}
.visitor-header__meta {
    font-size: .62rem;
    color: rgba(255,255,255,.45);
    margin-top: .15rem;
    font-weight: 500;
    letter-spacing: .4px;
}

.visitor-nav {
    display: flex;
    background: #1a1d27;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.visitor-nav::-webkit-scrollbar { display: none; }
.visitor-nav { -ms-overflow-style: none; scrollbar-width: none; }

.visitor-nav__btn {
    flex: 1;
    padding: 11px 6px;
    font-size: .65rem;
    font-weight: 700;
    font-family: inherit;
    color: rgba(255,255,255,.4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    -webkit-tap-highlight-color: transparent;
    min-height: 42px;
    position: relative;
}
.visitor-nav__btn:active {
    transform: scale(.96);
}
.visitor-nav__btn--active {
    color: #fff;
    border-bottom-color: var(--accent);
    font-weight: 800;
}

.visitor-main {
    padding: .75rem .85rem;
    background: #0f1117;
    flex: 1;
}
.visitor-view { display: none; animation: fadeIn .3s ease; }
.visitor-view--active { display: block; }

.visitor-section-title {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,.5);
    margin: 1.1rem 0 .55rem;
    padding-bottom: .3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-display);
}
.visitor-section-title::before {
    content: '';
    width: 3px;
    height: 1em;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}
.visitor-section-title:first-child { margin-top: 0; }

/* KO-Banner: Hinweis auf laufende KO-Spiele */
.visitor-ko-banner {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    background: linear-gradient(135deg, rgba(99,102,241,.15) 0%, rgba(99,102,241,.05) 100%);
    border: 1px solid rgba(99,102,241,.25);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all .2s ease;
}
.visitor-ko-banner:active { transform: scale(.98); }
.visitor-ko-banner__icon { font-size: 1rem; flex-shrink: 0; }
.visitor-ko-banner__text {
    flex: 1;
    font-size: .8rem;
    font-weight: 700;
    color: var(--accent-light, #a5b4fc);
}
.visitor-ko-banner__arrow {
    font-size: 1rem;
    color: rgba(255,255,255,.4);
    flex-shrink: 0;
}

.visitor-matches { display: flex; flex-direction: column; gap: .45rem; }

.visitor-match {
    background: #1a1d27;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius-md);
    padding: .75rem .9rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.visitor-match::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: rgba(255,255,255,.06);
    border-radius: 3px 0 0 3px;
}
.visitor-match--scheduled::before {
    background: rgba(255,255,255,.08);
}
.visitor-match--live {
    border-color: rgba(22,163,74,.35);
    background: linear-gradient(135deg, #1a1d27 0%, rgba(22,163,74,.08) 100%);
    box-shadow: 0 0 16px rgba(22,163,74,.08);
}
.visitor-match--live::before {
    background: var(--accent-green);
    animation: pulse-bar 2s infinite;
}
.visitor-match--finished {
    opacity: .45;
}
.visitor-match--finished::before {
    background: rgba(255,255,255,.03);
}

.visitor-match__header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .6rem;
    color: rgba(255,255,255,.35);
    margin-bottom: .45rem;
    font-weight: 500;
}
.visitor-match__time {
    font-weight: 700;
    color: rgba(255,255,255,.5);
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
}
.visitor-match__field {
    background: rgba(255,255,255,.06);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: .58rem;
    font-weight: 600;
    color: rgba(255,255,255,.4);
}
.visitor-match__group {
    margin-left: auto;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-size: .58rem;
    color: var(--accent-light);
    background: rgba(211,47,47,.1);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.visitor-match__body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .5rem;
}
.visitor-match__team {
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
    word-break: break-word;
    line-height: 1.2;
}
.visitor-match__team:last-child { text-align: right; }
.visitor-match__score {
    font-weight: 900;
    font-size: 1.1rem;
    text-align: center;
    min-width: 54px;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: rgba(255,255,255,.06);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 2px;
}
.visitor-match--live .visitor-match__score {
    color: var(--accent-green-light);
    background: rgba(22,163,74,.12);
    font-weight: 900;
    animation: pulse-score 2s infinite;
}
.visitor-match--scheduled .visitor-match__score {
    color: rgba(255,255,255,.3);
    font-size: .9rem;
    letter-spacing: 0;
    background: transparent;
}
.visitor-match--finished .visitor-match__score {
    color: rgba(255,255,255,.5);
    background: rgba(255,255,255,.04);
}

/* Visitor Filter — Dark theme */
.visitor-filter {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.visitor-filter__row {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    align-items: center;
}
.visitor-filter__pill {
    padding: 6px 14px;
    font-size: .75rem;
    font-weight: 700;
    font-family: inherit;
    background: #1a1d27;
    color: rgba(255,255,255,.6);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.visitor-filter__pill:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}
.visitor-filter__pill--active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
/* Custom dropdown wrapper to avoid native select artifacts */
.visitor-filter__dropdown {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    position: relative;
}
.visitor-filter__dropdown-btn {
    width: 100%;
    padding: 8px 36px 8px 12px;
    font-size: .85rem;
    font-family: inherit;
    background: #1a1d27;
    color: rgba(255,255,255,.8);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.visitor-filter__dropdown-btn::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255,255,255,.4);
    pointer-events: none;
}
.visitor-filter__dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #1a1d27;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius-md);
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.visitor-filter__dropdown--open .visitor-filter__dropdown-list {
    display: block;
}
.visitor-filter__dropdown-item {
    padding: 10px 14px;
    font-size: .85rem;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.visitor-filter__dropdown-item:last-child { border-bottom: none; }
.visitor-filter__dropdown-item:active,
.visitor-filter__dropdown-item--active {
    background: rgba(99,102,241,.15);
    color: #fff;
}

.visitor-filter__active {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 6px 12px;
    background: rgba(211,47,47,.1);
    border-radius: var(--radius-md);
    font-size: .78rem;
    color: var(--accent-light);
}
.visitor-filter__clear {
    background: none;
    border: none;
    color: var(--accent-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    font-weight: 700;
    transition: color var(--transition);
}
.visitor-filter__clear:hover { color: #fff; }

/* Visitor: dark standings overrides */
.visitor-layout .standings-table-wrap { background: #1a1d27; border-radius: var(--radius-md); overflow: hidden; border: 1px solid rgba(255,255,255,.06); }
.visitor-layout .standings-table__title { background: rgba(255,255,255,.04); color: rgba(255,255,255,.6); border-bottom: 1px solid rgba(255,255,255,.06); }
.visitor-layout .standings-table { font-size: .8rem; color: rgba(255,255,255,.8); background: transparent; }
.visitor-layout .standings-table thead { background: rgba(255,255,255,.03); }
.visitor-layout .standings-table th { color: rgba(255,255,255,.4); background: rgba(255,255,255,.02); border-bottom-color: rgba(255,255,255,.06); }
.visitor-layout .standings-table th,
.visitor-layout .standings-table td { padding: 8px 6px; border-bottom-color: rgba(255,255,255,.04); }
.visitor-layout .standings-table__points strong { color: #fff; }
.visitor-layout .standings-row { border-left-color: transparent; }
.visitor-layout .standings-row:hover { background: rgba(255,255,255,.04); }
.visitor-layout .standings-row:nth-child(even) { background: rgba(255,255,255,.02); }
.visitor-layout .standings-row--qualified { border-left-color: var(--accent-green); background: rgba(22,163,74,.06); }
.visitor-layout .standings-row--qualified:nth-child(even) { background: rgba(22,163,74,.08); }
.visitor-layout .ko-match { background: #1a1d27; border: 1px solid rgba(255,255,255,.06); box-shadow: none; }
.visitor-layout .ko-match__team { border-color: rgba(255,255,255,.04); }
.visitor-layout .ko-match__name { color: rgba(255,255,255,.8); }
.visitor-layout .ko-match__score { color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); }
.visitor-layout .ko-match__team--winner { background: linear-gradient(90deg, rgba(22,163,74,.1) 0%, rgba(22,163,74,.03) 100%); }
.visitor-layout .ko-match__team--winner .ko-match__name { color: var(--accent-green-light); }
.visitor-layout .ko-match__team--winner .ko-match__score { background: rgba(22,163,74,.15); color: var(--accent-green-light); }
.visitor-layout .text-green { color: var(--accent-green-light); }
.visitor-layout .text-red { color: var(--accent-light); }

.visitor-layout .ko-bracket { flex-direction: column; }
.visitor-layout .ko-bracket__stage { min-width: auto; }

/* Visitor: KO-Bracket-Tree vertikal statt horizontal, dark */
.visitor-layout .ko-bracket-tree {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}
.visitor-layout .ko-bracket-tree__round {
    min-width: auto;
    width: 100%;
}
.visitor-layout .ko-bracket-tree__round-title {
    font-size: .75rem;
    margin-bottom: .75rem;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.5);
    padding: .4rem .75rem;
    border-radius: var(--radius-full);
    text-align: center;
    border: 1px solid rgba(255,255,255,.06);
}
.visitor-layout .ko-bracket-tree__matches {
    gap: .6rem;
}
/* Connector-Linien im Visitor ausblenden */
.visitor-layout .ko-bracket-tree__match::before,
.visitor-layout .ko-bracket-tree__match::after {
    display: none;
}
.visitor-layout .ko-bracket-tree__match {
    background: #1a1d27;
    border: 1px solid rgba(255,255,255,.06);
    border-left: 3px solid var(--accent);
    box-shadow: none;
}
.visitor-layout .ko-bracket-tree__team {
    padding: 10px 14px;
    font-size: .9rem;
    border-color: rgba(255,255,255,.04);
}
.visitor-layout .ko-bracket-tree__name {
    font-weight: 600;
    color: rgba(255,255,255,.8);
}
.visitor-layout .ko-bracket-tree__score {
    font-weight: 800;
    min-width: 24px;
    text-align: center;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.7);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
}
.visitor-layout .ko-bracket-tree__team--winner .ko-bracket-tree__score {
    background: rgba(22,163,74,.15);
    color: var(--accent-green-light);
}
.visitor-layout .ko-bracket-tree__team--winner .ko-bracket-tree__name {
    color: var(--accent-green-light);
}
.visitor-layout .ko-bracket-tree__info {
    font-size: .65rem;
    color: rgba(255,255,255,.4);
    padding: 3px 14px 5px;
    border-top: 1px solid rgba(255,255,255,.04);
}
/* Finale im Visitor hervorheben */
.visitor-layout .ko-bracket-tree__round:last-child .ko-bracket-tree__match {
    border: 1px solid rgba(217,119,6,.3);
    border-left: 4px solid var(--accent-amber);
}
/* Spiel um Platz 3 im Visitor */
.visitor-layout .ko-third-place {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
.visitor-layout .ko-third-place__title {
    font-size: .75rem;
    color: rgba(255,255,255,.4);
    margin-bottom: .5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Visitor: KO live match + badge dark */
.visitor-layout .ko-bracket-tree__match--live {
    border-left-color: var(--accent-green);
    box-shadow: 0 0 12px rgba(22,163,74,.15);
}
.visitor-layout .ko-bracket-tree__live {
    font-size: .55rem;
    padding: 2px 8px;
}
.visitor-layout .ko-match--live {
    border-color: var(--accent-green);
}
.visitor-layout .ko-match__live-indicator {
    background: var(--accent-green);
    color: #fff;
}

/* Visitor: empty state & badge dark */
.visitor-layout .empty-state { color: rgba(255,255,255,.35); }
.visitor-layout .badge--scheduled { background: rgba(211,47,47,.12); color: var(--accent-light); }
.visitor-layout .badge--finished { background: rgba(255,255,255,.06); color: rgba(255,255,255,.4); }
.visitor-layout .badge--waiting { background: rgba(245,127,23,.12); color: var(--accent-amber); }

/* Visitor: sponsor header dark */
.sponsor-header--visitor {
    padding: .3rem .75rem;
    gap: .75rem;
    background: linear-gradient(180deg, #1a1d27 0%, #13151c 100%);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sponsor-header--visitor .sponsor-header__img {
    max-height: 22px;
    max-width: 70px;
    filter: brightness(1.1);
}
.sponsor-header--visitor .sponsor-header__label {
    font-size: .42rem;
    color: rgba(255,255,255,.35);
}
.sponsor-header--visitor .sponsor-header__divider {
    height: 16px;
    background: rgba(255,255,255,.1);
}

/* Visitor: sponsor slideshow dark */
.sponsor-slideshow--visitor {
    padding: .5rem .75rem;
    background: #1a1d27;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sponsor-slideshow--visitor .sponsor-slideshow__item { max-width: 100%; }
.sponsor-slideshow--visitor .sponsor-slideshow__img { max-height: 80px; filter: brightness(1.05); }

/* Visitor: footer dark */
.app-footer--visitor {
    background: #1a1d27;
    border-top: 1px solid rgba(255,255,255,.06);
}
.app-footer--visitor p { color: rgba(255,255,255,.25); }
.app-footer--visitor a { color: rgba(255,255,255,.4); }
.app-footer--visitor a:hover { color: var(--accent-light); }

/* Visitor: form input dark (no white flash) */
.visitor-layout .form-input {
    background-color: #1a1d27;
    color: rgba(255,255,255,.8);
    border-color: rgba(255,255,255,.12);
}
.visitor-layout .form-input:focus {
    background-color: #1a1d27;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(211,47,47,.15);
}
.visitor-layout select.form-input {
    background-color: #1a1d27;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    color: rgba(255,255,255,.8);
    border-color: rgba(255,255,255,.12);
}

/* Visitor: ko-match__info (third-place match) dark */
.visitor-layout .ko-match__info {
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.4);
}

/* Visitor: Finale round title — consistent dark style */
.visitor-layout .ko-bracket-tree__round:last-child .ko-bracket-tree__round-title {
    background: rgba(217,119,6,.15);
    color: rgba(255,255,255,.7);
    border-color: rgba(217,119,6,.3);
}

/* Visitor on wider screens: dark shell */
html:has(.visitor-layout) {
    background: #080a0e;
}

/* ==========================================================================
   MOBILE OPTIMIERUNGEN
   ========================================================================== */

/* --- Touch-friendly: active states für alle interaktiven Elemente --- */
@media (hover: none) and (pointer: coarse) {
    .btn:active { transform: scale(.96); opacity: .85; }
    .visitor-filter__pill:active { transform: scale(.95); opacity: .8; }
    .visitor-filter__dropdown-btn:active { opacity: .8; }
    .visitor-filter__dropdown-item:active { background: rgba(99,102,241,.2); }
    .visitor-filter__clear:active { color: #fff; transform: scale(1.1); }
    .admin-nav-item:active { opacity: .8; }
    .match-card__edit { opacity: .6; }
    .match-card__edit:active { opacity: 1; color: var(--accent); }
    .standings-row:active { background: var(--accent-bg); }
    /* Hover-Effekte auf Touch-Geräten entfernen */
    .btn--primary:hover { transform: none; box-shadow: none; }
    .btn--success:hover { transform: none; box-shadow: none; }
}

/* --- Kleine Tablets & große Phones (max 600px) --- */
@media (max-width: 600px) {
    /* Presentation: auf kleinen Bildschirmen QR ausblenden */
    .presentation-header__qr { display: none; }
    .presentation-static { grid-template-columns: 1fr; padding: 1rem; }
    .presentation-layout { --pres-pad-x: 1rem; }
    .presentation-sponsor-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; }

    /* KO-Bracket */
    .ko-bracket { gap: 1rem; }
    .ko-bracket__stage { min-width: 200px; }

    /* Buttons: mindestens 44px Touch-Target */
    .btn { padding: 12px 20px; min-height: 44px; }
    .btn--xs { padding: 10px 14px; font-size: .8rem; min-height: 44px; }
    .btn--sm { padding: 10px 16px; font-size: .85rem; min-height: 44px; }
    .btn--icon { min-width: 44px; min-height: 44px; justify-content: center; }

    /* Badge */
    .badge { padding: 4px 10px; font-size: .75rem; }

    /* Form Inputs: mindestens 44px Höhe */
    .form-input { padding: 12px 14px; font-size: 1rem; min-height: 44px; }
    .form-input--sm { padding: 10px 12px; font-size: .9rem; min-height: 44px; }
    select.form-input { padding-right: 40px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1; min-width: 0; }

    /* Tabellen */
    .standings-table th { font-size: .7rem; padding: 8px 6px; }
    .standings-table td { font-size: .8rem; padding: 8px 6px; }

    /* Standings: horizontaler Scroll auf kleinen Screens */
    .standings-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .standings-table { min-width: 360px; }

    /* Modal: volle Breite auf Mobilgeräten */
    .modal { max-width: calc(100vw - 1.5rem); border-radius: var(--radius-lg); }
    .modal__header { padding: 1rem; }
    .modal__body { padding: 1rem; }
    .modal__footer { padding: .75rem 1rem; flex-wrap: wrap; }
    .modal__footer .btn { flex: 1; min-width: 0; }
    .modal__close { font-size: 1.8rem; padding: 4px 8px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .modal__title { font-size: 1rem; }

    /* Result Input */
    .result-input { gap: .5rem; }
    .result-input__score { width: 60px; font-size: 1.2rem; padding: 10px 8px; min-height: 44px; }
    .result-input__separator { font-size: 1.5rem; }
    .result-input__team span { font-size: .85rem; }

    /* Toast */
    .toast-container { max-width: calc(100vw - 2rem); right: 1rem; left: 1rem; }

    /* KO-Match Info */
    .ko-match__info { font-size: .8rem; }
    .ko-match__live-indicator { font-size: .7rem; padding: 3px 10px; }

    /* Admin: volle Breite, kompakt */
    .admin-content { padding: .75rem; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-stat { padding: 1rem .75rem; }
    .dashboard-stat__value { font-size: 1.5rem; }

    /* Admin Sidebar: horizontal auf mobil */
    .admin-sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--sidebar-border); }
    .admin-sidebar__nav { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: .5rem; gap: 4px; flex-wrap: nowrap; }
    .admin-nav-item { white-space: nowrap; min-height: 44px; padding: 10px 14px; font-size: .82rem; }
    .admin-app { flex-direction: column; }
    .admin-content { max-height: none; }
    .admin-sidebar__footer { display: none; }
    .section-header { flex-direction: column; align-items: stretch; gap: .5rem; }
    .section-header__actions { justify-content: flex-start; flex-wrap: wrap; }

    /* Visitor Topbar: kompakter */
    .visitor-topbar { padding: .3rem .5rem; gap: .35rem; }
    .visitor-topbar__label { font-size: .35rem; }
    .visitor-topbar__logo-img { height: 36px; max-width: 90px; }
    .visitor-topbar__app-logo { height: 36px; max-width: 90px; }

    /* Visitor Nav: mindestens 44px Touch-Target */
    .visitor-nav__btn { min-height: 44px; padding: 12px 6px; font-size: .65rem; }

    /* Visitor Header */
    .visitor-header { padding: .5rem .75rem .4rem; }
    .visitor-header__title { font-size: 1.05rem; }

    /* Visitor: Kompakter auf kleinen Screens */
    .visitor-layout { max-width: 100%; }
    .visitor-main { padding: .6rem .5rem; }
    .visitor-match { padding: .6rem .75rem; }
    .visitor-match__body { gap: .35rem; }
    .visitor-match__team { font-size: .78rem; }
    .visitor-match__score { font-size: 1rem; min-width: 48px; padding: 2px 6px; }

    /* Visitor Filter: Touch-freundlich */
    .visitor-filter__pill { padding: 8px 14px; font-size: .75rem; min-height: 40px; display: inline-flex; align-items: center; }
    .visitor-filter__dropdown-btn { min-height: 44px; padding: 10px 36px 10px 12px; }
    .visitor-filter__dropdown-item { padding: 12px 14px; min-height: 44px; }
    .visitor-filter__clear { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; }

    /* Sponsor slideshow */
    .sponsor-slideshow--visitor .sponsor-slideshow__img { max-height: 60px; }

    /* Match Cards Grid */
    .match-cards { grid-template-columns: 1fr; }

    /* Match Card Edit Button: Touch-freundlich */
    .match-card__edit { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; opacity: .6; font-size: 1rem; }

    /* Admin: Inline-Grid Overrides für Sponsor-Bereich */
    #section-sponsors [style*="grid-template-columns: 1fr 1fr 1fr"],
    #section-sponsors [style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    #section-sponsors [style*="grid-template-columns: repeat(4"],
    #section-sponsors [style*="grid-template-columns:repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #section-sponsors [style*="grid-template-columns: 1fr 1fr"],
    #section-sponsors [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    /* Allgemein: 2-spaltige Inline-Grids auf Mobilgeräten einspaltung */
    .admin-section [style*="grid-template-columns:1fr 1fr"],
    .admin-section [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* --- Phones (max 480px) — fehlender Breakpoint --- */
@media (max-width: 480px) {
    /* Typography: etwas kleiner */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.05rem; }

    /* Cards: weniger Padding */
    .card { padding: .75rem; }
    .card__header { padding: .75rem; }
    .card__body { padding: .75rem; }

    /* Admin: noch kompakter */
    .admin-content { padding: .5rem; }
    .admin-sidebar__nav { padding: .35rem; }
    .admin-nav-item { padding: 8px 10px; font-size: .78rem; }
    .admin-sidebar__header { padding: .75rem; gap: .5rem; }
    .admin-sidebar__logo-img { width: 28px; height: 28px; }
    .admin-sidebar__title { font-size: .85rem; }

    /* Section headers auf mobil */
    .section-header h2 { font-size: 1.15rem; }

    /* Tabellen: S, G, U, N Spalten schmaler */
    .standings-table th,
    .standings-table td { padding: 7px 4px; }
    .standings-table td.standings-table__pos { width: 28px; font-size: .8em; }
    .standings-table { min-width: 320px; }

    /* Visitor: noch kompakter */
    .visitor-main { padding: .5rem .4rem; }
    .visitor-match { padding: .5rem .6rem; border-radius: var(--radius-sm); }

    /* Modal: fast fullscreen */
    .modal { max-width: calc(100vw - 1rem); max-height: 95vh; }
    .modal__body { padding: .75rem; }

    /* KO-Bracket: schmalere Karten */
    .ko-bracket-tree__round { min-width: 170px; }
    .ko-bracket__stage { min-width: 190px; }

    /* Sponsor header: kompakter */
    .sponsor-header--visitor { padding: .2rem .5rem; gap: .5rem; }
    .sponsor-header--visitor .sponsor-header__img { max-height: 18px; max-width: 55px; }

    /* Form-Grid immer einspaltung */
    .form-grid { grid-template-columns: 1fr; gap: .75rem; }

    /* Admin: 4-spaltige Sponsor-Kategorien → 1 Spalte */
    #section-sponsors [style*="grid-template-columns:repeat(4"],
    #section-sponsors [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
    }
}

/* --- Sehr kleine Phones (max 380px) --- */
@media (max-width: 380px) {
    .presentation-header__title { font-size: 1.1rem; }
    .visitor-header__title { font-size: .95rem; }
    .visitor-header__meta { font-size: .55rem; }
    .visitor-nav__btn { font-size: .55rem; padding: 10px 3px; letter-spacing: .3px; min-height: 44px; }
    .visitor-match__team { font-size: .72rem; }
    .visitor-match__score { font-size: .9rem; min-width: 42px; }
    .ko-bracket-tree__round { min-width: 150px; }
    .ko-bracket__stage { min-width: 170px; }
    .result-input__score { width: 50px; font-size: 1rem; }
    .standings-table th,
    .standings-table td { padding: 6px 3px; font-size: .7rem; }
    .standings-table { min-width: 290px; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
    .dashboard-stat__value { font-size: 1.25rem; }

    /* Visitor Topbar: minimal */
    .visitor-topbar { padding: .2rem .35rem; }
    .visitor-topbar__logo-img { height: 30px; max-width: 70px; }
    .visitor-topbar__app-logo { height: 30px; max-width: 70px; }

    /* Admin: minimal padding */
    .admin-content { padding: .35rem; }
    .admin-nav-item { padding: 8px 8px; font-size: .72rem; gap: .5rem; }

    /* Modal: fast fullscreen */
    .modal { max-width: calc(100vw - .5rem); border-radius: var(--radius-md); }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .admin-sidebar, .visitor-nav, .app-footer,
    .btn, .match-card__actions, .ko-match__edit,
    .sponsor-slideshow { display: none !important; }
    .standings-table { border: 1px solid #ccc; }
    .standings-table th { background: #eee; color: #333; }
    .card, .match-card, .ko-match, .visitor-match,
    .presentation-match { border: 1px solid #ccc; box-shadow: none; background: #fff; }
    .standings-row--qualified { border-left-color: var(--accent); }
    .presentation-header { border-bottom-color: #333; }
    .visitor-header { border-bottom-color: #333; }
}
