/* --- Proměnné --- */
:root {
    --accent: #45f882;
    --card: #fff;
    --muted: #6b7280;
    --row-height: 40px; /* zmenšená výška řádku pro kompaktnost */
}

/* --- Kontejnery --- */
#dayz-leaderboard, #dayz-leaderboard-admin {
    max-width: 1500px; /* zmenšeno z 1000, zvětšeno o 300 */
    margin: 0 auto;
    padding: 15px; /* zmenšeno z 20 */
    background: var(--bg);
}

.dayz-table-container {
    max-width: 100%;
    border-radius: 8px; /* zmenšeno z 12 */
    background: var(--card);
    box-shadow: 0 4px 12px rgba(16,24,40,0.05); /* zmenšeno z 0 6px 22px */
    overflow: hidden;
}

.table-scroll {
    max-height: calc(60vh + 300px);
    overflow: auto;
}

/* --- Top bar --- */
.topbar {
    display: flex;
    gap: 0.75rem; /* zmenšeno z 1rem */
    align-items: center;
    margin-bottom: 0.5rem; /* zmenšeno z 0.75rem */
    flex-wrap: wrap;
}

.title {
    font-size: 1rem; /* zmenšeno z 1.1rem */
    font-weight: 700;
    color: var(--accent);
    margin-right: auto;
}

.controls {
    display: flex;
    gap: 0.25rem; /* zmenšeno z 0.5rem */
    align-items: center;
}

.controls select,
.controls input {
    padding: 6px 8px; /* zmenšeno z 8px 10px */
    border-radius: 6px; /* zmenšeno z 8px */
    border: 1px solid #e6eef6;
    background: #fff;
    font-size: 13px; /* zmenšeno z 14px */
    outline: none;
}

.controls input::placeholder {
    color: #bfc9d6;
}

.update-time {
    text-align: right;
    font-size: 12px; /* zmenšeno z 13px */
    font-style: italic;
    color: #505a66;
    margin-bottom: 0.25rem; /* zmenšeno z 0.5rem */
}

/* --- Tabulka --- */
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px; /* zmenšeno z 800, přidáno +300 */
    table-layout: fixed;
    font-size: 13px; /* zmenšeno z 14px */
}

