/* Keep your existing root variables */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Simple gradient border animation */
@keyframes animatedgradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main container with SIMPLE gradient border */
.container {
    --borderWidth: 4px;
    background: #1a1a1a;
    position: relative;
    border-radius: 16px;
    max-width: 1200px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Gradient border using ::after */
.container::after {
    content: '';
    position: absolute;
    top: calc(-1 * var(--borderWidth));
    left: calc(-1 * var(--borderWidth));
    height: calc(100% + var(--borderWidth) * 2);
    width: calc(100% + var(--borderWidth) * 2);
    background: linear-gradient(60deg,
            #f79533, #f37055, #ef4e7b, #a166ab,
            #5073b8, #1098ad, #07b39b, #6fba82);
    border-radius: calc(16px + var(--borderWidth));
    /* Container radius + border */
    z-index: -1;
    animation: animatedgradient 3s ease alternate infinite;
    background-size: 300% 300%;
}

/* All content inside container */
.container>* {
    position: relative;
    z-index: 1;
}

/* Remove the progress-indicator */
.progress-indicator {
    display: none;
}

/* Header */
.header {
    background: rgba(26, 26, 26, 0.95);
    padding: 2.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-family: "Rubik", sans-serif;
    font-size: 1.7rem;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(30, 30, 30, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 9px;
    background: linear-gradient(45deg,
            transparent 50%,
            rgba(255, 255, 255, 0.1) 100%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 600;
    color: #4cd964;
    position: relative;
    z-index: 1;
    font-family: 'Courier New', monospace;
}

/* Table Container */
.table-container {
    background: rgba(20, 20, 20, 0.9);
    padding: 0;
}


.table-container h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #ffffff;
}

/* Refresh Button */
.btn-refresh {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-refresh:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Table */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background-color: rgba(40, 40, 40, 0.9);
    position: sticky;
    top: 0;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

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

tr {
    animation: slideIn 0.5s ease-out forwards;
    animation-delay: calc(var(--index, 0) * 0.05s);
    opacity: 0;
    transition: all 0.3s ease;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Rank Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 1rem;
    text-align: center;
    min-width: 36px;
}

.badge-primary {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.badge-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.badge-silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: #000;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.3);
}

.badge-bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: white;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.3);
}

/* Special styling for top 3 rows */
tr:nth-child(1) {
    background: linear-gradient(135deg,
            rgba(255, 215, 0, 0.1),
            rgba(40, 40, 40, 0.8));
    border-left: 3px solid #FFD700;
}

tr:nth-child(2) {
    background: linear-gradient(135deg,
            rgba(192, 192, 192, 0.1),
            rgba(40, 40, 40, 0.8));
    border-left: 3px solid #C0C0C0;
}

tr:nth-child(3) {
    background: linear-gradient(135deg,
            rgba(205, 127, 50, 0.1),
            rgba(40, 40, 40, 0.8));
    border-left: 3px solid #CD7F32;
}

/* User info */
.username {
    font-weight: 500;
    color: #ffffff;
}

.userid {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.points {
    font-weight: 600;
    color: #4cd964;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.timestamp {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    margin: 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.empty-state p {
    font-size: 0.875rem;
}

/* Footer */
.container>div:last-child:not(.table-container) {
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(26, 26, 26, 0.95);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .container {
        margin: 0 auto;
    }

    .header {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }



    .btn-refresh {
        width: 100%;
        justify-content: center;
    }

    table {
        font-size: 0.75rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
    }

    .username {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .header p {
        font-size: 0.875rem;
    }

    .badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
        min-width: 32px;
    }

    .points {
        font-size: 0.875rem;
    }
}