header {
    background: #1a1c2c !important;
    box-shadow: none !important;
}

.logo {
    color: white !important;
}

nav {
    background: #1a1c2c !important;
}

nav a {
    color: #a0aec0 !important;
}

nav a:hover {
    color: #FFD700 !important;
}

.mobile-menu-btn span {
    background: white !important;
}

/* Add loading/skeleton styles */
.skeleton {
    background: linear-gradient(90deg, #2a2d3e 25%, #3a3f55 50%, #2a2d3e 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

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

.loading .leaderboard-card {
    opacity: 0.7;
}

.loading .progress {
    width: 0 !important;
}

.loading .points {
    width: 80px;
    height: 1em;
}

.loading .house-details h3 {
    width: 120px;
    height: 1.2em;
    margin-bottom: 0.5rem;
}

.hidden {
    display: none;
}

#error-message {
    text-align: center;
    color: #ff6b6b;
    padding: 2rem;
    display: none;
}

/* Add to existing skeleton styles */
.skeleton-text {
    height: 1em;
    width: 100%;
    max-width: 120px;
    border-radius: 4px;
}

.skeleton-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

.loading .achiever-card {
    opacity: 0.7;
}

.loading .table-row:not(.header) .name {
    width: 120px;
}

.loading .table-row:not(.header) .house {
    width: 80px;
}

.loading .table-row:not(.header) .points {
    width: 60px;
}

@media (max-width: 768px) {
    .skeleton-avatar {
        width: 72px;
        height: 72px;
    }
}

/* Version history styles */
.version-history-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2B6CB0;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.2s;
    z-index: 1000;
}

.version-history-btn:hover {
    background: #2C5282;
    transform: scale(1.05);
}

.version-history-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.4);
}

.version-history-btn svg {
    width: 24px;
    height: 24px;
}

.version-dropdown {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    background: #2a2d3e;
    border-radius: 16px;
    padding: 1rem;
    width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.version-dropdown.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.version-options {
    max-height: 300px;
    overflow: hidden;
    margin: -1rem -1rem 0.75rem -1rem;
    padding: 1rem;
}

.version-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.version-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.version-option {
    padding: 0.75rem 1rem;
    color: #a0aec0;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.version-option:last-child {
    margin-bottom: 0;
}

.version-option:hover {
    background: #3a3f55;
    color: white;
}

.version-option.selected {
    background: #2B6CB0;
    color: white;
}

/* Remove dot styles */
.version-option .dot {
    display: none;
}

.compare-btn {
    margin-top: 0.75rem;
    padding: 0.75rem;
    width: 100%;
    border: none;
    border-radius: 8px;
    background: #4a5568;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.compare-btn:hover {
    background: #2B6CB0;
}

.compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1001;
}

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

.compare-content {
    background: #2a2d3e;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.compare-modal.active .compare-content {
    transform: translateY(0);
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.compare-header h3 {
    color: white;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.close-modal:hover {
    color: white;
}

.version-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #1a1c2c;
    z-index: 1002;
}

.version-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background: #2B6CB0;
    animation: loading-bar 1s infinite ease-in-out;
}

@keyframes loading-bar {
    0% {
        left: -20%;
    }

    100% {
        left: 100%;
    }
}

@media (max-width: 768px) {
    .version-history-btn {
        bottom: 1rem;
        right: 1rem;
    }

    .version-dropdown {
        bottom: 4rem;
        right: 1rem;
        width: calc(100% - 2rem);
    }
}

/* Compare modal styles */
.compare-versions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.version-select-column {
    background: #1a1c2c;
    padding: 1rem;
    border-radius: 8px;
}

.version-select-column h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.version-select-scroll {
    max-height: 200px;
    overflow-y: auto;
}

.compare-version-option {
    padding: 0.75rem;
    color: #a0aec0;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.compare-version-option:hover {
    background: #2a2d3e;
    color: white;
}

.compare-version-option.selected {
    background: #2B6CB0;
    color: white;
}

.compare-body {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #3a3f55;
    display: none;
}

.change-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: #1a1c2c;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    color: #a0aec0;
}

.change-item:last-child {
    margin-bottom: 0;
}

.increase {
    color: #48BB78;
}

.decrease {
    color: #F56565;
}

.version-indicator {
    background: #2B6CB0;
    padding: 0.75rem 0;
    position: sticky;
    top: 84px;
    z-index: 999;
}

.version-indicator-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: white;
}

.version-indicator svg {
    width: 20px;
    height: 20px;
}

.version-text {
    font-size: 0.95rem;
}

