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

body {
    background: #5C94FC;
    height: 100vh;
    overflow: hidden;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    touch-action: none;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg,
        #1a0a2e 0%,
        #2d1b4e 10%,
        #4a2c6e 20%,
        #6b4d8e 30%,
        #FF7F50 45%,
        #FFB07C 55%,
        #87CEEB 70%,
        #5C94FC 100%
    );
}

.game-world {
    position: absolute;
    width: 3200px;
    height: 100%;
    z-index: 10;
}

/* Parallax Background Layers */
.parallax-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Distant Mountains - Very slow, washed out colors */
.parallax-mountains-far {
    position: absolute;
    bottom: 20%;
    left: 0;
    width: 400%;
    height: 300px;
    background: url('parallax-mountains-far.svg') repeat-x bottom;
    background-size: 1200px 300px;
    filter: blur(1.5px);
    transition: transform 0.1s linear;
    z-index: 1;
}

/* Near Mountains with Snow Caps - solid colors */
.parallax-mountains-near {
    position: absolute;
    bottom: 12%;
    left: 0;
    width: 300%;
    height: 350px;
    background: url('parallax-mountains-near.svg') repeat-x bottom;
    background-size: 1000px 350px;
    transition: transform 0.1s linear;
    z-index: 2;
}

/* Green Hills - Medium distance, minimal fade */
.parallax-hills {
    position: absolute;
    bottom: 90px;
    left: 0;
    width: 250%;
    height: 250px;
    background: url('parallax-hills.svg') repeat-x bottom;
    background-size: 1400px 200px;
    opacity: 1;
    transition: transform 0.1s linear;
    z-index: 3;
}

/* Foreground Bushes - Near, fully vivid */
.parallax-bushes {
    position: absolute;
    bottom: 95px;
    left: 0;
    width: 200%;
    height: 80px;
    background: url('parallax-bushes.svg') repeat-x bottom;
    background-size: 800px 80px;
    opacity: 1;
    transition: transform 0.1s linear;
    z-index: 4;
}

/* Floating Clouds - distant, faded */
.parallax-clouds {
    position: absolute;
    top: 5%;
    left: 0;
    width: 350%;
    height: 200px;
    background: url('parallax-clouds.svg') repeat-x top;
    background-size: 1600px 200px;
    opacity: 0.5;
    filter: blur(0.5px);
    transition: transform 0.1s linear;
    z-index: 1;
}

/* Sun */
.parallax-sun {
    position: absolute;
    top: 8%;
    right: 15%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #FFE082 0%, #FFB74D 40%, #FF9800 70%, transparent 70%);
    border-radius: 50%;
    box-shadow:
        0 0 60px 30px rgba(255,183,77,0.4),
        0 0 100px 60px rgba(255,152,0,0.2),
        0 0 140px 90px rgba(255,87,34,0.1);
    animation: sunPulse 4s ease-in-out infinite;
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 60px 30px rgba(255,183,77,0.4), 0 0 100px 60px rgba(255,152,0,0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 80px 40px rgba(255,183,77,0.5), 0 0 120px 70px rgba(255,152,0,0.3); }
}

/* Legacy parallax-layer classes (for game-world children) */
.parallax-layer {
    position: absolute;
    width: 200%;
    height: 100%;
    pointer-events: none;
}

.parallax-layer.mountains { display: none; }
.parallax-layer.hills { display: none; }
.parallax-layer.bushes { display: none; }

/* HUD */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 15px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 40, 0.9) 100%);
    z-index: 1000;
    border-bottom: 4px solid #FFD700;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 -2px 10px rgba(255, 215, 0, 0.1);
    font-size: 10px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    gap: 6px;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.hud-label {
    font-size: 10px;
    color: #FFD700;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    font-weight: bold;
}

.hud-item span:last-child {
    font-size: 16px;
    text-shadow: 2px 2px 0 #000, 0 0 10px rgba(255,255,255,0.3);
    font-weight: bold;
}

