/* Limit Switcher */
.limit-switcher {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}
.limit-btn {
    padding: 10px 30px;
    border: 2px solid var(--accent-strong);
    background: var(--panel-bg);
    color: var(--accent);
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
}
.limit-btn.active {
    background: var(--accent);
    color: var(--panel-bg);
    border-color: var(--accent);
}
.limit-btn:hover {
    background: var(--accent-strong);
    color: var(--panel-bg);
}
/* ==========================================
   LEADERBOARD PAGE - MODERN DESIGN
   ========================================== */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    padding: 60px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px var(--shadow);
    animation: fadeIn 0.6s ease;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.page-header h1 {
    font-size: 3em;
    margin: 0 0 15px 0;
    color: var(--panel-bg);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.page-header h1 .rank-info-btn {
    font-size: 0.5em;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 1;
}

.page-header p {
    font-size: 1.2em;
    margin: 0;
    color: var(--panel-bg);
    opacity: 0.95;
}

/* Filter Tabs */
.filter-section {
    margin-bottom: 30px;
    animation: slideDown 0.5s ease;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: var(--panel-bg);
    border: 2px solid var(--accent-strong);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: 600;
    color: var(--text);
}

.filter-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.filter-tab.active {
    background: var(--accent);
    color: var(--panel-bg);
    border-color: var(--accent);
}

.tab-icon {
    font-size: 1.2em;
}

.tab-text {
    font-size: 0.95em;
}

/* User Stats Section */
.user-stats-section {
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease;
}

.user-stats-card {
    background: var(--panel-bg);
    border: 2px solid var(--accent-strong);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px var(--shadow);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-strong);
}

.stats-header h2 {
    margin: 0;
    color: var(--accent);
    font-size: 1.5em;
}

.user-rank-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-radius: 20px;
    color: var(--panel-bg);
    font-weight: bold;
}

.rank-info-btn {
    background: none;
    border: none;
    color: var(--panel-bg);
    font-size: 1.2em;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    opacity: 0.8;
}

.rank-info-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.rank-emoji {
    font-size: 1.5em;
}

.rank-name {
    font-size: 1.1em;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f9f6f0 0%, #fff 100%);
    border-radius: 10px;
    border: 1px solid var(--accent-strong);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark .stat-item {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--shadow);
}

