/* ================================================ */
/*  DRAWS PAGE - WHITE LABEL THEME AWARE          */
/*  Uses CSS variables from theme-system.css      */
/* ================================================ */

    /* ================================================ */
    /* DRAWS PAGE STYLES - THEME AWARE                */
    /* Uses CSS variables from theme-system.css       */
    /* ================================================ */
/* ================================================ */
    /* DRAWS PAGE STYLES (Adapted from Teams Page)    */
    /* ================================================ */


    .hero-draws {
        position: relative;
        background: var(--bg-primary);
        overflow: visible;
        padding: 8rem 0 4rem;
        min-height: 40vh;
        display: flex;
        align-items: center;
    }

    /* Top-left glow - accent primary */
    .hero-draws::before {
        content: "";
        position: absolute;
        top: -20%;
        left: -15%;
        width: 60%;
        height: 80%;
        background: radial-gradient(
            circle at center,
            color-mix(in srgb, var(--accent-primary) 15%, transparent) 0%,
            color-mix(in srgb, var(--accent-primary) 8%, transparent) 30%,
            transparent 70%
        );
        pointer-events: none;
        z-index: 1;
        animation: pulse-glow 8s ease-in-out infinite;
        filter: blur(60px);
    }

    /* Bottom-right glow - accent secondary */
    .hero-draws::after {
        content: "";
        position: absolute;
        bottom: -20%;
        right: -15%;
        width: 50%;
        height: 60%;
        background: radial-gradient(
            circle at center,
            color-mix(in srgb, var(--accent-secondary) 10%, transparent) 0%,
            color-mix(in srgb, var(--accent-secondary) 5%, transparent) 30%,
            transparent 70%
        );
        pointer-events: none;
        z-index: 1;
        animation: pulse-glow 8s ease-in-out infinite 4s;
        filter: blur(60px);
    }

    .hero-draws > * {
        position: relative;
        z-index: 3;
    }
