* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
}

.screen.active {
    display: flex;
}

#authScreen {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: #ff66aa;
    box-shadow: 0 0 0 3px rgba(255, 102, 170, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: #ff66aa;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.btn-primary:hover {
    background: #ff4499;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 170, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.signup-text {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.signup-text a {
    color: #ff66aa;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.signup-text a:hover {
    text-decoration: underline;
}

#menuScreen {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.menu-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.menu-header {
    text-align: center;
    margin-bottom: 40px;
}

.menu-header h1 {
    color: white;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 102, 170, 0.5);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: white;
    font-size: 16px;
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.menu-btn {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 3px solid rgba(255, 102, 170, 0.5);
    border-radius: 15px;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.menu-btn:hover {
    background: rgba(255, 102, 170, 0.2);
    border-color: #ff66aa;
    transform: scale(1.05);
}

.btn-icon {
    font-size: 28px;
}

.difficulty-selector {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.difficulty-selector label {
    color: white;
    font-size: 16px;
    margin-bottom: 12px;
    display: block;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
}

.difficulty-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.difficulty-btn.active {
    background: #ff66aa;
    border-color: #ff66aa;
}

#gameScreen {
    position: relative;
    background: #0a0a0a;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

.game-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    gap: 10px;
}

.btn-pause {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    pointer-events: all;
}

.btn-pause:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.score-display,
.combo-display,
.accuracy-display,
.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 4px;
}

#scoreValue,
#comboValue,
#accuracyValue,
#timerValue {
    font-size: 24px;
    font-weight: 700;
}

#comboValue {
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

#timerValue {
    color: #ff6666;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: white;
}

.overlay-content h2 {
    font-size: 48px;
    margin-bottom: 20px;
}

.overlay-content p {
    font-size: 20px;
    opacity: 0.8;
}

#leaderboardScreen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
}

.leaderboard-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.leaderboard-header h2 {
    color: white;
    font-size: 32px;
    flex: 1;
    text-align: center;
}

.btn-back {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

.difficulty-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: #ff66aa;
    border-color: #ff66aa;
}

.leaderboard-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    color: white;
}

.leaderboard-item.current-user {
    background: rgba(255, 102, 170, 0.2);
    border: 2px solid #ff66aa;
}

.rank {
    font-size: 24px;
    font-weight: 700;
    width: 40px;
    text-align: center;
}

.rank.gold {
    color: #ffd700;
}

.rank.silver {
    color: #c0c0c0;
}

.rank.bronze {
    color: #cd7f32;
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.player-stats {
    font-size: 12px;
    opacity: 0.7;
}

.player-score {
    font-size: 24px;
    font-weight: 700;
    color: #ff66aa;
}

.empty-leaderboard {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px;
    font-size: 16px;
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .menu-header h1 {
        font-size: 36px;
    }
    
    .game-header {
        padding: 15px;
    }
    
    #scoreValue,
    #comboValue,
    #accuracyValue {
        font-size: 20px;
    }
}
