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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1A0033 0%, #000033 100%);
    color: #FFFFFF;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#gameCanvas {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border: 3px solid #1DA1F2;
    box-shadow: 0 0 30px rgba(29, 161, 242, 0.5);
    image-rendering: pixelated;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

/* Start Screen */
.title {
    font-size: 72px;
    font-weight: bold;
    color: #1DA1F2;
    text-shadow: 0 0 20px #1DA1F2;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch 0.3s infinite;
    color: #FF0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch 0.3s infinite reverse;
    color: #00FF00;
    z-index: -2;
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    33% {
        transform: translate(-2px, 2px);
    }
    66% {
        transform: translate(2px, -2px);
    }
}

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

.subtitle {
    font-size: 18px;
    color: #FFD700;
    margin-bottom: 40px;
    text-shadow: 0 0 10px #FFD700;
}

.floating-icons {
    margin: 30px 0;
    display: flex;
    gap: 30px;
}

.icon {
    font-size: 48px;
    animation: float 3s infinite ease-in-out;
    display: inline-block;
}

.icon:nth-child(1) { animation-delay: 0s; }
.icon:nth-child(2) { animation-delay: 0.5s; }
.icon:nth-child(3) { animation-delay: 1s; }
.icon:nth-child(4) { animation-delay: 1.5s; }

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

.btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
    pointer-events: all;
}

.btn-primary {
    background: #1DA1F2;
    color: #FFFFFF;
    box-shadow: 0 0 20px rgba(29, 161, 242, 0.5);
}

.btn-primary:hover {
    background: #0d8bd9;
    transform: scale(1.05);
}

.btn-secondary {
    background: #333;
    color: #FFFFFF;
}

.btn-secondary:hover {
    background: #444;
    transform: scale(1.05);
}

.btn-danger {
    background: #FF0000;
    color: #FFFFFF;
}

.btn-share {
    background: #FFD700;
    color: #000;
}

.pulse {
    animation: pulse 1.5s infinite;
}

.instructions {
    margin-top: 30px;
    text-align: center;
    color: #AAA;
}

.instructions p {
    margin: 5px 0;
}

.mobile-hint {
    font-size: 14px;
    color: #888;
}

/* HUD */
.hud {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    pointer-events: none;
    z-index: 10;
}

.hud-left,
.hud-center,
.hud-right {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-display,
.distance-display {
    text-align: center;
}

.label {
    font-size: 14px;
    color: #888;
    margin-bottom: 5px;
}

.score-value,
.distance-value {
    font-size: 36px;
    font-weight: bold;
    color: #1DA1F2;
    text-shadow: 0 0 10px #1DA1F2;
}

.high-score-mini {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.multiplier-badge {
    background: #FFD700;
    color: #000;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: pulse 1s infinite;
}

.powerup-display {
    position: absolute;
    bottom: 80px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid #1DA1F2;
}

#powerup-icon {
    font-size: 32px;
}

#powerup-timer {
    font-size: 20px;
    color: #FFD700;
    font-weight: bold;
}

/* Game Over Screen */
.game-over-title {
    font-size: 64px;
    color: #FF0000;
    text-shadow: 0 0 20px #FF0000;
    margin-bottom: 20px;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.new-high-score {
    font-size: 24px;
    color: #FFD700;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.final-stats {
    background: rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #1DA1F2;
}

.stat-item {
    text-align: center;
    margin-bottom: 20px;
}

.stat-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 48px;
    font-weight: bold;
    color: #1DA1F2;
    text-shadow: 0 0 10px #1DA1F2;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.stat-mini {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.stat-mini-label {
    color: #AAA;
}

.stat-mini-value {
    color: #1DA1F2;
    font-weight: bold;
}

.achievements {
    margin: 20px 0;
    max-width: 500px;
}

.achievements-title {
    font-size: 18px;
    color: #FFD700;
    margin-bottom: 10px;
    text-align: center;
}

.achievement {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid #FFD700;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 14px;
}

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

/* Leaderboard */
.leaderboard-title {
    font-size: 48px;
    color: #1DA1F2;
    margin-bottom: 30px;
}

.leaderboard-list {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #1DA1F2;
    max-width: 600px;
    width: 90%;
    max-height: 60vh;
    overflow-y: auto;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 60px 1fr 100px 100px;
    gap: 15px;
    padding: 15px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    align-items: center;
}

.leaderboard-item.rank-1 {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #FFD700;
}

.rank {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
}

.score {
    font-size: 20px;
    color: #1DA1F2;
    font-weight: bold;
}

.distance {
    font-size: 16px;
    color: #AAA;
}

.date {
    font-size: 14px;
    color: #666;
}

.no-scores {
    text-align: center;
    color: #888;
    padding: 40px;
}

.leaderboard-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

/* Footer */
.game-footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: #888;
    pointer-events: all;
}

.game-footer a {
    color: #1DA1F2;
    text-decoration: none;
}

.game-footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .title {
        font-size: 48px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .btn {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .hud {
        padding: 0 20px;
    }
    
    .score-value,
    .distance-value {
        font-size: 24px;
    }
    
    .game-over-title {
        font-size: 48px;
    }
    
    .stat-value {
        font-size: 36px;
    }
    
    .leaderboard-item {
        grid-template-columns: 50px 1fr 80px;
        gap: 10px;
        font-size: 14px;
    }
    
    .date {
        display: none;
    }
}

@media (max-width: 480px) {
    .floating-icons {
        gap: 15px;
    }
    
    .icon {
        font-size: 32px;
    }
}