50% { opacity: 0.7; transform: scale(1.1); }
    }

    /* ===== MAIN SECTION & CONTAINER ===== */
    .draws-main-section {
        position: relative;
        overflow: visible;
        padding: 3rem 0;
    }

    .draw-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-primary);
        border-radius: 1.5rem;
        padding: 1.5rem;
        position: relative;
    }
    
    /* Subtle radial glow overlay */
    .draw-container::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(
            ellipse at 0% 100%,
            color-mix(in srgb, var(--accent-primary) 8%, transparent) 0%,
            transparent 65%
        );
        pointer-events: none;
        z-index: 1;
        border-radius: inherit;
    }

    .draw-container > * {
        position: relative;
        z-index: 2;
    }

    /* ===== CATEGORY TABS & SELECT ===== */
    .category-tabs {
        display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-bottom: 2rem;
    }
    .category-tab {
        background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
        border: 1px solid var(--border-primary);
        color: var(--text-primary); padding: 0.5rem 1.25rem; border-radius: 9999px;
        cursor: pointer; transition: all 0.3s ease; text-decoration: none;
        display: inline-flex; align-items: center; gap: 0.5rem;
        font-weight: 600; font-size: 0.875rem;
    }
    .category-tab:hover {
        border-color: var(--accent-secondary);
        color: var(--accent-secondary);
        transform: translateY(-2px);
    }
    .category-tab.active {
        border-color: var(--accent-secondary);
        color: var(--accent-secondary);
        box-shadow: 0 0 15px color-mix(in srgb, var(--accent-secondary) 30%, transparent);
    }
    .mobile-select {
        width: 100%;
        padding: 0.75rem 1rem;
        background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
        border: 1px solid var(--border-color);
        border-radius: 9999px;
        color: var(--text-primary);
    }
    .mobile-select option { background: var(--bg-secondary); }
    
    /* ===== PHASE HEADERS ===== */
    .phase-header {
        display: flex; align-items: center; gap: 0.75rem;
        padding-bottom: 1rem; margin-bottom: 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    .phase-title {
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--text-primary);
        margin: 0;
    }

    /* ===== MATCH CARD STYLING ===== */
    .match-card {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 0.75rem;
        padding: 1rem;
        transition: all 0.3s ease;
        position: relative;
    }
    /* Subtle radial glow overlay */
    .match-card::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(
            ellipse at 0% 100%,
            color-mix(in srgb, var(--accent-primary) 6%, transparent) 0%,
            transparent 65%
        );
        pointer-events: none;
        z-index: 1;
        border-radius: inherit;
    }
    .match-card > * { position: relative; z-index: 2; }

    .match-team-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    .match-team-name {
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--text-primary);
        line-height: 1.3;
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }
    .match-card:hover {
        background: color-mix(in srgb, var(--bg-tertiary) 80%, transparent);
        border-color: color-mix(in srgb, var(--accent-primary) 40%, transparent);
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
    }

    /* Phase Badge (CF1, SF1, etc.) */
    .phase-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: 700;
        border-radius: 9999px;
        padding: 0.25rem 0.75rem;
    }
    .phase-badge--quarter {
        background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
        color: var(--accent-primary);
        border: 1px solid color-mix(in srgb, var(--accent-primary) 20%, transparent);
    }
    .phase-badge--semi {
        background: color-mix(in srgb, var(--accent-secondary) 10%, transparent);
        color: var(--accent-secondary);
        border: 1px solid color-mix(in srgb, var(--accent-secondary) 20%, transparent);
    }
    .phase-badge--final {
        background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
        color: var(--accent-primary);
        border: 1px solid color-mix(in srgb, var(--accent-primary) 20%, transparent);
    }

    /* Score display */
    .score-set {
        background-color: var(--bg-accent);
        color: var(--text-secondary);
        font-weight: 600; text-align: center;
        width: 2rem; height: 2rem; line-height: 2rem;
        border-radius: 0.375rem;
    }

    /* ===== BACK TO TOP BUTTON ===== */
    .back-to-top {
        position: fixed; bottom: 1.5rem; right: 1.5rem; height: 3.5rem; width: 3.5rem;
        border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center;
        opacity: 0; visibility: hidden; transition: all 0.3s ease; cursor: pointer; z-index: 50;
        background: var(--gradient-primary); color: var(--bg-primary);
        box-shadow: 0 8px 30px color-mix(in srgb, var(--accent-primary) 40%, transparent);
        font-size: 1.25rem;
    }
    .back-to-top.show { opacity: 1; visibility: visible; }
    .back-to-top:hover { transform: translateY(-3px) scale(1.05); }

    /* ===== EMPTY STATE ===== */
    .empty-state {
        text-align: center;
        padding: 4rem 2rem;
        background: var(--bg-card, rgba(255,255,255,0.04));
        border: 1px solid var(--border-primary, rgba(255,255,255,0.08));
        border-radius: 1.25rem;
        margin: 1.5rem 0;
    }

    .empty-icon {
        width: 5rem;
        height: 5rem;
        border-radius: 50%;
        background: var(--gradient-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 1.5rem;
        box-shadow: 0 8px 30px color-mix(in srgb, var(--accent-secondary) 30%, transparent);
        animation: float 3s ease-in-out infinite;
    }

    .empty-icon i {
        color: var(--bg-primary);
        font-size: 2rem;
    }

    .empty-state h3 {
        color: var(--text-primary);
    }

    .empty-state p {
        color: var(--text-secondary);
        max-width: 30rem;
        margin: 0 auto;
        line-height: 1.75;
    }

    @keyframes float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-10px); }
    }

    /* Animation */
    .category-content { animation: fadeIn 0.5s ease-out; }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* ===== BRACKET LAYOUT ===== */
    .bracket-scroll {
        overflow-x: auto;
        padding: 1rem 0 2rem;
        -webkit-overflow-scrolling: touch;
        cursor: grab;
    }
    .bracket-scroll:active { cursor: grabbing; }

    .bracket {
        display: flex;
        align-items: stretch;
        min-width: max-content;
        padding: 0 1rem 1.5rem;
        position: relative;
    }

    .round-col {
        display: flex;
        flex-direction: column;
        width: 260px;
        flex-shrink: 0;
        margin-right: 48px;
    }
    .round-col:last-of-type { margin-right: 0; }

    .round-header {
        text-align: center;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: var(--text-tertiary, #6b7280);
        padding: 0.4rem 0 0.75rem;
        border-bottom: 1px solid var(--border-primary, rgba(255,255,255,0.08));
        margin-bottom: 0;
        font-style: normal;
    }

    .round-matches {
        display: flex;
        flex-direction: column;
        flex: 1;
        position: relative;
    }

    .match-slot {
        flex: 1;
        display: flex;
        align-items: center;
        position: relative;
        padding: 8px 0;
        min-height: 112px;
    }

    .match-slot .match-card {
        width: 100%;
    }



    /* ── Champion column ── */
    .champion-col {
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        margin-left: 0;
    }
    .champion-spacer {
        flex-shrink: 0;
        /* height set by JS to match .round-header height */
    }
    .champion-body {
        flex: 1;
        display: flex;
        align-items: center;
    }

    .champion-trophy {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        text-align: center;
        padding: 1.5rem 1rem;
        background: color-mix(in srgb, var(--accent-secondary, #f97316) 8%, transparent);
        border: 1px solid color-mix(in srgb, var(--accent-secondary, #f97316) 25%, transparent);
        border-radius: 1rem;
        min-width: 140px;
    }

    .champion-trophy i {
        font-size: 2.5rem;
        color: var(--accent-secondary, #f97316);
        filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent-secondary, #f97316) 50%, transparent));
    }

    .champion-label {
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: var(--text-tertiary, #6b7280);
    }

    .champion-name {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--accent-secondary, #f97316);
        line-height: 1.3;
    }



    /* Mobile: hide bracket, show stacked phases */
    @media (max-width: 767px) {
        .bracket-scroll { display: none; }
        .bracket-mobile { display: block; }
    }
    @media (min-width: 768px) {
        .bracket-mobile { display: none; }
    }


/* ── Shared filter card & select (mirrors schedule page style) ── */
.section-header-card {
    background: linear-gradient(145deg, var(--bg-tertiary, rgba(28,28,35,1)) 0%, var(--bg-secondary, rgba(18,18,22,1)) 100%);
    border: 1px solid color-mix(in srgb, var(--text-primary, #fff) 10%, transparent);
    border-radius: 1.5rem;
    padding: 1.5rem;
    position: relative;
}

.page-filter-select {
    appearance: none;
    -webkit-appearance: none;
    background: color-mix(in srgb, var(--bg-secondary, #111) 80%, transparent)
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
                no-repeat right 1rem center;
    border: 1px solid var(--border-primary, rgba(255,255,255,0.15));
    color: var(--text-primary, #e4e4e7);
    padding: 0.5rem 2.5rem 0.5rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    min-width: 200px;
}
.page-filter-select:focus {
    outline: none;
    border-color: var(--accent-primary, #CBFC02);
}
.page-filter-select:hover {
    border-color: rgba(255,255,255,0.3);
}
