/* GENEROVÁNO scripts/bust-cache.cjs z css/style.css — NEEDITOVAT RUČNĚ.
   Zdroj pravidel jsou importované soubory; změnu udělej tam a spusť node scripts/bust-cache.cjs. */

/* --- css/style.css --- */
/* TurnajSystem — Hlavní styly (design tokens + index).
   Po refaktoru obsahuje :root tokens + dark mode + @import index.
   Komponenty viz base.css, components.css, responsive.css, accessibility.css, themes/.

   POZOR: @import MUSÍ být na začátku CSS souboru (CSS spec), jinak je browser
   ignoruje. Tokeny v :root jsou globální a dostupné importovaným stylesheets
   bez ohledu na jejich umístění zde. */

/* --- css/base.css --- */
/* TurnajSystem — Base styly
   Container, typografie, buttons, forms, cards, tables, grid, utility, loader. */

/* Reset */
* { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typografie */
h1, h2, h3, h4 {
    margin: 0 0 1rem;
    font-weight: 600;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Tlačítka */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 60%);
    transform: scale(0);
    opacity: 0;
    transition: transform var(--transition-slow), opacity var(--transition-normal);
    pointer-events: none;
}
.btn:active::after {
    transform: scale(2.5);
    opacity: 1;
}
.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-on-color);
}
.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    text-decoration: none;
}

.btn-secondary { background: var(--gray);    color: var(--text-on-color); }
.btn-success   { background: var(--success); color: var(--text-on-color); }
.btn-danger    { background: var(--danger);  color: var(--text-on-color); }

.btn-sm { padding: 6px 12px;  font-size: 0.875rem; }
.btn-lg { padding: 14px 28px; font-size: 1.125rem; }

/* Formuláře */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast);
    background: var(--input-bg);
    color: var(--text);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px var(--primary-glow);
}

select.form-control {
    background: var(--input-bg);
    color: var(--text);
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Karty */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.card:hover {
    transform: translateY(-2px);
    border-color: rgba(220, 20, 60, 0.2);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
}

/* Tabulky */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--gradient-primary);
    color: var(--text-on-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--text-xs);
}

.table tr {
    transition: background var(--transition-fast);
}
.table tr:hover {
    background: var(--hover-bg);
}
.table tr:last-child td {
    border-bottom: none;
}
.table tr:nth-child(even) {
    background: var(--table-stripe);
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}
.col {
    flex: 1;
    padding: 0 10px;
}
.col-6 { flex: 0 0 50%; }
.col-4 { flex: 0 0 33.333%; }
.col-3 { flex: 0 0 25%; }

/* Utility */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

/* Loader */
.loader {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* --- css/components.css --- */
/* TurnajSystem — UI komponenty
   Header (+admin nav, theme toggle, admin hamburger, lang switcher),
   alerts, badges, modal, season tabs, tournaments timeline, h2h grid,
   table-responsive wrapper. */

/* =============================================
   Header
   ============================================= */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-on-color);
    padding: 15px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 50%, #06cef9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header nav a {
    color: rgba(255, 255, 255, 0.7);
    margin-left: 20px;
    transition: color var(--transition-fast);
}

.header nav a:hover,
.header nav a.active {
    color: var(--text-on-color);
    text-decoration: none;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition-fast), color var(--transition-fast);
    line-height: 1;
}

.theme-toggle:hover {
    color: var(--text-on-color);
    background: rgba(255, 255, 255, 0.15);
}

/* Admin hamburger menu */
.admin-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.admin-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-on-color);
    margin: 5px 0;
    transition: all var(--transition-normal);
    border-radius: 1px;
}

