* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: #0f0f13;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Orbitron', sans-serif;
    overflow: hidden;
    color: white;
}
#game-container {
    width: 800px;
    height: 450px;
    background-color: #1a1a24;
    background-image: linear-gradient(rgba(13, 13, 18, 0.5), rgba(26, 26, 36, 0.9)), url('https://images.unsplash.com/photo-1605806616949-1e87b487cb2a?q=80&w=800&auto=format&fit=crop');
    background-position: 50% center;
    background-size: 120% 100%;
    position: relative;
    border: 2px solid #333;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.scanlines {
    position: absolute;
    width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 25;
}
.ground {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    border-top: 2px solid rgba(0, 242, 254, 0.3);
    z-index: 1;
}
#ui {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 10;
}
.health-bar-container {
    width: 300px;
    height: 20px;
    background-color: #222;
    border: 2px solid #555;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0,0,0,0.8);
}
.health-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff3366, #ff003c);
    transition: width 0.2s ease-out;
}
#player-health {
    background: linear-gradient(90deg, #00f2fe, #4facfe);
}
.center-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.timer {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}
.wave-text {
    font-size: 16px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    margin-top: 5px;
}
.character {
    width: 50px;
    height: 100px;
    position: absolute;
    bottom: 40px;
    border-radius: 8px;
    z-index: 5;
    transition: transform 0.1s;
}
#player {
    background: url('https://api.iconify.design/mdi:ninja.svg?color=%2300f2fe') no-repeat center center;
    background-size: contain;
    left: 100px;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.8));
}
#enemy {
    background: url('https://api.iconify.design/mdi:ninja.svg?color=%23ff3366') no-repeat center center;
    background-size: contain;
    right: 100px;
    filter: drop-shadow(0 0 20px rgba(255, 0, 60, 0.8));
}
.attack-box {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px white;
    border-radius: 4px;
    z-index: 5;
}
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}
.shake-active {
    animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both;
}
#game-over {
    position: absolute;
    z-index: 20;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    background: rgba(15, 15, 19, 0.95);
    border: 2px solid #00f2fe;
    border-radius: 15px;
    padding: 40px 60px;
    box-shadow: 0 0 50px rgba(0, 242, 254, 0.4);
    text-align: center;
}
#game-over-text {
    font-size: 48px;
    font-weight: bold;
    color: #ff3366;
    text-shadow: 0 0 20px #ff3366;
    letter-spacing: 5px;
    margin-bottom: 10px;
}
#game-over-stats {
    font-size: 20px;
    color: #fff;
    margin-bottom: 30px;
    font-weight: bold;
}
#final-wave {
    font-size: 36px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700;
    margin-left: 10px;
}
#restart-btn {
    padding: 10px 30px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background: linear-gradient(90deg, #ff003c, #ff3366);
    border: 2px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.8);
    transition: transform 0.2s, box-shadow 0.2s;
}
#restart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 0, 60, 1);
}
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 15;
}
@keyframes particleFade {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}
.shuriken {
    position: absolute;
    width: 30px;
    height: 30px;
    background: url('https://api.iconify.design/mdi:shuriken.svg?color=%2300f2fe') no-repeat center center;
    background-size: contain;
    animation: spin 0.2s linear infinite;
    z-index: 12;
    filter: drop-shadow(0 0 10px #00f2fe);
}
@keyframes spin {
    100% { transform: rotate(360deg); }
}
.falling-sword {
    position: absolute;
    width: 40px;
    height: 80px;
    background: url('https://api.iconify.design/mdi:sword.svg?color=%23ff3366') no-repeat center center;
    background-size: contain;
    transform: rotate(180deg);
    z-index: 14;
    filter: drop-shadow(0 0 15px #ff3366);
}
.warning-laser {
    position: absolute;
    width: 40px;
    height: 100%;
    bottom: 0;
    background: linear-gradient(to top, rgba(255, 51, 102, 0.4), transparent);
    z-index: 3;
    animation: warningBlink 0.1s infinite alternate;
}
@keyframes warningBlink {
    from { opacity: 0.3; }
    to { opacity: 0.8; }
}
.potion {
    position: absolute;
    width: 30px;
    height: 30px;
    background: url('https://api.iconify.design/mdi:bottle-tonic-plus.svg?color=%2300ff88') no-repeat center center;
    background-size: contain;
    z-index: 11;
    filter: drop-shadow(0 0 10px #00ff88);
    animation: float 2s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.dash-ghost {
    position: absolute;
    width: 50px; height: 100px;
    background: url('https://api.iconify.design/mdi:ninja.svg?color=%2300f2fe') no-repeat center center;
    background-size: contain;
    pointer-events: none;
    filter: drop-shadow(0 0 15px #00f2fe);
    z-index: 5;
}
#mobile-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 30;
}
.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: white;
    font-weight: bold;
    font-size: 12px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}
.action-btn:active {
    background: rgba(0, 242, 254, 0.4);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.8);
    transform: scale(0.95);
}
#character-select {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}
.char-cards { display: flex; gap: 30px; margin-top: 30px; }
.char-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #555;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    width: 220px;
}
.char-card.ninja:hover { transform: translateY(-10px); border-color: #00f2fe; box-shadow: 0 0 20px rgba(0, 242, 254, 0.5); }
.char-card.cyborg:hover { transform: translateY(-10px); border-color: #ffea00; box-shadow: 0 0 20px rgba(255, 234, 0, 0.5); }
.char-card.samurai:hover { transform: translateY(-10px); border-color: #ff4500; box-shadow: 0 0 20px rgba(255, 69, 0, 0.5); }
.char-card h3 { margin: 15px 0 10px; font-size: 18px; }
.char-card p { font-size: 12px; color: #ccc; margin-bottom: 5px; }
#btn-ult { border-color: #ffea00; color: #ffea00; }
#btn-ult:disabled { opacity: 0.3; border-color: #555; color: #555; cursor: not-allowed; box-shadow: none; }
#btn-ult.ready { animation: pulse-ult 1s infinite; background: rgba(255, 234, 0, 0.2); border-color: #ffea00; }
@keyframes pulse-ult {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px #ffea00; }
    50% { transform: scale(1.1); box-shadow: 0 0 25px #ffea00; }
}
.ultimate-fx {
    position: absolute;
    height: 60px;
    z-index: 15;
    border-radius: 30px;
    pointer-events: none;
    animation: blast 0.4s ease-out forwards;
}
#rain-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
.rain-drop {
    position: absolute;
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.4));
    animation: rainFall linear infinite;
}
@keyframes rainFall {
    0% { transform: translateY(-50px) rotate(15deg); }
    100% { transform: translateY(500px) rotate(15deg); }
}
@keyframes blast {
    0% { opacity: 1; transform: scaleX(0) scaleY(0.5); }
    40% { opacity: 1; transform: scaleX(1) scaleY(1.5); }
    100% { opacity: 0; transform: scaleX(1) scaleY(0.2); }
}