/* Highlight important stats */
.hud-item:nth-child(1) span:last-child { color: #FFD700; } /* Score */
.hud-item:nth-child(2) span:last-child { color: #FFD700; } /* Coins */
.hud-item:nth-child(4) span:last-child { color: #FF6B6B; } /* Time - red tint */
.hud-item:nth-child(5) span:last-child { color: #E52521; } /* Lives - Mario red */

/* Pulse animation for low time */
.hud-item:nth-child(4).low-time span:last-child {
    animation: lowTimePulse 0.5s ease-in-out infinite;
    color: #FF0000;
}

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

/* Ground */
.ground {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(180deg, #C84C0C 0%, #A04000 100%);
    border-top: 8px solid #68B668;
    z-index: 5;
}

.ground-tile {
    position: absolute;
    bottom: 0;
    width: 64px;
    height: 100px;
    background:
        linear-gradient(180deg, #68B668 0%, #68B668 8px, #C84C0C 8px, #C84C0C 100%);
    border-right: 1px solid rgba(0,0,0,0.1);
    z-index: 5;
}

/* Mario */
.mario {
    position: absolute;
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    z-index: 100;
    transform-origin: center bottom;
}

.mario.big {
    transform-origin: center bottom;
}

.mario.flashing {
    animation: flash 0.08s infinite;
}

.mario.dying {
    animation: deathSpin 1.5s ease-out forwards;
    z-index: 1000;
}

.mario.star-power {
    animation: starRainbow 0.1s linear infinite;
    filter: drop-shadow(0 0 15px gold) drop-shadow(0 0 30px rgba(255,215,0,0.5));
}

@keyframes flash {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.2; }
}

@keyframes deathSpin {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    20% { transform: translateY(-150px) rotate(180deg); }
    100% { transform: translateY(600px) rotate(1080deg); opacity: 0; }
}

@keyframes starRainbow {
    0% { filter: hue-rotate(0deg) brightness(1.4) drop-shadow(0 0 15px gold); }
    100% { filter: hue-rotate(360deg) brightness(1.4) drop-shadow(0 0 15px gold); }
}

/* Coins */
.coin {
    position: absolute;
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    animation: coinBob 0.8s ease-in-out infinite;
    z-index: 50;
    filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.4));
}

.coin.block-coin {
    animation: none;
    transition: top 0.3s ease-out, opacity 0.3s ease-out;
    z-index: 200;
}

@keyframes coinBob {
    0%, 100% { transform: translateY(0) rotateY(0deg); }
    25% { transform: translateY(-3px) rotateY(90deg); }
    50% { transform: translateY(0) rotateY(180deg); }
    75% { transform: translateY(-3px) rotateY(270deg); }
}

/* Bricks */
.brick {
    position: absolute;
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    z-index: 30;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.3));
    transition: transform 0.1s ease-out;
}

/* Question Blocks */
.question-block {
    position: absolute;
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    z-index: 30;
    animation: questionGlow 1.5s ease-in-out infinite;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.3));
    transition: transform 0.1s ease-out;
}

.question-block.hit {
    animation: none;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.3)) brightness(0.7);
}

@keyframes questionGlow {
    0%, 100% { filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.3)) brightness(1); }
    50% { filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.3)) brightness(1.3) drop-shadow(0 0 8px rgba(255,200,0,0.5)); }
}

/* Enemies */
.enemy {
    position: absolute;
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    z-index: 40;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.4));
    transition: transform 0.05s;
}

.enemy.goomba {
    animation: enemyBounce 0.3s ease-in-out infinite;
}

.enemy.koopa {
    animation: enemyBounce 0.25s ease-in-out infinite;
}

.enemy.squished {
    transform: scaleY(0.15) !important;
    animation: none;
    filter: brightness(0.4);
    transition: transform 0.1s;
}

.enemy.shell {
    animation: shellSpin 0.2s linear infinite;
}

@keyframes enemyBounce {
    0%, 100% { transform: translateY(0) scaleX(1); }
    50% { transform: translateY(-2px) scaleX(1); }
}

@keyframes shellSpin {
    from { transform: rotate(0deg) scaleY(0.5); }
    to { transform: rotate(360deg) scaleY(0.5); }
}