.admin-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.admin-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.admin-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Language switcher */
.lang-switcher {
    display: inline-flex;
    gap: 2px;
    margin-left: 8px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* =============================================
   Alerts
   ============================================= */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

[data-theme="dark"] .alert-success {
    background: var(--success-bg-soft);
    color: #5ced73;
    border: 1px solid rgba(40, 167, 69, 0.3);
}
[data-theme="dark"] .alert-danger {
    background: rgba(220, 53, 69, 0.15);
    color: var(--color-danger-light);
    border: 1px solid rgba(220, 53, 69, 0.3);
}
[data-theme="dark"] .alert-warning {
    background: rgba(255, 193, 7, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(255, 193, 7, 0.3);
}
[data-theme="dark"] .alert-info {
    background: var(--secondary-bg-medium);
    color: var(--secondary);
    border: 1px solid rgba(6, 206, 249, 0.3);
}

/* =============================================
   Badges
   ============================================= */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
}

.badge-success   { background: var(--success);   color: var(--text-on-color); }
.badge-warning   { background: var(--warning);   color: #333; }
.badge-danger    { background: var(--danger);    color: var(--text-on-color); }
.badge-secondary { background: var(--gray);      color: var(--text-on-color); }
.badge-primary   { background: var(--primary);   color: var(--text-on-color); }

/* =============================================
   Modal
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--modal-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--text);
    animation: modalSlideUp 0.3s var(--ease-out);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =============================================
   Season Tabs + Tournaments Timeline
   ============================================= */
.season-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
}

.season-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.season-tab:hover {
    color: var(--primary);
}

.season-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tournaments-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.tournament-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 15px;
    border-left: 4px solid var(--text-muted);
}

.tournament-card.completed {
    border-left-color: var(--success);
}

.tournament-round {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tournament-name {
    font-weight: 600;
    margin: 5px 0;
}

.tournament-date {
    font-size: 0.9rem;
    color: var(--gray);
}

.tournament-players {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.tournament-podium {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
}

.podium-place {
    font-size: 0.9rem;
    padding: 2px 0;
}

/* =============================================
   Head-to-Head Grid
   ============================================= */
.h2h-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.h2h-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
}

.h2h-players {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.h2h-player {
    font-weight: 500;
}

.h2h-player.winner {
    color: var(--success);
    font-weight: 700;
}

.h2h-vs {
    color: var(--gray);
    font-size: 0.8rem;
}

.h2h-score {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
}

.h2h-wins {
    color: var(--dark);
}

.h2h-wins.winner {
    color: var(--success);
}

.h2h-separator {
    color: var(--gray);
    margin: 0 5px;
}

.h2h-legs {
    font-size: 0.9rem;
    color: var(--gray);
}

.h2h-matches {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 5px;
}

.h2h-filter {
    display: flex;
    gap: 10px;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive .table {
    margin-bottom: 0;
}
/* --- css/responsive.css --- */
/* TurnajSystem — Globální responsive overrides (tablet/mobile/small mobile) */

/* Tablet (max 1024px) */
@media (max-width: 1024px) {
    .col-4 { flex: 0 0 50%; }
    .col-3 { flex: 0 0 50%; }
}

/* Mobil (max 768px) */
@media (max-width: 768px) {
    .col-6, .col-4, .col-3 {
        flex: 0 0 100%;
    }

    /* Admin hamburger nav */
    .admin-menu-toggle {
        display: block;
    }

    .header .container {
        position: relative;
    }

    .header nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        z-index: 100;
        padding: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }

    .header nav.active {
        display: flex;
    }

    .header nav a {
        padding: 12px 20px;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0;
    }

    .header nav a:last-of-type {
        border-bottom: none;
    }

    .header nav .theme-toggle {
        padding: 12px 20px;
        border-radius: 0;
    }

    /* Tabulky */
    .table {
        font-size: 0.875rem;
    }
    .table th,
    .table td {
        padding: 8px 10px;
    }

    /* Formuláře — stacked */
    .row {
        flex-direction: column;
    }

    .col {
        flex: none;
        width: 100%;
    }

    /* Modály — bottom sheet */
    .modal {
        max-width: 100%;
        width: 100%;
        max-height: 85vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        margin: 0;
        animation: sheetSlideUp 0.35s var(--ease-out);
    }

    @keyframes sheetSlideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    .modal-overlay {
        align-items: flex-end;
    }

    /* Touch targets */
    .btn { min-height: 44px; }
    .faq-question { min-height: 48px; }

    /* Dashboard karty */
    #dashboard {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Container padding */
    .container {
        padding: 0 15px;
    }

    /* H2H filter stacked */
    .h2h-filter {
        flex-direction: column;
    }

    /* Season tabs scrollable */
    .season-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .season-tab {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Malý mobil (max 480px) */
@media (max-width: 480px) {
    #dashboard {
        grid-template-columns: 1fr !important;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .btn { padding: 8px 16px; font-size: 0.9rem; }
    .btn-lg { padding: 12px 24px; }
}
/* --- css/accessibility.css --- */
/* TurnajSystem — Accessibility
   Skip link, focus-visible (klávesová navigace), reduced motion preference. */

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--text-on-color);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 0 0 var(--radius) var(--radius);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

/* Focus visible pro bracket zápasy */
.bracket-match:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(6, 206, 249, 0.3);
}

/* Reduced motion preference — disable animations + transitions */
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}
/* --- css/themes/colorblind.css --- */
/* TurnajSystem — Color-blind mode (WCAG AA 4.5:1 kontrast)
   Aktivuje se přes [data-theme="colorblind"] na <html>.
   Strategie: vzory + ikony místo samotných barev, colorblind-safe paleta. */

[data-theme="colorblind"] {
    --bg: #1a1a2e;
    --card-bg: rgba(255, 255, 255, 0.06);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --border-color: rgba(255, 255, 255, 0.15);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.4);
    --table-stripe: rgba(255, 255, 255, 0.03);
    --input-bg: rgba(255, 255, 255, 0.08);
    --modal-bg: #1e1e3a;
    --hover-bg: rgba(255, 255, 255, 0.08);
    --white: rgba(255, 255, 255, 0.06);
    --light: #1a1a2e;
    --dark: #ffffff;
    --gray: rgba(255, 255, 255, 0.5);
    --border: rgba(255, 255, 255, 0.1);

    /* Colorblind-safe paleta — vysoký kontrast, odlišitelné i bez barev */
    --primary: #0077bb;
    --primary-dark: #005599;
    --success: #009e73;
    --warning: #f0e442;
    --danger: #d55e00;
    --secondary: #56b4e9;
}

