/* ==========================================
   WITCHCRAFT & WIZARDRY - 80s Retro Style
   ========================================== */

/* CSS Variables - Color Themes */
:root {
    /* Main Colors */
    --bg-dark: #0a0a1a;
    --bg-medium: #1a1a2e;
    --bg-light: #16213e;

    /* Neon Colors */
    --neon-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --neon-yellow: #ffff00;
    --neon-green: #00ff00;

    /* Character Colors */
    --witch-primary: #9b59b6;
    --witch-secondary: #2ecc71;
    --witch-glow: #8e44ad;

    --wizard-primary: #3498db;
    --wizard-secondary: #f1c40f;
    --wizard-glow: #2980b9;

    --goblin-primary: #27ae60;
    --goblin-secondary: #8b4513;
    --goblin-glow: #1e8449;

    --giant-primary: #8b7355;
    --giant-secondary: #5a4a3a;
    --giant-glow: #6b5540;

    /* Element Colors */
    --shadow-color: #9b59b6;
    --lightning-color: #f39c12;
    --earth-color: #27ae60;

    /* UI Colors */
    --health-green: #2ecc71;
    --health-yellow: #f1c40f;
    --health-red: #e74c3c;
    --mana-blue: #3498db;

    /* Fonts */
    --font-retro: 'Press Start 2P', cursive;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-retro);
    background: var(--bg-dark);
    color: white;
    min-height: 100vh;
    overflow: hidden;
}

/* Game Container */
#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-medium) 50%, var(--bg-light) 100%);
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay.active {
    display: flex;
}

/* ==========================================
   TITLE SCREEN
   ========================================== */

#title-screen {
    background: radial-gradient(ellipse at center, var(--bg-medium) 0%, var(--bg-dark) 100%);
}

.stars-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, white, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 350px 50px, white, transparent),
        radial-gradient(2px 2px at 420px 180px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 500px 90px, white, transparent),
        radial-gradient(2px 2px at 580px 130px, rgba(255,255,255,0.9), transparent);
    background-size: 600px 200px;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.title-content {
    text-align: center;
    z-index: 10;
}

.game-title {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.title-line {
    font-size: 3rem;
    background: linear-gradient(180deg, var(--neon-pink) 0%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

.title-and {
    font-size: 2rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.7);
}

@keyframes glow {
    from { filter: drop-shadow(0 0 20px var(--neon-pink)); }
    to { filter: drop-shadow(0 0 40px var(--neon-cyan)); }
}

.subtitle {
    font-size: 0.8rem;
    color: var(--neon-cyan);
    margin-bottom: 50px;
    letter-spacing: 4px;
}

/* Retro Button */
.retro-btn {
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-dark) 100%);
    border: 3px solid var(--neon-cyan);
    padding: 20px 40px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.retro-btn:hover {
    border-color: var(--neon-pink);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5), inset 0 0 30px rgba(255, 0, 255, 0.1);
}

.retro-btn .btn-text {
    font-family: var(--font-retro);
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.retro-btn:hover .btn-text {
    text-shadow: 0 0 10px var(--neon-pink);
}

/* Pulsing animation for start button */
#start-btn {
    animation: pulse 1.5s ease-in-out infinite;
}

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

.controls-hint {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
}

/* ==========================================
   CHARACTER SELECT SCREEN
   ========================================== */

#select-screen {
    background: radial-gradient(ellipse at center, var(--bg-medium) 0%, var(--bg-dark) 100%);
    padding: 40px;
}

.screen-title {
    font-size: 1.8rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px var(--neon-cyan);
    margin-bottom: 40px;
}

.character-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.character-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.3) 100%);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 25px;
    width: 280px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.character-card:hover,
.character-card.selected {
    transform: translateY(-10px);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.3), 0 20px 40px rgba(0, 0, 0, 0.5);
}

.character-card[data-character="witch"]:hover,
.character-card[data-character="witch"].selected {
    border-color: var(--witch-primary);
    box-shadow: 0 0 40px rgba(155, 89, 182, 0.5), 0 20px 40px rgba(0, 0, 0, 0.5);
}

