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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            /* WebP for modern browsers, falls back to JPEG */
            background-image: url('../background.webp');
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
            background-repeat: no-repeat;
            position: relative;
            min-height: 100vh;
            color: #1f2937;
        }
        
        /* JPEG fallback for older browsers */
        @supports not (background-image: url('../background.webp')) {
            body {
                background-image: url('../background.jpg');
            }
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 1rem;
            position: relative;
            z-index: 1;
        }

        .logo-container {
            max-width: 200px;
            margin: 0 auto 1.5rem;
        }

        .logo-container img {
            width: 100%;
            height: auto;
            border-radius: 50%;
            box-shadow: 0 10px 25px rgba(0,0,0,0.2);
            display: block;
        }

        .card {
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(20px);
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            border: 1px solid rgba(255, 255, 255, 0.5);
        }

        .btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 1rem;
            display: inline-block;
        }

        .btn-primary {
            background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
            color: white;
            box-shadow: 0 4px 6px rgba(255, 107, 53, 0.3);
        }

        .btn-primary:hover {
            box-shadow: 0 6px 12px rgba(255, 107, 53, 0.4);
            transform: translateY(-2px);
        }

        .btn-secondary {
            background: white;
            border: 2px solid #d1d5db;
            color: #4b5563;
        }

        .btn-secondary:hover {
            background: #f9fafb;
        }

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

        .user-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.25rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .stat-card {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            padding: 1.25rem;
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .stat-icon {
            width: 56px;
            height: 56px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.5rem;
        }

        .stat-icon.cyan {
            background: linear-gradient(135deg, #00CED1 0%, #20B2AA 100%);
        }

        .stat-icon.desert {
            background: linear-gradient(135deg, #F4A460 0%, #D2691E 100%);
        }

        .stat-icon.orange {
            background: #FFA500;
        }

        .stat-icon.red {
            background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
        }

        .stat-value {
            font-size: 1.5rem;
            font-weight: bold;
            color: #1f2937;
        }

        .stat-label {
            font-size: 0.875rem;
            color: #6b7280;
        }

        .tabs {
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            padding: 0.5rem;
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            overflow-x: auto;
        }

        .tab {
            flex: 1;
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 8px;
            background: white;
            color: #4b5563;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            white-space: nowrap;
            min-width: 100px;
        }

        .tab:hover {
            background: #f3f4f6;
        }

        .tab.active {
            background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
            color: white;
        }

        .session-item {
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            padding: 1.25rem;
            margin-bottom: 1rem;
            transition: all 0.3s;
        }

        .session-item:hover {
            border-color: #D2691E;
        }

        .session-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .session-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .btn-delete-session {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1.25rem;
            padding: 0.25rem 0.5rem;
            border-radius: 6px;
            transition: all 0.2s;
            opacity: 0.5;
        }
        
        .btn-delete-session:hover {
            opacity: 1;
            background: rgba(239, 68, 68, 0.1);
            transform: scale(1.1);
        }
        
        .session-date {
            font-weight: 600;
            color: #1f2937;
        }
        
        .session-time {
            font-size: 0.875rem;
            color: #6b7280;
            margin-left: 0.5rem;
        }
        
        .routine-tag {
            display: inline-block;
            background: #dbeafe;
            color: #1e40af;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            margin-left: 0.5rem;
            font-weight: 500;
        }

        .session-points {
            font-size: 1.75rem;
            font-weight: bold;
            background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .session-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            z-index: 1000;
        }

        .modal {
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-radius: 12px;
            max-width: 500px;
            width: 100%;
            padding: 2rem;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
            animation: modalFadeIn 0.3s;
        }

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

        .form-group {
            margin-bottom: 1.25rem;
        }

        .form-label {
            display: block;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: #374151;
        }

        .form-input, .form-select {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid #d1d5db;
            border-radius: 8px;
            font-size: 1rem;
        }

        .form-input:focus, .form-select:focus {
            outline: none;
            border-color: #D2691E;
            box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.1);
        }

        .modal-buttons {
            display: flex;
            gap: 1rem;
            margin-top: 1.5rem;
        }

        .modal-buttons .btn {
            flex: 1;
        }

        .leaderboard-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.25rem;
            border-radius: 12px;
            margin-bottom: 0.75rem;
            background: #f9fafb;
            border: 2px solid #e5e7eb;
            transition: all 0.3s;
        }

        .leaderboard-item:hover {
            background: #f3f4f6;
        }

        .leaderboard-item.current-user {
            background: #FFF5E6;
            border-color: #D2691E;
        }

        .rank-badge {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.125rem;
        }

        .rank-gold {
            background: #fbbf24;
            color: #78350f;
        }

        .rank-silver {
            background: #d1d5db;
            color: #374151;
        }

        .rank-bronze {
            background: #fb923c;
            color: #7c2d12;
        }

        .rank-other {
            background: #e5e7eb;
            color: #6b7280;
        }

        .badge {
            padding: 0.25rem 0.75rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            display: inline-block;
            margin-left: 0.5rem;
        }

        .badge-you {
            background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
            color: white;
        }

        .badge-friend {
            background: linear-gradient(135deg, #00CED1 0%, #20B2AA 100%);
            color: white;
        }

        .login-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .login-card {
            background: white;
            border-radius: 16px;
            box-shadow: 0 20px 50px rgba(0,0,0,0.2);
            padding: 2.5rem;
            max-width: 450px;
            width: 100%;
            text-align: center;
        }

        .login-title {
            font-size: 2rem;
            font-weight: bold;
            margin-bottom: 0.5rem;
            color: #1f2937;
        }

        .login-subtitle {
            color: #6b7280;
            margin-bottom: 2rem;
        }

        .login-buttons {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .login-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            padding: 1rem 1.5rem;
            border: 2px solid #d1d5db;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            background: white;
            color: #374151;
            text-decoration: none;
        }

        .login-btn:hover {
            background: #f9fafb;
        }

        .login-btn.primary {
            background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
            color: white;
            border: none;
        }

        .login-btn.apple {
            background: black;
            color: white;
            border: none;
        }

        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
            color: #6b7280;
        }

        .challenge-box {
            background: linear-gradient(135deg, #FFE4B5 0%, #DEB887 100%);
            border: 2px solid #D2691E;
            border-radius: 12px;
            padding: 1.25rem;
            margin-top: 1rem;
        }

        .achievement-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
        }

        .achievement-card {
            padding: 1.25rem;
            border-radius: 12px;
            border: 2px solid #e5e7eb;
            transition: all 0.3s;
        }

        .achievement-card.unlocked {
            background: linear-gradient(to bottom right, #fef3c7, #fde68a);
            border-color: #fbbf24;
        }

        .achievement-card.locked {
            background: #f9fafb;
            opacity: 0.6;
        }

        .text-center {
            text-align: center;
        }

        .loading-spinner {
            display: inline-block;
            width: 50px;
            height: 50px;
            border: 5px solid #f3f3f3;
            border-top: 5px solid #FF6B35;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

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

        .error-message {
            background: #fee;
            border: 2px solid #f88;
            color: #c33;
            padding: 1rem;
            border-radius: 8px;
            margin: 1rem 0;
        }

        .flex {
            display: flex;
        }

        .flex-between {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .gap-2 {
            gap: 0.5rem;
        }

        .gap-3 {
            gap: 0.75rem;
        }

        h1 {
            font-size: 1.875rem;
            font-weight: bold;
        }

        h2 {
            font-size: 1.5rem;
            font-weight: bold;
            margin-bottom: 1rem;
        }

        h3 {
            font-size: 1.25rem;
            font-weight: bold;
        }

        @media (max-width: 768px) {
            /* Fix background on mobile devices */
            body {
                background-attachment: scroll;
            }

            .container {
                padding: 0.75rem;
            }

            .card {
                padding: 1rem;
                margin-bottom: 1rem;
                border-radius: 8px;
            }

            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.75rem;
            }

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

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

            h1 {
                font-size: 1.5rem;
            }

            h2 {
                font-size: 1.25rem;
            }
            
            /* Header on mobile */
            .header-content {
                grid-template-columns: 1fr;
                text-align: center;
            }
            
            .header-left {
                justify-content: center;
                order: 1;
            }
            
            .header-center {
                order: 2;
                margin: 0.5rem 0;
            }
            
            .app-title {
                font-size: 1.75rem;
            }
            
            .header-right {
                justify-content: center;
                order: 3;
            }

            /* Stack quote and logo on mobile */
            .container > div:first-child {
                flex-direction: column !important;
            }

            .logo-container {
                max-width: 150px !important;
                margin-bottom: 1rem !important;
            }

            /* Better button spacing on mobile */
            .btn {
                padding: 0.625rem 1.25rem;
                font-size: 0.9375rem;
            }

            /* Modal padding on mobile */
            .modal {
                padding: 1.5rem;
                margin: 1rem;
            }

            /* Session items on mobile */
            .session-item {
                padding: 1rem;
            }

            .session-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }

            .session-actions {
                width: 100%;
                justify-content: space-between;
            }

            /* Gender filter on mobile */
            .gender-filter-container {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
                padding: 0.75rem;
            }

            .gender-toggles {
                width: 100%;
                justify-content: center;
            }

            .gender-toggle {
                flex: 1;
                min-width: 80px;
            }
            
            /* Header profile on mobile */
            .header-profile-pic {
                width: 32px;
                height: 32px;
            }
            
            .header-user-profile {
                padding: 0.4rem 0.6rem;
            }
            
            /* Leaderboard profile on mobile */
            .leaderboard-profile-pic {
                width: 40px;
                height: 40px;
            }
            
            /* Achievements on mobile */
            .player-achievements {
                font-size: 0.75rem;
            }
        }
    </style>

/* App Header */
.app-header {
    background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.header-logo {
    height: 50px;
    border-radius: 8px;
}

.app-title {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
    cursor: pointer;
}

.header-user-profile:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.header-profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-profile-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
}

.user-name {
    font-weight: 500;
    color: white;
}

.user-name.clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.user-name.clickable:hover {
    color: #ffffff;
}

/* Navigation Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
}

.tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
}

.tab:hover {
    color: #FF6B35;
    background: rgba(255, 107, 53, 0.05);
}

.tab.active {
    color: white;
    background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
    border-bottom-color: transparent;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 300px);
    padding-bottom: 3rem;
}

/* Stats Card */
.stat-card {
    background: linear-gradient(135deg, #F4A460 0%, #FF6B35 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Action Section */
.action-section {
    text-align: center;
    margin: 2rem 0;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

/* Add Session Form */
.add-session-form {
    margin: 2rem 0;
}

.add-session-form h3 {
    margin-bottom: 1.5rem;
    color: #FF6B35;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #FF6B35;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Sessions List */
.sessions-list {
    max-height: 500px;
    overflow-y: auto;
}

.session-item {
    padding: 1rem;
    border-left: 4px solid #FF6B35;
    background: #FFF8DC;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.session-item.routine-item {
    border-left-color: #3B82F6;
    background: #EFF6FF;
}

.session-item.game-item {
    border-left-color: #10B981;
    background: #ECFDF5;
}

.session-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.session-date {
    color: #6b7280;
}

.session-time {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.session-points {
    color: #FF6B35;
    font-size: 1.1rem;
}

.routine-item .session-points {
    color: #3B82F6;
}

.game-item .session-points {
    color: #10B981;
}

.session-stats {
    display: flex;
    gap: 1rem;
    color: #4b5563;
}

.routine-tag {
    display: inline-block;
    background: #3B82F6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.game-tag {
    display: inline-block;
    background: #10B981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.goal-badge {
    color: #10B981;
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.leaderboard-tab {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    flex: 1;
    min-width: fit-content;
}

.leaderboard-tab:hover {
    border-color: #FF6B35;
    background: #fff7ed;
}

.leaderboard-tab.active {
    background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
    color: white;
    border-color: #FF6B35;
}

/* Gender Filter */
.gender-filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.filter-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.gender-toggles {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gender-toggle {
    padding: 0.5rem 1rem;
    border: 2px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    min-width: 90px;
    text-align: center;
}

.gender-toggle:hover {
    border-color: #9ca3af;
    background: #f3f4f6;
}

.gender-toggle.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
}

.leaderboard-list {
    max-height: 600px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, #FFE4B5 0%, #F4A460 100%);
    font-weight: 600;
}

.rank {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.rank.gold { color: #FFD700; }
.rank.silver { color: #C0C0C0; }
.rank.bronze { color: #CD7F32; }

.leaderboard-profile-pic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.leaderboard-profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leaderboard-profile-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.player-name-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.player-achievements {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.leaderboard-item.current-user .player-achievements {
    color: #8B6F47;
}

.player-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #FF6B35;
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Achievements */
.achievement-category {
    margin-bottom: 2.5rem;
}

.category-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #FF6B35;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-progress {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.achievement-card {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, #FFE4B5 0%, #F4A460 100%);
    border-color: #FF6B35;
}

.achievement-card.locked {
    opacity: 0.5;
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.achievement-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.achievement-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.achievement-points {
    font-size: 0.85rem;
    color: #FF6B35;
    font-weight: 600;
}

.achievement-badge {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #4CAF50;
    color: white;
    border-radius: 6px;
    font-weight: 600;
}

/* Footer */
.app-footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.app-footer p {
    margin: 0.5rem 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .player-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .routines-grid {
        grid-template-columns: 1fr;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }

    /* Better spacing for tabs on mobile */
    .tabs {
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .tab {
        white-space: nowrap;
        min-width: fit-content;
    }

    /* Game cards on mobile */
    .game-card {
        padding: 1rem;
    }

    /* Routine cards on mobile */
    .routine-card {
        padding: 1rem;
    }

    /* Form groups on mobile */
    .form-group {
        margin-bottom: 1rem;
    }
}

/* Routines Panel Styles */
.routines-panel {
    margin-bottom: 1.5rem;
}

.routines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.routine-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.routine-card:hover {
    border-color: #FF6B35;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

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

.routine-header h4 {
    font-size: 1.25rem;
    color: #1f2937;
    margin: 0;
}

.routine-badge {
    background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.routine-description {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.routine-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.routine-drills {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.drill-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.drill-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.drill-item strong {
    display: block;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.drill-item p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.action-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Games Grid Styles */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.game-card:hover {
    border-color: #FF6B35;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.game-header h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin: 0;
    flex: 1;
}

.game-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.game-badge.easy {
    background: #10b981;
    color: white;
}

.game-badge.medium {
    background: #f59e0b;
    color: white;
}

.game-badge.hard {
    background: #ef4444;
    color: white;
}

.game-description {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.game-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.game-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.game-details.expanded {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.game-details h4 {
    color: #1f2937;
    margin: 1.5rem 0 0.75rem;
    font-size: 1rem;
}

.game-instructions {
    background: #f9fafb;
    border-radius: 6px;
    padding: 1rem 1rem 1rem 2rem;
    margin-bottom: 1rem;
}

.game-instructions li {
    color: #4b5563;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.game-instructions li:last-child {
    margin-bottom: 0;
}

.game-scoring {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.game-scoring p {
    margin: 0.5rem 0;
    color: #78350f;
}

.game-scoring p:first-child {
    margin-top: 0;
}

.game-scoring p:last-child {
    margin-bottom: 0;
}

.toggle-game-btn {
    width: 100%;
    margin-top: 1rem;
}

.routine-actions,
.game-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.routine-actions button,
.game-actions button {
    flex: 1;
}

/* Routine Completion Modal */
.routine-completion-modal {
    max-width: 700px;
}

.modal-description {
    margin-bottom: 1.5rem;
    color: #6b7280;
}

.drill-completion-group {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #FF6B35;
}

.drill-completion-group h4 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1rem;
}

.drill-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.drill-completion-group .form-row {
    margin-bottom: 0;
}

/* Game Score Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.modal-body {
    padding: 0 2rem 2rem 2rem;
}

.game-score-modal {
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-bottom: 0;
    border-bottom: 2px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-btn:hover {
    color: #1f2937;
    background: #f3f4f6;
    border-radius: 4px;
}

.game-score-form .form-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: #FF6B35;
    background: #fff7ed;
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

.game-stats-display {
    margin: 1.5rem 0;
}

.rotations-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.rotations-grid-detailed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.turn-input-group {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.turn-label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.turn-inputs {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.turn-field {
    flex: 1;
}

.turn-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.turn-makes-input,
.turn-attempts-input {
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0.5rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
}

.turn-makes-input:focus,
.turn-attempts-input:focus {
    outline: none;
    border-color: #FF6B35;
}

.turn-separator {
    font-size: 1.5rem;
    font-weight: bold;
    color: #9ca3af;
    padding: 0 0.25rem;
    padding-bottom: 0.5rem;
}

.rotation-input {
    margin-bottom: 0 !important;
}

.rotation-input label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.rotation-input input {
    text-align: center;
    font-weight: bold;
}

.form-description {
    background: #f3f4f6;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #4b5563;
}

@media (max-width: 640px) {
    .rotations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rotations-grid-detailed {
        grid-template-columns: 1fr;
    }
}

/* Profile Modal */
.profile-modal {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Profile Picture Section */
.profile-picture-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    border-radius: 12px;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FF6B35 0%, #D9534F 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
}

/* Profile Info Section */
.profile-info-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-field label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.profile-input {
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
}

.profile-input:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.profile-value {
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    color: #4b5563;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600 !important;
}

.profile-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.profile-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    font-style: italic;
}

/* Profile Stats Section */
.profile-stats-section {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.profile-stats-section h4 {
    margin: 0 0 1rem 0;
    color: #374151;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-stat {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF6B35;
}

.profile-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.profile-member-since {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

.player-name-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Mobile Responsive - Profile */
@media (max-width: 768px) {
    .profile-modal {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-picture {
        width: 100px;
        height: 100px;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .profile-actions button {
        width: 100%;
    }
}

