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

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: 'Orbitron', 'Courier New', monospace;
    background: linear-gradient(135deg, #0f0f0f, #1a1a2e, #16213e);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 215, 0, 0.2) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

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

#game-container {
    text-align: center;
    padding: 20px;
    max-width: 1400px;
    width: 100%;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: containerGlow 3s ease-in-out infinite alternate;
}

@keyframes containerGlow {
    0% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
    100% { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
}

h1 {
    font-size: 3.5em;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ffd700, #ff6b6b, #4ecdc4);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

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

#game-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: space-between;
}

#mario-section {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
}

#shop-section {
    flex: 0 0 50%;
    padding: 30px;
}

#mario-area {
    position: relative;
    margin: 30px auto;
    display: inline-block;
}

#mario-img {
    width: 300px;
    height: 300px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.6));
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(45deg, #ffd700, #ff6b6b) border-box;
    background-clip: padding-box;
}

#mario-img:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.8));
}

#mario-img:active {
    transform: scale(0.95) rotate(-5deg);
}

#mario-img:focus-visible {
    outline: 4px solid #ffd700;
    outline-offset: 8px;
    border-radius: 50%;
}

#mario-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 350px;
    height: 350px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: pulseRing 2s ease-out infinite;
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    color: #ffd700;
    pointer-events: none;
    animation: popUp 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

@keyframes popUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -200%) scale(1.5) rotate(-10deg);
    }
}

header#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

#header h1 {
    margin: 0;
    font-size: 2.5em;
}

#header-stats {
    text-align: right;
    font-size: 1.2em;
}

#header-stats p {
    margin: 5px 0;
    font-weight: bold;
}

#stats {
    margin: 40px 0;
    width: 100%;
    font-size: 1.4em;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

#progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

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

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #4ecdc4);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    border-radius: 15px;
}

#progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: shine 3s infinite;
}

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

#shop {
    width: 100%;
    margin: 0;
    background: rgba(255, 255, 255, 0.08);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#shop h2 {
    font-size: 2em;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upgrade-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.upgrade-item:hover::before {
    left: 100%;
}

.upgrade-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.3);
}

button {
    padding: 12px 24px;
    font-size: 16px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

button:hover:not(:disabled)::before {
    left: 100%;
}

button:hover:not(:disabled) {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
}

button:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 3px;
    border-radius: 25px;
}

button:disabled {
    background: linear-gradient(45deg, #666, #555);
    cursor: not-allowed;
    opacity: 0.6;
    transform: scale(0.95);
}

.victory-button {
    font-size: 28px;
    padding: 25px 50px;
    background: linear-gradient(45deg, #ffd700, #ff6b6b, #4ecdc4);
    background-size: 300% 300%;
    animation: gradientShift 2s ease infinite, pulse 2s infinite;
    border-radius: 50px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.victory-button:hover {
    animation: gradientShift 1s ease infinite, pulse 1s infinite;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
}

#victory {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
}

#victory h1 {
    font-size: 5em;
    animation: victoryPulse 2s ease-in-out infinite;
}

@keyframes victoryPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
}

@media (max-width: 1024px) {
    #game-content {
        flex-direction: column;
        gap: 20px;
    }
    
    #mario-section {
        flex: 1;
        padding: 20px;
    }
    
    #shop-section {
        flex: 1;
        padding: 20px;
    }
    
    #mario-img {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5em;
    }
    
    #mario-img {
        width: 180px;
        height: 180px;
    }
    
    .upgrade-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    header#header {
        flex-direction: column;
        gap: 15px;
    }
    
    #header h1 {
        font-size: 2em;
    }
    
    #header-stats {
        text-align: center;
    }
}