.character-card[data-character="wizard"]:hover,
.character-card[data-character="wizard"].selected {
    border-color: var(--wizard-primary);
    box-shadow: 0 0 40px rgba(52, 152, 219, 0.5), 0 20px 40px rgba(0, 0, 0, 0.5);
}

.character-card[data-character="goblin"]:hover,
.character-card[data-character="goblin"].selected {
    border-color: var(--goblin-primary);
    box-shadow: 0 0 40px rgba(39, 174, 96, 0.5), 0 20px 40px rgba(0, 0, 0, 0.5);
}

.character-card[data-character="giant"]:hover,
.character-card[data-character="giant"].selected {
    border-color: var(--giant-primary);
    box-shadow: 0 0 40px rgba(139, 115, 85, 0.5), 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Character Sprites - Pixel Art */
.character-sprite {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    position: relative;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.character-card:hover .character-sprite,
.character-card.selected .character-sprite {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
}

/* Witch Sprite */
.witch-sprite {
    background-image: url('../assets/witch.svg');
}

.character-card[data-character="witch"]:hover .witch-sprite,
.character-card[data-character="witch"].selected .witch-sprite {
    filter: drop-shadow(0 0 20px var(--witch-primary));
}

/* Wizard Sprite */
.wizard-sprite {
    background-image: url('../assets/wizard.svg');
}

.character-card[data-character="wizard"]:hover .wizard-sprite,
.character-card[data-character="wizard"].selected .wizard-sprite {
    filter: drop-shadow(0 0 20px var(--wizard-primary));
}

/* Goblin Sprite */
.goblin-sprite {
    background-image: url('../assets/goblin.svg');
}

.character-card[data-character="goblin"]:hover .goblin-sprite,
.character-card[data-character="goblin"].selected .goblin-sprite {
    filter: drop-shadow(0 0 20px var(--goblin-primary));
}

/* Giant Sprite */
.giant-sprite {
    background-image: url('../assets/giant.svg');
}

.character-card[data-character="giant"]:hover .giant-sprite,
.character-card[data-character="giant"].selected .giant-sprite {
    filter: drop-shadow(0 0 20px var(--giant-primary));
}

.character-name {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: white;
}

.character-element {
    font-size: 0.6rem;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 15px;
}

.shadow-element {
    background: var(--shadow-color);
    box-shadow: 0 0 15px var(--shadow-color);
}

.lightning-element {
    background: var(--lightning-color);
    box-shadow: 0 0 15px var(--lightning-color);
}

.earth-element {
    background: var(--earth-color);
    box-shadow: 0 0 15px var(--earth-color);
}

/* Stats */
.character-stats {
    margin: 15px 0;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.5rem;
    width: 35px;
    color: rgba(255, 255, 255, 0.7);
}

.stat-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.hp-fill { background: linear-gradient(90deg, var(--health-red), var(--health-green)); }
.mag-fill { background: linear-gradient(90deg, var(--mana-blue), var(--neon-cyan)); }
.spd-fill { background: linear-gradient(90deg, var(--neon-yellow), var(--neon-green)); }

/* Character Moves */
.character-moves {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 15px;
}

.move {
    font-size: 0.5rem;
    padding: 5px 10px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
}

.shadow-move { border-left: 3px solid var(--shadow-color); }
.lightning-move { border-left: 3px solid var(--lightning-color); }
.earth-move { border-left: 3px solid var(--earth-color); }

.select-prompt {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 40px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ==========================================
   BATTLE SCREEN
   ========================================== */

#battle-screen {
    background: linear-gradient(180deg, #1a0a2e 0%, #0f1a3d 40%, #0a2818 100%);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#battle-screen.active {
    display: flex;
}

/* Background with sky and ground */
.battle-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.bg-sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(180deg,
        #0a0a2e 0%,
        #1a1a4e 30%,
        #2a2a5e 60%,
        #3a3a6e 100%
    );
}

.bg-sky::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 100px 50px, white, transparent),
        radial-gradient(2px 2px at 200px 100px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 300px 30px, white, transparent),
        radial-gradient(2px 2px at 400px 80px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 500px 60px, white, transparent),
        radial-gradient(2px 2px at 600px 40px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 700px 90px, white, transparent),
        radial-gradient(2px 2px at 800px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 900px 50px, white, transparent),
        radial-gradient(2px 2px at 1000px 30px, rgba(255,255,255,0.9), transparent);
    animation: twinkle 4s ease-in-out infinite;
}

