* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a0a2a 50%, #2a0a3a 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated starfield background */
.stars, .stars2, .stars3 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.stars {
    background: transparent url('data:image/svg+xml,%3Csvg width="1" height="1" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="1" height="1" fill="white"/%3E%3C/svg%3E') repeat;
    background-size: 1px 1px;
    animation: animStar 50s linear infinite;
    box-shadow: 
        779px 1331px #fff, 324px 42px #fff, 303px 586px #fff,
        1312px 276px #fff, 451px 625px #fff, 521px 1931px #fff,
        1087px 1871px #fff, 36px 1546px #fff, 132px 934px #fff;
}

.stars2 {
    background: transparent url('data:image/svg+xml,%3Csvg width="2" height="2" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="2" height="2" fill="white"/%3E%3C/svg%3E') repeat;
    background-size: 2px 2px;
    animation: animStar 100s linear infinite;
    box-shadow:
        779px 1331px #fff, 324px 42px #fff, 303px 586px #fff,
        1312px 276px #fff, 451px 625px #fff;
}

.stars3 {
    background: transparent url('data:image/svg+xml,%3Csvg width="3" height="3" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="3" height="3" fill="white"/%3E%3C/svg%3E') repeat;
    background-size: 3px 3px;
    animation: animStar 150s linear infinite;
    box-shadow:
        779px 1331px #fff, 324px 42px #fff, 303px 586px #fff;
}

@keyframes animStar {
    from { transform: translateY(0px); }
    to { transform: translateY(-2000px); }
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(138, 43, 226, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 48px;
    animation: rocket-pulse 2s ease-in-out infinite;
}

@keyframes rocket-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.logo h1 {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.wallet-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.balance-display {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 20px;
    display: none;
}

.balance-display.active {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-amount {
    font-weight: 700;
    color: #f093fb;
}

.connect-wallet {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.connect-wallet:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.connect-wallet::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.connect-wallet:hover::before {
    left: 100%;
}

/* Game Section */
.game-section {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 30px;
    margin-bottom: 40px;
}

/* Panels */
.panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    margin-bottom: 20px;
    color: #f093fb;
}

.panel-title .icon {
    font-size: 24px;
}

/* Leaderboard */
.timer {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.timer-value {
    font-weight: 700;
    font-size: 18px;
}

.leaderboard {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 50px 1fr 80px 80px;
    padding: 10px;
    border-bottom: 2px solid rgba(138, 43, 226, 0.3);
    font-weight: 700;
    font-size: 12px;
    color: #888;
}

.leaderboard-entries {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 50px 1fr 80px 80px;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.leaderboard-entry:hover {
    background: rgba(138, 43, 226, 0.1);
    transform: translateX(5px);
}

.leaderboard-entry.gold { color: #ffd700; }
.leaderboard-entry.silver { color: #c0c0c0; }
.leaderboard-entry.bronze { color: #cd7f32; }

.leaderboard-entry.current-player {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.5);
}

.rank {
    font-weight: 900;
}

.player-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score {
    font-weight: 700;
    color: #f093fb;
}

.prize {
    font-size: 12px;
    color: #4ade80;
}

.your-rank {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(240, 147, 251, 0.2));
    border-radius: 10px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
}

/* Game Container */
.game-container {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    border: 2px solid rgba(138, 43, 226, 0.3);
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.2);
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 900;
}

.multiplier {
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.fuel-bar {
    width: 100px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
}

.fuel-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    transition: width 0.3s ease;
    width: 100%;
}

#gameCanvas {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
}

/* Game Overlay */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.start-screen, .game-over-screen {
    text-align: center;
    padding: 40px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-screen h2, .game-over-screen h2 {
    font-size: 32px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.controls-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.controls-info p {
    margin: 10px 0;
}

.play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 18px 48px;
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 900;
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.play-btn:active .btn-glow {
    width: 300px;
    height: 300px;
}

.requirement {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 15px;
}

.final-score {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.score-value {
    display: block;
    font-size: 48px;
    font-weight: 900;
    color: #f093fb;
    text-shadow: 0 0 30px rgba(240, 147, 251, 0.5);
}

.game-over-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
}

.stat-item span:first-child {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.stat-item span:last-child {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

/* Stats Panel */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.stat-card .stat-label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 5px;
}

.stat-big {
    font-size: 24px;
    font-weight: 900;
    color: #f093fb;
}

/* Prize Pool */
.prize-pool {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.prize-pool h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #ffd700;
}

.prize-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prize-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.prize-item:hover {
    transform: translateX(5px);
    background: rgba(255, 215, 0, 0.1);
}

.prize-item.gold {
    border-left: 3px solid #ffd700;
}

.prize-item.silver {
    border-left: 3px solid #c0c0c0;
}

.prize-item.bronze {
    border-left: 3px solid #cd7f32;
}

.prize-rank {
    font-weight: 700;
}

.prize-amount {
    color: #4ade80;
    font-weight: 700;
}

/* Sound Toggle */
.sound-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    color: white;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid rgba(138, 43, 226, 0.2);
}

.footer-content p {
    color: #888;
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.social-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: #f093fb;
    transform: translateY(-2px);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(240, 147, 251, 0.9));
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 24px;
}

.toast-message {
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .game-section {
        grid-template-columns: 1fr;
    }
    
    .panel {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .stats-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .game-container {
        padding: 10px;
    }
    
    #gameCanvas {
        height: 400px;
    }
    
    .panel {
        padding: 15px;
    }
    
    .leaderboard-header,
    .leaderboard-entry {
        grid-template-columns: 40px 1fr 70px 70px;
        font-size: 12px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
}