/* Badge — přidání ikon/prefixů pro rozlišení bez barvy */
[data-theme="colorblind"] .badge-success {
    background: #009e73;
    position: relative;
}
[data-theme="colorblind"] .badge-success::before {
    content: '\2713 ';
    font-weight: 700;
}

[data-theme="colorblind"] .badge-warning {
    background: #f0e442;
    color: #000000;
}
[data-theme="colorblind"] .badge-warning::before {
    content: '\26a0 ';
}

[data-theme="colorblind"] .badge-danger {
    background: #d55e00;
}
[data-theme="colorblind"] .badge-danger::before {
    content: '\2717 ';
}

[data-theme="colorblind"] .badge-primary {
    background: #0077bb;
}

/* Bracket match statusy — vzory pro rozlišení */
[data-theme="colorblind"] .bracket-match.completed {
    border-left: 4px solid #009e73;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 158, 115, 0.06) 10px,
        rgba(0, 158, 115, 0.06) 20px
    );
}

[data-theme="colorblind"] .bracket-match.ready {
    border-left: 4px solid #f0e442;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(240, 228, 66, 0.06) 8px,
        rgba(240, 228, 66, 0.06) 16px
    );
}

[data-theme="colorblind"] .bracket-match.pending {
    opacity: 0.5;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 6px,
        rgba(255, 255, 255, 0.03) 6px,
        rgba(255, 255, 255, 0.03) 12px
    );
}

[data-theme="colorblind"] .bracket-match.in-progress,
[data-theme="colorblind"] .bracket-match.in_progress {
    border-left: 4px solid #56b4e9;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 6px,
        rgba(86, 180, 233, 0.05) 6px,
        rgba(86, 180, 233, 0.05) 12px
    );
}

/* Hráči — výhra/prohra se vzory */
[data-theme="colorblind"] .bracket-player.winner {
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 158, 115, 0.08),
        rgba(0, 158, 115, 0.08) 4px,
        rgba(0, 158, 115, 0.15) 4px,
        rgba(0, 158, 115, 0.15) 8px
    );
    border-left: 3px solid #009e73;
}

[data-theme="colorblind"] .bracket-player.loser {
    background: repeating-radial-gradient(
        circle at 3px 3px,
        rgba(213, 94, 0, 0.1) 1px,
        transparent 1px,
        transparent 6px
    );
    opacity: 0.65;
    border-left: 3px solid #d55e00;
}

[data-theme="colorblind"] .bracket-player-score.winner {
    color: #009e73;
    font-weight: 800;
}

/* Alerts — silnější borders + ikony */
[data-theme="colorblind"] .alert-success {
    background: rgba(0, 158, 115, 0.15);
    color: #ffffff;
    border: 2px solid #009e73;
    border-left: 6px solid #009e73;
}
[data-theme="colorblind"] .alert-success::before {
    content: '\2713 ';
    font-weight: 700;
}