/* Power-ups */
.power-up {
    position: absolute;
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    z-index: 45;
    animation: powerUpFloat 0.5s ease-in-out infinite;
    filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.4));
}

.power-up.star {
    animation: powerUpFloat 0.3s ease-in-out infinite, starPulse 0.2s ease-in-out infinite;
}

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

@keyframes starPulse {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 10px gold); }
    50% { filter: brightness(1.5) drop-shadow(0 0 20px gold) drop-shadow(0 0 40px rgba(255,215,0,0.5)); }
}

/* Pipes */
.pipe {
    position: absolute;
    width: 80px;
    image-rendering: pixelated;
    z-index: 35;
    filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.3));
}

/* Flag */
.flag-pole {
    position: absolute;
    bottom: 100px;
    width: 48px;
    height: 192px;
    image-rendering: pixelated;
    z-index: 25;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.3));
}

/* Particles */
.particle {
    position: absolute;
    pointer-events: none;
    z-index: 200;
    will-change: transform, opacity;
}

.particle-dust {
    width: 8px;
    height: 8px;
    background: rgba(139, 90, 43, 0.8);
    border-radius: 50%;
}

.particle-star {
    width: 12px;
    height: 12px;
    background: gold;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    filter: drop-shadow(0 0 5px gold);
}

.particle-brick {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #C84C0C, #A04000);
    border: 1px solid #743410;
}

/* Score Popup */
.score-popup {
    position: absolute;
    color: #FFF;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    animation: scoreRise 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 300;
}

@keyframes scoreRise {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    50% { transform: translateY(-40px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-70px) scale(1); opacity: 0; }
}

/* Combo Text */
.combo-text {
    position: absolute;
    color: #FF6600;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 0 #000, 0 0 10px #FF6600;
    animation: comboPopup 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 300;
    white-space: nowrap;
}

@keyframes comboPopup {
    0% { transform: scale(0) rotate(-10deg); opacity: 1; }
    30% { transform: scale(1.3) rotate(5deg); }
    100% { transform: scale(1) translateY(-50px) rotate(0deg); opacity: 0; }
}

/* Decorations */
.decoration {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.decoration.bush {
    width: 80px;
    height: 40px;
    background: radial-gradient(ellipse 80px 40px at center bottom, #228B22 60%, transparent 60%);
}

.decoration.cloud {
    width: 100px;
    height: 50px;
    background: white;
    border-radius: 50px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.decoration.cloud::before,
.decoration.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.decoration.cloud::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 15px;
}

.decoration.cloud::after {
    width: 60px;
    height: 45px;
    top: -15px;
    right: 10px;
}

/* Title Screen */
.title-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #000 0%, #0a0a1a 30%, #1a1a3a 60%, #2a2a4a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.title-content {
    text-align: center;
    color: white;
}

.game-title {
    font-size: 42px;
    color: #E52521;
    text-shadow:
        4px 4px 0 #FBD000,
        8px 8px 0 #43B047,
        12px 12px 0 #000,
        0 0 30px rgba(229, 37, 33, 0.5);
    margin-bottom: 8px;
    animation: titlePulse 2s ease-in-out infinite;
    letter-spacing: 2px;
}

.game-subtitle {
    font-size: 16px;
    color: #43B047;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 40px;
    letter-spacing: 4px;
}

.title-mario {
    width: 128px;
    height: 128px;
    margin: 30px auto;
    background: url('mario-standing.svg') center/contain no-repeat;
    animation: titleMarioJump 1.5s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.start-text {
    font-size: 14px;
    color: #FFD700;
    margin: 25px 0;
    letter-spacing: 2px;
}

.high-score {
    font-size: 12px;
    color: #FFA500;
    margin: 20px 0;
    text-shadow: 2px 2px 0 #000;
}

.controls-info {
    margin-top: 40px;
    font-size: 10px;
    color: #888;
    line-height: 2;
}

.blink {
    animation: blink 0.8s steps(1) infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

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

@keyframes titleMarioJump {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-40px) rotate(5deg); }
}

/* Story/Intro Screen */
.story-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 30%, #2a2a5a 60%, #1a1a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.story-content {
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 40px;
}

