/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Icon styling */
.fas {
    margin: 0 5px;
    color: inherit;
}

.fa-fire {
    color: #ff6b6b;
    animation: fireFlicker 1s ease-in-out infinite;
}

.fa-crown {
    color: #ffd700;
    animation: crownGlow 2s ease-in-out infinite;
}

.fa-bolt {
    color: #4ecdc4;
    animation: boltFlash 1.5s ease-in-out infinite;
}

.fa-globe {
    color: #45b7d1;
    animation: globeSpin 3s linear infinite;
}

.fa-bullseye {
    color: #ff6b6b;
}

.fa-share-alt {
    color: #4ecdc4;
}

.fa-trophy {
    color: #ffd700;
    animation: trophyShine 2s ease-in-out infinite;
}

@keyframes fireFlicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes crownGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }
    50% { text-shadow: 0 0 20px rgba(255, 215, 0, 1); }
}

@keyframes boltFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

@keyframes trophyShine {
    0%, 100% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }
    50% { text-shadow: 0 0 20px rgba(255, 215, 0, 1); }
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(45deg, #0a0a0a, #1a1a2e, #16213e);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    border: none;
    background: transparent;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Screen overlays */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.hidden {
    display: none !important;
}

/* Game title */
.game-title {
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite, pulse 2s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    margin-bottom: 1rem;
}

.game-subtitle {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

/* Neon buttons */
.neon-button {
    background: transparent;
    border: 2px solid #4ecdc4;
    color: #4ecdc4;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
    margin: 10px;
}

.neon-button:hover {
    background: #4ecdc4;
    color: #000;
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.8);
    transform: translateY(-2px);
}

.neon-button:active {
    transform: translateY(0);
}

.share-button {
    border-color: #ff6b6b;
    color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.share-button:hover {
    background: #ff6b6b;
    color: #fff;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.8);
}

/* Score display */
.score-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
    z-index: 5;
    animation: pulse 1s ease-in-out infinite;
}

.best-score-display {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1rem;
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
    z-index: 5;
}

/* Game over screen */
.game-over-title {
    font-size: 3rem;
    color: #ff6b6b;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.8);
    margin-bottom: 2rem;
    animation: pulse 1s ease-in-out infinite;
}

.score-summary {
    margin-bottom: 2rem;
    text-align: center;
}

.current-score, .best-score {
    font-size: 1.5rem;
    color: #fff;
    margin: 10px 0;
}

.current-score {
    color: #4ecdc4;
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
}

.best-score {
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

.game-over-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Controls hint */
.controls-hint {
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 1rem;
    text-align: center;
}

/* Loading screen */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(78, 205, 196, 0.3);
    border-top: 3px solid #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Viral Stats */
.viral-stats {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 5;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 15px;
    border: 1px solid rgba(78, 205, 196, 0.3);
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

.stat-label {
    font-size: 0.7rem;
    color: #fff;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* Social Proof */
.social-proof {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(78, 205, 196, 0.3);
    backdrop-filter: blur(10px);
}

.proof-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.proof-icon {
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

.proof-text {
    font-size: 1rem;
    opacity: 0.9;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Pulse Button */
.pulse-button {
    animation: buttonPulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.pulse-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: buttonShine 3s ease-in-out infinite;
}

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

@keyframes buttonShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes worldRecordPulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Call-to-Action */
.viral-cta {
    margin-top: 20px;
    text-align: center;
    color: #fff;
    opacity: 0.8;
}

.viral-cta p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Hot Streak */
.hot-streak {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    padding: 15px 20px;
    border-radius: 20px;
    text-align: center;
    z-index: 5;
    animation: streakPulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

.streak-text {
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.streak-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes streakPulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.05); }
}

/* Countdown Timer */
.countdown-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 15;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border-radius: 20px;
    border: 2px solid #4ecdc4;
    backdrop-filter: blur(10px);
}

.timer-text {
    color: #4ecdc4;
    font-size: 1rem;
    margin-bottom: 10px;
}

.timer-number {
    font-size: 3rem;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
    animation: timerPulse 1s ease-in-out infinite;
}

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

/* Funny Share Liner */
.funny-share-liner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    animation: gradientShift 2s ease infinite, linerEntrance 0.8s ease-out;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.liner-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px 60px;
    border-radius: 30px;
    border: 3px solid #fff;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
    animation: linerPulse 2s ease-in-out infinite;
}

.liner-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: iconBounce 1s ease-in-out infinite;
}

.liner-text {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: textGlow 1.5s ease-in-out infinite;
    line-height: 1.2;
}

.liner-subtext {
    font-size: 1.2rem;
    color: #4ecdc4;
    text-shadow: 0 0 15px rgba(78, 205, 196, 0.8);
    animation: subtextFloat 2s ease-in-out infinite;
}

@keyframes linerEntrance {
    0% { 
        transform: scale(0.5) rotate(-10deg); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.1) rotate(5deg); 
        opacity: 0.8; 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1; 
    }
}

@keyframes linerPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 80px rgba(255, 255, 255, 0.8);
    }
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-5deg); }
    75% { transform: translateY(-5px) rotate(5deg); }
}