[data-theme="colorblind"] .alert-danger {
    background: rgba(213, 94, 0, 0.15);
    color: #ffffff;
    border: 2px solid #d55e00;
    border-left: 6px solid #d55e00;
}
[data-theme="colorblind"] .alert-danger::before {
    content: '\2717 ';
    font-weight: 700;
}

[data-theme="colorblind"] .alert-warning {
    background: rgba(240, 228, 66, 0.12);
    color: #ffffff;
    border: 2px solid #f0e442;
    border-left: 6px solid #f0e442;
}
[data-theme="colorblind"] .alert-warning::before {
    content: '\26a0 ';
}

[data-theme="colorblind"] .alert-info {
    background: rgba(86, 180, 233, 0.15);
    color: #ffffff;
    border: 2px solid #56b4e9;
    border-left: 6px solid #56b4e9;
}
[data-theme="colorblind"] .alert-info::before {
    content: '\2139 ';
    font-weight: 700;
}

/* Tabulka — silnější odlišení top 3 */
[data-theme="colorblind"] .round-robin-table tr.top-3:nth-child(1) {
    background: rgba(0, 158, 115, 0.15);
    border-left: 4px solid #009e73;
}
[data-theme="colorblind"] .round-robin-table tr.top-3:nth-child(2) {
    background: rgba(86, 180, 233, 0.12);
    border-left: 4px solid #56b4e9;
}
[data-theme="colorblind"] .round-robin-table tr.top-3:nth-child(3) {
    background: rgba(240, 228, 66, 0.08);
    border-left: 4px solid #f0e442;
}