.story-header {
    margin-bottom: 20px;
}

.story-title {
    font-size: 36px;
    color: #FFD700;
    text-shadow:
        3px 3px 0 #B8860B,
        6px 6px 0 #000,
        0 0 30px rgba(255, 215, 0, 0.5);
    margin-bottom: 8px;
    animation: storyTitlePulse 2s ease-in-out infinite;
}

.story-subtitle {
    font-size: 18px;
    color: #43B047;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

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

.story-mario-scene {
    margin: 25px 0;
    height: 100px;
    position: relative;
    overflow: hidden;
}

.story-mario {
    width: 80px;
    height: 80px;
    background: url('mario-standing.svg') center/contain no-repeat;
    margin: 0 auto;
    animation: storyMarioWalk 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

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

.story-text {
    margin: 25px 0;
    line-height: 1.8;
}

.story-line {
    font-size: 14px;
    color: #E0E0E0;
    text-shadow: 1px 1px 0 #000;
    margin: 8px 0;
}

.story-hint {
    margin: 30px 0 20px;
    padding: 15px 25px;
    background: rgba(67, 176, 71, 0.2);
    border: 2px solid #43B047;
    border-radius: 8px;
    font-size: 12px;
    color: #7FFF7F;
    text-shadow: 1px 1px 0 #000;
}

.hint-icon {
    margin-right: 8px;
}

.story-continue {
    font-size: 14px;
    color: #FFD700;
    margin-top: 30px;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #000;
}

/* Overlay Screens */
.game-over-screen,
.victory-screen,
.pause-screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.game-over-content,
.victory-content,
.pause-content {
    text-align: center;
    color: white;
    padding: 50px 60px;
    background: linear-gradient(180deg, #1a1a2e, #0a0a1e);
    border: 4px solid;
    border-radius: 8px;
    animation: screenAppear 0.3s ease-out;
}

.game-over-content {
    border-color: #E52521;
    box-shadow: 0 0 50px rgba(229, 37, 33, 0.5), inset 0 0 30px rgba(229, 37, 33, 0.1);
}

.victory-content {
    border-color: #FFD700;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.pause-content {
    border-color: #43B047;
    box-shadow: 0 0 50px rgba(67, 176, 71, 0.5), inset 0 0 30px rgba(67, 176, 71, 0.1);
}

@keyframes screenAppear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.game-over-content h1 {
    font-size: 36px;
    color: #E52521;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 25px;
}

.victory-content h1 {
    font-size: 28px;
    color: #FFD700;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 25px;
}

.pause-content h1 {
    font-size: 36px;
    color: #43B047;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 25px;
}

.game-over-content p,
.victory-content p,
.pause-content p {
    font-size: 14px;
    margin: 12px 0;
    text-shadow: 2px 2px 0 #000;
}

/* Mobile Controls */
.mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 15px;
    z-index: 1500;
    pointer-events: none;
}

.mobile-dpad,
.mobile-buttons {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.mobile-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Press Start 2P', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    backdrop-filter: blur(4px);
    transition: transform 0.1s, background 0.1s;
}

.mobile-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

.mobile-btn.jump {
    width: 80px;
    height: 80px;
    background: rgba(229, 37, 33, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
}

.mobile-btn.run {
    width: 60px;
    height: 60px;
    background: rgba(67, 176, 71, 0.6);
    font-size: 16px;
}

@media (hover: none) and (pointer: coarse) {
    .mobile-controls { display: flex; }
}

@media (max-width: 768px) {
    .mobile-controls { display: flex; }
    .hud { padding: 8px 10px; font-size: 8px; }
    .hud-label { font-size: 6px; }
    .hud-item span:last-child { font-size: 10px; }
    .game-title { font-size: 28px; }
    .game-subtitle { font-size: 12px; }
}

/* CRT Scanline Effect */
.game-container::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.02) 0px,
            rgba(0, 0, 0, 0.02) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 9999;
}

/* Smooth pixel rendering */
img {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ========================================
   2025 GAME JUICE EFFECTS
   ======================================== */

/* Impact Flash - screen flash on big hits */
.impact-flash {
    position: fixed;
    inset: 0;
    background: white;
    pointer-events: none;
    z-index: 9000;
    animation: impactFlash 0.1s ease-out forwards;
}

@keyframes impactFlash {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Screen Shake */
.screen-shake {
    animation: screenShake 0.15s ease-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -4px); }
    20% { transform: translate(8px, 6px); }
    30% { transform: translate(-6px, -8px); }
    40% { transform: translate(6px, 4px); }
    50% { transform: translate(-4px, 6px); }
    60% { transform: translate(4px, -4px); }
    70% { transform: translate(-2px, 2px); }
    80% { transform: translate(2px, -2px); }
    90% { transform: translate(-1px, 1px); }
}

/* Speed Lines - horizontal motion blur lines */
.speed-line {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 20%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.8) 80%,
        transparent 100%
    );
    border-radius: 2px;
    pointer-events: none;
    z-index: 150;
    animation: speedLineMove 0.3s linear forwards;
    filter: blur(0.5px);
}