.stat-icon {
    font-size: 2.5em;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Progress Container */
.progress-container {
    background: linear-gradient(135deg, #f9f6f0 0%, #fff 100%);
    border: 1px solid var(--accent-strong);
    border-radius: 10px;
    padding: 20px;
}

.dark .progress-container {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label {
    font-weight: 600;
    color: var(--text);
}

.progress-percentage {
    font-weight: bold;
    color: var(--accent);
    font-size: 1.1em;
}

.progress-bar-wrapper {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.dark .progress-bar-wrapper {
    background: #3a3a3a;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-radius: 10px;
    transition: width 0.8s ease;
}

.progress-info {
    text-align: center;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Leaderboard Section */
.leaderboard-section {
    animation: fadeInUp 0.7s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-strong);
}

.section-header h2 {
    margin: 0;
    color: var(--accent);
    font-size: 1.8em;
}

.leaderboard-info {
    font-size: 1em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: var(--panel-bg);
    border: 2px solid var(--accent-strong);
    border-radius: 12px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--accent-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 1.1em;
}

/* Error State */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: var(--panel-bg);
    border: 2px solid #e74c3c;
    border-radius: 12px;
}

.error-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.error-message {
    color: var(--text);
    font-size: 1.2em;
    margin-bottom: 20px;
}

.retry-button {
    padding: 12px 30px;
    background: var(--accent);
    color: var(--panel-bg);
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: var(--accent-strong);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

/* Leaderboard Table */
.leaderboard-container {
    animation: fadeInUp 0.8s ease;
}

.leaderboard-table-wrapper {
    background: var(--panel-bg);
    border: 2px solid var(--accent-strong);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.leaderboard-table th {
    padding: 18px 20px;
    text-align: center;
    font-weight: bold;
    font-size: 1em;
    color: var(--panel-bg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.col-rank {
    width: 80px;
}

.col-player,
.leaderboard-table th.col-player {
    width: auto;
    text-align: left;
}

.col-rank-badge {
    width: 150px;
}

.col-mushrooms {
    width: 150px;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid var(--accent-strong);
    transition: all 0.3s ease;
    animation: fadeInRow 0.4s ease;
    animation-fill-mode: both;
}

.leaderboard-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(139, 90, 43, 0.05) 0%, rgba(139, 90, 43, 0.1) 100%);
    transform: translateX(5px);
}


.dark .leaderboard-table thead {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.dark .leaderboard-table th {
    color: var(--panel-bg);
}

.dark .leaderboard-table td,
.dark .leaderboard-table .player-cell,
.dark .leaderboard-table .rank-cell,
.dark .leaderboard-table .mushroom-cell {
    color: var(--text);
}

.dark .leaderboard-table td.rank {
    color: var(--accent);
}

.dark .username-name {
    color: var(--accent);
}

.dark .discovered-cell,
.dark .points-cell,
.dark .rank-stats .stat-number,
.dark .stat-box .stat-value {
    color: var(--accent-strong);
}

.dark .rank-info h3 {
    color: var(--accent);
}

.dark .rank-info .rank-number {
    color: var(--accent-strong);
}

.dark .my-rank-section h2,
.dark .stat-box h3 {
    color: var(--accent);
}

.dark .stat-box {
    background: var(--panel-bg);
    border-color: var(--accent-strong);
}

.dark .stat-box .stat-subtitle {
    color: var(--accent-strong);
}

.dark .progress-section p,
.dark .progress-text {
    color: var(--accent);
}

.dark .level-badge {
    background: var(--panel-bg);
    color: var(--accent);
}

.dark .leaderboard-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(160, 112, 77, 0.15) 0%, rgba(160, 112, 77, 0.22) 100%);
}

@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-table td {
    padding: 18px 20px;
    color: var(--text);
}

.rank-cell {
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    color: var(--accent);
}

.rank-medal {
    font-size: 1.5em;
}

.player-cell {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    font-size: 1.05em;
}

.rank-badge-cell {
    text-align: center;
}

.table-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9em;
}

.rank-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #b86f28 100%);
    color: white;
}

.rank-silber {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    color: #333;
}

.rank-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb900 100%);
    color: #333;
}

.rank-platin {
    background: linear-gradient(135deg, #e5e4e2 0%, #b9f2ff 100%);
    color: #333;
}

.mushroom-cell {
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    color: var(--accent);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--panel-bg);
    border: 2px dashed var(--accent-strong);
    border-radius: 12px;
    margin-top: 50px;
}

.empty-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--accent);
    font-size: 1.8em;
    margin: 0 0 15px 0;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.1em;
    margin-bottom: 30px;
}

.action-button {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent);
    color: var(--panel-bg);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-button:hover {
    background: var(--accent-strong);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2em;
    }

    .page-header p {
        font-size: 1em;
    }

    .filter-tabs {
        flex-direction: column;
    }

    .filter-tab {
        width: 100%;
        justify-content: center;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 10px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 40px 20px;
    }

    .user-stats-card {
        padding: 20px;
    }

    .stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .leaderboard-table tbody tr:hover {
        transform: none;
    }
}

.leaderboard-table th.points {
    width: 120px;
}

.leaderboard-table th.level {
    width: 80px;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background-color: #f9f6f0;
}

.leaderboard-table td {
    padding: 15px;
    color: #333;
}

.leaderboard-table td.rank {
    text-align: center;
    font-weight: bold;
    color: #8b5a2b;
}

.rank-medal {
    font-size: 1.3em;
    margin-right: 5px;
}

.username-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.username-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5a2b, #a0704d);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8em;
}

.username-name {
    font-weight: 600;
    color: #8b5a2b;
}

.discovered-cell {
    font-weight: bold;
    color: #a0704d;
}

