:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --surface-color: #1e293b;
    --text-color: #f8fafc;
    --title-color: #f8fafc;
    --accent-color: #3b82f6;
    --header_btns_color: #3b82f6;
    --table_text_color: #f8fafc;
    --table_link_color: #3b82f6;
    --player_badge_color: #1e293b;
    --round_selector_color: #3b82f6;
    --round_selector_border_color: #3b82f6;
    --border-color: rgba(255, 255, 255, 0.1);
    --input_border_color: rgba(255, 255, 255, 0.1);
    --th_bg_color: rgba(255, 255, 255, 0.05);
    --th_text_color: #3b82f6;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    --skeleton-bg: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
}

.hide-on-mobile {
    display: table-cell;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }

    [data-theme="light"] .hide-on-mobile {
        display: none;
    }
}

[data-theme="light"] {
    --bg-color: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.8);
    --surface-color: #ffffff;
    --text-color: #1e293b;
    --title-color: #1e293b;
    /* Adăugat */
    --accent-color: #2563eb;

    /* Variabilele noi - Forțăm culori de tip "Light Mode" */
    --header_btns_color: #2563eb;
    --table_text_color: #1e293b;
    --table_link_color: #2563eb;
    --player_badge_color: #e2e8f0;
    --round_selector_color: #2563eb;
    --round_selector_border_color: #1d4ed8;
    --th_bg_color: rgba(0, 0, 0, 0.03);
    --th_text_color: #2563eb;
    --input_border_color: #cbd5e1;

    --border-color: rgba(0, 0, 0, 0.05);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --skeleton-bg: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    color: var(--title-color, var(--text-color));
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
    position: relative;
}

/* Responsive Header Layout */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.url-loader {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 600px;
}

.glass-input {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--input-border-color, var(--border-color));
    color: var(--text-color);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    outline: none;
    transition: 0.3s;
    width: 100%;
    min-width: 0;
}

.glass-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.glass-select {
    background: var(--card-bg);
    border: 1px solid var(--input-border-color, var(--border-color));
    color: var(--text-color);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    outline: none;
    transition: 0.3s;
    cursor: pointer;
    width: fit-content;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.glass-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-refresh {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

.controls {
    display: flex;
    gap: 0.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    margin-bottom: 3rem;
}

.tournament-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.tournament-info h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.badge-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tournament-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 5. Badge-urile din tabel (ex: Locul 1, 2) */
.rank-badge {
    background: var(--player_badge_color) !important;
}

.search-container {
    position: relative;
    width: 350px;
    flex: 0 0 auto;
    margin-top: 5px;
}

.search-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--card-shadow);
    display: none;
}

.search-dropdown.active {
    display: block;
}

.search-item {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.main-content-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--th_bg_color, rgba(255, 255, 255, 0.05));
    padding: 0.5rem 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--th_text_color, var(--accent-color));
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.5rem 0.5rem;
    color: var(--table_text_color) !important;
    border-bottom: 1px solid var(--border-color);
    transition: 0.2s;
}

/* 3. Link-urile din tabele (Nume jucători) */
td a,
.player-link {
    color: var(--table_link_color) !important;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Aliniere la stânga pentru tot capul de tabel de la Clasament */
#rankings-table th {
    text-align: left !important;
    padding-left: 3px !important;
}

#rankings-table th:nth-child(1) {
    padding-left: 6px !important;
}

/* RTG și Pts - centrat */
#rankings-table th:nth-child(3),
#rankings-table th:nth-child(4) {
    text-align: center !important;
}

/* Nume nu se-wrap pe desktop decat daca e foarte lung */
#rankings-table td:nth-child(2) {
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 3px !important;
}

#rankings-table td:nth-child(3) {
    padding-left: 3px !important;
}

/* Rezultate table - cap de tabel */
#results-table th {
    text-align: center !important;
}

#results-table th:nth-child(2) {
    text-align: right !important;
}

/* Aliniere la stânga doar pentru primul element (Bo.) din capul de tabel Rezultate */
#results-table th:nth-child(1) {
    text-align: left !important;
    padding-left: 6px !important;
}

.player-link {
    cursor: pointer;
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

.player-link:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Schedule Grid */
#schedule-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.schedule-item {
    padding: 0.4rem 1rem;
    text-align: left;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
}