@keyframes speedLineMove {
    0% { opacity: 0.9; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(0.5) translateX(-100px); }
}

/* Mario Trail - ghost images showing motion */
.mario-trail {
    position: absolute;
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    pointer-events: none;
    z-index: 95;
    opacity: 0.4;
    filter: brightness(1.5) saturate(0.5) blur(1px);
    animation: trailFade 0.25s ease-out forwards;
}

@keyframes trailFade {
    0% { opacity: 0.4; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* Star Power Trail - rainbow trail effect */
.star-trail {
    position: absolute;
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    pointer-events: none;
    z-index: 95;
    animation: starTrailFade 0.4s ease-out forwards;
    filter: drop-shadow(0 0 10px gold);
}

@keyframes starTrailFade {
    0% {
        opacity: 0.7;
        transform: scale(1);
        filter: hue-rotate(0deg) drop-shadow(0 0 10px gold);
    }
    100% {
        opacity: 0;
        transform: scale(0.6);
        filter: hue-rotate(180deg) drop-shadow(0 0 5px gold);
    }
}

/* Impact Ring - expanding circle on stomp */
.impact-ring {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 4px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    pointer-events: none;
    z-index: 180;
    animation: impactRingExpand 0.4s ease-out forwards;
    box-shadow:
        0 0 10px rgba(255, 200, 0, 0.8),
        inset 0 0 10px rgba(255, 200, 0, 0.3);
}

@keyframes impactRingExpand {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
        border-width: 6px;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
        border-width: 1px;
    }
}

/* Celebration Particles - burst on combos */
.celebration-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    pointer-events: none;
    z-index: 190;
    animation: celebrationBurst 0.6s ease-out forwards;
}

.celebration-particle.star {
    background: gold;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    filter: drop-shadow(0 0 4px gold);
}

.celebration-particle.circle {
    border-radius: 50%;
    background: radial-gradient(circle, #fff 30%, transparent 70%);
}

.celebration-particle.spark {
    width: 4px;
    height: 12px;
    background: linear-gradient(180deg, #fff 0%, #FFD700 50%, transparent 100%);
    border-radius: 2px;
}

@keyframes celebrationBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.5) translateY(-80px);
        opacity: 0;
    }
}

/* Stomp Squash Effect */
.stomp-squash {
    animation: stompSquash 0.15s ease-out;
    transform-origin: center bottom;
}

@keyframes stompSquash {
    0% { transform: scaleY(1) scaleX(1); }
    40% { transform: scaleY(0.6) scaleX(1.3); }
    100% { transform: scaleY(1) scaleX(1); }
}

/* Landing Dust Cloud */
.dust-cloud {
    position: absolute;
    width: 40px;
    height: 20px;
    pointer-events: none;
    z-index: 90;
    animation: dustCloudExpand 0.3s ease-out forwards;
}

.dust-cloud::before,
.dust-cloud::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: rgba(139, 90, 43, 0.6);
    border-radius: 50%;
    bottom: 0;
}

.dust-cloud::before {
    left: 0;
    animation: dustPuffLeft 0.3s ease-out forwards;
}

