/* ==========================
   GLOBAL BASE STYLES
========================== */
body {
    margin: 0;
    font-family: 'Gill Sans', sans-serif;
    background-color: #f4f4f4;
    color: #222;
}

/* ==========================
   LAYOUT ELEMENTS
========================== */
#dropdown-container {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 50;
}

#bracket {
    margin-top: 20px;
    overflow-y: auto;
}

/* ==========================
   DESKTOP TABS
========================== */
.tabs {
    display: flex;
    flex-wrap: wrap;
    background: #222;
    color: white;
    overflow-x: auto;
}

.tab {
    flex: 1;
    padding: 12px 15px;
    background-color: #333;
    cursor: pointer;
    text-align: center;
    border-right: 1px solid #444;
    transition: background 0.2s, color 0.2s;
}

.tab:last-child {
    border-right: none;
}

.tab:hover {
    background-color: #444;
}

.tab.active {
    background-color: #f0f0f0;
    color: #000; /* ✅ black text on selected tab */
}

/* Style the Tournaments tab differently */
.tab.tournaments-tab {
    margin-right: 20px;
    background-color: #f8f9fa;
    color: #007BFF;
    border-radius: 5px 5px 0 0;
}

.tab.tournaments-tab:hover {
    background-color: #e2e6ea;
    cursor: pointer;
}

/* ==========================
   CONTENT CONTAINERS
========================== */
.content-container {
    padding: 10px;
    border: 1px solid #ccc;
    display: none;
    overflow-x: auto;
    background: white;
    min-width: 300px;
}

.content-container.active {
    display: block;
}

/* ==========================
   BRACKET ELEMENTS
========================== */
.round {
    float: left;
}

.bracket-game {
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.player {
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 190px;
    border: 1px solid #AAA;
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 4px;
    background: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player.win {
    background: linear-gradient(to bottom, #5DB65F, #396884);
}

.player.loss {
    background: grey;
}

.player.free {
    background-color: grey;
}

.player.free.single { height: 16px; }
.player.free.double { height: 32px; }
.player.free.triple { height: 16px; }

/* ==========================
   TABLE STYLING
========================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: 'Spider', sans-serif;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: linear-gradient(135deg, #4e73df, #1cc88a);
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    letter-spacing: 0.5px;
}

td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

tr:nth-child(even) td {
    background-color: #fafafa;
}

tr:hover td {
    background-color: #688396;
    color: white;
}

/* Info table */
.info-table th {
    width: 180px;
    background: #1cc88a;
    color: #fff;
}

.info-table td {
    font-weight: 500;
}

/* Player / Darts tables */
#player-list-table th, #darts-table th {
    background: #4e73df;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    padding: 10px 15px;
}

#player-list-table tbody td,
#darts-table tbody td {
    text-align: center;
    font-weight: 600;
    color: black;
    padding: 10px 15px;
}

#player-list-table tbody tr:nth-child(odd),
#darts-table tbody tr:nth-child(odd) {
    background-color: silver;
}

#player-list-table tbody tr:nth-child(even),
#darts-table tbody tr:nth-child(even) {
    background-color: white;
}

/* ==========================
   HAMBURGER MENU (MOBILE)
========================== */
.menu-toggle {
    display: none;
    font-size: 26px;
    padding: 12px 18px;
    cursor: pointer;
    color: white;
    background: #007BFF;
    user-select: none;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: #0056b3;
}

/* Tabs list container */
.tab-list {
    display: flex;
    flex-wrap: wrap;
}

/* ==========================
   RESPONSIVE OPTIMIZATION
========================== */
@media screen and (max-width: 900px) {
    body {
        background: #f8f9fa;
    }

    .tabs {
        flex-direction: column;
        background: #007BFF;
        color: white;
        position: relative;
    }

    /* Hamburger visible on mobile */
    .menu-toggle {
        display: block;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    /* Hide tabs list by default */
    .tab-list {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #007BFF;
        animation: slideDown 0.3s ease;
    }

    /* Show menu when opened */
    .tabs.open .tab-list {
        display: flex;
    }

    /* Tab styling inside mobile dropdown */
    .tab {
        width: 100%;
        text-align: left;
        padding: 14px 20px;
        border-top: 1px solid rgba(255,255,255,0.2);
        background: #007BFF;
        color: white;
    }

    .tab:hover {
        background: #0056b3;
    }

    /* ✅ Active tab fix for mobile: white background + black text */
    .tab.active {
        background-color: #f8f9fa;
        color: black;
    }

    /* Responsive bracket */
    #bracket {
        transform: scale(0.9);
        transform-origin: top left;
        overflow-x: auto;
        margin: 10px 0;
    }

    /* Responsive tables */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    th, td {
        padding: 8px;
        font-size: 13px;
    }

    /* Player blocks smaller */
    .player {
        width: 150px;
        font-size: 12px;
    }

    /* Dropdown repositioned */
    #dropdown-container {
        position: static;
        margin-bottom: 10px;
        width: 100%;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
.player-block {
    display: flex;
    flex-direction: column;   /* 👈 stack dart info on top */
    align-items: stretch;
    gap: 4px;
}

.dart-info {
    text-align: left;
    font-size: 13px;
    font-weight: bold;
    border-radius: 6px;
    padding: 2px 6px;
    color: white;
    box-sizing: border-box;
    min-height: 21px;
}

/* Dart colors */
.dart-info.black { background: black; }
.dart-info.red { background: red; }
.dart-info.gray { background: gray; }

/* Placeholder (same height, no text) */
.dart-info.placeholder {
    background: #555;
    min-height: 21px;
}

/* Player element styling remains unchanged */
.playerLicence {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