.schedule-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.schedule-item.active {
    background: var(--round_selector_color) !important;
    color: white;
    border-color: var(--round_selector_border_color) !important;
}

.schedule-item .round-number {
    display: none;
    /* Ascuns pe desktop unde scrie Runda X */
}

.schedule-item-detail {
    display: flex !important;
    flex-direction: row !important;
    /* Forțează așezarea pe orizontală */
    align-items: center;
    font-size: 0.9rem;
    padding: 0 !important;
    /* Eliminăm padding-ul intern care mărea caseta */
    gap: 10px;
    /* Distanță între numărul rundei și dată */
}

/* Mobile Optimization: Forced Top-Down & Correct Ordering */
@media (max-width: 768px) {
    .container {
        width: 98%;
        padding: 0.8rem 0;
    }

    /* 1. REORDONARE SECTIUNI (Clasament -> Selector -> Rezultate) */
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .main-content-area {
        display: flex;
        flex-direction: column;
        display: contents;
        /* Permite reordonarea copiilor direct în dashboard-grid */
    }

    .glass-card {
        /* Reducem padding-ul de la 2rem (32px) la un nivel mult mai compact */
        padding: 0.7rem !important;

        /* Ajustăm și rotunjirea colțurilor pentru a nu "mânca" din spațiul vizual pe margini */
        border-radius: 12x;

        /* Ne asigurăm că marginea exterioară nu împinge cardul prea mult în interior */
        margin-bottom: 0.8rem;
        width: 100%;
    }

    .glass-card h2 {
        text-align: center !important;
        /* margin-bottom: 1.2rem !important; */
        width: 100%;
    }

    .search-container {
        position: relative;
        width: 100%;
        flex: 0 0 auto;
        margin-top: 5px;
    }

    /* Clasament (Top 10) - Primul */
    .main-content-area section:nth-child(1) {
        order: 1;
    }

    /* Selector Runda (Aside) - Al doilea */
    /* Containerul pentru selectorul de runde */
    aside.glass-card {
        order: 2;
        margin-bottom: 1rem;
        padding: 0.5rem !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    table {
        table-layout: auto !important;
        width: 100% !important;
    }

    /* ========== RANKINGS TABLE (Clasament) ========== */
    #rankings-table th:nth-child(1),
    #rankings-table td:nth-child(1) {
        width: 35px !important;
        padding: 0.4rem 2px !important;
        text-align: center !important;
        white-space: nowrap !important;
        /* Împiedică ruperea textului pe rândul următor */
        overflow: visible !important;
        /* Ne asigurăm că nu taie numărul dacă e la limită */
    }

    #rankings-table th:nth-child(2),
    #rankings-table td:nth-child(2) {
        width: auto !important;
        min-width: 100px !important;
        text-align: left !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        white-space: nowrap !important;
    }

    #rankings-table td:nth-child(2) {
        font-size: 0.8rem !important;
    }

    #rankings-table th:nth-child(3),
    #rankings-table td:nth-child(3) {
        width: 55px !important;
        min-width: 55px !important;
        font-weight: 700 !important;
        text-align: center !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    #rankings-table th:nth-child(4),
    #rankings-table td:nth-child(4) {
        width: 45px !important;
        min-width: 45px !important;
        text-align: center !important;
        font-weight: 800 !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    /* ========== RESULTS TABLE (Rezultate) ========== */
    #results-table th,
    #results-table td {
        font-size: 0.7rem !important;
    }

    #results-table th:nth-child(1),
    #results-table td:nth-child(1) {
        width: 30px !important;
        text-align: center !important;
    }

    #results-table th:nth-child(2),
    #results-table td:nth-child(2) {
        width: auto !important;
        min-width: 80px !important;
        text-align: right !important;
    }

    #results-table th:nth-child(3),
    #results-table td:nth-child(3) {
        width: 40px !important;
        text-align: center !important;
    }

    #results-table th:nth-child(4),
    #results-table td:nth-child(4) {
        width: auto !important;
        min-width: 80px !important;
        text-align: left !important;
    }

    .table-responsive,
    #results-table,
    #rankings-table {
        border-radius: 0 !important;
    }

    #results-table th {
        font-size: 0.8rem !important;
        text-align: center !important;
    }

    #results-table td {
        font-size: 0.7rem !important;
    }

    #results-table td:nth-child(2) {
        text-align: right !important;
    }

    #results-table td:nth-child(3) {
        text-align: center !important;
    }

    #results-table td:nth-child(4) {
        text-align: left !important;
    }

    /* Asigurăm că link-ul numelui nu forțează lățime fixă */
    .player-link {
        display: inline-block;
        white-space: nowrap !important;
        /* Permite textului să treacă pe rândul 2 dacă e cazul */
        word-break: break-word;
        max-width: 180%;
        /* Ajustează în funcție de ecran */
        text-align: left !important;
    }

    /* Forțăm așezarea pe rând (linie) a pătratelor */
    #schedule-body {
        display: flex !important;
        flex-direction: row !important;
        /* Forțează așezarea pe orizontală */
        flex-wrap: nowrap !important;
        /* Împiedică trecerea pe rândul următor */
        overflow-x: auto;
        /* Permite scroll lateral dacă sunt multe runde */
        gap: 3px !important;
        /* Spațiu între pătrățele */
        justify-content: flex-start !important;
        padding: 2px 2px;
        -webkit-overflow-scrolling: touch;
        /* Scroll fin pe iOS */
    }

    /* Ascundem scrollbar-ul pentru un aspect curat, dar lăsăm funcționalitatea */
    #schedule-body::-webkit-scrollbar {
        display: none;
    }

    /* Ajustăm pătrățelele individuale să fie egale și să nu se comprime */
    .schedule-item {
        width: 18px !important;
        height: 18px !important;
        flex: 0 0 auto !important;
        /* Esențial: previne micșorarea lor pe rând */
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 8px !important;
    }

    /* Ne asigurăm că numărul este vizibil central */
    .schedule-item .round-number {
        display: block !important;
        font-size: 0.8rem !important;
        font-weight: bold;
        margin: 0 !important;
    }

    /* Ascundem detaliile text (ex: "Runda X", Data) care ar ocupa prea mult loc */
    .schedule-item-detail {
        display: none !important;
    }

    /* Rezultate - Ultimul */
    .main-content-area section:nth-child(2) {
        order: 3;
    }

    /* 2. OPTIMIZARE TABELE (Ascundere coloane neesențiale) */

    /* Clasament: Ascundem TB1 și TB2 (coloanele 5 și 6) - restul e vizibil */
    #rankings-table th:nth-child(5),
    #rankings-table td:nth-child(5),
    #rankings-table th:nth-child(6),
    #rankings-table td:nth-child(6) {
        display: none;
    }

    /* Evolution (Modal): Ascundem coloana Bo. (coloana 2) */
    .small-table th:nth-child(2),
    .small-table td:nth-child(2) {
        display: none;
    }

    td {
        white-space: normal;
        /* Permite textului să treacă pe rândul următor dacă e prea lung */
        word-break: break-word;
    }

    th,
    td {
        padding: 0.4rem 0.2rem !important;
        font-size: 0.7rem !important;
        /* Font clar mai mic */
        text-align: center !important;
    }

    /* Numele jucătorului primește prioritate */
    .player-link {
        display: inline-block;
        white-space: nowrap !important;
        /* Permite textului să treacă pe rândul 2 dacă e cazul */
        word-break: break-word;
        max-width: 180%;
        /* Ajustează în funcție de ecran */
        text-align: left !important;
    }

    /* 3. HEADER & NAV (Existente, optimizate) */
    .top-nav {
        display: flex !important;
        align-items: stretch !important;
        /* Forțează aceeași înălțime */
        gap: 0.5rem !important;
    }

    .url-loader {
        display: flex !important;
        flex: 1;
    }

    /* Facem butoanele de control (reload/tema) să aibă aceeași înălțime cu input-ul/butonul de load */
    .controls {
        display: flex !important;
        gap: 0.5rem !important;
        flex: 0 0 auto !important;
        /* Împiedică lărgirea lor automată */
    }

    /* Stilul butoanelor individuale */
    #refresh-btn,
    #theme-toggle {
        width: 40px !important;
        /* Forțăm o lățime fixă, egală cu înălțimea pentru a fi pătrate */
        padding: 0 !important;
        /* Eliminăm spațiul lateral intern */
        min-width: 40px !important;
        justify-content: center !important;
    }

    /* Ajustăm input-ul de Load să ocupe restul spațiului rămas */
    .url-loader {
        flex: 1 !important;
        display: flex !important;
    }

    .url-loader .glass-input {
        flex: 1 !important;
        /* Input-ul se întinde cât poate */
        min-width: 0;
        /* Previne ruperea layout-ului pe ecrane foarte mici */
    }

    /* 2. Titlu și Badge pe același rând */
    /* --- HEADER CENTRAT --- */
    header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.4rem !important;
        /* Spațiu mic între rânduri */
        margin-bottom: 1.5rem !important;
    }

    .tournament-info {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    #tournament-name {
        font-size: 1.35rem !important;
        margin: 0 !important;
        line-height: 1.2;
        display: block !important;
    }

    /* Containerul de sub titlu (Badge + Locație) */
    .tournament-info div:first-of-type {
        display: flex !important;
        flex-direction: row !important;
        /* Forțăm badge-ul și locația pe același rând */
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center;
        gap: 8px !important;
        /* Spațiu între R8 și oraș */
        margin-top: 4px !important;
    }

    #current-round-badge {
        display: inline-flex !important;
        padding: 2px 8px !important;
        font-size: 0.75rem !important;
        font-weight: 800 !important;
        border-radius: 4px !important;
        background: var(--accent-color) !important;
        color: white !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    #location-info {
        display: inline-block !important;
        font-size: 0.8rem !important;
        opacity: 0.8;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    /* 4. SELECTOR RUNDA (Grid orizontal compact) */
    #schedule-label {
        font-size: 1rem;
        text-align: center;
        margin-bottom: 0.8rem;
    }

    #schedule-body {
        display: flex !important;
        flex-wrap: wrap !important;
        /* Permite curgerea pe mai multe rânduri dacă sunt multe runde */
        justify-content: center !important;
        gap: 5px !important;
    }

    .schedule-item {
        width: 30px !important;
        height: 30px !important;
        padding: 0 !important;
        border-radius: 8px !important;
        justify-content: center !important;
        flex: 0 0 auto !important;
    }

    .schedule-item .round-number {
        display: block !important;
        /* Ne asigurăm că numărul e vizibil */
        font-size: 0.8rem !important;
        font-weight: bold;
    }

    .schedule-item-detail {
        display: none !important;
        /* Ascundem textul "Runda X" și Data pe mobil */
    }

    /* 5. MODAL MOBIL */
    .modal {
        width: 95% !important;
        padding: 1.5rem 1rem !important;
        border-radius: 20px !important;
    }

    .close-modal {
        top: 0.5rem !important;
        right: 0.5rem !important;
        background: var(--surface-color) !important;
        border-radius: 50% !important;
        width: 32px;
        height: 32px;
    }

    /* 1. Resetăm tabelul din modal pentru flexibilitate */
    .small-table {
        table-layout: auto !important;
        /* Esențial pentru coloane de lățimi diferite */
        width: 100% !important;
        border-collapse: collapse;
        border-radius: 5% !important;
    }

    /* 2. Coloana RD (Runda) - Minimă */
    .small-table th:nth-child(1),
    .small-table td:nth-child(1) {
        width: 25px !important;
        padding-left: 5px !important;
        text-align: center;
    }

    /* 3. ASCUNDEM coloana BO (Masa) - pe mobil ocupă loc degeaba */
    .small-table th:nth-child(2),
    .small-table td:nth-child(2) {
        display: none !important;
    }

    /* 4. Coloana ADVERSAR - Prioritate Maximă */
    .small-table th:nth-child(3),
    .small-table td:nth-child(3) {
        width: auto !important;
        /* Ocupă tot restul spațiului */
        text-align: left !important;
        padding-left: 8px !important;
        font-size: 0.7rem !important;
        white-space: normal !important;
        /* Permite numelui să treacă pe rândul 2 */
        word-break: break-word;
        line-height: 1.1;
    }

    /* 5. Coloana RTG (Rating) - Îngustă și aliniată la dreapta */
    .small-table th:nth-child(4),
    .small-table td:nth-child(4) {
        width: 45px !important;
        text-align: right !important;
        padding-right: 8px !important;
        font-variant-numeric: tabular-nums;
        /* Cifrele să fie aliniate egal */
        opacity: 0.8;
    }

    /* 6. Coloana RES (Rezultat) */
    .small-table th:nth-child(5),
    .small-table td:nth-child(5) {
        width: 35px !important;
        text-align: center !important;
        padding-right: 5px !important;
        font-weight: bold;
        color: var(--accent-color);
    }

    /* Ajustare spațiere card Evolution */
    .history-card.glass-card {
        padding: 0.8rem !important;
        margin-top: 1rem;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    position: relative;
    box-shadow: var(--card-shadow);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
}