.dust-cloud::after {
    right: 0;
    animation: dustPuffRight 0.3s ease-out forwards;
}

@keyframes dustCloudExpand {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes dustPuffLeft {
    0% { transform: scale(0.3) translate(10px, 0); opacity: 0.8; }
    100% { transform: scale(1.5) translate(-20px, -10px); opacity: 0; }
}

@keyframes dustPuffRight {
    0% { transform: scale(0.3) translate(-10px, 0); opacity: 0.8; }
    100% { transform: scale(1.5) translate(20px, -10px); opacity: 0; }
}

/* Jump Anticipation Squash */
.jump-anticipation {
    animation: jumpAnticipation 0.08s ease-in;
    transform-origin: center bottom;
}

@keyframes jumpAnticipation {
    0% { transform: scaleY(1) scaleX(1); }
    100% { transform: scaleY(0.85) scaleX(1.15); }
}

/* Jump Stretch */
.jump-stretch {
    animation: jumpStretch 0.1s ease-out;
    transform-origin: center bottom;
}

@keyframes jumpStretch {
    0% { transform: scaleY(0.85) scaleX(1.15); }
    100% { transform: scaleY(1.15) scaleX(0.9); }
}

/* Coin Collect Burst */
.coin-burst {
    position: absolute;
    width: 32px;
    height: 32px;
    pointer-events: none;
    z-index: 200;
}

.coin-burst::before {
    content: '';
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, transparent 70%);
    animation: coinBurstGlow 0.3s ease-out forwards;
}

@keyframes coinBurstGlow {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Power-up Collect Flash */
.powerup-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 8000;
    animation: powerupFlash 0.4s ease-out forwards;
}

.powerup-flash.mushroom {
    background: radial-gradient(circle at center, rgba(229, 37, 33, 0.4) 0%, transparent 60%);
}

.powerup-flash.star {
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.5) 0%, transparent 60%);
}