.bg-ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    background: linear-gradient(180deg,
        #1a4a2a 0%,
        #0d3d1a 30%,
        #0a2810 100%
    );
    border-top: 4px solid #2d5a3a;
}

.bg-ground::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 25% 20%, rgba(155, 89, 182, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 75% 20%, rgba(39, 174, 96, 0.15) 0%, transparent 40%);
}

/* Round Indicator */
.round-indicator {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 30px;
    border-radius: 20px;
    border: 2px solid var(--neon-cyan);
}

.round-text {
    font-size: 1rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.round-dots {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 8px;
}

.round-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.round-dot.won {
    background: var(--health-green);
    border-color: var(--health-green);
    box-shadow: 0 0 15px var(--health-green);
}

.round-dot.lost {
    background: var(--health-red);
    border-color: var(--health-red);
    box-shadow: 0 0 15px var(--health-red);
}

/* Battle Arena - Centered Container */
.battle-arena {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 55%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 50px;
    z-index: 5;
}

/* Fighter Container */
.fighter {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.player-fighter {
    transform: scaleX(1);
}

.enemy-fighter {
    transform: scaleX(-1);
}

.enemy-fighter .fighter-info-floating {
    transform: scaleX(-1);
}

/* Fighter Info - Floating Above Character */
.fighter-info-floating {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 12px 20px;
    min-width: 220px;
    text-align: center;
    z-index: 10;
}

.fighter-name {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: white;
    text-shadow: 0 0 10px currentColor;
}

.fighter-element {
    font-size: 0.55rem;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Health Bar */
.health-bar-container {
    margin-bottom: 8px;
}

.health-bar {
    width: 100%;
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 11px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #58d68d);
    transition: width 0.5s ease;
    border-radius: 9px;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.health-fill.low {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.health-fill.medium {
    background: linear-gradient(90deg, #d68910, #f1c40f);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.enemy-health-fill {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.health-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
    display: block;
}

/* Status Effects */
.status-effects {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 5px;
}

.status-effect {
    font-size: 0.55rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(155, 89, 182, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.status-effect.poison {
    background: rgba(142, 68, 173, 0.8);
}

.status-effect.shield {
    background: rgba(41, 128, 185, 0.8);
}

/* ==========================================
   CHARACTER BODY SPRITES - PIXEL ART
   ========================================== */

.character-body {
    width: 200px;
    height: 300px;
    position: relative;
    animation: idle-bounce 2s ease-in-out infinite;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Pixel Art Character Images */
.character-body.witch {
    background-image: url('../assets/witch.svg');
    filter: drop-shadow(0 0 15px var(--witch-primary));
}

.character-body.wizard {
    background-image: url('../assets/wizard.svg');
    filter: drop-shadow(0 0 15px var(--wizard-primary));
}

.character-body.goblin {
    background-image: url('../assets/goblin.svg');
    filter: drop-shadow(0 0 15px var(--goblin-primary));
}

.character-body.giant {
    background-image: url('../assets/giant.svg');
    filter: drop-shadow(0 0 15px var(--giant-primary));
}

/* Hide the old CSS body parts when using pixel art */
.character-body .char-head,
.character-body .char-face,
.character-body .char-hat,
.character-body .char-body-main,
.character-body .char-arms,
.character-body .char-legs,
.character-body .char-accessory,
.character-body .char-eyes,
.character-body .char-mouth {
    display: none;
}

@keyframes idle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.character-body.casting {
    animation: cast-spell 0.6s ease-out;
}

@keyframes cast-spell {
    0% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-25px) scale(1.05); }
    60% { transform: translateY(-15px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

.character-body.big-attack {
    animation: big-attack-anim 0.8s ease-out;
}

@keyframes big-attack-anim {
    0% { transform: translateY(0) scale(1); filter: brightness(1); }
    20% { transform: translateY(15px) scale(0.95); filter: brightness(0.7); }
    50% { transform: translateY(-40px) scale(1.15); filter: brightness(1.8); }
    100% { transform: translateY(0) scale(1); filter: brightness(1); }
}

.character-body.hit {
    animation: take-hit 0.4s ease-out;
}

@keyframes take-hit {
    0%, 100% { transform: translateX(0); filter: brightness(1); }
    20% { transform: translateX(-30px); filter: brightness(2) saturate(0); }
    40% { transform: translateX(20px); filter: brightness(1.5); }
    60% { transform: translateX(-10px); filter: brightness(1.2); }
}

/* Fighter Shadow */
.fighter-shadow {
    width: 140px;
    height: 30px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    margin-top: -10px;
}

/* --- WITCH CHARACTER --- */
.character-body.witch .char-head {
    width: 80px;
    height: 80px;
    background: linear-gradient(180deg, #f5d6ba 0%, #e8c4a0 100%);
    border-radius: 50%;
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.character-body.witch .char-hat {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
}

.character-body.witch .char-hat::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 70px solid #2c1654;
}

.character-body.witch .char-hat::after {
    content: '';
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 15px;
    background: #1a0d33;
    border-radius: 50%;
}

.character-body.witch .char-face {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.character-body.witch .char-eyes {
    display: flex;
    gap: 25px;
    justify-content: center;
}

.character-body.witch .eye {
    width: 12px;
    height: 12px;
    background: #2c1654;
    border-radius: 50%;
}

.character-body.witch .char-mouth {
    width: 15px;
    height: 8px;
    background: #c0392b;
    border-radius: 0 0 10px 10px;
    margin: 10px auto 0;
}

.character-body.witch .char-body-main {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 120px;
    background: linear-gradient(180deg, #9b59b6 0%, #8e44ad 50%, #7d3c98 100%);
    border-radius: 20px 20px 60px 60px;
    z-index: 2;
}

.character-body.witch .char-body-main::after {
    content: '✦';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    color: #2ecc71;
}

.character-body.witch .char-arms .arm {
    position: absolute;
    width: 25px;
    height: 80px;
    background: linear-gradient(180deg, #9b59b6, #7d3c98);
    border-radius: 15px;
    top: 130px;
}

.character-body.witch .char-arms .arm.left {
    left: 15px;
    transform: rotate(20deg);
}

.character-body.witch .char-arms .arm.right {
    right: 15px;
    transform: rotate(-20deg);
}

.character-body.witch .char-accessory {
    position: absolute;
    right: 0;
    top: 120px;
    width: 60px;
    height: 8px;
    background: linear-gradient(90deg, #5d3a1a, #8b4513);
    transform: rotate(-30deg);
    border-radius: 4px;
    z-index: 6;
}

.character-body.witch .char-accessory::after {
    content: '★';
    position: absolute;
    right: -15px;
    top: -12px;
    font-size: 24px;
    color: #2ecc71;
    text-shadow: 0 0 10px #2ecc71;
}

/* --- WIZARD CHARACTER --- */
.character-body.wizard .char-head {
    width: 80px;
    height: 85px;
    background: linear-gradient(180deg, #f5d6ba 0%, #e8c4a0 100%);
    border-radius: 50% 50% 45% 45%;
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.character-body.wizard .char-hat {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
}

.character-body.wizard .char-hat::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 45px solid transparent;
    border-right: 45px solid transparent;
    border-bottom: 65px solid #1a4a7a;
}

.character-body.wizard .char-hat::after {
    content: '★';
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    color: #f1c40f;
    text-shadow: 0 0 15px #f1c40f;
}

.character-body.wizard .char-face {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.character-body.wizard .char-eyes {
    display: flex;
    gap: 25px;
    justify-content: center;
}

.character-body.wizard .eye {
    width: 12px;
    height: 12px;
    background: #1a4a7a;
    border-radius: 50%;
}

.character-body.wizard .char-mouth {
    width: 40px;
    height: 15px;
    border: 3px solid #7f8c8d;
    border-top: none;
    border-radius: 0 0 20px 20px;
    margin: 15px auto 0;
    background: #7f8c8d;
}

.character-body.wizard .char-body-main {
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 110px;
    background: linear-gradient(180deg, #3498db 0%, #2980b9 50%, #1a5276 100%);
    border-radius: 20px 20px 50px 50px;
    z-index: 2;
}

.character-body.wizard .char-body-main::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 25px;
    background: #f1c40f;
    border-radius: 50%;
    box-shadow: 0 0 15px #f1c40f;
}

.character-body.wizard .char-arms .arm {
    position: absolute;
    width: 28px;
    height: 75px;
    background: linear-gradient(180deg, #3498db, #1a5276);
    border-radius: 15px;
    top: 140px;
}

.character-body.wizard .char-arms .arm.left {
    left: 10px;
    transform: rotate(25deg);
}

.character-body.wizard .char-arms .arm.right {
    right: 10px;
    transform: rotate(-25deg);
}

.character-body.wizard .char-accessory {
    position: absolute;
    right: -10px;
    top: 130px;
    width: 70px;
    height: 12px;
    background: linear-gradient(90deg, #5d3a1a, #8b4513, #5d3a1a);
    transform: rotate(-25deg);
    border-radius: 6px;
    z-index: 6;
}

.character-body.wizard .char-accessory::after {
    content: '⚡';
    position: absolute;
    right: -20px;
    top: -20px;
    font-size: 35px;
    text-shadow: 0 0 15px #f1c40f;
}

/* --- GOBLIN CHARACTER --- */
.character-body.goblin .char-head {
    width: 90px;
    height: 75px;
    background: linear-gradient(180deg, #58d68d 0%, #27ae60 100%);
    border-radius: 50% 50% 40% 40%;
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.character-body.goblin .char-hat {
    position: absolute;
    top: 50px;
    left: 25px;
    z-index: 4;
}

.character-body.goblin .char-hat::before {
    content: '';
    position: absolute;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 40px solid #27ae60;
    transform: rotate(-20deg);
}

.character-body.goblin .char-hat::after {
    content: '';
    position: absolute;
    left: 100px;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 40px solid #27ae60;
    transform: rotate(20deg);
}

.character-body.goblin .char-face {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.character-body.goblin .char-eyes {
    display: flex;
    gap: 35px;
    justify-content: center;
}

.character-body.goblin .eye {
    width: 18px;
    height: 22px;
    background: #f1c40f;
    border-radius: 50%;
    position: relative;
}

.character-body.goblin .eye::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 6px;
    width: 8px;
    height: 8px;
    background: #1a0d33;
    border-radius: 50%;
}

.character-body.goblin .char-mouth {
    width: 35px;
    height: 18px;
    background: #1a0d33;
    border-radius: 0 0 20px 20px;
    margin: 8px auto 0;
    position: relative;
}

.character-body.goblin .char-mouth::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid white;
}

.character-body.goblin .char-mouth::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid white;
}

.character-body.goblin .char-body-main {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 100px;
    background: linear-gradient(180deg, #8b4513 0%, #6d3610 50%, #5d2e0d 100%);
    border-radius: 15px;
    z-index: 2;
}

.character-body.goblin .char-body-main::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    background: #27ae60;
    border-radius: 10px;
}

.character-body.goblin .char-arms .arm {
    position: absolute;
    width: 30px;
    height: 70px;
    background: linear-gradient(180deg, #58d68d, #27ae60);
    border-radius: 15px;
    top: 145px;
}

.character-body.goblin .char-arms .arm.left {
    left: 10px;
    transform: rotate(15deg);
}

.character-body.goblin .char-arms .arm.right {
    right: 10px;
    transform: rotate(-15deg);
}

.character-body.goblin .char-legs .leg {
    position: absolute;
    width: 30px;
    height: 50px;
    background: linear-gradient(180deg, #8b4513, #5d2e0d);
    border-radius: 10px;
    top: 230px;
}

.character-body.goblin .char-legs .leg.left {
    left: 50px;
}

.character-body.goblin .char-legs .leg.right {
    right: 50px;
}

.character-body.goblin .char-accessory {
    position: absolute;
    right: -5px;
    top: 160px;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #7d6b5d, #5d4e37);
    border-radius: 50%;
    z-index: 6;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.4);
}

/* VS Indicator */
.vs-indicator {
    font-size: 2.5rem;
    color: var(--neon-pink);
    text-shadow: 0 0 30px var(--neon-pink), 0 0 60px var(--neon-pink);
    z-index: 10;
    opacity: 0.6;
    align-self: center;
    margin-bottom: 100px;
}

/* ==========================================
   BOTTOM PANEL
   ========================================== */

.bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    display: flex;
    gap: 20px;
    padding: 15px 30px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 30%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 20;
}

/* Battle Log */
.battle-log {
    flex: 1;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-cyan);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
}

.log-title {
    font-size: 0.7rem;
    color: var(--neon-cyan);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    font-size: 0.65rem;
    line-height: 1.7;
}

.log-content p {
    margin-bottom: 4px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-content .damage {
    color: var(--health-red);
}

.log-content .heal {
    color: var(--health-green);
}

.log-content .effect {
    color: var(--neon-cyan);
}

/* Attack Menu */
.attack-menu {
    flex: 2;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-pink);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
}

.menu-title {
    font-size: 0.75rem;
    color: var(--neon-pink);
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.attack-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex: 1;
}

.attack-btn {
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-dark) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 12px 20px;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.attack-btn:hover:not(:disabled),
.attack-btn.selected {
    border-color: var(--neon-pink);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.5);
    transform: translateY(-3px);
}

.attack-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.attack-key {
    font-size: 1.4rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 15px var(--neon-yellow);
}

.attack-name {
    font-size: 0.6rem;
    color: white;
}

.attack-info {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.cooldown-indicator {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.5rem;
    color: var(--health-red);
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
}

.menu-hint {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 8px;
}

/* Damage Popup */
.damage-popup {
    position: absolute;
    font-size: 3rem;
    font-weight: bold;
    color: var(--health-red);
    text-shadow: 0 0 20px var(--health-red), 3px 3px 0 black, -1px -1px 0 black;
    pointer-events: none;
    z-index: 60;
    opacity: 0;
}

.damage-popup.show {
    animation: damage-float 1.2s ease-out forwards;
}

@keyframes damage-float {
    0% { opacity: 1; transform: translateY(0) scale(0.5); }
    20% { opacity: 1; transform: translateY(-20px) scale(1.3); }
    100% { opacity: 0; transform: translateY(-80px) scale(1); }
}

.damage-popup.heal {
    color: var(--health-green);
    text-shadow: 0 0 20px var(--health-green), 3px 3px 0 black;
}

.damage-popup.critical {
    color: var(--neon-yellow);
    text-shadow: 0 0 30px var(--neon-yellow), 0 0 60px var(--neon-yellow), 3px 3px 0 black;
    font-size: 4rem;
}

/* ==========================================
   VICTORY / DEFEAT SCREENS
   ========================================== */

#victory-screen,
#defeat-screen {
    background: radial-gradient(ellipse at center, var(--bg-medium) 0%, var(--bg-dark) 100%);
}

.result-content {
    text-align: center;
    z-index: 10;
}

.result-title {
    font-size: 3rem;
    margin-bottom: 30px;
    animation: result-glow 1s ease-in-out infinite alternate;
}

.victory-title {
    color: var(--neon-green);
    text-shadow: 0 0 30px var(--neon-green);
}

.defeat-title {
    color: var(--health-red);
    text-shadow: 0 0 30px var(--health-red);
}

@keyframes result-glow {
    from { filter: drop-shadow(0 0 20px currentColor); }
    to { filter: drop-shadow(0 0 40px currentColor); }
}

.result-sprite {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 60px;
    animation: victory-bounce 0.5s ease-in-out infinite alternate;
}

@keyframes victory-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

.result-character {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 20px;
}

.result-stats {
    margin-bottom: 40px;
}

.result-stat {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.play-again-btn {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ==========================================
   ROUND TRANSITION
   ========================================== */

.transition-content {
    text-align: center;
}

.transition-text {
    font-size: 3rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 30px var(--neon-cyan);
    animation: transition-zoom 0.5s ease-out;
}

.transition-subtext {
    font-size: 2rem;
    color: var(--neon-pink);
    text-shadow: 0 0 30px var(--neon-pink);
    margin-top: 20px;
    animation: transition-zoom 0.5s ease-out 0.3s both;
}

@keyframes transition-zoom {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================
   ANIMATIONS & EFFECTS
   ========================================== */

/* Screen Shake */
@keyframes screen-shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-10px, -5px); }
    20% { transform: translate(10px, 5px); }
    30% { transform: translate(-10px, 5px); }
    40% { transform: translate(10px, -5px); }
    50% { transform: translate(-5px, 10px); }
    60% { transform: translate(5px, -10px); }
    70% { transform: translate(-5px, -5px); }
    80% { transform: translate(5px, 5px); }
    90% { transform: translate(-2px, 2px); }
}

#battle-screen.shake {
    animation: screen-shake 0.5s ease-out;
}

/* Projectile Container */
.projectile-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: visible;
}

#big-attack-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 45;
    overflow: hidden;
}

/* Base Projectile */
.projectile {
    position: absolute;
    pointer-events: none;
    z-index: 51;
}

/* Shadow Bolt Projectile */
.projectile-shadow {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #bf7fff 0%, #9b59b6 40%, transparent 70%);
    box-shadow: 0 0 30px #9b59b6, 0 0 60px #9b59b6, 0 0 90px rgba(155, 89, 182, 0.5);
    animation: shadow-pulse 0.15s ease-in-out infinite alternate;
}

.projectile-shadow::before {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: white;
    text-shadow: 0 0 10px #fff;
}

@keyframes shadow-pulse {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.2); filter: brightness(1.3); }
}

/* Lightning Bolt Projectile */
.projectile-lightning {
    width: 80px;
    height: 40px;
    background: linear-gradient(90deg, transparent, #fff700, #ffa500, #fff700, transparent);
    clip-path: polygon(0% 50%, 20% 0%, 35% 40%, 55% 0%, 70% 40%, 90% 0%, 100% 50%, 90% 100%, 70% 60%, 55% 100%, 35% 60%, 20% 100%);
    box-shadow: 0 0 20px #f1c40f, 0 0 40px #f39c12;
    animation: lightning-flicker 0.1s ease-in-out infinite;
}

@keyframes lightning-flicker {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.8; filter: brightness(1.5); }
}

/* Rock Projectile */
.projectile-earth {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #7d6b5d, #5d4e37 50%, #3d2e1f);
    border-radius: 40% 60% 50% 40% / 50% 40% 60% 50%;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.5), 0 0 20px rgba(39, 174, 96, 0.5);
    animation: rock-spin 0.3s linear infinite;
}

@keyframes rock-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Projectile Flight Animations */
@keyframes fly-to-enemy {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(25vw, -5%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(50vw, 0) scale(0.8);
        opacity: 0;
    }
}

@keyframes fly-to-player {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-25vw, 5%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50vw, 0) scale(0.8);
        opacity: 0;
    }
}

.projectile.to-enemy {
    animation: fly-to-enemy 0.6s ease-in-out forwards;
}

.projectile.to-player {
    animation: fly-to-player 0.6s ease-in-out forwards;
}

/* Impact Effects */
.impact-effect {
    position: absolute;
    pointer-events: none;
    z-index: 52;
}

.impact-shadow {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(155, 89, 182, 0.8) 0%, rgba(155, 89, 182, 0.4) 30%, transparent 70%);
    animation: impact-expand 0.4s ease-out forwards;
}

.impact-lightning {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(241, 196, 15, 0.6) 30%, transparent 70%);
    animation: impact-flash 0.3s ease-out forwards;
}

.impact-earth {
    width: 180px;
    height: 100px;
    background: radial-gradient(ellipse, rgba(139, 90, 43, 0.8) 0%, rgba(39, 174, 96, 0.4) 50%, transparent 80%);
    animation: impact-crack 0.5s ease-out forwards;
}

@keyframes impact-expand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

@keyframes impact-flash {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

@keyframes impact-crack {
    0% { transform: translate(-50%, -50%) scale(0.5) scaleY(0.3); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(1.5) scaleY(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2) scaleY(0.5); opacity: 0; }
}

/* Big Attack Effects (Nightmare Storm, Thunder Strike, Earthquake) */
.big-attack-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 45;
}

.nightmare-storm {
    background: linear-gradient(
        45deg,
        rgba(155, 89, 182, 0) 0%,
        rgba(155, 89, 182, 0.3) 25%,
        rgba(128, 0, 128, 0.5) 50%,
        rgba(155, 89, 182, 0.3) 75%,
        rgba(155, 89, 182, 0) 100%
    );
    animation: nightmare-wave 0.8s ease-out forwards;
}

.nightmare-storm::before {
    content: '✦ ✧ ★ ✦ ✧';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    color: #bf7fff;
    text-shadow: 0 0 30px #9b59b6;
    animation: stars-spin 0.8s ease-out;
    letter-spacing: 30px;
}

@keyframes nightmare-wave {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes stars-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.5); opacity: 0; }
    30% { transform: translate(-50%, -50%) rotate(180deg) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) rotate(360deg) scale(2); opacity: 0; }
}

.thunder-strike {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(241, 196, 15, 0.6) 20%,
        transparent 40%
    );
    animation: thunder-flash 0.6s ease-out forwards;
}

.thunder-strike::before {
    content: '⚡';
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 150px;
    animation: bolt-strike 0.6s ease-out;
}

@keyframes thunder-flash {
    0%, 15%, 30% { opacity: 1; }
    7%, 22% { opacity: 0.3; }
    100% { opacity: 0; }
}

@keyframes bolt-strike {
    0% { transform: translateX(-50%) translateY(-100%) scaleY(0.5); opacity: 0; }
    20% { transform: translateX(-50%) translateY(0) scaleY(1.2); opacity: 1; }
    100% { transform: translateX(-50%) translateY(50%) scaleY(1); opacity: 0; }
}

.earthquake-effect {
    background: linear-gradient(
        0deg,
        rgba(139, 90, 43, 0.8) 0%,
        rgba(39, 174, 96, 0.4) 20%,
        transparent 40%
    );
    animation: quake 0.7s ease-out forwards;
}

.earthquake-effect::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        rgba(139, 90, 43, 0.6) 2px,
        transparent 4px,
        transparent 20px
    );
    animation: cracks-appear 0.7s ease-out;
}

@keyframes quake {
    0% { opacity: 0; transform: translateY(100%); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes cracks-appear {
    0% { opacity: 0; transform: scaleX(0); }
    30% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; }
}

/* Poison Effect Visual */
.poison-cloud {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(128, 0, 128, 0.6) 0%, rgba(0, 128, 0, 0.3) 50%, transparent 70%);
    animation: poison-float 1s ease-out forwards;
}

@keyframes poison-float {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    30% { transform: translate(-50%, -80%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(1.5); opacity: 0; }
}

/* Shield Visual */
.shield-bubble {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid rgba(52, 152, 219, 0.8);
    background: radial-gradient(circle, rgba(52, 152, 219, 0.2) 0%, rgba(52, 152, 219, 0.1) 50%, transparent 70%);
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.5), inset 0 0 30px rgba(52, 152, 219, 0.3);
    animation: shield-appear 0.5s ease-out forwards;
}

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

/* Enhanced Sprite Animations */
.sprite-container.charging {
    animation: charge-up 0.5s ease-in-out;
}

@keyframes charge-up {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.5); }
    100% { transform: scale(1); filter: brightness(1); }
}

.sprite-container.casting {
    animation: casting 0.6s ease-out;
}

@keyframes casting {
    0% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-20px) scale(1.1); }
    60% { transform: translateY(-10px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

.sprite-container.big-attack {
    animation: big-attack-windup 0.8s ease-out;
}

@keyframes big-attack-windup {
    0% { transform: translateY(0) scale(1); filter: brightness(1); }
    20% { transform: translateY(10px) scale(0.9); filter: brightness(0.8); }
    50% { transform: translateY(-30px) scale(1.3); filter: brightness(2); }
    100% { transform: translateY(0) scale(1); filter: brightness(1); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
}

/* Responsive */
@media (max-width: 768px) {
    .title-line {
        font-size: 2rem;
    }

    .character-grid {
        flex-direction: column;
        align-items: center;
    }

    .character-card {
        width: 90%;
        max-width: 300px;
    }

    .attack-menu {
        min-width: auto;
        width: 95%;
    }

    .attack-options {
        flex-direction: column;
    }

    .battle-side {
        flex-direction: column;
        gap: 10px;
    }

    .player-side {
        left: 20px;
        bottom: 220px;
    }

    .enemy-side {
        right: 20px;
        top: 80px;
    }
}