thead tr {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(180deg, var(--accent), #2a9d4b);
    color: #f1f7ff;
    font-weight: 700; /* zmenšeno z 800 */
    text-transform: uppercase;
    letter-spacing: 0.04em; /* zmenšeno z 0.06em */
    font-size: 12px; /* zmenšeno z 13px */
}

thead th {
    padding: 8px 10px; /* zmenšeno z 10px 12px */
    border-bottom: 2px solid rgba(0,0,0,0.05); /* zmenšeno z 3px */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Šířky sloupců */
thead th:nth-child(1) {
    width: 7%;
    text-align: center;
}
thead th:nth-child(2) {
    width: 30%;
    text-align: left;
}
thead th:nth-child(3) {
    width: 15%;
    text-align: center;
}
thead th:nth-child(4) {
    width: 15%;
    text-align: center;
}
thead th:nth-child(5) {
    width: 15%;
    text-align: center;
}
thead th:nth-child(6) {
    width: 15%;
    text-align: center;
}
thead th:nth-child(7) {
    width: 15%;
    text-align: center;
}
thead th:nth-child(8) {
    width: 15%;
    text-align: center;
}
thead th:nth-child(9) {
    width: 15%;
    text-align: center;
}

/* Řádky tabulky */
tbody tr {
    height: var(--row-height);
    background: #fcfeff;
    transition: all 0.15s ease; /* zmenšeno z 0.18s */
    cursor: pointer;
    border-bottom: 1px solid #eef3f8;
}
tbody tr:not(.gold):not(.silver):not(.bronze):hover {
    background: #eef6ff;
    transform: translateY(-1px); /* zmenšeno z -2px */
    box-shadow: 0 2px 8px rgba(2,6,23,0.04); /* zmenšeno z 0 6px 18px */
}

/* Buňky tabulky */
tbody td {
    padding: 6px 8px; /* zmenšeno z 10px 12px */
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500; /* zmenšeno z 600 */
    color: #0f1724;
    position: relative;
}

tbody td:nth-child(6),
thead th:nth-child(6) {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: 200px; /* nebo podle potřeby */
    word-wrap: break-word;
}

/* Speciální sloupce */
td.id {
    position: relative; /* pro absolutní pozici šipky */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* mezera mezi ikonami a ID */
    padding-right: 30px; /* prostor pro šipku napravo */
    font-weight: 800;
    font-size: 15px;
    color: #092241;
}
td.id .trophy-icon {
    margin-right: 4px; /* mezera mezi trofejemi */
    flex-shrink: 0;
}
td.id .arrow {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #4b5563;
    user-select: none;
}

td.name {
    text-align: left;
    font-weight: 700; /* zmenšeno z 800 */
    color: #092241;
    font-size: 14px; /* zmenšeno z 15px */
    width: 30%;
}
td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 13px; /* zmenšeno z 14px */
    width: 12%;
}
td.online {
    text-align: center;
    color: var(--muted);
    font-weight: 500; /* zmenšeno z 600 */
    font-size: 12px; /* zmenšeno z 13px */
    width: 15%;
}

/* Šipka rozbalení */
.arrow {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    color: #4b5563;
    font-size: 12px;
    user-select: none;
}
tr.expanded .arrow {
    transform: translateY(-50%) rotate(90deg);
    color: var(--accent);
}

/* Barvy pro medaile */
.gold {
    background: linear-gradient(135deg, #fff9db, #ffd700) !important;
    color: #3b2f00 !important;
    box-shadow: inset 0 0 12px rgba(255,255,255,0.4);
}
.silver {
    background: linear-gradient(135deg, #fafafa, #cfcfcf) !important;
    color: #2e2e2e !important;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.3);
}
.bronze {
    background: linear-gradient(135deg, #f6d9b1, #cd7f32) !important;
    color: #2d1707 !important;
    box-shadow: inset 0 0 8px rgba(255,255,255,0.2);
}

/* Detailní řádek */
.detail-row td {
    background: linear-gradient(180deg, #f9fcff, #f3fbff);
    padding: 12px; /* zmenšeno z 16px */
    white-space: normal;
}

.detail-box {
    display: grid;
    gap: 8px; /* zmenšeno z 12px */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    align-items: start;
}

.detail-item {
    background: #fff;
    border-radius: 8px; /* zmenšeno z 12px */
    padding: 8px 10px; /* zmenšeno z 12px 14px */
    box-shadow: 0 2px 6px rgba(3,7,18,0.03);
    display: flex;
    gap: 8px; /* zmenšeno z 12px */
    align-items: center;
    font-size: 14px; /* zmenšeno z 16px */
    font-weight: 600; /* zmenšeno z 700 */
    color: #0f1724;
}

.detail-item .icon {
    font-size: 16px; /* zmenšeno z 18px */
    width: 24px; /* zmenšeno z 28px */
    height: 24px; /* zmenšeno z 28px */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px; /* zmenšeno z 8px */
    background: linear-gradient(180deg, #eef6ff, #e0f0ff);
    color: var(--accent);
}

/* Responsive - menší obrazovky */
@media (max-width: 768px) {
    table {
        min-width: 900px; /* zmenšeno z 600, přidáno +300 */
    }
    .topbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    .controls {
        justify-content: flex-start;
        gap: 0.5rem;
    }
    tbody td.name {
        width: 40%;
    }
    tbody td.num, tbody td.online {
        width: 20%;
        font-size: 12px;
    }
}

/* Scrollbar styl */
.table-scroll::-webkit-scrollbar {
    height: 8px;
}
.table-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.table-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.pagination-left {
    display: flex;
    justify-content: center; /* teď uprostřed */
    gap: 8px;
    padding: 10px 0 0 0;
    font-size: 14px;
}


.pagination-left button {
    background-color: #45f882;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 6px rgba(69, 248, 130, 0.4);
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

.pagination-left button:hover {
    background-color: #3ac76d;
}

.pagination-left button:disabled {
    background-color: #cccccc;
    cursor: default;
    opacity: 0.6;
    color: #666666;
}