@keyframes powerupFlash {
    0% { opacity: 1; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* Enemy Death Poof */
.enemy-poof {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 180;
    animation: enemyPoof 0.4s ease-out forwards;
}

.enemy-poof::before {
    content: '💥';
    position: absolute;
    font-size: 40px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes enemyPoof {
    0% { transform: scale(0.3); opacity: 1; }
    30% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Running Dust */
.run-dust {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(139, 90, 43, 0.7);
    border-radius: 50%;
    pointer-events: none;
    z-index: 85;
    animation: runDustFade 0.4s ease-out forwards;
}

@keyframes runDustFade {
    0% {
        transform: scale(0.5) translateY(0);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5) translateY(-15px);
        opacity: 0;
    }
}

/* Combo Counter Display */
.combo-counter {
    position: fixed;
    top: 80px;
    right: 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 20px;
    color: #FF6600;
    text-shadow:
        3px 3px 0 #000,
        0 0 20px rgba(255, 102, 0, 0.8);
    z-index: 500;
    animation: comboCounterPulse 0.15s ease-out;
    pointer-events: none;
}

@keyframes comboCounterPulse {
    0% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Level Transition Wipe */
.level-wipe {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    animation: levelWipeIn 0.5s ease-in-out;
}

@keyframes levelWipeIn {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

.level-wipe-out {
    animation: levelWipeOut 0.5s ease-in-out forwards;
}

@keyframes levelWipeOut {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* ========================================
   TUTORIAL HINT SYSTEM
   ======================================== */

.tutorial-hint {
    position: fixed;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 25px;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(40, 40, 80, 0.95));
    border: 3px solid #FFD700;
    border-radius: 12px;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.4),
        0 10px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 10000;
    max-width: 300px;
    animation: hintAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: auto;
}

@keyframes hintAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tutorial-hint.hint-fade-out {
    animation: hintDisappear 0.3s ease-out forwards;
}

@keyframes hintDisappear {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
}

.hint-icon {
    font-size: 36px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    animation: hintIconBounce 0.6s ease-out;
}

@keyframes hintIconBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.hint-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hint-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 1px;
}

.hint-description {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #E0E0E0;
    line-height: 1.6;
    text-shadow: 1px 1px 0 #000;
}

.hint-dismiss {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #888;
    animation: hintDismissBlink 1s steps(1) infinite;
}

@keyframes hintDismissBlink {
    0%, 70% { opacity: 1; }
    71%, 100% { opacity: 0.3; }
}

/* Hint pointer arrow */
.tutorial-hint::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #FFD700;
}

.tutorial-hint::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 33px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid rgba(40, 40, 80, 0.95);
}

/* Sparkle effect around hint */
.tutorial-hint .hint-icon::before {
    content: '✨';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 16px;
    animation: sparkleRotate 1s linear infinite;
}

@keyframes sparkleRotate {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 0.7; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

/* ========================================
   LEVEL THEMES
   ======================================== */

:root {
    --ground-top: #68B668;
    --ground-bottom: #C84C0C;
}

/* Theme-specific ground colors */
.theme-meadows .ground,
.theme-meadows .ground-tile {
    background: linear-gradient(180deg, var(--ground-top) 0%, var(--ground-top) 8px, var(--ground-bottom) 8px, var(--ground-bottom) 100%);
    border-top-color: var(--ground-top);
}

.theme-caves .ground,
.theme-caves .ground-tile {
    background: linear-gradient(180deg, #4a4a5a 0%, #4a4a5a 8px, #2a2a3a 8px, #2a2a3a 100%);
    border-top-color: #4a4a5a;
}

.theme-castle .ground,
.theme-castle .ground-tile {
    background: linear-gradient(180deg, #4a3030 0%, #4a3030 8px, #2a1a1a 8px, #2a1a1a 100%);
    border-top-color: #4a3030;
}

/* Cave theme - add crystal glow effect */
.theme-caves::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 100px 100px at 20% 30%, rgba(100, 200, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 80px 80px at 70% 50%, rgba(150, 100, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 60px 60px at 40% 70%, rgba(100, 255, 200, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
    animation: crystalGlow 4s ease-in-out infinite;
}

@keyframes crystalGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Castle theme - add fire/lava glow effect */
.theme-castle::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(0deg, rgba(255, 69, 0, 0.3) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    animation: lavaAmbient 2s ease-in-out infinite;
}

@keyframes lavaAmbient {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Castle theme - outdoor approach to Bowser's castle */
/* Uses regular parallax with dark/ominous tinting */
.theme-castle .parallax-mountains-far,
.theme-castle .parallax-mountains-near,
.theme-castle .parallax-mountains-mid {
    filter: brightness(0.4) sepia(0.5) hue-rotate(-20deg) saturate(1.5);
}

.theme-castle .parallax-hills {
    filter: brightness(0.5) sepia(0.4) hue-rotate(-15deg);
}

.theme-castle .parallax-bushes {
    filter: brightness(0.6) sepia(0.3) hue-rotate(-10deg);
}

.theme-castle .parallax-clouds {
    filter: brightness(0.3) sepia(0.5) hue-rotate(-30deg);
    opacity: 0.4 !important;
}

.theme-castle .parallax-sun {
    display: none !important;
}

/* Lava pit styling */
.lava-pit {
    box-shadow:
        0 0 20px rgba(255, 69, 0, 0.8),
        0 0 40px rgba(255, 140, 0, 0.5),
        0 -10px 30px rgba(255, 200, 0, 0.3);
}

@keyframes lavaGlow {
    0% {
        box-shadow:
            0 0 20px rgba(255, 69, 0, 0.8),
            0 0 40px rgba(255, 140, 0, 0.5);
        transform: scaleY(1);
    }
    100% {
        box-shadow:
            0 0 30px rgba(255, 69, 0, 1),
            0 0 60px rgba(255, 140, 0, 0.7);
        transform: scaleY(1.1);
    }
}

/* Boss enemy styling */
.enemy.boss {
    animation: bossIdle 0.5s ease-in-out infinite;
    filter: hue-rotate(180deg) saturate(2) drop-shadow(0 0 10px rgba(255, 0, 0, 0.5));
}

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

/* Fade in/out for tutorial reset message */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}
