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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #1A0033 0%, #FF10F0 50%, #00D9FF 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: 5px solid #00FF00;
    box-shadow: 0 0 40px rgba(255, 16, 240, 0.8), 0 0 60px rgba(0, 217, 255, 0.6);
    image-rendering: pixelated;
    background: #000;
}

#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: 64px;
    font-weight: bold;
    color: #FF10F0;
    text-shadow: 0 0 30px #FF10F0, 0 0 50px #00FF00, 3px 3px 0 #00D9FF;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite, rainbow 3s 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: #00FF00;
    z-index: -1;
}

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

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

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

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.subtitle {
    font-size: 20px;
    color: #FFD700;
    margin-bottom: 30px;
    text-shadow: 0 0 15px #FFD700, 2px 2px 0 #FF10F0;
    animation: pulse 2s infinite;
}

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

.floating-meme {
    width: 64px;
    height: 64px;
    animation: float 3s infinite ease-in-out;
    filter: drop-shadow(0 0 10px #FF10F0);
}

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

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

.meme-text-overlay {
    position: absolute;
    top: 20%;
    font-size: 36px;
    color: #00FF00;
    font-style: italic;
    opacity: 0.7;
    animation: drift 8s infinite;
}

@keyframes drift {
    0%, 100% { transform: translateX(-50px); }
    50% { transform: translateX(50px); }
}

.btn {
    padding: 18px 45px;
    font-size: 22px;
    font-weight: bold;
    border: 3px solid;
    border-radius: 10px;
    cursor: pointer;
    margin: 10px;
    font-family: 'Comic Sans MS', cursive;
    transition: all 0.3s;
    pointer-events: all;
    text-transform: uppercase;
    box-shadow: 0 0 20px currentColor;
}

.btn-primary {
    background: linear-gradient(45deg, #FF10F0, #00D9FF);
    color: #FFFFFF;
    border-color: #00FF00;
}

.btn-primary:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 0 40px #FF10F0, 0 0 60px #00D9FF;
}

.btn-secondary {
    background: #1A0033;
    color: #00FF00;
    border-color: #FF10F0;
}

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

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

.btn-share {
    background: linear-gradient(45deg, #FFD700, #FF6B35);
    color: #000;
    border-color: #00FF00;
}

.pulse {
    animation: pulse 1.5s infinite;
}

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

.instructions p {
    margin: 8px 0;
    font-size: 16px;
    text-shadow: 0 0 10px #00D9FF;
}

.meme-quote {
    margin-top: 15px;
    font-style: italic;
    color: #FFD700;
    font-size: 14px;
}

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

.score-display,
.distance-display {
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #FF10F0;
}

.label {
    font-size: 12px;
    color: #00FF00;
    margin-bottom: 5px;
    text-shadow: 0 0 5px #00FF00;
}

.score-value,
.distance-value {
    font-size: 32px;
    font-weight: bold;
    color: #FF10F0;
    text-shadow: 0 0 15px #FF10F0;
}

.score-sub {
    font-size: 14px;
    color: #00D9FF;
    margin-top: 5px;
}

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

.distance-status {
    font-size: 14px;
    margin-top: 5px;
    font-weight: bold;
}

.multiplier-badge {
    background: linear-gradient(45deg, #FFD700, #FF6B35);
    color: #000;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.9);
    animation: pulse 1s infinite;
    border: 3px solid #00FF00;
}

.chaos-text {
    position: absolute;
    top: 80px;
    font-size: 48px;
    color: #FF0000;
    font-weight: bold;
    text-shadow: 0 0 20px #FF0000;
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-5px, 5px) rotate(-2deg); }
    75% { transform: translate(5px, -5px) rotate(2deg); }
}

.vibe-check {
    position: absolute;
    left: 20px;
    top: 150px;
    width: 200px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #00FF00;
}

.vibe-label {
    font-size: 14px;
    color: #00FF00;
    margin-bottom: 8px;
    text-align: center;
}

.vibe-bar {
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #666;
}

.vibe-fill {
    height: 100%;
    width: 50%;
    background: #FFD700;
    transition: width 0.3s, background 0.3s;
}

.vibe-status {
    text-align: center;
    margin-top: 8px;
    font-size: 16px;
    font-weight: bold;
}

.powerup-display {
    position: absolute;
    bottom: 80px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 15px;
    border: 3px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

.powerup-icon {
    font-size: 28px;
}

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

/* Game Over */
.game-over-title {
    font-size: 72px;
    color: #FF0000;
    text-shadow: 0 0 30px #FF0000, 0 0 50px #FF10F0;
    margin-bottom: 20px;
    animation: shake 0.5s, pulse 2s infinite;
}

.new-high-score {
    font-size: 28px;
    color: #FFD700;
    margin-bottom: 20px;
    animation: pulse 1s infinite, rainbow 2s infinite;
    text-shadow: 0 0 20px #FFD700;
}

.final-stats {
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 3px solid #FF10F0;
    box-shadow: 0 0 30px rgba(255, 16, 240, 0.6);
}

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

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

.stat-value {
    font-size: 52px;
    font-weight: bold;
    color: #FF10F0;
    text-shadow: 0 0 20px #FF10F0;
}

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

.stat-mini {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #00FF00;
}

.stat-mini-label {
    color: #00D9FF;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-mini-value {
    color: #FFD700;
    font-weight: bold;
    font-size: 18px;
}

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

.achievements-title {
    font-size: 20px;
    color: #FFD700;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 0 15px #FFD700;
}

.achievement {
    background: rgba(255, 215, 0, 0.15);
    border: 2px solid #FFD700;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.no-achievements {
    text-align: center;
    color: #888;
    padding: 20px;
}

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

.rare-memes-title {
    font-size: 18px;
    color: #A020F0;
    margin-bottom: 10px;
    text-align: center;
}

.rare-meme {
    background: rgba(160, 32, 240, 0.2);
    border: 2px solid #A020F0;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
}

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

/* Leaderboard */
.leaderboard-title {
    font-size: 52px;
    color: #FFD700;
    margin-bottom: 30px;
    text-shadow: 0 0 30px #FFD700;
}

.leaderboard-list {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    border: 3px solid #00FF00;
    max-width: 700px;
    width: 90%;
    max-height: 50vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.4);
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 150px 1fr 80px 100px 40px;
    gap: 15px;
    padding: 15px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    align-items: center;
    border: 1px solid #333;
}

.leaderboard-item.rank-1 {
    background: rgba(255, 215, 0, 0.3);
    border: 3px solid #FFD700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.rank {
    font-size: 16px;
    font-weight: bold;
    color: #FF10F0;
}

.score {
    font-size: 22px;
    color: #00FF00;
    font-weight: bold;
}

.distance,
.memes {
    font-size: 14px;
    color: #00D9FF;
}

.grass {
    font-size: 20px;
}

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

.stats-summary {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #FF10F0;
    margin-top: 20px;
    max-width: 500px;
    text-align: center;
}

.stats-summary-title {
    font-size: 20px;
    color: #FFD700;
    margin-bottom: 15px;
}

.stats-summary div {
    margin: 8px 0;
    color: #00D9FF;
}

.grass-verdict {
    margin-top: 15px;
    font-weight: bold;
    color: #00FF00;
    font-size: 16px;
}

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

/* Settings */
.settings-title {
    font-size: 48px;
    color: #00D9FF;
    margin-bottom: 30px;
}

.settings-panel {
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #FF10F0;
    max-width: 500px;
}

.setting-item {
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    color: #00FF00;
    font-size: 16px;
}

.setting-item input[type="range"] {
    width: 200px;
}

.setting-item input[type="checkbox"] {
    width: 30px;
    height: 30px;
}

.setting-item span {
    color: #FFD700;
    font-weight: bold;
}

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

.game-footer a {
    color: #00FF00;
    text-decoration: none;
    text-shadow: 0 0 5px #00FF00;
}

.game-footer a:hover {
    text-decoration: underline;
    color: #00D9FF;
}

/* Mobile */
@media (max-width: 768px) {
    .title {
        font-size: 42px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .btn {
        padding: 14px 30px;
        font-size: 18px;
    }
    
    .hud {
        padding: 0 15px;
    }
    
    .score-value,
    .distance-value {
        font-size: 24px;
    }
    
    .game-over-title {
        font-size: 48px;
    }
    
    .stat-value {
        font-size: 36px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-item {
        grid-template-columns: 120px 1fr 60px;
        gap: 10px;
        font-size: 12px;
    }
    
    .memes,
    .grass {
        display: none;
    }
    
    .floating-memes {
        gap: 15px;
    }
    
    .floating-meme {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .vibe-check {
        width: 150px;
        padding: 10px;
    }
}