/* Presence indikátor — tvar místo barvy */
[data-theme="colorblind"] .presence-indicator {
    border-radius: 0;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

[data-theme="colorblind"] .presence-indicator.present {
    background: #009e73;
    border-color: #009e73;
    border-radius: 0;
}

/* Timer — vzory pro urgentnost */
[data-theme="colorblind"] .match-timer.timer-urgent  { border-top: 3px dashed #d55e00; }
[data-theme="colorblind"] .match-timer.timer-warning { border-top: 3px dotted #f0e442; }
[data-theme="colorblind"] .match-timer.timer-ok      { border-top: 3px solid  #009e73; }

/* Capacity bar */
[data-theme="colorblind"] .capacity-fill.green  { background: #009e73; }
[data-theme="colorblind"] .capacity-fill.yellow { background: #f0e442; }
[data-theme="colorblind"] .capacity-fill.red    { background: #d55e00; }

/* Buttons */
[data-theme="colorblind"] .btn-primary { background: #0077bb; }
[data-theme="colorblind"] .btn-primary:hover { background: #005599; }
[data-theme="colorblind"] .btn-success { background: #009e73; }
[data-theme="colorblind"] .btn-danger  { background: #d55e00; }

/* Match detail modal */
[data-theme="colorblind"] .match-detail-player.winner {
    border-left-color: #009e73;
    background: rgba(0, 158, 115, 0.1);
}
[data-theme="colorblind"] .match-detail-player.winner .match-detail-player-score {
    color: #009e73;
}

/* Grand final */
[data-theme="colorblind"] .grand-final {
    border-color: rgba(0, 119, 187, 0.4);
    background: rgba(0, 119, 187, 0.06);
}
[data-theme="colorblind"] .grand-final .bracket-match {
    border-color: rgba(0, 119, 187, 0.5);
}

/* Focus visible — vysoký kontrast pro klávesovou navigaci */
[data-theme="colorblind"] a:focus-visible,
[data-theme="colorblind"] button:focus-visible,
[data-theme="colorblind"] .bracket-match:focus-visible {
    outline: 3px solid #f0e442;
    outline-offset: 3px;
}

:root {
    --primary: #dc143c;
    --primary-dark: #b01030;
    --secondary: #06cef9;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

    --radius: 8px;

    /* Light mode (default pro zpětnou kompatibilitu) */
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
    --table-stripe: #f8f9fa;
    --input-bg: #ffffff;
    --modal-bg: #ffffff;
    --hover-bg: #f0f0f0;

    /* Aliasy pro zpětnou kompatibilitu */
    --dark: #343a40;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray: #6c757d;
    --border: #dee2e6;

    /* === Design System Tokeny === */

    /* Glow & Gradient */
    --primary-glow: rgba(220, 20, 60, 0.15);
    --secondary-glow: rgba(6, 206, 249, 0.15);
    --gradient-primary: linear-gradient(135deg, #dc143c, #ff2d55);
    --gradient-bg: linear-gradient(135deg, #f0f2f5 0%, #e8edf2 50%, #dce4ed 100%);
    --gradient-card: linear-gradient(135deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.01));

    /* Spacing scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-normal: 250ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);

    /* Typography scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3.5rem;

    /* Shadows - layered */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Glass */
    --glass-bg: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-blur: blur(20px);

    /* Radius scale */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Medal colors (rankings, achievements) */
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --gold-warm: #d4a520;

    /* Alpha variants (často reusable v badges, hovers) */
    --primary-bg-soft: rgba(220, 20, 60, 0.1);
    --primary-bg-medium: rgba(220, 20, 60, 0.15);
    --primary-bg-strong: rgba(220, 20, 60, 0.3);
    --secondary-bg-soft: rgba(6, 206, 249, 0.1);
    --secondary-bg-medium: rgba(6, 206, 249, 0.15);
    --secondary-bg-strong: rgba(6, 206, 249, 0.25);
    --success-bg-soft: rgba(40, 167, 69, 0.15);
    --success-bg-medium: rgba(40, 167, 69, 0.2);
    --success-bg-strong: rgba(40, 167, 69, 0.3);
    --warning-bg-soft: rgba(255, 193, 7, 0.13);
    --danger-bg-soft: rgba(220, 53, 69, 0.1);
    --danger-bg-medium: rgba(220, 53, 69, 0.2);
    --danger-bg-strong: rgba(220, 53, 69, 0.25);
    --gold-bg-soft: rgba(255, 215, 0, 0.15);
    --silver-bg-soft: rgba(192, 192, 192, 0.15);
    --bronze-bg-soft: rgba(205, 127, 50, 0.15);

    /* Status text colors (success/warning/danger semantic aliases) */
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-danger-light: #ff6b7a;
    --color-warning: #ffc107;

    /* Text na barevném pozadí (buttons, badges, gradient headers) — vždy bílá.
       NEPOUŽÍVAT --white — v dark mode je to rgba(255,255,255,0.06) pro glass effect! */
    --text-on-color: #ffffff;
}

/* Signature gradient (BSL) — crimson → cyan. Hero proužky, accent bary, logo text. */
:root {
    --gradient-accent: linear-gradient(135deg, #dc143c 0%, #06cef9 100%);
}

/* Dark mode — sladěno s Bruntálskou šipkovou ligou: čistě černé pozadí
   (#0a0a0a / #141414 / #1c1c1c), NE navy. Crimson + cyan akcenty + gradient. */
[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-secondary: #141414;
    --card-bg: #1c1c1c;
    --text: #ffffff;
    --text-muted: #9aa0a6;
    --border-color: #2e2e2e;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.6);
    --table-stripe: rgba(255, 255, 255, 0.03);
    --input-bg: #1c1c1c;
    --modal-bg: #141414;
    --hover-bg: #232323;

    --white: #1c1c1c;
    --light: #141414;
    --dark: #ffffff;
    --gray: #9aa0a6;
    --border: #2e2e2e;

    --gradient-bg: linear-gradient(135deg, #0a0a0a 0%, #141414 60%, #1a0008 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    --glass-bg: #1c1c1c;
    --glass-border: #2e2e2e;
}

/* === Vizuální editor bodovacích tabulek (sezóna + FFA custom) === */
.scoring-editor { margin-top: 0.5rem; border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; }
.scoring-row { display: grid; grid-template-columns: 1fr 1fr 1fr 32px; gap: 8px; align-items: center; margin-bottom: 6px; }
.scoring-row-head { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.scoring-row-head span { padding-left: 4px; }
.scoring-row input { padding: 6px 8px; }
.btn-row-del { border: none; background: transparent; color: var(--danger, #ff6b7a); font-size: 1.3rem; line-height: 1; cursor: pointer; border-radius: 6px; }
.btn-row-del:hover { background: rgba(220, 53, 69, 0.12); }
.scoring-editor-actions { display: flex; gap: 8px; margin: 8px 0 6px; }
.ffa-row { grid-template-columns: 1fr 1fr 32px; }
