/* Playful Leaderboard - Colorful & Punchy Design */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(ellipse at top left, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at top right, rgba(255, 193, 7, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(76, 175, 80, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(33, 150, 243, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #1a1d29 0%, #2a2d3a 50%, #3a3f4b 100%);
    min-height: 100vh;
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #e2e8f0;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 193, 7, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 107, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 40% 60%, rgba(76, 175, 80, 0.03) 0%, transparent 40%);
    z-index: -1;
}

/* Animated Background Elements */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 25% 25%, transparent 0%, transparent 1%, rgba(255, 193, 7, 0.02) 2%, transparent 3%),
        radial-gradient(circle at 75% 75%, transparent 0%, transparent 1%, rgba(255, 107, 107, 0.02) 2%, transparent 3%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
    /* Performance optimization */
    will-change: transform;
    transform: translateZ(0);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Main Container */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.header {
    background:
        linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(255, 193, 7, 0.3);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow:
        0 4px 20px rgba(255, 107, 107, 0.1),
        0 8px 40px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

.btn-icon {
    background:
        linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 107, 107, 0.15) 100%);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 16px;
    padding: 12px 16px;
    color: #ffd93d;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow:
        0 4px 16px rgba(255, 193, 7, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-icon:hover {
    background:
        linear-gradient(135deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 107, 107, 0.25) 100%);
    border-color: rgba(255, 193, 7, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 8px 24px rgba(255, 193, 7, 0.3),
        0 12px 48px rgba(0, 0, 0, 0.15);
}

.control-icon {
    width: 24px;
    height: 24px;
}

/* Main Content */
.leaderboard-content {
    flex: 1;
    padding: 32px 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Controls Row */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
    gap: 20px;
}

/* Responsive design for controls row */
@media (max-width: 768px) {
    .controls-row {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .room-selector-section,
    .time-selector {
        justify-content: center;
    }
    
    .room-filter-dropdown {
        min-width: 100%;
    }
}

/* Room Selector Section */
.room-selector-section {
    margin-bottom: 0;
    display: flex;
    justify-content: flex-start;
    padding: 0;
    flex: 1;
}

.room-selector-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    padding: 16px 24px;
    border-radius: 20px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow:
        0 8px 24px rgba(139, 92, 246, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-selector-container:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 32px rgba(139, 92, 246, 0.2),
        0 6px 16px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(139, 92, 246, 0.5);
}

.room-selector-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #cbd5e1;
    cursor: default;
}

.label-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.label-text {
    white-space: nowrap;
}

.room-filter-dropdown {
    min-width: 280px;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    background:
        linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.85) 100%);
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.05);
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.room-filter-dropdown:hover {
    border-color: rgba(139, 92, 246, 0.6);
    background:
        linear-gradient(135deg, rgba(30, 41, 59, 1) 0%, rgba(51, 65, 85, 0.95) 100%);
    box-shadow:
        0 6px 16px rgba(139, 92, 246, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.08);
}

.room-filter-dropdown:focus {
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow:
        0 0 0 4px rgba(139, 92, 246, 0.2),
        0 6px 16px rgba(139, 92, 246, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.08);
}

.room-filter-dropdown option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    font-weight: 600;
}

/* Time Selector */
.time-selector {
    margin-bottom: 0;
    display: flex;
    justify-content: flex-end;
    flex: 1;
}

.selector-container {
    display: flex;
    background:
        linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-radius: 20px;
    padding: 8px;
    gap: 8px;
    border: 2px solid rgba(255, 193, 7, 0.2);
    box-shadow:
        0 8px 32px rgba(255, 107, 107, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.time-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: none;
    border: none;
    border-radius: 16px;
    color: rgba(226, 232, 240, 0.7);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    /* Accessibility */
    min-height: 44px; /* Minimum touch target size */
    position: relative;
}

/* Focus styles for keyboard navigation */
.time-btn:focus {
    outline: 2px solid #ffd93d;
    outline-offset: 2px;
}

.time-btn .emoji {
    font-size: 1.2rem;
    animation: wiggle 2s ease-in-out infinite;
}

.time-btn.active {
    background:
        linear-gradient(135deg, rgba(255, 193, 7, 0.25) 0%, rgba(255, 107, 107, 0.2) 100%);
    color: #ffd93d;
    box-shadow:
        0 4px 16px rgba(255, 193, 7, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.time-btn:hover:not(.active) {
    background:
        linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 193, 7, 0.08) 100%);
    color: rgba(226, 232, 240, 0.9);
    transform: translateY(-1px);
}

@keyframes wiggle {
    0%, 7% { transform: rotateZ(0); }
    15% { transform: rotateZ(-15deg); }
    20% { transform: rotateZ(10deg); }
    25% { transform: rotateZ(-10deg); }
    30% { transform: rotateZ(6deg); }
    35% { transform: rotateZ(-4deg); }
    40%, 100% { transform: rotateZ(0); }
}

/* Task Filter Row */
.task-filter-row {
    margin: 0 20px 32px 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: 20px;
    border: 2px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.15);
    backdrop-filter: blur(10px);
}

.task-filter-container {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

/* Task Filter Toggle */
.task-filter-toggle {
    display: flex;
    align-items: center;
}

.task-toggle-label {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    user-select: none;
}

.task-toggle-checkbox {
    display: none;
}

.task-toggle-slider {
    position: relative;
    width: 60px;
    height: 30px;
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.1) 0%, rgba(226, 232, 240, 0.05) 100%);
    border-radius: 30px;
    transition: all 0.25s ease;
    border: 2px solid rgba(168, 85, 247, 0.35);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.task-toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    top: 2px;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 50%;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.task-toggle-checkbox:checked + .task-toggle-slider {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 
        inset 0 2px 4px rgba(168, 85, 247, 0.2),
        0 0 0 3px rgba(168, 85, 247, 0.1);
}

.task-toggle-checkbox:checked + .task-toggle-slider::before {
    transform: translateX(30px);
    background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.5);
}