.return-latest {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.return-latest:hover {
    background: rgba(255, 255, 255, 0.3);
}

.update-note {
    background: #0f111a;
    padding: 1rem 0 3rem;
    text-align: center;
}

.update-note p {
    color: #a0aec0;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* User link styles */
.user-link {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
    position: relative;
}

.user-link:hover {
    color: #FFD700;
}

.user-link:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.user-link:hover:after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Enhance top achievers user links */
.achiever-card h3 .user-link {
    color: white;
}

.achiever-card h3 .user-link:hover {
    color: #FFD700;
}

/* Add these new styles */
.house-card-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.house-card-container:last-child {
    margin-bottom: 0;
}

.leaderboard-card {
    background: #2a2d3e;
    border-radius: 12px 12px 0 0;
    /* Round only top corners */
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.3s;
}

.house-contributors {
    width: 100%;
    border-collapse: collapse;
    background: #1a1c2c;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    border-top: 1px solid #3a3f55;
    table-layout: fixed;
    /* Force consistent column sizes */
}

.house-contributors td {
    padding: 0.5rem 1.25rem;
    text-align: left;
    color: #a0aec0;
    font-size: 0.9rem;
}

.house-contributors td:first-child {
    width: 70%;
    /* Name column takes most space */
}

.house-contributors td:last-child {
    width: 30%;
    text-align: right;
    font-size: 0.8rem;
    opacity: 0.8;
}

.house-contributors tr:not(:last-child) {
    border-bottom: 1px solid #2a2d3e;
}

.house-contributors tr:hover {
    background: #2a2d3e;
}

@media (max-width: 768px) {
    .house-contributors td {
        padding: 0.375rem 1rem;
    }

    .house-contributors td:first-child {
        width: 65%;
        /* Slightly adjust ratio on mobile */
    }

    .house-contributors td:last-child {
        width: 35%;
    }
}

/* Add loading state for contributors table */
.loading .contributors-row td {
    height: 2.5rem;
}

.loading .contributors-name {
    width: 120px;
    margin-right: auto;
    /* Align left */
}

.loading .contributors-points {
    width: 60px;
    margin-left: auto;
    /* Align right */
}

body {
    background-color: #1a1c2c;
}

/* Dark mode scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1a1c2c;
}

::-webkit-scrollbar-thumb {
    background: #2a2d3e;
    border-radius: 6px;
    border: 3px solid #1a1c2c;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3f56;
}

.leaderboard-header {
    padding: 4rem 0;
    background: #1a1c2c;
    text-align: center;
    color: white;
}

.leaderboard-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.leaderboard-header p {
    font-size: 1.2rem;
    color: #a0aec0;
}

.leaderboard-header img {
    height: 200px;
    max-width: 100%;
}

.house-leaderboard,
.individual-leaderboard {
    padding: 4rem 0;
    background: #0f111a;
}

.house-leaderboard h2,
.individual-leaderboard h2 {
    text-align: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.leaderboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.leaderboard-card {
    background: #2a2d3e;
    border-radius: 12px 12px 0 0;
    /* Round only top corners */
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.3s;
}

.rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #a0aec0;
    min-width: 40px;
}

.house-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 8px;
}

.house-icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.house-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.house-details {
    flex: 1;
}

.house-details h3 {
    color: white;
    margin-bottom: 0.25rem;
}

.points {
    color: #a0aec0;
    font-size: 0.9rem;
}

.progress-bar {
    background: #3a3f55;
    height: 8px;
    border-radius: 4px;
    width: 200px;
    overflow: hidden;
}

.progress {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

.first .progress {
    background: linear-gradient(45deg, #FFD700, #FFA500);
}

.second .progress {
    background: linear-gradient(45deg, #C0C0C0, #A0A0A0);
}

.third .progress {
    background: linear-gradient(45deg, #CD7F32, #8B4513);
}

.leaderboard-card:not(.first):not(.second):not(.third) .progress {
    background: #4a5568;
}

.top-achievers {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    margin-bottom: 4rem;
}

.achiever-card {
    background: #2a2d3e;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    width: 200px;
    order: 2;
    /* Default order for non-first/second/third cards */
}

.achiever-card.first {
    order: 1;
}

.achiever-card.second {
    order: 2;
}

.achiever-card.third {
    order: 3;
}

.achiever-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achiever-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.achiever-card h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.rankings-table {
    max-width: 800px;
    margin: 0 auto;
    background: #2a2d3e;
    border-radius: 12px;
    overflow: hidden;
}

.table-row {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 100px;
    padding: 1rem;
    align-items: center;
}

.table-row:not(.header):hover {
    background: #3a3f55;
}

.table-row.header {
    background: #1a1c2c;
    font-weight: bold;
    color: white;
}

.table-row:not(.header) {
    color: #a0aec0;
    border-bottom: 1px solid #3a3f55;
}

.table-row:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .top-achievers {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

    .achiever-card {
        width: 90%;
        max-width: 280px;
        padding: 1.25rem;
        margin: 0;
        /* Reset desktop ordering for mobile */
        order: 2;
    }

    .achiever-card.first {
        order: 1;
    }

    .achiever-card.second {
        order: 2;
    }

    .achiever-card.third {
        order: 3;
    }

    .table-row {
        grid-template-columns: 40px 2fr 1fr 80px;
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .house {
        display: none;
        /* Hide house column on mobile */
    }

    .progress-bar {
        width: 80px;
    }

    .house-icon {
        width: 56px;
        height: 56px;
        padding: 6px;
    }

    .achiever-avatar {
        width: 72px;
        height: 72px;
    }

    .leaderboard-card {
        padding: 1rem;
        gap: 1rem;
    }

    .house-leaderboard h2,
    .individual-leaderboard h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .table-row {
        grid-template-columns: 32px 2fr 70px;
        font-size: 0.875rem;
    }

    .house {
        display: none;
    }

    .achiever-card {
        width: 95%;
    }

    .rank {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .update-note {
        padding: 0.75rem 0 2rem;
    }
}