.close-modal:hover {
    opacity: 1;
}

.skeleton {
    background: var(--skeleton-bg);
    background-size: 200% 100%;
    animation: skeleton-shift 1.5s infinite linear;
    border-radius: 8px;
    height: 1.2rem;
}

@keyframes skeleton-shift {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-right: 40px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 769px) {
    .modal-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.info-label {
    opacity: 0.7;
    font-size: 0.9rem;
}

.info-value {
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.small-table {
    width: 100%;
    font-size: 0.85rem;
}

footer {
    text-align: center;
    padding: 4rem 0;
    font-size: 0.8rem;
    opacity: 0.4;
}

/* Stiluri pentru Tabelul Evolution din Modal (Desktop focus) */
.small-table {
    table-layout: fixed !important;
    /* Forțează respectarea lățimilor de mai jos */
    width: 100% !important;
    border-collapse: collapse;
}

/* Stil pentru Capul de Tabel (Header) */
.small-table thead th {
    font-size: 0.75rem !important;
    /* Text mai mic pentru capul de tabel */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 4px !important;
    text-align: center !important;
    /* Centrare text în header */
    background: rgba(255, 255, 255, 0.03);
    /* Opțional: un fundal ușor diferit */
    color: var(--accent-color);
    /* Opțional: culoare accent pentru contrast */
}

/* Coloana Rd (Runda) */
.small-table th:nth-child(1),
.small-table td:nth-child(1) {
    width: 35px !important;
    text-align: center;
}

/* Coloana Bo (Masa) */
.small-table th:nth-child(2),
.small-table td:nth-child(2) {
    width: 35px !important;
    text-align: center;
}

/* Coloana ADVERSAR - Aici dăm spațiul maxim */
.small-table th:nth-child(3),
.small-table td:nth-child(3) {
    width: auto !important;
    /* Ocupă tot restul */
    text-align: left;
    padding-left: 10px !important;
    white-space: nowrap;
    /* Încercăm să ținem pe un rând */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Dacă e totuși prea lung, pune ... */
}

/* Coloana RTG (Rating) */
.small-table th:nth-child(4),
.small-table td:nth-child(4) {
    width: 55px !important;
    text-align: center;
}

/* Coloana RES (Rezultat) */
.small-table th:nth-child(5),
.small-table td:nth-child(5) {
    width: 45px !important;
    text-align: center;
    font-weight: bold;
}

/* Compactare rânduri (Micsorăm înălțimea) */
.small-table td {
    padding: 6px 4px !important;
    /* Mai puțin padding vertical pentru a evita scroll-ul */
    font-size: 0.85rem !important;
}

/* Eliminăm scrollbar-ul orizontal dacă cardul e prea strâmt */
.table-responsive {
    overflow-x: hidden !important;
}

/* Forțăm fundalul albastru pentru butoanele de acțiune */
#refresh-btn,
.url-loader .btn {
    background-color: var(--accent-color) !important;
    color: white !important;
    /* Text/Iconițe albe pentru contrast */
    border: none !important;
    transition: opacity 0.2s ease;
}

/* Efect de hover pentru a simți că e interactiv */
#refresh-btn:hover,
.url-loader .btn:hover {
    opacity: 0.9;
    background-color: var(--accent-color) !important;
}

/* Ne asigurăm că iconițele din interior sunt albe */
#refresh-btn i,
.url-loader .btn i {
    color: white !important;
}