.task-toggle-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.85);
    transition: color 0.25s ease;
    letter-spacing: -0.01em;
}

.task-toggle-checkbox:checked ~ .task-toggle-text {
    color: #c4b5fd;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* Task Selector Container */
.task-selector-container {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.task-selector-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.75);
    white-space: nowrap;
}

.task-selector-label .label-icon {
    font-size: 1.3rem;
}

.task-filter-dropdown {
    flex: 1;
    min-width: 220px;
    max-width: 350px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(168, 85, 247, 0.35);
    border-radius: 14px;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.task-filter-dropdown:hover {
    border-color: rgba(168, 85, 247, 0.55);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(168, 85, 247, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.task-filter-dropdown:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 
        0 0 0 3px rgba(168, 85, 247, 0.25),
        0 6px 16px rgba(168, 85, 247, 0.2);
}

.task-filter-dropdown option {
    background: #1a1d29;
    color: #e2e8f0;
    padding: 8px;
}

/* Responsive design for task filter */
@media (max-width: 768px) {
    .task-filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .task-selector-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .task-selector-label {
        justify-content: center;
    }
    
    .task-filter-dropdown {
        min-width: 100%;
        max-width: 100%;
    }
}

/* Podium Section */
.podium-section {
    margin-bottom: 48px;
    display: flex;
    justify-content: center;
}

.podium-container {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    position: relative;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Performance optimization */
    will-change: transform;
}

.podium-pillar {
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

/* First Place */
.first-place .podium-pillar {
    height: 200px;
    background:
        linear-gradient(135deg, #ffd93d 0%, #ff6b6b 50%, #4ecdc4 100%);
    border-radius: 20px 20px 0 0;
    box-shadow:
        0 8px 32px rgba(255, 211, 61, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    animation: pulse 3s ease-in-out infinite;
}

.first-place .rank-number {
    font-size: 2rem;
    font-weight: 900;
    color: #1a1d29;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

/* Second Place */
.second-place .podium-pillar {
    height: 160px;
    background:
        linear-gradient(135deg, #c0c0c0 0%, #e0e0e0 50%, #f0f0f0 100%);
    border-radius: 20px 20px 0 0;
    box-shadow:
        0 6px 24px rgba(192, 192, 192, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.second-place .rank-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1a1d29;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

/* Third Place */
.third-place .podium-pillar {
    height: 120px;
    background:
        linear-gradient(135deg, #cd7f32 0%, #d2b48c 50%, #daa520 100%);
    border-radius: 20px 20px 0 0;
    box-shadow:
        0 4px 16px rgba(205, 127, 50, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.third-place .rank-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1d29;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.medal {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: bounce 2s ease-in-out infinite;
}

.medal.gold {
    animation-delay: 0s;
}

.medal.silver {
    animation-delay: 0.3s;
}

.medal.bronze {
    animation-delay: 0.6s;
}

.podium-info {
    background:
        linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.8) 100%);
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
    text-align: center;
    border: 2px solid rgba(255, 193, 7, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 140px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background:
        linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
    margin: 0 auto 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-name {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    /* Truncate long names with ellipsis */
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-score {
    font-size: 1.2rem;
    font-weight: 800;
    background:
        linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Rankings Container */
.rankings-container {
    background:
        linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(51, 65, 85, 0.3) 100%);
    border-radius: 24px;
    padding: 32px;
    border: 2px solid rgba(255, 193, 7, 0.15);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

.rankings-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    background:
        linear-gradient(135deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rankings-count {
    color: rgba(226, 232, 240, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Rankings List */
.rankings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background:
        linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 193, 7, 0.08) 100%);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ranking-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.1), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ranking-item:hover {
    background:
        linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 193, 7, 0.12) 100%);
    border-color: rgba(255, 193, 7, 0.3);
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(255, 107, 107, 0.1),
        0 12px 48px rgba(0, 0, 0, 0.1);
}

.ranking-item:hover::before {
    left: 100%;
}

.rank-position {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1d29;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.rank-position.rank-1 {
    background:
        linear-gradient(135deg, #ffd93d 0%, #ff6b6b 100%);
    box-shadow: 0 4px 12px rgba(255, 211, 61, 0.4);
}

.rank-position.rank-2 {
    background:
        linear-gradient(135deg, #c0c0c0 0%, #e0e0e0 100%);
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.4);
}

.rank-position.rank-3 {
    background:
        linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

.rank-position.other {
    background:
        linear-gradient(135deg, rgba(255, 107, 107, 0.3) 0%, rgba(255, 193, 7, 0.2) 100%);
    color: #e2e8f0;
    border: 2px solid rgba(255, 193, 7, 0.3);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    /* Truncate long names with ellipsis */
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-focus-id {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.7);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    background:
        linear-gradient(135deg, rgba(71, 85, 105, 0.3) 0%, rgba(51, 65, 85, 0.2) 100%);
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-block;
    font-weight: 500;
}

.study-time {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffd93d;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: right;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at top, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(255, 193, 7, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #1a1d29 0%, #2a2d3a 50%, #3a3f4b 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #e2e8f0;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 193, 7, 0.2);
    border-top: 4px solid #ffd93d;
    border-right: 4px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow:
        0 0 20px rgba(255, 193, 7, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-screen p {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Retry buttons */
.retry-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: #1a1d29;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.3);
}

.retry-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

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

    .leaderboard-content {
        padding: 20px 16px;
    }

    .podium-container {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .podium-pillar {
        width: 100px;
    }

    .first-place .podium-pillar {
        height: 120px;
    }

    .second-place .podium-pillar {
        height: 100px;
    }

    .third-place .podium-pillar {
        height: 80px;
    }

    .rankings-container {
        padding: 20px;
    }

    .selector-container {
        flex-wrap: wrap;
    }

    .time-btn {
        flex: 1;
        min-width: 100px;
    }
}

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

    .podium-info {
        min-width: 120px;
        padding: 12px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
    }

    .ranking-item {
        padding: 12px 16px;
    }
}

