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

        body {
            background: 
                radial-gradient(ellipse at 30% 20%, rgba(25, 25, 50, 0.3) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(30, 20, 40, 0.2) 0%, transparent 60%),
                linear-gradient(180deg, #0a0a0f 0%, #151520 30%, #1a1a25 70%, #0f0f1a 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            font-family: 'Cinzel', 'Georgia', serif;
            overflow: hidden;
            position: relative;
        }

        /* Distant stars - very subtle */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: 
                radial-gradient(1px 1px at 80px 120px, rgba(255, 255, 255, 0.4), transparent),
                radial-gradient(1px 1px at 300px 80px, rgba(255, 255, 255, 0.3), transparent),
                radial-gradient(1px 1px at 180px 220px, rgba(255, 255, 255, 0.3), transparent),
                radial-gradient(1px 1px at 450px 150px, rgba(255, 255, 255, 0.2), transparent),
                radial-gradient(1px 1px at 50px 300px, rgba(255, 255, 255, 0.3), transparent),
                radial-gradient(1px 1px at 400px 280px, rgba(255, 255, 255, 0.2), transparent);
            background-repeat: no-repeat;
            animation: distant-twinkle 8s ease-in-out infinite alternate;
            z-index: -2;
            opacity: 0.6;
        }

        /* Very subtle distant nebula */
        body::after {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(ellipse 400px 200px at 10% 80%, rgba(50, 30, 80, 0.05) 0%, transparent 70%),
                radial-gradient(ellipse 300px 400px at 90% 20%, rgba(30, 30, 60, 0.05) 0%, transparent 70%);
            animation: nebula-drift 20s linear infinite;
            z-index: -1;
            opacity: 0.4;
        }

        @keyframes distant-twinkle {
            0% { opacity: 0.4; }
            100% { opacity: 0.8; }
        }

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

        .card-container {
            perspective: 1000px;
            position: relative;
        }

        .card-flip-inner {
            position: relative;
            width: 100%;
            height: 100%;
            text-align: center;
            transition: transform 0.8s;
            transform-style: preserve-3d;
        }

        .card-container.flipped .card-flip-inner {
            transform: rotateY(180deg);
        }

        .card-front, .card-back {
            position: absolute;
            width: 100%;
            height: 100%;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            border-radius: 15px;
            /* Add solid background to prevent bleed-through */
            background: linear-gradient(180deg, #0a0a0f 0%, #151520 30%, #1a1a25 70%, #0f0f1a 100%);
        }

        .card-front {
            transform: rotateY(0deg);
            z-index: 2;
        }

        .card-back {
            transform: rotateY(180deg);
            z-index: 1;
        }
        
        /* Glass blocker - sits behind glass effects but blocks opposite side */
        .glass-blocker {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(ellipse at 30% 20%, rgba(15, 15, 25, 0.8) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(20, 15, 25, 0.7) 0%, transparent 60%),
                rgba(10, 10, 20, 0.9);
            border-radius: 15px;
            z-index: 0;
        }

        .magical-bg {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(ellipse 1200px 600px at 50% 100%, rgba(20, 20, 35, 0.3) 0%, transparent 80%),
                radial-gradient(ellipse 800px 400px at 20% 50%, rgba(25, 15, 30, 0.2) 0%, transparent 70%);
            animation: subtle-pulse 12s ease-in-out infinite alternate;
            z-index: -1;
        }

        @keyframes subtle-pulse {
            0% { opacity: 0.6; }
            100% { opacity: 0.8; }
        }

        .game-card {
            width: 350px;
            height: 640px;
            position: relative;
            border-radius: 15px;
            cursor: pointer;
            transition: none; /* Remove scale transition for flip */
            transform-style: preserve-3d;
        }

        .card-glow {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 15px;
            background: linear-gradient(
                135deg, 
                rgba(255,255,255,0.08) 0%, 
                transparent 30%, 
                transparent 70%, 
                rgba(255,255,255,0.04) 100%
            );
            z-index: 2;
            pointer-events: none;
        }

        .card-frame {
            width: 100%;
            height: 100%;
            background: 
                /* Glass texture overlay */
                radial-gradient(circle at 20% 20%, rgba(255,255,255,0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255,255,255,0.02) 0%, transparent 50%),
                /* Subtle noise texture */
                repeating-linear-gradient(
                    45deg,
                    transparent,
                    transparent 1px,
                    rgba(255,255,255,0.01) 1px,
                    rgba(255,255,255,0.01) 2px
                ),
                /* Main glass background - reduced opacity to work with blocker */
                linear-gradient(145deg, 
                    rgba(20, 25, 40, 0.6) 0%, 
                    rgba(30, 35, 55, 0.7) 25%,
                    rgba(25, 30, 50, 0.65) 50%, 
                    rgba(20, 25, 40, 0.7) 75%,
                    rgba(15, 20, 35, 0.75) 100%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 15px;
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(12px) saturate(180%);
            box-shadow: 
                /* Inner glass highlights */
                inset 0 1px 0 rgba(255,255,255,0.1),
                inset 1px 0 0 rgba(255,255,255,0.05),
                inset 0 -1px 0 rgba(0,0,0,0.1),
                inset -1px 0 0 rgba(0,0,0,0.05),
                /* Outer depth */
                0 8px 32px rgba(0,0,0,0.4),
                0 2px 8px rgba(0,0,0,0.2);
            z-index: 1;
        }

        /* Glass surface reflection effect */
        .card-frame::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(
                135deg,
                rgba(255,255,255,0.1) 0%,
                transparent 20%,
                transparent 80%,
                rgba(255,255,255,0.05) 100%
            );
            border-radius: 15px;
            pointer-events: none;
            z-index: 2;
        }

        /* Subtle glass pattern */
        .card-frame::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: 
                radial-gradient(circle at 30% 30%, rgba(255,255,255,0.02) 0%, transparent 20%),
                radial-gradient(circle at 70% 70%, rgba(255,255,255,0.015) 0%, transparent 25%),
                radial-gradient(circle at 50% 80%, rgba(255,255,255,0.01) 0%, transparent 30%);
            border-radius: 15px;
            pointer-events: none;
            z-index: 2;
        }

        .level-xp-bar {
            position: absolute;
            top: 15px;
            left: 15px;
            right: 15px;
            height: 35px;
            width: auto; /* Let it calculate based on left/right */
            max-width: calc(100% - 30px); /* Never exceed parent minus margins */
            background: 
                radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
                radial-gradient(ellipse, rgba(147, 51, 234, 0.3) 0%, rgba(107, 33, 168, 0.4) 100%),
                rgba(25, 15, 35, 0.8);
            border: 1px solid rgba(147, 51, 234, 0.8);
            border-radius: 22px;
            display: flex;
            align-items: center;
            backdrop-filter: blur(8px) saturate(150%);
            box-shadow: 
                0 0 20px rgba(147, 51, 234, 0.6),
                0 0 40px rgba(147, 51, 234, 0.3),
                inset 0 1px 0 rgba(255,255,255,0.3),
                inset 1px 0 0 rgba(255,255,255,0.2),
                0 4px 15px rgba(0,0,0,0.4);
            z-index: 10;
            position: relative;
            overflow: hidden;
            box-sizing: border-box; /* Include padding/border in width */
        }

        .level-xp-bar::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            right: 2px;
            bottom: 2px;
            background: linear-gradient(
                135deg,
                rgba(255,255,255,0.4) 0%,
                transparent 30%,
                transparent 70%,
                rgba(255,255,255,0.1) 100%
            );
            border-radius: 20px;
            pointer-events: none;
        }

        .level-xp-bar::after {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -1px;
            bottom: -1px;
            background: transparent;
            border: 1px solid rgba(147, 51, 234, 0.4);
            border-radius: 23px;
            animation: level-neon-pulse 3s ease-in-out infinite alternate;
            pointer-events: none;
        }

        @keyframes level-neon-pulse {
            0% { 
                box-shadow: 0 0 5px rgba(147, 51, 234, 0.4);
                opacity: 0.6;
            }
            100% { 
                box-shadow: 0 0 15px rgba(147, 51, 234, 0.8);
                opacity: 1;
            }
        }

        .level-section {
            display: flex;
            align-items: center;
            padding-left: 8px;
            flex-shrink: 0; /* Don't shrink the level */
            width: auto;
        }

        .level-number {
            color: rgba(255, 255, 255, 0.95);
            font-weight: bold;
            font-size: 15px;
            text-shadow: 
                0 0 10px rgba(147, 51, 234, 0.8),
                2px 2px 4px rgba(0,0,0,0.8);
            margin-right: 6px;
            white-space: nowrap; /* Keep level text on one line */
        }

        .xp-section {
            flex: 1; /* Take remaining space */
            height: 18px;
            margin: 0 8px 0 3px;
            position: relative;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 9px;
            overflow: hidden;
            border: 1px solid rgba(147, 51, 234, 0.3);
            min-width: 60px; /* Minimum viable width */
            max-width: none; /* Let flex handle it */
        }

        .xp-fill {
            height: 100%;
            width: 65%; /* 65% filled */
            background: linear-gradient(
                90deg,
                rgba(147, 51, 234, 0.9) 0%,
                rgba(168, 85, 247, 0.8) 50%,
                rgba(147, 51, 234, 0.7) 100%
            );
            border-radius: 7px;
            box-shadow: 
                0 0 8px rgba(147, 51, 234, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            animation: xp-pulse 2s ease-in-out infinite alternate;
        }

        @keyframes xp-pulse {
            0% { 
                box-shadow: 0 0 6px rgba(147, 51, 234, 0.4);
            }
            100% { 
                box-shadow: 0 0 12px rgba(147, 51, 234, 0.8);
            }
        }

        .xp-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: rgba(255, 255, 255, 0.9);
            font-size: 8px; /* Fixed reasonable size */
            font-weight: bold;
            text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
            white-space: nowrap;
            z-index: 2;
            width: calc(100% - 4px); /* Full width minus small padding */
            text-align: center;
            overflow: hidden;
            text-overflow: ellipsis;
            padding: 0 2px;
            box-sizing: border-box;
        }

        /* Hide XP text on very small screens, show shorter version */
        .xp-text-full {
            display: inline;
        }
        
        .xp-text-short {
            display: none;
        }

        @media (max-width: 350px) {
            .xp-text-full {
                display: none;
            }
            
            .xp-text-short {
                display: inline;
            }
        }

        .card-art {
            margin: 25px 15px 5px 15px;
            height: 235px;
            position: relative;
            border-radius: 10px;
            overflow: hidden;
            z-index: 5;
        }

        /* Rotating hue animation for front card SVG - smooth with intensity peaks */
        .card-front .art-placeholder svg,
        .card-front .art-placeholder image {
            animation: stone-color-cycle 12s linear infinite;
        }
        
        @keyframes stone-color-cycle {
            /* Arcane phase (0-3s) */
            0%    { filter: hue-rotate(0deg) saturate(1.0) brightness(1.0); }     /* Arcane start */
            12.5% { filter: hue-rotate(0deg) saturate(1.4) brightness(1.2); }     /* Arcane peak (1.5s) */
            25%   { filter: hue-rotate(0deg) saturate(1.0) brightness(1.0); }     /* Arcane fade */
            
            /* Frost phase (3-6s) */
            25%   { filter: hue-rotate(-120deg) saturate(1.0) brightness(1.0); }  /* Frost start */
            37.5% { filter: hue-rotate(-120deg) saturate(1.3) brightness(1.1); } /* Frost peak (4.5s) */
            50%   { filter: hue-rotate(-120deg) saturate(1.0) brightness(1.0); }  /* Frost fade */
            
            /* Staff phase (6-9s) */
            50%   { filter: hue-rotate(30deg) saturate(1.0) brightness(1.0); }    /* Staff start */
            62.5% { filter: hue-rotate(30deg) saturate(1.5) brightness(1.15); }  /* Staff peak (7.5s) */
            75%   { filter: hue-rotate(30deg) saturate(1.0) brightness(1.0); }    /* Staff fade */
            
            /* Cataclysm phase (9-12s) */
            75%   { filter: hue-rotate(-30deg) saturate(1.0) brightness(1.0); }   /* Cataclysm start */
            87.5% { filter: hue-rotate(-30deg) saturate(1.6) brightness(1.2); }  /* Cataclysm peak (10.5s) */
            100%  { filter: hue-rotate(0deg) saturate(1.0) brightness(1.0); }     /* Back to Arcane */
        }
        
        /* Hover effect - pause the animation */
        .card-front:hover .art-placeholder svg,
        .card-front:hover .art-placeholder image {
            animation-play-state: paused;
        }

        /* 🪨 STONE HOVERING EFFECT - Front card only 🪨 */
        /* Target the stone path by ID or inkscape label - only on front card */
        .card-front .art-placeholder svg #path2,
        .card-front .art-placeholder svg [inkscape\:label="stone"],
        .card-front .art-placeholder svg path[id="path2"] {
            animation: stone-hover 2.5s ease-in-out infinite;
            transform-origin: center center;
            filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.3));
        }
        
        @keyframes stone-hover {
            0% {
                transform: translateY(0px);
                filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.3));
            }
            50% {
                transform: translateY(-12px);
                filter: drop-shadow(0 8px 16px rgba(255, 255, 255, 0.5)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
            }
            100% {
                transform: translateY(0px);
                filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.3));
            }
        }
        
        /* Pause stone animation on card hover */
        .card-front:hover .art-placeholder svg #path2,
        .card-front:hover .art-placeholder svg [inkscape\:label="stone"],
        .card-front:hover .art-placeholder svg path[id="path2"] {
            animation-play-state: paused;
        }

        .art-placeholder {
            width: 100%;
            height: 100%;
            background: transparent; /* Removed gradient background */
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .placeholder-text {
            color: rgba(255,255,255,0.8);
            font-size: 18px;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
        }

        .art-frame {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            box-shadow: 
                inset 0 0 20px rgba(255, 255, 255, 0.05),
                inset 0 1px 0 rgba(255,255,255,0.1);
            z-index: 3;
        }

        .card-name {
            text-align: center;
            margin: 5px 15px 5px 15px;
            padding: 6px 0;
            background: 
                linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
            backdrop-filter: blur(2px);
            border-radius: 4px;
            z-index: 5;
            position: relative;
        }

        .card-name h2 {
            color: #ffffff;
            font-size: 20px;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
            letter-spacing: 1px;
        }

        .card-description {
            margin: 5px 15px 20px 15px;
            position: relative;
            min-height: 120px;
            z-index: 5;
        }

        .description-bg {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                rgba(0, 0, 0, 0.2);
            border-radius: 8px;
            backdrop-filter: blur(6px);
            border: 1px solid rgba(255,255,255,0.05);
        }

        .card-description p {
            position: relative;
            z-index: 2;
            color: #e0e0e0;
            font-size: 14px;
            line-height: 1.5;
            padding: 12px;
            text-align: center;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
        }

        .card-stats {
            position: absolute;
            bottom: 20px;
            left: 15px;
            right: 15px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 10;
        }

        .stat-bar {
            height: 35px;
            border-radius: 18px;
            display: flex;
            align-items: center;
            backdrop-filter: blur(8px) saturate(150%);
            position: relative;
            box-shadow: 
                inset 0 1px 0 rgba(255,255,255,0.2),
                inset 1px 0 0 rgba(255,255,255,0.1),
                0 4px 15px rgba(0,0,0,0.4);
            overflow: hidden;
        }

        /* HP Bar */
        .stat-bar.hp {
            background: 
                radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
                radial-gradient(ellipse, rgba(239, 68, 68, 0.3) 0%, rgba(185, 28, 28, 0.4) 100%),
                rgba(35, 15, 15, 0.8);
            border: 1px solid rgba(239, 68, 68, 0.8);
        }

        .stat-bar.hp::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            right: 2px;
            bottom: 2px;
            background: linear-gradient(
                135deg,
                rgba(255,255,255,0.3) 0%,
                transparent 30%,
                transparent 70%,
                rgba(255,255,255,0.1) 100%
            );
            border-radius: 16px;
            pointer-events: none;
        }

        .stat-bar.hp::after {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -1px;
            bottom: -1px;
            background: transparent;
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 19px;
            animation: hp-bar-pulse 4s ease-in-out infinite alternate;
            pointer-events: none;
        }

        @keyframes hp-bar-pulse {
            0% { 
                box-shadow: 0 0 5px rgba(239, 68, 68, 0.3);
                opacity: 0.6;
            }
            100% { 
                box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
                opacity: 1;
            }
        }

        /* Mana Bar */
        .stat-bar.mana {
            background: 
                radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
                radial-gradient(ellipse, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.4) 100%),
                rgba(15, 25, 35, 0.8);
            border: 1px solid rgba(59, 130, 246, 0.8);
        }

        .stat-bar.mana::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            right: 2px;
            bottom: 2px;
            background: linear-gradient(
                135deg,
                rgba(255,255,255,0.3) 0%,
                transparent 30%,
                transparent 70%,
                rgba(255,255,255,0.1) 100%
            );
            border-radius: 16px;
            pointer-events: none;
        }

        .stat-bar.mana::after {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -1px;
            bottom: -1px;
            background: transparent;
            border: 1px solid rgba(59, 130, 246, 0.3);
            border-radius: 19px;
            animation: mana-bar-pulse 3.5s ease-in-out infinite alternate;
            pointer-events: none;
        }

        @keyframes mana-bar-pulse {
            0% { 
                box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
                opacity: 0.6;
            }
            100% { 
                box-shadow: 0 0 12px rgba(59, 130, 246, 0.7);
                opacity: 1;
            }
        }

        .stat-icon {
            width: 25px;
            height: 25px;
            margin-left: 10px;
            margin-right: 10px;
            z-index: 2;
            position: relative;
        }

        .stat-fill-section {
            flex: 1;
            height: 18px;
            margin-right: 10px;
            position: relative;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 9px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .stat-fill {
            height: 100%;
            border-radius: 8px;
            position: relative;
            overflow: hidden;
        }

        .stat-fill.hp-fill {
            width: 85%; /* 85% HP */
            background: linear-gradient(
                90deg,
                rgba(239, 68, 68, 0.9) 0%,
                rgba(248, 113, 113, 0.8) 50%,
                rgba(239, 68, 68, 0.7) 100%
            );
            box-shadow: 
                0 0 8px rgba(239, 68, 68, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            animation: hp-fill-pulse 3s ease-in-out infinite alternate;
        }

        .stat-fill.mana-fill {
            width: 50%; /* 50% Mana */
            background: linear-gradient(
                90deg,
                rgba(59, 130, 246, 0.9) 0%,
                rgba(96, 165, 250, 0.8) 50%,
                rgba(59, 130, 246, 0.7) 100%
            );
            box-shadow: 
                0 0 8px rgba(59, 130, 246, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            animation: mana-fill-pulse 2.5s ease-in-out infinite alternate;
        }

        @keyframes hp-fill-pulse {
            0% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
            100% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.8); }
        }

        @keyframes mana-fill-pulse {
            0% { box-shadow: 0 0 6px rgba(59, 130, 246, 0.4); }
            100% { box-shadow: 0 0 12px rgba(59, 130, 246, 0.8); }
        }

        .stat-text {
            position: absolute;
            top: 50%;
            right: 8px;
            transform: translateY(-50%);
            color: rgba(255, 255, 255, 0.95);
            font-size: 11px;
            font-weight: bold;
            text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
            z-index: 2;
        }

        .stat-bar.hp .stat-text {
            text-shadow: 0 0 5px rgba(239, 68, 68, 0.8);
        }

        .stat-bar.mana .stat-text {
            text-shadow: 0 0 5px rgba(59, 130, 246, 0.8);
        }

        .border-decoration {
            position: absolute;
            background: linear-gradient(45deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
            z-index: 5;
        }

        .border-decoration.top {
            top: -2px;
            left: 20%;
            right: 20%;
            height: 4px;
            border-radius: 2px;
        }

        .border-decoration.bottom {
            bottom: -2px;
            left: 20%;
            right: 20%;
            height: 4px;
            border-radius: 2px;
        }

        .border-decoration.left {
            left: -2px;
            top: 20%;
            bottom: 20%;
            width: 4px;
            border-radius: 2px;
        }

        .border-decoration.right {
            right: -2px;
            top: 20%;
            bottom: 20%;
            width: 4px;
            border-radius: 2px;
        }

        .combat-stats {
            position: absolute;
            bottom: 20px;
            left: 15px;
            right: 15px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 10;
        }

        .combat-stat {
            height: 32px;
            border-radius: 16px;
            display: flex;
            align-items: center;
            backdrop-filter: blur(8px) saturate(150%);
            position: relative;
            box-shadow: 
                inset 0 1px 0 rgba(255,255,255,0.2),
                inset 1px 0 0 rgba(255,255,255,0.1),
                0 4px 15px rgba(0,0,0,0.4);
            overflow: hidden;
        }

        /* Attack Bar - Orange */
        .combat-stat.attack {
            background: 
                radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
                radial-gradient(ellipse, rgba(249, 115, 22, 0.3) 0%, rgba(194, 65, 12, 0.4) 100%),
                rgba(35, 25, 15, 0.8);
            border: 1px solid rgba(249, 115, 22, 0.8);
        }

        .combat-stat.attack::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            right: 2px;
            bottom: 2px;
            background: linear-gradient(
                135deg,
                rgba(255,255,255,0.3) 0%,
                transparent 30%,
                transparent 70%,
                rgba(255,255,255,0.1) 100%
            );
            border-radius: 14px;
            pointer-events: none;
        }

        .combat-stat.attack::after {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -1px;
            bottom: -1px;
            background: transparent;
            border: 1px solid rgba(249, 115, 22, 0.3);
            border-radius: 17px;
            animation: attack-neon-pulse 3s ease-in-out infinite alternate;
            pointer-events: none;
        }

        @keyframes attack-neon-pulse {
            0% { 
                box-shadow: 0 0 5px rgba(249, 115, 22, 0.3);
                opacity: 0.6;
            }
            100% { 
                box-shadow: 0 0 12px rgba(249, 115, 22, 0.7);
                opacity: 1;
            }
        }

        /* Spell Power Bar - Cyan */
        .combat-stat.spell-power {
            background: 
                radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
                radial-gradient(ellipse, rgba(6, 182, 212, 0.3) 0%, rgba(8, 145, 178, 0.4) 100%),
                rgba(15, 25, 35, 0.8);
            border: 1px solid rgba(6, 182, 212, 0.8);
        }

        .combat-stat.spell-power::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            right: 2px;
            bottom: 2px;
            background: linear-gradient(
                135deg,
                rgba(255,255,255,0.3) 0%,
                transparent 30%,
                transparent 70%,
                rgba(255,255,255,0.1) 100%
            );
            border-radius: 14px;
            pointer-events: none;
        }

        .combat-stat.spell-power::after {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -1px;
            bottom: -1px;
            background: transparent;
            border: 1px solid rgba(6, 182, 212, 0.3);
            border-radius: 17px;
            animation: spell-power-neon-pulse 3.2s ease-in-out infinite alternate;
            pointer-events: none;
        }

        @keyframes spell-power-neon-pulse {
            0% { 
                box-shadow: 0 0 5px rgba(6, 182, 212, 0.3);
                opacity: 0.6;
            }
            100% { 
                box-shadow: 0 0 12px rgba(6, 182, 212, 0.7);
                opacity: 1;
            }
        }

        /* Defense Bar - Green */
        .combat-stat.defense {
            background: 
                radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
                radial-gradient(ellipse, rgba(34, 197, 94, 0.3) 0%, rgba(21, 128, 61, 0.4) 100%),
                rgba(15, 35, 25, 0.8);
            border: 1px solid rgba(34, 197, 94, 0.8);
        }

        .combat-stat.defense::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            right: 2px;
            bottom: 2px;
            background: linear-gradient(
                135deg,
                rgba(255,255,255,0.3) 0%,
                transparent 30%,
                transparent 70%,
                rgba(255,255,255,0.1) 100%
            );
            border-radius: 14px;
            pointer-events: none;
        }

        .combat-stat.defense::after {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -1px;
            bottom: -1px;
            background: transparent;
            border: 1px solid rgba(34, 197, 94, 0.3);
            border-radius: 17px;
            animation: defense-neon-pulse 3.7s ease-in-out infinite alternate;
            pointer-events: none;
        }

        @keyframes defense-neon-pulse {
            0% { 
                box-shadow: 0 0 5px rgba(34, 197, 94, 0.3);
                opacity: 0.6;
            }
            100% { 
                box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
                opacity: 1;
            }
        }

        .combat-stat-icon {
            width: 22px;
            height: 22px;
            margin-left: 10px;
            margin-right: 8px;
            z-index: 2;
            position: relative;
        }

        .combat-stat-fill-section {
            flex: 1;
            height: 16px;
            margin-right: 10px;
            position: relative;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .combat-stat-fill {
            height: 100%;
            border-radius: 7px;
            position: relative;
            overflow: hidden;
        }

        .combat-stat-fill.attack-fill {
            width: 30%; /* 6/20 */
            background: linear-gradient(
                90deg,
                rgba(249, 115, 22, 0.9) 0%,
                rgba(251, 146, 60, 0.8) 50%,
                rgba(249, 115, 22, 0.7) 100%
            );
            box-shadow: 
                0 0 8px rgba(249, 115, 22, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            animation: attack-fill-pulse 3s ease-in-out infinite alternate;
        }

        .combat-stat-fill.spell-fill {
            width: 75%; /* 15/20 */
            background: linear-gradient(
                90deg,
                rgba(6, 182, 212, 0.9) 0%,
                rgba(34, 211, 238, 0.8) 50%,
                rgba(6, 182, 212, 0.7) 100%
            );
            box-shadow: 
                0 0 8px rgba(6, 182, 212, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            animation: spell-fill-pulse 2.8s ease-in-out infinite alternate;
        }

        .combat-stat-fill.defense-fill {
            width: 20%; /* 4/20 */
            background: linear-gradient(
                90deg,
                rgba(34, 197, 94, 0.9) 0%,
                rgba(74, 222, 128, 0.8) 50%,
                rgba(34, 197, 94, 0.7) 100%
            );
            box-shadow: 
                0 0 8px rgba(34, 197, 94, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            animation: defense-fill-pulse 3.5s ease-in-out infinite alternate;
        }

        @keyframes attack-fill-pulse {
            0% { box-shadow: 0 0 6px rgba(249, 115, 22, 0.4); }
            100% { box-shadow: 0 0 12px rgba(249, 115, 22, 0.8); }
        }

        @keyframes spell-fill-pulse {
            0% { box-shadow: 0 0 6px rgba(6, 182, 212, 0.4); }
            100% { box-shadow: 0 0 12px rgba(6, 182, 212, 0.8); }
        }

        @keyframes defense-fill-pulse {
            0% { box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
            100% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.8); }
        }

        .combat-stat-text {
            position: absolute;
            top: 50%;
            right: 8px;
            transform: translateY(-50%);
            color: rgba(255, 255, 255, 0.95);
            font-size: 10px;
            font-weight: bold;
            text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
            z-index: 2;
        }

        .combat-stat.attack .combat-stat-text {
            text-shadow: 0 0 5px rgba(249, 115, 22, 0.8);
        }

        .combat-stat.spell-power .combat-stat-text {
            text-shadow: 0 0 5px rgba(6, 182, 212, 0.8);
        }

        .combat-stat.defense .combat-stat-text {
            text-shadow: 0 0 5px rgba(34, 197, 94, 0.8);
        }

        /* Ability selector */
        .ability-selector {
            position: absolute;
            top: 75px;
            right: 15px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 15;
        }

        .ability-tab {
            width: 40px;
            height: 35px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(6px);
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(0,0,0,0.3);
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 16px;
        }

        .ability-tab:hover {
            background: rgba(255,255,255,0.1);
            transform: scale(1.05);
        }

        .ability-tab.active {
            background: rgba(249, 115, 22, 0.3);
            border-color: rgba(249, 115, 22, 0.8);
            box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
        }

        /* Ability content area */
        .ability-content {
            position: relative;
            height: 100%;
        }

        .ability {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            transition: opacity 0.4s ease;
            pointer-events: none;
        }

        .ability.active {
            opacity: 1;
            pointer-events: all;
        }
        /* Ability art area */
        .ability-art {
            margin: 25px 15px 5px 15px;
            height: 235px;
            position: relative;
            border-radius: 10px;
            overflow: hidden;
            z-index: 5;
        }

        .ability-art-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            border-radius: 8px;
        }

        .ability-art-frame {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 10px;
            box-shadow: 
                inset 0 0 20px rgba(255,255,255,0.05),
                inset 0 1px 0 rgba(255,255,255,0.1);
            z-index: 3;
            border: 1px solid;
        }

        /* Ability-specific styling with hue shifts for SVG content */
        .ability[data-ability="attack"] .ability-art-placeholder {
            background: transparent; /* Removed gradient background */
        }

        .ability[data-ability="attack"] .ability-art-placeholder svg,
        .ability[data-ability="attack"] .ability-art-placeholder image {
            filter: hue-rotate(0deg) saturate(1.2) brightness(1.1);
            animation: attack-pulse 2s ease-in-out infinite alternate;
        }
        
        @keyframes attack-pulse {
            0%   { filter: hue-rotate(-10deg) saturate(1.0) brightness(0.9); }
            100% { filter: hue-rotate(15deg) saturate(1.5) brightness(1.3); }
        }

        .ability[data-ability="attack"] .ability-art-frame {
            border-color: rgba(249, 115, 22, 0.4);
        }

        .ability[data-ability="frost"] .ability-art-placeholder {
            background: transparent; /* Removed gradient background */
        }

        .ability[data-ability="frost"] .ability-art-placeholder svg,
        .ability[data-ability="frost"] .ability-art-placeholder image {
            filter: hue-rotate(-60deg) saturate(1.1) brightness(1.0);
            animation: frost-pulse 3s ease-in-out infinite alternate;
        }
        
        @keyframes frost-pulse {
            0%   { filter: hue-rotate(-80deg) saturate(0.9) brightness(0.8); }
            100% { filter: hue-rotate(-40deg) saturate(1.4) brightness(1.3); }
        }

        .ability[data-ability="frost"] .ability-art-frame {
            border-color: rgba(59, 130, 246, 0.4);
        }

        .ability[data-ability="slam"] .ability-art-placeholder {
            background: transparent; /* Removed gradient background */
        }

        .ability[data-ability="slam"] .ability-art-placeholder svg,
        .ability[data-ability="slam"] .ability-art-placeholder image {
            filter: hue-rotate(60deg) saturate(1.3) brightness(1.05);
            animation: slam-pulse 2.8s ease-in-out infinite alternate;
        }
        
        @keyframes slam-pulse {
            0%   { filter: hue-rotate(40deg) saturate(1.0) brightness(0.9); }
            100% { filter: hue-rotate(80deg) saturate(1.6) brightness(1.4); }
        }

        .ability[data-ability="slam"] .ability-art-frame {
            border-color: rgba(168, 85, 247, 0.4);
        }

        .ability[data-ability="meteor"] .ability-art-placeholder {
            background: transparent; /* Removed gradient background */
        }

        .ability[data-ability="meteor"] .ability-art-placeholder svg,
        .ability[data-ability="meteor"] .ability-art-placeholder image {
            filter: hue-rotate(-20deg) saturate(1.4) brightness(1.1);
            animation: meteor-pulse 3.2s ease-in-out infinite alternate;
        }
        
        @keyframes meteor-pulse {
            0%   { filter: hue-rotate(-40deg) saturate(1.1) brightness(0.9); }
            100% { filter: hue-rotate(0deg) saturate(1.7) brightness(1.4); }
        }

        .ability[data-ability="meteor"] .ability-art-frame {
            border-color: rgba(239, 68, 68, 0.5);
        }

        /* Ability info area */
        .ability-info {
            margin: 5px 15px 20px 15px;
            position: relative;
            min-height: 120px;
            z-index: 5;
        }

        .ability-info-bg {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 8px;
            backdrop-filter: blur(6px);
            border: 1px solid rgba(255,255,255,0.1);
        }

        .ability-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 12px 8px 12px;
            position: relative;
            z-index: 2;
            flex-wrap: wrap;
            gap: 8px;
        }

        .ability-progression {
            display: flex;
            gap: 4px;
            align-items: center;
        }

        .ability-level {
            width: 24px;
            height: 24px;
            transition: all 0.3s ease;
        }

        .ability-level.active {
            filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.6));
            animation: ability-glow 2s ease-in-out infinite alternate;
        }

        .ability-level.inactive {
            opacity: 0.6;
            filter: grayscale(0.3);
        }

        .ability-level:hover {
            transform: scale(1.1);
        }

        @keyframes ability-glow {
            0% { 
                filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.4));
            }
            100% { 
                filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.8));
            }
        }

        .ability-name {
            color: rgba(255, 255, 255, 0.9);
            font-size: 16px;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1px;
            text-shadow: 0 0 8px rgba(255,255,255,0.3);
        }

        .ability-cost {
            position: absolute;
            bottom: 8px;
            right: 8px;
            background: rgba(59, 130, 246, 0.3);
            border: 1px solid rgba(59, 130, 246, 0.8);
            border-radius: 12px;
            padding: 4px 8px;
            font-size: 11px;
            font-weight: bold;
            color: rgba(255, 255, 255, 0.9);
            text-shadow: 0 0 5px rgba(59, 130, 246, 0.8);
            box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
            z-index: 4;
            backdrop-filter: blur(4px);
        }
        
        /* Attack cost styling - matches attack stat */
        .ability-cost.attack-cost {
            background: rgba(249, 115, 22, 0.3);
            border: 1px solid rgba(249, 115, 22, 0.8);
            text-shadow: 0 0 5px rgba(249, 115, 22, 0.8);
            box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
        }
        
        /* Defense cost styling - matches defense stat */
        .ability-cost.defense-cost {
            background: rgba(34, 197, 94, 0.3);
            border: 1px solid rgba(34, 197, 94, 0.8);
            text-shadow: 0 0 5px rgba(34, 197, 94, 0.8);
            box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
        }

        .ability-description {
            position: relative;
            z-index: 2;
            color: #e0e0e0;
            font-size: 13px;
            line-height: 1.5;
            padding: 0 12px 12px 12px;
            text-align: center;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
        }

        /* Ability-specific colors for names */
        .ability[data-ability="attack"] .ability-name {
            color: rgba(249, 115, 22, 0.9);
            text-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
        }

        .ability[data-ability="frost"] .ability-name {
            color: rgba(59, 130, 246, 0.9);
            text-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
        }

        .ability[data-ability="slam"] .ability-name {
            color: rgba(168, 85, 247, 0.9);
            text-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
        }

        .ability[data-ability="meteor"] .ability-name {
            color: rgba(239, 68, 68, 0.9);
            text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
        }
        /* Medium screens - bigger card and art area */
        @media (min-width: 768px) and (max-width: 1200px) {
            .game-card {
                width: 400px;
                height: 720px;
            }
            
            .card-art, .ability-art {
                height: 285px;
                margin: 30px 20px 10px 20px;
            }
            
            .card-name {
                margin: 10px 20px 10px 20px;
            }
            
            .card-description, .ability-info {
                margin: 10px 20px 25px 20px;
                min-height: 130px;
            }
            
            .card-description p, .ability-description {
                font-size: 15px;
                padding: 14px;
            }
            
            .card-name h2 {
                font-size: 22px;
            }
            
            .ability-name {
                font-size: 18px;
            }
            
            .level-xp-bar {
                height: 40px;
                left: 20px;
                right: 20px;
            }
            
            .xp-section {
                height: 22px;
            }
            
            .level-number {
                font-size: 18px;
            }
            
            .xp-section {
                min-width: 0; /* Allow shrinking on medium screens too */
                max-width: calc(100% - 60px); /* Leave space for level */
            }
            
            .xp-text {
                font-size: clamp(6px, 2vw, 9px); /* Better medium screen scaling */
            }
            
            .ability-selector {
                top: 85px;
                right: 20px;
                gap: 10px;
            }
            
            .ability-tab {
                width: 45px;
                height: 40px;
                font-size: 18px;
            }
            
            .stat-bar {
                height: 40px;
            }
            
            .stat-icon {
                width: 30px;
                height: 30px;
            }
            
            .stat-fill-section {
                height: 22px;
            }
            
            .stat-text {
                font-size: 12px;
            }
        }