@keyframes textGlow {
    0%, 100% { 
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 30px rgba(255, 255, 255, 1);
        transform: scale(1.02);
    }
}

@keyframes subtextFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Music Toggle Button */
.music-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: 2px solid #4ecdc4;
    background: rgba(0, 0, 0, 0.7);
    color: #4ecdc4;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.music-toggle:hover {
    background: #4ecdc4;
    color: #000;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
    transform: scale(1.1);
}

.music-toggle.muted {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.music-toggle.muted:hover {
    background: #ff6b6b;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

/* Name Input Screen */
.name-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.name-input {
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 2px solid #4ecdc4;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    width: 300px;
    max-width: 90%;
}

.name-input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    transform: scale(1.02);
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.confirm-name-button {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: #000;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.confirm-name-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(78, 205, 196, 0.4);
}

.confirm-name-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Leaderboard Preview */
.leaderboard-preview {
    margin-top: 40px;
    text-align: center;
}

.leaderboard-preview h3 {
    color: #4ecdc4;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    border-color: #4ecdc4;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.3);
    transform: translateX(5px);
}

.leaderboard-item.rank-1 {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.leaderboard-item.rank-2 {
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.1);
}

.leaderboard-item.rank-3 {
    border-color: #cd7f32;
    background: rgba(205, 127, 50, 0.1);
}

.leaderboard-rank {
    font-weight: bold;
    font-size: 1.2rem;
    color: #4ecdc4;
    min-width: 30px;
}

.leaderboard-rank.rank-1 {
    color: #ffd700;
}

.leaderboard-rank.rank-2 {
    color: #c0c0c0;
}

.leaderboard-rank.rank-3 {
    color: #cd7f32;
}

.leaderboard-name {
    flex: 1;
    text-align: left;
    margin-left: 15px;
    color: #fff;
    font-weight: 500;
}

.leaderboard-score {
    font-weight: bold;
    color: #ff6b6b;
    font-size: 1.1rem;
}

/* Game Over Leaderboard */
.game-over-leaderboard {
    margin-top: 30px;
    text-align: center;
}

.game-over-leaderboard h3 {
    color: #4ecdc4;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.new-record {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: newRecordPulse 2s infinite;
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .score-display {
        font-size: 2rem;
        top: 10px;
    }
    
    .best-score-display {
        font-size: 0.9rem;
        top: 10px;
        right: 10px;
    }
    
    .neon-button {
        padding: 12px 24px;
        font-size: 1rem;
        min-height: 44px; /* iOS touch target */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .game-over-title {
        font-size: 2rem;
    }
    
    .game-over-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .viral-stats {
        top: 10px;
        left: 10px;
        gap: 5px;
    }
    
    .stat-item {
        padding: 6px 10px;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
    }
    
    
    .social-proof {
        padding: 15px;
        gap: 10px;
    }
    
    .proof-item {
        gap: 8px;
    }
    
    .proof-icon {
        font-size: 1.2rem;
    }
    
    .proof-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .score-display {
        font-size: 1.5rem;
    }
    
    .game-over-title {
        font-size: 1.5rem;
    }
    
    /* Mobile-specific improvements */
    .name-input {
        font-size: 1.1rem;
        padding: 18px 20px;
        min-height: 44px;
    }
    
    .confirm-name-button {
        padding: 18px 30px;
        font-size: 1rem;
        min-height: 44px;
    }
    
    .leaderboard-item {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .music-toggle {
        width: 44px;
        height: 44px;
        top: 15px;
        right: 15px;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"] {
        font-size: 16px;
    }
    
    /* Touch-friendly buttons */
    button {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Prevent scrolling during game */
    body.game-playing {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}
