.stats-container {
    background-color: #4a4a4a;
    border: 3px solid #8b8b8b;
    padding: 2rem;
    box-shadow: inset 2px 2px 0 #6b6b6b, inset -2px -2px 0 #2b2b2b;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.table-container {
    width: 100%;
    overflow: visible;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Minecraftia", sans-serif;
    color: white;
    font-size: 1.1rem;
    table-layout: fixed;
    border: 2px solid #666; /* Outer border */
}

.stats-table th,
.stats-table td {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #666;
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-right: 1px solid #666; /* Vertical lines between columns */
}

/* Remove right border from last column */
.stats-table th:last-child,
.stats-table td:last-child {
    border-right: none;
}

.stats-table th {
    background-color: #3a5c3a;
    color: #55ff55;
    cursor: pointer;
    user-select: none;
    position: relative;
    font-size: 1.1rem;
    font-weight: bold;
    border-bottom: 3px solid #8b8b8b;
    text-align: center; /* Center all headers by default */
}

/* Keep player column header left-aligned */
.stats-table th.player-col {
    text-align: left;
}

/* Center the number and date column headers */
.stats-table th.number-col,
.stats-table th.date-col {
    text-align: center;
}

.stats-table th:hover {
    background-color: #2b4a2b;
}

.stats-table th.sort-asc::after {
    content: " ↑";
    color: #ffff55;
    font-weight: bold;
}

.stats-table th.sort-desc::after {
    content: " ↓";
    color: #ffff55;
    font-weight: bold;
}

.stats-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.1);
}

.stats-table tr:hover {
    background-color: rgba(85, 255, 85, 0.1);
}

/* Column width distribution - using percentages for full responsiveness */
.stats-table .player-col {
    width: 25%; /* Larger space for player names */
}

.stats-table .number-col {
    width: 12%;
    text-align: right;
}

.stats-table .number-col.playtime-col {
    width: 15%
}

.stats-table .number-col.deaths-col {
    width: 8%;
}

.stats-table .number-col.mobskilled-col{
    width: 12%;
}

.stats-table .date-col {
    width: 15%;
}

.stats-table td:not(.player-col) {
    text-align: right;
}

.stats-table .menu-col {
    width: 3%;
    text-align: center;
    vertical-align: middle;
}

.menu-icon {
    background: none;
    border: none;
    color: #aaffaa;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.menu-icon:hover {
    transform: scale(1.25);
}

.player-avatar {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
    vertical-align: middle;
    margin-right: 0.75rem;
    border: 2px solid #666;
    border-radius: 3px;
    float: left;
}

.player-name {
    font-weight: bold;
    color: #aaffaa;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #ffff55;
    font-size: 1.2rem;
}

.error {
    text-align: center;
    padding: 3rem;
    color: #ff5555;
    font-size: 1.2rem;
}

.back-button {
    display: inline-block;
    background-color: #3a5c3a;
    border: 2px solid #5b7d5b;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-family: "Minecraftia", sans-serif;
    margin-bottom: 1rem;
    box-shadow: inset 1px 1px 0 #5b7d5b, inset -1px -1px 0 #2b4a2b;
    font-size: 1.1rem;
    transition: background-color 0.2s ease;
}

.back-button:hover {
    background-color: #2b4a2b;
    color: #aaffaa;
}

/* Server status styles */
#server-status::before {
    content: "● ";
    font-size: 1.2em;
}

.server-online::before {
    color: #55ff55;
    text-shadow: 0 0 5px #55ff55;
}

.server-offline::before {
    color: #ff5555;
    text-shadow: 0 0 5px #ff5555;
}

.server-checking::before {
    color: #ffff55;
    text-shadow: 0 0 5px #ffff55;
    animation: pulse 1.5s infinite;
}

.player-count {
    color: #55ffff;
    font-weight: bold;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 768px) {
    .stats-container {
        padding: 1rem;
        overflow-x: auto;
    }
    
    .stats-table {
        font-size: 0.9rem;
        min-width: 600px;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.85rem;
    }
    
    .player-avatar {
        width: 28px;
        height: 28px;
        margin-right: 0.375rem;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
    
    .back-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .stats-table .player-col {
        width: 35%;
    }
    
    .stats-table .number-col {
        width: 10%;
    }
    
    .stats-table .playtime-col {
        width: 12%;
    }
    
    .stats-table .date-col {
        width: 20%;
    }
    
    .stats-table .menu-col {
        width: 4%;
    }
}

.table-container::-webkit-scrollbar {
    display: none;
}