/*
 * © 2025-2026 Sven Wheeldon. All rights reserved.
 * Unauthorized copying, modification, or distribution is prohibited.
 */
:root {
    --bg: #0f1113;
    --card-bg: #1a1c1e;
    --primary: #3498db;
    --accent: #2ecc71;
    --text: #e0e0e0;
    --text-dim: #9ea3a8;
    --danger: #e74c3c;
    --gold: #f1c40f;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
body { background-color: var(--bg); color: var(--text); line-height: 1.5; padding-bottom: 80px; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.container { max-width: 1200px; margin: 0 auto; padding: 15px; padding-left: max(15px, env(safe-area-inset-left, 0px)); padding-right: max(15px, env(safe-area-inset-right, 0px)); }

/* SIDEBAR */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 900;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

.sidebar {
    position: fixed; top: 0; left: -280px; width: 280px; height: 100vh; height: 100dvh;
    background: #151719; border-right: 1px solid #333; z-index: 950;
    transition: left 0.3s ease; overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar.open { left: 0; }

.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid #333;
}
.sidebar-close {
    background: none; border: none; color: #888; font-size: 24px; cursor: pointer; padding: 0 4px;
}
.sidebar-close:hover { color: #fff; }

.sidebar-section { padding: 16px 20px; border-bottom: 1px solid #252729; }
.sidebar-label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }

.sidebar-btn-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sidebar-btn {
    background: #222; border: 1px solid #444; color: #ccc; padding: 8px 14px;
    border-radius: 6px; cursor: pointer; font-size: 13px; flex: 1; min-width: 70px; text-align: center;
}
.sidebar-btn:hover { background: #333; color: #fff; }
.sidebar-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.sidebar-btn-danger:hover { background: #c0392b; }
.sidebar-input {
    width: 100%; box-sizing: border-box; background: #1a1c1e; border: 1px solid #444; color: #eee;
    padding: 10px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 6px; outline: none;
}
.sidebar-input:focus { border-color: var(--primary); }
.sidebar-input::placeholder { color: #666; }

.hamburger-btn {
    background: #222; border: 1px solid #333; color: var(--text); padding: 8px 12px;
    border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; flex-shrink: 0;
}
.hamburger-btn:hover { background: #333; }

/* NAV & TABS */
.liga-logo-wrap { position: relative; }
.liga-logo-wrap.has-logo { background-size: contain; background-position: top center; background-repeat: no-repeat; background-attachment: fixed; }
.liga-logo-wrap.has-logo::before { content: ''; position: absolute; inset: 0; background: rgba(15, 17, 19, 0.75); pointer-events: none; z-index: 0; border-radius: 12px; }
.liga-logo-wrap > * { position: relative; z-index: 1; }
.top-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #222; }
.nav-select { background: #222; color: white; border: 1px solid #444; padding: 8px 12px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.admin-badge { background: var(--danger); color: white; font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: bold; }

#ligaTabs { display: flex; flex-wrap: wrap; gap: 8px; }

/* Wrapper für Tab + Settings Icon */
.tab-wrapper {
    display: inline-flex;
    align-items: center;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding-right: 8px; /* Platz rechts fürs Icon */
}

.tab-btn { 
    background: transparent; 
    border: none; 
    color: var(--text-dim); 
    padding: 10px 18px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 14px; 
    white-space: nowrap; 
}

/* Wenn Button direkt (ohne Wrapper) genutzt wird */
button.tab-btn { background: #222; border: 1px solid #333; }

.tab-btn.active { background: var(--primary); color: white; border-radius: 7px; }
.tab-wrapper .tab-btn.active { border-radius: 7px; }

.tab-edit {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    padding-left: 5px;
    transition: all 0.2s;
}
.tab-edit:hover { opacity: 1; transform: scale(1.2); }

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 2px;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    50% { opacity: 0.6; box-shadow: 0 0 8px 4px rgba(231, 76, 60, 0.3); }
}

.pool-tabs { display: flex; justify-content: center; background: #111; border: 1px solid #333; border-radius: 12px; padding: 5px; margin: 20px auto; width: fit-content; }
.pool-tab { padding: 8px 25px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-dim); }
.pool-tab.active { background: #333; color: white; }

/* PRIZE CALCULATOR */
.prize-cat-card { background: #111; border: 1px solid #333; border-radius: 10px; padding: 15px; margin-bottom: 12px; }
.prize-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.prize-table th, .prize-table td { padding: 6px 8px; border-bottom: 1px solid #222; font-size: 13px; }
.prize-amount { color: var(--gold); font-weight: bold; }

/* CARDS & LISTS */
.card { background: var(--card-bg); border-radius: 12px; margin-bottom: 12px; border: 1px solid #333; border-left: 4px solid var(--primary); overflow: hidden; }
.card-title { padding: 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.event-row { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--card-bg); border: 1px solid #333; border-radius: 10px; margin-bottom: 10px; }
.date-badge { background: #333; color: var(--primary); padding: 5px 10px; border-radius: 6px; font-weight: bold; font-size: 12px; }

/* STATS */
.clickable-link { color: var(--primary); text-decoration: none; cursor: pointer; font-weight: 500; transition: color 0.2s; }
.clickable-link:hover { color: #63b3ed; text-decoration: underline; }
.stats-header { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid #333; margin-bottom: 20px; text-align: center; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-top: 15px; }
.stat-box { background: #222; padding: 10px; border-radius: 8px; text-align: center; display: flex; flex-direction: column; justify-content: space-between; min-height: 70px; }
.stat-label { font-size: 11px; color: #888; text-transform: uppercase; }
.stat-num { font-size: 18px; font-weight: bold; color: white; }

/* TABELLEN */
.table-responsive { overflow-x: auto; border-radius: 12px; border: 1px solid #333; margin-bottom: 20px; background: var(--card-bg); }
.standings-table, .history-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.standings-table th, .history-table th { text-align: center; padding: 16px 12px; background: #1a1a1a; color: #888; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid #333; }
.standings-table th:nth-child(2), .history-table th:first-child { text-align: left; }
.standings-table td, .history-table td { padding: 14px 12px; border-bottom: 1px solid #2a2c2e; background: var(--card-bg); }
.standings-table tr:last-child td { border-bottom: none; }
.rank-cell { font-weight: bold; width: 50px; text-align: center; color: #666; }
.team-cell { font-weight: bold; color: white; text-align: left; min-width: 160px; }
.val-cell { text-align: center; color: var(--text-dim); min-width: 60px; }
.pts-cell { font-weight: 900; color: var(--primary); text-align: center; font-size: 15px; background: rgba(52, 152, 219, 0.08); min-width: 70px; }

/* MODAL SYSTEM */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; z-index: 1000; padding: 10px; }
.modal-box-framed { background: var(--card-bg); border: 2px solid #444; border-radius: 15px; padding: 20px; width: 100%; max-width: 1150px; max-height: none; overflow-y: visible; box-shadow: 0 10px 40px rgba(0,0,0,0.6); margin: auto 0; }

/* FIXED HEADER LAYOUT (FLEXBOX) */
.match-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
    width: 100%;
}
.match-modal-header > div:first-child { flex: 1; text-align: left; }
.match-modal-header > div:last-child { flex: 1; text-align: right; }
.match-modal-header > div:nth-child(2) { min-width: 140px; text-align: center; padding: 0 10px; }

.modal-total-pts { font-size: 14px; color: var(--primary); font-weight: bold; margin-top: 5px; }

.dual-score-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.dual-score-table th { background: #111; color: #888; padding: 8px; font-size: 11px; text-transform: uppercase; }
.dual-row td { padding: 12px 2px; border-bottom: 1px solid #252729; vertical-align: top; }
.dual-score-table th:first-child, .dual-score-table th:last-child { width: 25%; text-align: center; } /* Teams */

.col-score { width: 50px; text-align: center; }
.col-divider { width: 130px; text-align: center; }
.col-divider-cell { background: #151515; border-left: 1px solid #333; border-right: 1px solid #333; }
.mobile-serie-row { display: none; }

.serie-comparison { display: flex; flex-direction: row; justify-content: center; gap: 10px; height: 100%; align-items: center; }
.serie-box { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; width: 45%; }
.s-val { color: #aaa; font-size: 10px; }
.h-val { color: var(--text); font-size: 11px; }
.p-val { color: var(--gold); font-weight: 900; font-size: 13px; margin-top: 2px; }

.score-input-modal { width: 100%; max-width: 50px; padding: 8px 2px; background: #333; border: 1px solid #444; color: white; text-align: center; border-radius: 4px; font-weight: bold; font-size: 14px; }
.slot-select-modal { width: 100%; padding: 6px; background: #222; border: 1px solid #444; color: white; border-radius: 4px; font-size: 13px; text-overflow: ellipsis; overflow: hidden; }

.score-cell-content { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; }
.sub-dropdown-wrapper { margin-top: 6px; padding-top: 4px; border-top: 1px dashed #444; width: 100%; text-align: center; }

.player-container { display: none; padding: 0 15px 15px; }
.player-container.show { display: block; }
.player-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #2a2c2e; }
.mini-btn { background: #222; border: 1px solid #444; color: #ccc; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.save-btn { background: var(--accent); color: black; width: 100%; padding: 15px; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; margin-top: 20px; }
.pts-badge-gold { color: var(--gold); font-weight: bold; font-size: 11px; }
.pts-badge-dark { color: #444; font-size: 11px; }

/* Turnier */
.tournament-status-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.group-card { background: var(--card-bg, #1e1e1e); border: 1px solid #333; border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.group-header { padding: 12px 15px; background: #1a1a1a; font-weight: bold; font-size: 16px; border-bottom: 1px solid #333; color: var(--primary); }
.match-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #2a2c2e; font-size: 13px; }
.match-row:last-child { border-bottom: none; }
.match-row:hover { background: rgba(255,255,255,0.03); }

/* Bracket */
.bracket-container { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 20px 0; overflow-x: auto; min-height: 400px; }
.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 30px; min-width: 160px; flex: 1; }
.bracket-round-label { text-align: center; font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.bracket-final { max-width: 180px; }
.bracket-match { background: #1a1a1a; border: 1px solid #333; border-radius: 8px; overflow: hidden; transition: border-color 0.2s; }
.bracket-match:hover { border-color: #555; }
.bracket-match.played { border-color: var(--accent); }
.bracket-team { padding: 8px 12px; display: flex; justify-content: space-between; font-size: 13px; color: #ccc; }
.bracket-team.winner { color: var(--accent); font-weight: bold; background: rgba(0,200,83,0.08); }
.bracket-team.loser { color: #555; }
.bracket-divider { height: 1px; background: #333; }

.info { text-align: center; padding: 20px; color: var(--text-dim); }

/* Utility-Klassen */
.hide-mobile { display: table-cell; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-auto-250 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.team-logo-img { width: 120px; height: 120px; object-fit: contain; }
.player-photo-img { width: 100px; height: 100px; object-fit: cover; border-radius: 50%; }
.score-display-box { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.tournament-score-input { width: 100%; padding: 8px; background: #222; color: white; border: 1px solid #444; border-radius: 4px; }
.match-team-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.score-badge { text-align: center; background: #222; border: 1px solid #333; border-radius: 6px; margin: 0 8px; color: var(--primary); font-weight: bold; padding: 4px 8px; }
.settings-collapsed { display: none !important; }
.collapsed { display: none !important; }
.settings-section { transition: all 0.2s; }

/* =====================================================
   LIGHT MODE
   ===================================================== */
body.light-mode {
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1a1a1a;
    --text-dim: #555555;
}

/* Sidebar */
body.light-mode .sidebar { background: #ffffff; border-right-color: #ddd; }
body.light-mode .sidebar-overlay.open { background: rgba(0,0,0,0.3); }
body.light-mode .sidebar-header { border-bottom-color: #ddd; }
body.light-mode .sidebar-section { border-bottom-color: #e8e8e8; }
body.light-mode .sidebar-close { color: #999; }
body.light-mode .sidebar-close:hover { color: #333; }
body.light-mode .sidebar-btn { background: #f0f2f5; color: #333; border-color: #ccc; }
body.light-mode .sidebar-btn:hover { background: #e4e6e9; color: #111; }
body.light-mode .sidebar-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
body.light-mode .sidebar-label { color: #888; }
body.light-mode .sidebar-input { background: #f0f2f5; border-color: #ccc; color: #333; }
body.light-mode .sidebar-input::placeholder { color: #999; }

/* Navigation & Tabs */
body.light-mode .hamburger-btn { background: #e8e8e8; border-color: #ccc; color: #333; }
body.light-mode .hamburger-btn:hover { background: #ddd; }
body.light-mode .nav-select { background: #e8e8e8; color: #1a1a1a; border-color: #ccc; }
body.light-mode .top-nav { border-bottom-color: #ddd; }
body.light-mode input, body.light-mode textarea, body.light-mode select { background: #f0f2f5; color: #1a1a1a; border-color: #ccc; }
body.light-mode .tab-btn { color: #555; }
body.light-mode button.tab-btn { background: #e8e8e8; border-color: #ccc; color: #555; }
body.light-mode .tab-btn.active { background: var(--primary); color: white; }
body.light-mode .tab-wrapper { background: #e8e8e8; border-color: #ccc; }
body.light-mode .pool-tabs { background: #e8e8e8; border-color: #ccc; }
body.light-mode .pool-tab { color: #555; }
body.light-mode .pool-tab.active { background: #fff; color: #1a1a1a; }

/* Cards & Rows */
body.light-mode .card { background: #ffffff; border-color: #ddd; }
body.light-mode .prize-cat-card { background: #f8f8f8; border-color: #ddd; }
body.light-mode .modal-box-framed { background: #ffffff; border-color: #ccc; }
body.light-mode .event-row { background: #ffffff; border-color: #ddd; }
body.light-mode .date-badge { background: #e8e8e8; color: var(--primary); }

/* Stats */
body.light-mode .stats-header { background: #ffffff; border-color: #ddd; }
body.light-mode .stat-box { background: #f0f2f5; }
body.light-mode .stat-num { color: #1a1a1a; }
body.light-mode .stat-label { color: #888; }

/* Tabellen */
body.light-mode .table-responsive { border-color: #ddd; background: #fff; }
body.light-mode .standings-table th, body.light-mode .history-table th { background: #e8e8e8; color: #555; border-bottom-color: #ccc; }
body.light-mode .standings-table td, body.light-mode .history-table td { border-bottom-color: #e8e8e8; background: #fff; }
body.light-mode .standings-table tr:nth-child(even) td { background: #f8f9fa; }
body.light-mode .history-table td { border-color: #e0e0e0; }
body.light-mode .team-cell { color: #1a1a1a; }
body.light-mode .rank-cell { color: #999; }
body.light-mode .pts-cell { background: rgba(52, 152, 219, 0.06); }

/* Match Modal */
body.light-mode .match-modal-header { border-bottom-color: #ddd; }
body.light-mode .dual-score-table th { background: #e8e8e8; color: #555; }
body.light-mode .dual-row td { border-bottom-color: #e8e8e8; }
body.light-mode .col-divider-cell { background: #f5f5f5; border-left-color: #ddd; border-right-color: #ddd; }
body.light-mode .score-input-modal { background: #f0f2f5; border-color: #ccc; color: #1a1a1a; }
body.light-mode .slot-select-modal { background: #f0f2f5; border-color: #ccc; color: #1a1a1a; }
body.light-mode .sub-dropdown-wrapper { border-top-color: #ddd; }

/* Buttons & Inputs */
body.light-mode .save-btn { color: #fff; }
body.light-mode .mini-btn { background: #f0f2f5; border-color: #ccc; color: #333; }
body.light-mode .player-item { border-bottom-color: #e8e8e8; }
body.light-mode .modal-input { background: #f0f2f5; color: #1a1a1a; border-color: #ccc; }
body.light-mode .modal-input-disabled { background: #e8e8e8; color: #999; border-color: #ccc; }
body.light-mode .settings-input { background: #f0f2f5; color: #1a1a1a; border-color: #ccc; }
body.light-mode .settings-label { color: #333; }
body.light-mode .settings-section-header { border-bottom-color: #ddd; }
body.light-mode .filter-input, body.light-mode .filter-select { background: #f0f2f5; color: #1a1a1a; border-color: #ccc; }

/* Rankings & Boxes */
body.light-mode .ranking-box { background: linear-gradient(135deg, #f0f2f5, #e8eaed); border-color: #ddd; }
body.light-mode .ranking-item { color: #555; }

/* News */
body.light-mode .news-block { background: linear-gradient(135deg, #e8f4fd, #eef0ff); border-color: #3498db44; }
body.light-mode .news-block-text { color: #333; }
body.light-mode .news-list-item { border-bottom-color: #ddd; }
body.light-mode .news-list-text { color: #333; }
body.light-mode .news-list-btn { background: #e8e8e8; border-color: #ccc; color: #333; }
body.light-mode .news-list-btn:hover { background: #ddd; color: #111; }

/* Turniere */
body.light-mode .group-card { background: #fff; border-color: #ddd; }
body.light-mode .group-header { background: #e8e8e8; border-bottom-color: #ddd; }
body.light-mode .match-row { border-bottom-color: #e8e8e8; }
body.light-mode .match-row:hover { background: rgba(0,0,0,0.03); }
body.light-mode .bracket-match { background: #fff; border-color: #ddd; }
body.light-mode .bracket-match:hover { border-color: #aaa; }
body.light-mode .bracket-team { color: #333; }
body.light-mode .bracket-divider { background: #ddd; }

/* Misc */
body.light-mode .lane-badge { background: #e8e8e8; border-color: #ccc; color: #333; }
body.light-mode .score-badge { background: #f0f2f5; border-color: #ddd; }
body.light-mode .modal-overlay { background: rgba(0,0,0,0.5); }
body.light-mode .cal-preview-item { border-bottom-color: #ddd; }
body.light-mode .cal-preview-title { color: #333; }
body.light-mode #cookieBanner { background: #ffffff; border-top-color: #ddd; }
body.light-mode #cookieBanner p { color: #555; }

/* Inline-Style Overrides via Attribut-Selektoren */
body.light-mode [style*="background:#222"], body.light-mode [style*="background: #222"],
body.light-mode [style*="background:#1a1a1a"], body.light-mode [style*="background: #1a1a1a"],
body.light-mode [style*="background:#111"], body.light-mode [style*="background: #111"],
body.light-mode [style*="background:#151515"], body.light-mode [style*="background: #151515"],
body.light-mode [style*="background:#333"], body.light-mode [style*="background: #333"] {
    background: #f0f2f5 !important;
}
body.light-mode [style*="background:#1a1a2e"], body.light-mode [style*="background:linear-gradient(135deg, #1a1a2e"] {
    background: linear-gradient(135deg, #e8eaed, #f0f2f5) !important;
}
body.light-mode [style*="border:1px solid #333"], body.light-mode [style*="border: 1px solid #333"],
body.light-mode [style*="border:1px solid #444"], body.light-mode [style*="border: 1px solid #444"],
body.light-mode [style*="border:2px solid #444"], body.light-mode [style*="border: 2px solid #444"] {
    border-color: #ddd !important;
}
body.light-mode [style*="border-bottom:1px solid #333"], body.light-mode [style*="border-bottom:1px solid #222"],
body.light-mode [style*="border-bottom:1px solid #252729"] {
    border-bottom-color: #ddd !important;
}
body.light-mode [style*="color:#fff"], body.light-mode [style*="color: #fff"],
body.light-mode [style*="color:white"], body.light-mode [style*="color: white"] {
    color: #1a1a1a !important;
}
body.light-mode [style*="color:#ccc"], body.light-mode [style*="color: #ccc"],
body.light-mode [style*="color:#aaa"], body.light-mode [style*="color: #aaa"],
body.light-mode [style*="color:#888"], body.light-mode [style*="color: #888"],
body.light-mode [style*="color:#666"], body.light-mode [style*="color: #666"] {
    color: #666 !important;
}

/* =====================================================
   MOBILE RESPONSIVE (max-width: 768px)
   ===================================================== */
@media (max-width: 768px) {
    /* Container & Base */
    .container { padding: 8px; }
    body { font-size: 14px; }

    /* Navigation */
    .top-nav { gap: 6px; margin-bottom: 12px; padding-bottom: 8px; }
    #ligaTabs { gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    #ligaTabs::-webkit-scrollbar { display: none; }
    .tab-btn { padding: 8px 10px; font-size: 12px; }
    button.tab-btn { padding: 8px 10px; font-size: 12px; }
    .tab-wrapper { padding-right: 4px; }
    .pool-tabs { flex-wrap: wrap; width: 100%; padding: 4px; margin: 10px auto; }
    .pool-tab { padding: 6px 12px; font-size: 12px; }

    /* Cards */
    .card { border-radius: 8px; margin-bottom: 8px; }
    .card-title { padding: 12px; font-size: 14px; }
    .event-row { padding: 10px; gap: 10px; }

    /* Tabellen - kompakter */
    .table-responsive { border-radius: 8px; }
    .standings-table, .history-table { font-size: 12px; white-space: normal; }
    .standings-table th, .history-table th { padding: 8px 3px; font-size: 9px; letter-spacing: 0; }
    .standings-table td, .history-table td { padding: 8px 3px; }
    .team-cell { min-width: 70px; font-size: 12px; }
    .val-cell { min-width: 28px; font-size: 11px; }
    .pts-cell { min-width: 35px; font-size: 13px; }
    .rank-cell { width: 25px; font-size: 12px; }
    .hide-mobile { display: none !important; }

    /* Stats */
    .stats-header { padding: 12px; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .stat-box { padding: 6px; }
    .stat-num { font-size: 15px; }
    .stat-label { font-size: 9px; }

    /* Modal */
    .modal-overlay { padding: 4px; }
    .modal-box-framed { padding: 12px; max-width: 100%; border-radius: 10px; }

    /* Match-Modal */
    .match-modal-header { flex-direction: column; gap: 6px; text-align: center; }
    .match-modal-header > div { flex: none !important; text-align: center !important; }
    .match-modal-header > div:nth-child(2) { min-width: auto; }
    .dual-score-table { table-layout: auto; }
    .dual-score-table th { padding: 6px 2px; font-size: 9px; }
    .col-score { width: auto; min-width: 28px; }
    .col-divider { display: none; }
    .col-divider-cell { display: none; }
    .dual-score-table th:nth-child(4) { border-right: 2px solid var(--primary); }
    .dual-row td:nth-child(4) { border-right: 2px solid var(--primary); }
    .mobile-serie-row { display: table-row; }
    .dual-row td { padding: 6px 1px; }
    .score-input-modal { max-width: 36px; padding: 5px 1px; font-size: 12px; -moz-appearance: textfield; }
    .score-input-modal::-webkit-outer-spin-button, .score-input-modal::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .slot-select-modal { font-size: 10px; padding: 3px 2px; }
    .score-cell-content { min-height: 40px; gap: 1px; }
    .sub-dropdown-wrapper { margin-top: 3px; padding-top: 2px; }
    .serie-comparison { gap: 4px; }
    .serie-box { width: 48%; }
    .s-val { font-size: 9px; }
    .h-val { font-size: 10px; }
    .p-val { font-size: 11px; }

    /* Buttons */
    .save-btn { padding: 12px; font-size: 14px; margin-top: 12px; }
    .mini-btn { padding: 6px 8px; font-size: 12px; }

    /* Grids responsive */
    .grid-2col { grid-template-columns: 1fr; }
    .grid-auto-250 { grid-template-columns: 1fr; }

    /* Bilder */
    .team-logo-img { width: 80px; height: 80px; }
    .player-photo-img { width: 70px; height: 70px; }

    /* Player Container */
    .player-item { padding: 8px 0; font-size: 13px; }
    .player-container { padding: 0 10px 10px; }

    /* Turnier Bracket */
    .bracket-container { flex-direction: column; align-items: stretch; min-height: auto; gap: 15px; padding: 10px 0; }
    .bracket-round { flex-direction: row; flex-wrap: wrap; gap: 8px; min-width: auto; }
    .bracket-round-label { font-size: 10px; margin-bottom: 4px; }
    .bracket-match { min-width: 130px; flex: 1; }
    .bracket-team { padding: 6px 8px; font-size: 12px; }
    .bracket-final { max-width: none; }

    /* Turnier Gruppen */
    .group-card { margin-bottom: 12px; }
    .group-header { padding: 10px 12px; font-size: 14px; }
    .match-row { padding: 6px 8px; font-size: 12px; }

    /* Score Display in Ergebnisse */
    .score-display-box { min-width: 50px; }
    .score-badge { margin: 0 4px; padding: 3px 6px; font-size: 13px; }
    .match-team-name { font-size: 13px; word-break: break-word; }

    /* Tournament Score Input */
    .tournament-score-input { padding: 6px; font-size: 14px; }

    /* Bonus Ranking */
    .bonus-ranking { padding: 8px; }
}

/* =====================================================
   WIEDERVERWENDBARE KOMPONENTEN
   ===================================================== */

/* Ranking-Box (Bonus, Peterson, Field) */
.ranking-box { margin-top: 15px; padding: 12px; background: linear-gradient(135deg, #1a1a1a, #252525); border: 1px solid #333; border-radius: 8px; }
.ranking-box-label { font-size: 12px; color: #888; text-transform: uppercase; margin-bottom: 8px; }
.ranking-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; color: #aaa; }
.ranking-item.first { font-weight: bold; }
.ranking-item.bonus-first { color: var(--gold); }
.ranking-item.peterson-first { color: #ff9800; }
.ranking-item.field-first { color: #9C27B0; }

/* Modal-Formulare */
.modal-label { display: block; color: #888; font-size: 11px; margin-bottom: 5px; text-transform: uppercase; }
.modal-label-gap { display: block; color: #888; font-size: 11px; margin: 15px 0 5px 0; text-transform: uppercase; }
.modal-input { width: 100%; padding: 12px; background: #222; color: white; border: 1px solid #444; border-radius: 6px; box-sizing: border-box; }
.modal-input-disabled { width: 100%; padding: 12px; background: #222; color: #666; border: 1px solid #444; border-radius: 6px; box-sizing: border-box; }
.modal-hint { font-size: 11px; color: #666; margin-top: 5px; }
.modal-subtitle { color: #888; font-size: 12px; }
.modal-section { margin-top: 20px; }
.modal-preview-img { max-width: 200px; max-height: 200px; margin-top: 15px; border-radius: 8px; border: 1px solid #444; }
.modal-preview-round { max-width: 200px; max-height: 200px; margin-top: 15px; border-radius: 50%; border: 2px solid #444; }
.btn-cancel { background: #444; margin-top: 10px; }

/* Settings-Formulare */
.settings-input { width: 100%; padding: 8px; margin-top: 5px; background: #222; color: white; border: 1px solid #444; border-radius: 4px; box-sizing: border-box; }
.settings-label { display: block; margin: 10px 0; color: #ccc; }
.settings-section-header { margin: 20px 0 10px 0; padding-bottom: 8px; border-bottom: 1px solid #333; color: var(--primary); font-size: 14px; }
.settings-hint { font-size: 12px; color: #888; margin-top: 3px; }

/* Filter */
.filter-group { display: flex; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; align-items: center; }
.filter-group > div { display: flex; flex-direction: column; gap: 5px; }
.filter-label { font-size: 12px; color: #888; }
.filter-input { width: 100px; padding: 6px; background: #222; color: white; border: 1px solid #444; border-radius: 4px; }
.filter-select { padding: 6px; background: #222; color: white; border: 1px solid #444; border-radius: 4px; }

/* Bahn-Badge */
.lane-badge { background: #222; border: 1px solid #444; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 11px; margin-top: 4px; }

/* News-Block */
.news-block { background: linear-gradient(135deg, #1a2a3a, #1a1c2e); border: 1px solid #3498db44; border-radius: 10px; padding: 15px 20px; margin-bottom: 20px; }
.news-block-header { display: flex; justify-content: space-between; align-items: center; color: var(--primary); font-weight: bold; font-size: 14px; }
.news-block-text { color: #e0e0e0; margin-top: 8px; white-space: pre-wrap; word-break: break-word; }
.news-block-meta { font-size: 11px; color: #666; margin-top: 8px; }
.news-block-edit { cursor: pointer; font-size: 16px; opacity: 0.6; transition: opacity 0.2s; }
.news-block-edit:hover { opacity: 1; }
.news-add-btn { color: #666; font-size: 13px; cursor: pointer; padding: 10px 0; text-align: center; }
.news-add-btn:hover { color: var(--primary); }
.news-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #333; }
.news-list-order { display: flex; flex-direction: column; gap: 2px; }
.news-list-text { flex: 1; color: #ccc; font-size: 13px; min-width: 0; }
.news-list-text > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list-actions { display: flex; gap: 6px; flex-shrink: 0; }
.news-list-btn { background: #333; border: 1px solid #555; color: #ccc; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.news-list-btn:hover { background: #444; color: white; }
.news-list-btn.disabled { opacity: 0.3; cursor: default; pointer-events: none; }

/* Calendar Preview */
.cal-preview-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-bottom: 1px solid #333; }
.cal-preview-date { min-width: 70px; color: #3498db; font-weight: bold; }
.cal-preview-title { color: #e0e0e0; flex: 1; }

/* Toast - already in utils.js but backup */
.toast-success { background: #2ecc71; }
.toast-error { background: #e74c3c; }
.toast-warning { background: #f39c12; }
.toast-info { background: #3498db; }

/* Ergebnis-Farben */
.result-win { color: #4CAF50; }
.result-loss { color: #e74c3c; }
.result-draw { color: var(--gold); }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* LOADING SPINNER */
.loading-spinner {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; color: var(--text-dim);
}
.loading-spinner::before {
    content: ''; display: block; width: 40px; height: 40px;
    border: 3px solid #333; border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px;
}

/* EMPTY STATE */
.empty-state {
    text-align: center; padding: 40px 20px; color: var(--text-dim);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state-text { font-size: 13px; max-width: 300px; margin: 0 auto 16px; line-height: 1.5; }
.empty-state-btn {
    display: inline-block; background: var(--primary); color: #fff; border: none;
    padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.empty-state-btn:hover { opacity: 0.9; }

/* BUTTON LOADING STATE */
.save-btn:disabled, .mini-btn:disabled, .sidebar-btn:disabled {
    opacity: 0.6; cursor: not-allowed; pointer-events: none;
}
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.6s linear infinite;
}

/* STICKY TABLE HEADERS */
.table-responsive { position: relative; }
.standings-table thead th, .history-table thead th {
    position: sticky; top: 0; z-index: 2;
}

/* HANDICAP INFO BUTTON */
.hdcp-info-btn {
    background: none; border: none; color: var(--primary); cursor: pointer;
    font-size: 14px; padding: 2px 6px; opacity: 0.7; vertical-align: middle;
}
.hdcp-info-btn:hover { opacity: 1; }
.hdcp-step { padding: 8px 0; border-bottom: 1px solid #333; }
.hdcp-step:last-child { border-bottom: none; }
.hdcp-step-label { font-size: 12px; color: #888; text-transform: uppercase; margin-bottom: 4px; }
.hdcp-step-value { font-size: 16px; font-weight: bold; color: var(--text); }
.hdcp-step-formula { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* OFFLINE BANNER */
#offlineBanner { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }

/* SKIP LINK (accessibility) */
.skip-link {
    position: absolute; top: -100%; left: 16px; z-index: 9999;
    background: var(--primary); color: #fff; padding: 8px 16px; border-radius: 4px; font-size: 14px;
    text-decoration: none;
}
.skip-link:focus { top: 8px; }