.points-cell {
    text-align: right;
    color: #8b5a2b;
    font-weight: bold;
}

.level-cell {
    text-align: center;
    font-weight: bold;
}

.level-badge {
    background: #f9f6f0;
    padding: 4px 10px;
    border-radius: 12px;
    color: #8b5a2b;
    font-size: 0.85em;
}

/* My Rank Section */
.my-rank-section {
    background: #f9f6f0;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 40px;
}

.my-rank-section h2 {
    color: #8b5a2b;
    margin: 0 0 25px 0;
}

.my-rank-card {
    background: white;
    border: 3px solid #a0704d;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(139, 90, 43, 0.1);
}

.rank-position {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f9f6f0;
}

.rank-position .medal {
    font-size: 3em;
}

.rank-info h3 {
    color: #8b5a2b;
    margin: 0 0 5px 0;
    font-size: 1.3em;
}

.rank-info .rank-number {
    color: #a0704d;
    margin: 0;
    font-size: 0.95em;
}

.rank-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.rank-stats .stat {
    text-align: center;
    padding: 15px;
    background: #f9f6f0;
    border-radius: 8px;
}

.rank-stats .stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #8b5a2b;
    margin-bottom: 5px;
}

.rank-stats .stat-label {
    display: block;
    color: #a0704d;
    font-size: 0.85em;
    font-weight: bold;
}

.progress-section {
    background: #f9f6f0;
    padding: 15px;
    border-radius: 8px;
}

.progress-section p {
    margin: 0 0 10px 0;
    color: #8b5a2b;
    font-weight: 600;
    font-size: 0.95em;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5a2b, #a0704d);
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #a0704d;
    font-size: 0.85em;
    margin: 0;
}

/* Statistics Section */
.statistics-section {
    margin-bottom: 40px;
}

.statistics-section h2 {
    color: #8b5a2b;
    border-bottom: 3px solid #a0704d;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
}

.stat-box {
    background: white;
    border: 2px solid #a0704d;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.1);
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(139, 90, 43, 0.15);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-box h3 {
    color: #8b5a2b;
    margin: 10px 0 8px 0;
    font-size: 0.95em;
    text-transform: uppercase;
}

.stat-box .stat-value {
    font-size: 2.2em;
    font-weight: bold;
    color: #8b5a2b;
    margin: 10px 0;
}

.stat-box .stat-subtitle {
    color: #a0704d;
    font-size: 0.85em;
    margin: 0;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 1024px) {
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 10px;
        font-size: 0.9em;
    }

    .leaderboard-table th.username {
        width: 150px;
    }

    .rank-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .leaderboard-header {
        padding: 35px 20px;
    }

    .leaderboard-header h1 {
        font-size: 1.8em;
    }

    /* Tabelle scrollbar machen */
    .leaderboard-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .leaderboard-table {
        min-width: 600px;
    }

    .rank-position {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        margin-bottom: 15px;
    }

    .rank-position .medal {
        font-size: 2.5em;
    }

    .rank-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
        margin-bottom: 15px;
    }

    .rank-stats .stat {
        padding: 10px;
    }

    .rank-stats .stat-number {
        font-size: 1.5em;
    }

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

    .filter-section {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85em;
    }
}

/* Rank Info Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--panel-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--accent-strong);
}

.modal-header h2 {
    margin: 0;
    color: var(--accent);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--text);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.rank-thresholds {
    margin: 20px 0;
}

.rank-threshold {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.rank-threshold:last-child {
    border-bottom: none;
}

.rank-threshold-emoji {
    font-size: 1.5em;
    margin-right: 10px;
}

.rank-threshold-name {
    font-weight: bold;
    color: var(--accent);
}

.rank-threshold-value {
    font-weight: bold;
    color: var(--text);
}

.modal-note {
    margin-top: 20px;
    padding: 15px;
    background: var(--accent-light);
    border-radius: 8px;
    font-size: 0.9em;
}

.dark .modal-note {
    background: rgba(255, 255, 255, 0.1);
}
