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

/* Cross-platform consistency */
html {
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Normalize button appearance across platforms */
button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

/* Ensure consistent touch targets */
@media (pointer: coarse) {
    button, .card, .action-btn {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }
}

/* Performance optimizations */
.card, .battle-card {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    /* Optimize rendering */
    contain: layout style paint;
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Optimize card images */
.card-image {
    contain: layout style paint;
    transform: translateZ(0);
    image-rendering: optimizeQuality;
}

/* Reduce animation complexity for better performance */
.card:hover {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out !important;
}

.battle-card:hover {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out !important;
}

/* Performance mode for lower-end devices */
@media (max-width: 768px) {
    .card,
    .battle-card {
        animation-duration: 0.3s !important;
        transition-duration: 0.2s !important;
    }
    
    /* Simplify shadows on mobile */
    .card:hover,
    .battle-card:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
    }
    
    /* Disable heavy effects on mobile */
    * {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    
    /* Reduce blur effects */
    .battle-result-stats,
    .card-collection-wrapper {
        backdrop-filter: blur(2px) !important;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .card-collection {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 18px;
    }
    
    .battle-result-title {
        font-size: 42px;
        letter-spacing: 5px;
    }
    
    .battle-arena {
        padding: 30px;
    }
}

/* Large Desktop Optimizations */
@media (min-width: 1200px) {
    .card-collection {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 25px;
    }
    
    .battle-result-title {
        font-size: 56px;
        letter-spacing: 8px;
    }
    
    .battle-arena {
        padding: 50px;
        max-width: 1200px;
        margin: 20px auto;
    }
}

/* Mobile Landscape Optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .battle-result-title {
        font-size: 28px;
        letter-spacing: 2px;
    }
    
    .battle-result-content {
        gap: 8px;
    }
    
    .battle-result-stats {
        padding: 12px;
        margin-top: 10px;
    }
    
    .battle-arena {
        padding: 15px;
        margin: 10px 0;
    }
}

/* Container Responsiveness */
.game-container {
    max-width: 100vw;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .game-container {
        padding: 0 10px;
    }
}

/* Smooth scrolling and reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #667eea 100%),
                url('banner.png') center/cover no-repeat fixed;
    /* Fallback for browsers that don't support blend modes */
    background-color: #2a5298;
    background-blend-mode: overlay;
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    /* Ensure consistent line height and text rendering */
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header content styling */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

/* Website logo styling */
.website-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.website-logo:hover {
    transform: scale(1.1);
}

header h1 {
    color: white;
    font-size: 2.5em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive logo styling */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .website-logo {
        width: 40px;
        height: 40px;
    }
    
    header h1 {
        font-size: 2em;
    }
}

.game-status {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    color: white;
    font-weight: bold;
}

/* Enhanced Card Selection */
.card-selection {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-selection:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.selection-header {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    padding: 25px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.selection-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.selection-header h2 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 2.2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.collection-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.card-count {
    background: rgba(45, 55, 72, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.card-collection-wrapper {
    padding: 30px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.card-collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 0;
    padding: 0;
    transition: all 0.3s ease;
}

/* Mobile Card Collection Optimizations */
@media (max-width: 768px) {
    .card-collection-wrapper {
        padding: 15px; /* Reduced padding for mobile */
    }
    
    .card-collection {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Smaller cards on mobile */
        gap: 15px;
    }
}

.card-collection::-webkit-scrollbar {
    width: 8px;
}

.card-collection::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.card-collection::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.card-collection::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    background-clip: content-box;
}

.selection-actions {
    padding: 25px 30px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Card Styles */
.card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    /* Fallback for browsers that don't support gradients */
    background-color: #ffffff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    animation: pokemonSlideIn 0.8s ease-out forwards, pokemonCardFloat 3s ease-in-out infinite 1s;
    opacity: 0;
    transform: translateX(-100px) rotateY(-15deg);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Ensure consistent aspect ratio across platforms */
    aspect-ratio: 2.5/3.5;
    width: 100%;
    height: auto;
    /* Prevent text selection on cards */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Ensure smooth rendering */
    -webkit-font-smoothing: antialiased;
}

/* Pokemon-style card selection animations */
@keyframes pokemonSlideIn {
    0% {
        transform: translate3d(-50px, 20px, 0) scale(0.9);
        opacity: 0;
    }
    50% {
        transform: translate3d(10px, -5px, 0) scale(1.02);
        opacity: 0.8;
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }
}

@keyframes pokemonCardFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0);
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: translate3d(0, -8px, 0);
        box-shadow: 0 12px 35px rgba(255, 215, 0, 0.4);
    }
}

@keyframes pokemonCardGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3), 
                    0 0 20px rgba(255, 255, 255, 0.1),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6), 
                    0 0 30px rgba(255, 255, 255, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

@keyframes pokemonSelectPulse {
    0% {
        transform: scale(1) rotateY(0deg);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        transform: scale(1.05) rotateY(5deg);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 
                    0 0 50px rgba(255, 255, 255, 0.3);
    }
    100% {
        transform: scale(1) rotateY(0deg);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
}

@keyframes cardSlideIn {
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-15px) scale(1.08) rotateY(8deg) rotateX(5deg);
    animation: pokemonCardGlow 1.5s ease-in-out infinite, pokemonCardFloat 3s ease-in-out infinite;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 
                0 0 30px rgba(255, 255, 255, 0.2),
                0 0 60px rgba(255, 215, 0, 0.3);
    filter: brightness(1.15) saturate(1.3) contrast(1.1);
}

.card:hover .card-image {
    transform: scale(1.1) rotate(2deg);
    filter: brightness(1.2) saturate(1.4);
}

.card:hover .card-name {
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    transform: scale(1.05);
}

.card:hover .card-stats {
    transform: translateY(-2px);
}

.card:hover .stat {
    animation: statGlow 0.6s ease-in-out;
}

/* Mobile Card Hover Optimizations */
@media (max-width: 768px) {
    .card:hover {
        transform: translateY(-8px) scale(1.05); /* Simplified 3D transforms */
        animation: none; /* Disable heavy animations */
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3); /* Reduced shadow complexity */
        filter: brightness(1.1); /* Simplified filter */
    }
    
    .card:hover .card-image {
        transform: scale(1.05); /* Reduced scale and no rotation */
        filter: brightness(1.1);
    }
    
    .card:hover .card-name {
        text-shadow: none; /* Remove glow effect */
        transform: none;
    }
    
    .card:hover .stat {
        animation: none; /* Disable stat glow animation */
    }
}

@keyframes statGlow {
    0%, 100% { text-shadow: none; }
    50% { text-shadow: 0 0 10px currentColor; }
}

/* Card Active State */
.card:active {
    transform: translateY(-8px) scale(1.02) rotateY(4deg);
    transition: all 0.1s ease;
}

/* Card Focus State */
.card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.5);
}

.card:hover::before {
    transform: translateX(100%);
}

.card.selected {
    border-color: #ffd700;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    transform: scale(1.1) rotateY(0deg);
    animation: pokemonSelectPulse 1.2s ease-in-out infinite;
    z-index: 15;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes selectedPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 20px 40px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 25px 50px rgba(0, 0, 0, 0.4); }
}

.card-image {
    width: 100%;
    height: 100%;
    background: #f7fafc;
    border-radius: 10px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    color: #718096;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-name {
    display: none;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 6px;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat {
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 32px;
    text-align: center;
}

.stat.attack { background: #fed7d7; color: #c53030; }
.stat.defense { background: #c6f6d5; color: #2f855a; }
.stat.health { background: #bee3f8; color: #2b6cb0; }

/* Yu-Gi-Oh/Pokémon Style Battle Arena */
.battle-arena {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(30, 30, 60, 0.9) 50%, 
        rgba(0, 0, 0, 0.8) 100%),
        radial-gradient(circle at 50% 50%, 
            rgba(100, 0, 0, 0.4) 0%, 
            rgba(50, 0, 100, 0.6) 50%, 
            rgba(0, 0, 50, 0.8) 100%);
    border-radius: 25px;
    padding: 50px 40px;
    margin: 30px 0;
    border: 4px solid #ffd700;
    position: relative;
    perspective: 1200px;
    transform-style: preserve-3d;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        inset 0 0 100px rgba(255, 215, 0, 0.3),
        0 0 150px rgba(255, 0, 0, 0.4),
        0 0 200px rgba(0, 0, 255, 0.3);
    backdrop-filter: blur(15px);
    overflow: visible;
    animation: yugiohArenaGlow 6s ease-in-out infinite;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Arial Black', 'Impact', sans-serif;
}

.battle-arena:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                0 0 130px rgba(255, 215, 0, 0.2);
}

/* Mobile Battle Arena Optimizations */
@media (max-width: 768px) {
    .battle-arena {
        padding: 20px; /* Reduced padding for mobile */
        margin: 10px 0;
        animation: none; /* Disable glow animation */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* Simplified shadow */
        backdrop-filter: blur(5px); /* Reduced blur */
    }
    
    .battle-arena:hover {
        transform: none; /* Disable hover transform */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
}

@keyframes yugiohArenaGlow {
    0% {
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.6),
            inset 0 0 100px rgba(255, 215, 0, 0.3),
            0 0 150px rgba(255, 0, 0, 0.4),
            0 0 200px rgba(0, 0, 255, 0.3);
    }
    33% {
        box-shadow: 
            0 30px 90px rgba(0, 0, 0, 0.7),
            inset 0 0 120px rgba(255, 215, 0, 0.4),
            0 0 180px rgba(255, 0, 0, 0.5),
            0 0 250px rgba(0, 0, 255, 0.4);
    }
    66% {
        box-shadow: 
            0 35px 100px rgba(0, 0, 0, 0.8),
            inset 0 0 140px rgba(255, 215, 0, 0.5),
            0 0 200px rgba(255, 0, 0, 0.6),
            0 0 300px rgba(0, 0, 255, 0.5);
    }
    100% {
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.6),
            inset 0 0 100px rgba(255, 215, 0, 0.3),
            0 0 150px rgba(255, 0, 0, 0.4),
            0 0 200px rgba(0, 0, 255, 0.3);
    }
}

@keyframes shakeEffect {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-3px) rotateZ(-1deg); }
    20% { transform: translateX(3px) rotateZ(1deg); }
    30% { transform: translateX(-2px) rotateZ(-0.5deg); }
    40% { transform: translateX(2px) rotateZ(0.5deg); }
    50% { transform: translateX(-1px) rotateZ(-0.2deg); }
    60% { transform: translateX(1px) rotateZ(0.2deg); }
    70% { transform: translateX(-0.5px); }
    80% { transform: translateX(0.5px); }
    90% { transform: translateX(0); }
}

@keyframes particleEffect {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: scale(1) rotate(90deg);
    }
    80% {
        opacity: 1;
        transform: scale(1.2) rotate(270deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 0 0 50px rgba(255, 215, 0, 0.4);
    }
}

/* Victory Effects Animations */
@keyframes victoryExplosion {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(3) rotate(360deg);
        opacity: 0;
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes victoryTextAppear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotateY(90deg);
        opacity: 0;
        filter: blur(10px);
    }
    30% {
        transform: translate(-50%, -50%) scale(1.2) rotateY(0deg);
        opacity: 0.8;
        filter: blur(2px);
    }
    60% {
        transform: translate(-50%, -50%) scale(1) rotateY(0deg);
        opacity: 1;
        filter: blur(0px);
    }
    100% {
        transform: translate(-50%, -50%) scale(0.9) rotateY(0deg);
        opacity: 0;
        filter: blur(5px);
    }
}

@keyframes soundWaveExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Enhanced Victory Text Overlay - Optimized for Performance */
.victory-text-overlay {
    font-family: 'Arial Black', Arial, sans-serif;
    background: linear-gradient(45deg, currentColor, transparent, currentColor);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 20px currentColor);
}

.victory-text-overlay span {
    display: inline-block;
    animation: victoryBounce 0.6s ease-in-out infinite alternate;
}

@keyframes victoryBounce {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-10px) scale(1.05);
    }
}

/* Mobile Optimizations - Reduce Heavy Effects */
@media (max-width: 768px) {
    .victory-text-overlay {
        filter: none; /* Remove heavy drop-shadow on mobile */
    }
    
    .victory-text-overlay span {
        animation: none; /* Disable bounce animation on mobile */
    }
    
    /* Simplify battle result animations for mobile */
    .battle-result.victory {
        animation: mobileVictoryGlow 2s ease-in-out infinite alternate;
    }
    
    .battle-result.defeat {
        animation: mobileDefeatPulse 1.5s ease-in-out infinite alternate;
    }
}

@keyframes mobileVictoryGlow {
    0% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
        text-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
    }
    100% {
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.8);
        text-shadow: 0 0 15px rgba(34, 197, 94, 1);
    }
}

@keyframes mobileDefeatPulse {
    0% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    }
    100% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
        text-shadow: 0 0 15px rgba(239, 68, 68, 1);
    }
}

/* Modern Battle Result Content */
.battle-result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 3;
}

.battle-result-title {
    font-size: 48px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 6px;
    margin: 0;
    animation: titlePulse 2s ease-in-out infinite alternate;
}

.battle-result-subtitle {
    font-size: 18px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: none;
    letter-spacing: 1px;
    margin: 0;
    animation: subtitleFade 3s ease-in-out infinite alternate;
}

/* Mobile Battle Result Optimizations */
@media (max-width: 768px) {
    .battle-result-content {
        gap: 10px;
        padding: 0 10px;
    }
    
    .battle-result-title {
        font-size: 32px; /* Smaller title for mobile */
        letter-spacing: 3px;
        animation: none; /* Disable pulse animation */
    }
    
    .battle-result-subtitle {
        font-size: 16px;
        animation: none; /* Disable fade animation */
    }
}

.battle-result-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 300px;
}

/* Mobile Stats Optimizations */
@media (max-width: 768px) {
    .battle-result-stats {
        min-width: 280px;
        padding: 15px;
        margin-top: 15px;
        backdrop-filter: blur(5px); /* Reduced blur for performance */
    }
}

.result-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 0 10px currentColor;
}

@keyframes titlePulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    100% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

@keyframes subtitleFade {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Battle Result Action Buttons */
.battle-result-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Mobile Action Buttons Optimizations */
@media (max-width: 768px) {
    .battle-result-actions {
        gap: 10px;
        margin-top: 20px;
        flex-direction: column; /* Stack buttons vertically on mobile */
        align-items: center;
    }
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
}

/* Mobile Action Button Optimizations */
@media (max-width: 768px) {
    .action-btn {
        min-width: 200px; /* Wider buttons for mobile */
        padding: 14px 28px; /* Larger touch targets */
        font-size: 15px;
    }
    
    .action-btn::before {
        display: none; /* Disable shimmer effect on mobile */
    }
    
    .action-btn:hover {
        transform: translateY(-1px) scale(1.02); /* Reduced hover effect */
    }
}

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

.action-btn:hover::before {
    left: 100%;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.action-btn.primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    filter: brightness(1.1);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.action-btn.secondary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.6);
    filter: brightness(1.1);
}

.action-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 5px currentColor);
}

.btn-text {
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.battle-arena::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 191, 255, 0.1) 0%, transparent 50%),
        linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.05) 50%, transparent 60%);
    border-radius: 20px;
    pointer-events: none;
    animation: particleEffect 3s ease-in-out infinite;
}

.battle-arena::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(10px);
    z-index: -1;
}

.battle-arena h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #4a5568;
    font-size: 1.8em;
}

.battle-field {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    perspective: 1500px;
    transform-style: preserve-3d;
}

.battle-field::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    background: 
        radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 60%),
        radial-gradient(circle at 30% 30%, rgba(255, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 0, 255, 0.3) 0%, transparent 50%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: yugiohFieldPulse 4s ease-in-out infinite;
    z-index: 0;
    filter: blur(15px);
}

@keyframes yugiohFieldPulse {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.4;
        filter: blur(15px) hue-rotate(0deg);
    }
    33% {
        transform: translate(-50%, -50%) scale(1.3) rotate(120deg);
        opacity: 0.7;
        filter: blur(20px) hue-rotate(120deg);
    }
    66% {
        transform: translate(-50%, -50%) scale(1.1) rotate(240deg);
        opacity: 0.6;
        filter: blur(18px) hue-rotate(240deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(360deg);
        opacity: 0.4;
        filter: blur(15px) hue-rotate(360deg);
    }
}

.battle-cards {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 80px;
    margin: 40px 0;
    position: relative;
    transform-style: preserve-3d;
}

.battle-cards::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%) rotateX(90deg);
    border-radius: 50%;
    z-index: 0;
}

.player-side, .opponent-side {
    text-align: center;
}

.player-side h3, .opponent-side h3 {
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 215, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.4);
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.battle-card {
    width: 280px;
    height: 380px;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.9) 0%, 
        rgba(118, 75, 162, 0.9) 30%, 
        rgba(60, 30, 100, 0.9) 70%, 
        rgba(30, 15, 60, 0.9) 100%);
    border-radius: 18px;
    padding: 25px;
    border: 4px solid #ffd700;
    position: relative;
    transform: scale(1.15) rotateX(8deg) perspective(1000px);
    transform-style: preserve-3d;
    animation: yugiohCardFloat 4s ease-in-out infinite, yugiohCardGlow 3s ease-in-out infinite;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 50px rgba(255, 215, 0, 0.8),
        0 0 100px rgba(255, 0, 0, 0.4),
        0 0 150px rgba(0, 0, 255, 0.3),
        inset 0 0 50px rgba(255, 255, 255, 0.1);
    z-index: 2;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.battle-card.attacking {
    animation: attackAnimation 1.2s ease-in-out, shakeEffect 0.1s ease-in-out 0.3s;
    z-index: 10;
}

.battle-card.defending {
    animation: defendAnimation 1s ease-in-out, shakeEffect 0.2s ease-in-out 0.2s, defeatCardShake 0.3s ease-in-out 1.2s 2;
    z-index: 5;
    filter: brightness(0.7) contrast(1.3) saturate(1.5);
}

.battle-card.defeated {
    animation: defeatCardAnimation 2s ease-in-out, defeatCardShake 0.4s ease-in-out 0.5s 3;
    z-index: 3;
    filter: brightness(0.5) contrast(2) saturate(0.3) blur(1px);
    transform: scale(0.9) rotateX(-15deg) rotateY(10deg);
    opacity: 0.7;
}

.battle-card.winner {
    animation: victoryAnimation 3s ease-in-out infinite, glowPulse 0.5s ease-in-out infinite;
    transform: scale(1.2) rotateY(360deg);
    z-index: 15;
}

/* Enhanced Battle Field Effects */
.battle-field.battle-active {
    animation: backgroundPulse 4s ease-in-out infinite;
    position: relative;
}

.battle-field.battle-active::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: particleEffect 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Enhanced VS Text Effects */
.vs-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: glowPulse 1.5s ease-in-out infinite;
    z-index: -1;
}

/* Particle Effects */
.battle-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ffd700 0%, #ff6b00 100%);
    border-radius: 50%;
    animation: particleEffect 1.5s ease-out infinite;
    pointer-events: none;
}

.battle-particle:nth-child(2n) {
    background: radial-gradient(circle, #00ff88 0%, #0066ff 100%);
    animation-delay: 0.3s;
}

.battle-particle:nth-child(3n) {
    background: radial-gradient(circle, #ff0066 0%, #ff6600 100%);
    animation-delay: 0.6s;
}

/* Enhanced Card Hover Effects */
.card:hover .card-image {
    transform: scale(1.05);
    filter: brightness(1.1) saturate(1.2);
}

.card:hover .card-stats {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: white;
}

@keyframes backgroundPulse {
    0%, 100% {
        background: linear-gradient(135deg, rgba(45, 55, 72, 0.95) 0%, rgba(74, 85, 104, 0.95) 100%);
    }
    50% {
        background: linear-gradient(135deg, rgba(45, 55, 72, 0.98) 0%, rgba(74, 85, 104, 0.98) 100%);
    }
}

@keyframes vsPulse {
    0%, 100% {
        transform: scale(1) rotateY(0deg);
        text-shadow: 2px 2px 12px rgba(255, 215, 0, 0.6);
    }
    50% {
        transform: scale(1.1) rotateY(0deg);
        text-shadow: 4px 4px 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 255, 255, 0.8);
    }
}

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

@keyframes attackAnimation {
    0% {
        transform: scale(1.1) rotateX(10deg) translateX(0);
        filter: brightness(1) saturate(1);
    }
    15% {
        transform: scale(1.25) rotateX(12deg) translateX(20px) rotateZ(3deg);
        box-shadow: 0 20px 50px rgba(255, 0, 0, 0.5), 
                    0 0 40px rgba(255, 215, 0, 0.8),
                    0 40px 80px rgba(255, 0, 0, 0.3);
        filter: brightness(1.2) saturate(1.3);
        animation: shakeEffect 0.1s ease-in-out;
    }
    25% {
        transform: scale(1.3) rotateX(15deg) translateX(30px) rotateZ(5deg);
        box-shadow: 0 25px 60px rgba(255, 0, 0, 0.6), 
                    0 0 50px rgba(255, 215, 0, 1),
                    0 50px 100px rgba(255, 0, 0, 0.4);
        filter: brightness(1.4) saturate(1.6);
    }
    50% {
        transform: scale(1.4) rotateX(20deg) translateX(50px) rotateZ(10deg);
        box-shadow: 0 30px 70px rgba(255, 0, 0, 0.8), 
                    0 0 60px rgba(255, 215, 0, 1),
                    0 60px 120px rgba(255, 0, 0, 0.6);
        filter: brightness(1.6) saturate(2);
    }
    75% {
        transform: scale(1.2) rotateX(12deg) translateX(20px) rotateZ(3deg);
        filter: brightness(1.3) saturate(1.4);
    }
    100% {
        transform: scale(1.1) rotateX(10deg) translateX(0);
        filter: brightness(1) saturate(1);
    }
}

@keyframes defendAnimation {
    0% {
        transform: scale(1.1) rotateX(10deg);
        filter: brightness(1);
    }
    10% {
        transform: scale(1.05) rotateX(8deg) translateX(-3px) rotateZ(-1deg);
        animation: shakeEffect 0.2s ease-in-out;
    }
    25% {
        transform: scale(0.9) rotateX(5deg) translateX(-10px);
        box-shadow: 0 10px 25px rgba(0, 0, 255, 0.6), 
                    0 0 40px rgba(0, 191, 255, 0.8),
                    0 0 80px rgba(100, 200, 255, 0.4);
        filter: brightness(1.3) hue-rotate(30deg);
    }
    50% {
        transform: scale(0.85) rotateX(0deg) translateX(-15px);
        box-shadow: 0 8px 20px rgba(0, 0, 255, 0.8), 
                    0 0 50px rgba(0, 191, 255, 1),
                    0 0 100px rgba(150, 220, 255, 0.6);
        filter: brightness(1.5) hue-rotate(45deg);
    }
    75% {
        transform: scale(0.95) rotateX(5deg) translateX(-5px);
        filter: brightness(1.2) hue-rotate(15deg);
    }
    100% {
        transform: scale(1.1) rotateX(10deg);
        filter: brightness(1);
    }
}

@keyframes victoryAnimation {
    0% {
        transform: scale(1.1) rotateX(10deg) rotateY(0deg);
        filter: brightness(1) hue-rotate(0deg);
    }
    15% {
        transform: scale(1.2) rotateX(12deg) rotateY(45deg);
        box-shadow: 0 20px 50px rgba(0, 255, 0, 0.5), 
                    0 0 60px rgba(255, 215, 0, 0.8),
                    0 40px 80px rgba(0, 255, 0, 0.3);
        filter: brightness(1.3) hue-rotate(60deg);
        animation: glowPulse 0.3s ease-in-out infinite;
    }
    25% {
        transform: scale(1.3) rotateX(15deg) rotateY(90deg);
        box-shadow: 0 25px 60px rgba(0, 255, 0, 0.6), 
                    0 0 80px rgba(255, 215, 0, 1),
                    0 50px 100px rgba(0, 255, 0, 0.4),
                    0 0 150px rgba(100, 255, 150, 0.5);
        filter: brightness(1.5) hue-rotate(120deg);
    }
    50% {
        transform: scale(1.4) rotateX(20deg) rotateY(180deg);
        box-shadow: 0 30px 70px rgba(0, 255, 0, 0.8), 
                    0 0 100px rgba(255, 215, 0, 1),
                    0 60px 120px rgba(0, 255, 0, 0.6),
                    0 0 200px rgba(150, 255, 200, 0.7);
        filter: brightness(1.7) hue-rotate(180deg);
    }
    75% {
        transform: scale(1.3) rotateX(15deg) rotateY(270deg);
        filter: brightness(1.4) hue-rotate(240deg);
    }
    100% {
        transform: scale(1.2) rotateX(10deg) rotateY(360deg);
        filter: brightness(1.2) hue-rotate(360deg);
    }
}

.battle-card::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to bottom, 
                rgba(102, 126, 234, 0.3) 0%, 
                rgba(118, 75, 162, 0.2) 50%, 
                transparent 100%);
    border-radius: 15px;
    transform: rotateX(180deg) translateZ(-1px);
    opacity: 0.6;
    filter: blur(2px);
    z-index: 1;
}

@keyframes yugiohCardFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotateX(8deg);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: translate3d(0, -10px, 0) rotateX(10deg);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    }
}

@keyframes yugiohCardGlow {
    0%, 100% {
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 
                    0 0 30px rgba(255, 215, 0, 0.6),
                    0 30px 60px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 
                    0 0 40px rgba(255, 215, 0, 0.8),
                    0 40px 80px rgba(0, 0, 0, 0.3);
    }
}

.battle-card.player { border-color: #4299e1; }
.battle-card.opponent { border-color: #f56565; }

.card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a0aec0;
    font-style: italic;
    text-align: center;
}

.vs-section {
    text-align: center;
    position: relative;
    z-index: 10;
    perspective: 1200px;
}

.vs-text {
    font-size: 4.5em;
    font-weight: 900;
    color: #ffd700;
    margin-bottom: 30px;
    text-shadow: 
        4px 4px 15px rgba(0, 0, 0, 0.9),
        0 0 25px rgba(255, 215, 0, 0.8),
        0 0 50px rgba(255, 0, 0, 0.6),
        0 0 75px rgba(0, 0, 255, 0.4);
    letter-spacing: 4px;
    animation: yugiohVsPulse 3s ease-in-out infinite;
    position: relative;
    z-index: 10;
    text-transform: uppercase;
    transform-style: preserve-3d;
    font-family: 'Impact', 'Arial Black', sans-serif;
}

@keyframes yugiohVsPulse {
    0% {
        transform: scale(1) rotateY(0deg) translateZ(0);
        text-shadow: 
            4px 4px 15px rgba(0, 0, 0, 0.9),
            0 0 25px rgba(255, 215, 0, 0.8),
            0 0 50px rgba(255, 0, 0, 0.6),
            0 0 75px rgba(0, 0, 255, 0.4);
        color: #ffd700;
        filter: hue-rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotateY(15deg) translateZ(20px);
        text-shadow: 
            6px 6px 25px rgba(0, 0, 0, 1),
            0 0 40px rgba(255, 215, 0, 1),
            0 0 80px rgba(255, 0, 0, 0.8),
            0 0 120px rgba(0, 0, 255, 0.6);
        color: #ffff00;
        filter: hue-rotate(90deg);
    }
    50% {
        transform: scale(1.3) rotateY(0deg) translateZ(40px);
        text-shadow: 
            8px 8px 35px rgba(0, 0, 0, 1),
            0 0 60px rgba(255, 215, 0, 1),
            0 0 120px rgba(255, 0, 0, 1),
            0 0 180px rgba(0, 0, 255, 0.8);
        color: #ffffff;
        filter: hue-rotate(180deg);
    }
    75% {
        transform: scale(1.2) rotateY(-15deg) translateZ(20px);
        text-shadow: 
            6px 6px 25px rgba(0, 0, 0, 1),
            0 0 40px rgba(255, 215, 0, 1),
            0 0 80px rgba(255, 0, 0, 0.8),
            0 0 120px rgba(0, 0, 255, 0.6);
        color: #ffff00;
        filter: hue-rotate(270deg);
    }
    100% {
        transform: scale(1) rotateY(0deg) translateZ(0);
        text-shadow: 
            4px 4px 15px rgba(0, 0, 0, 0.9),
            0 0 25px rgba(255, 215, 0, 0.8),
            0 0 50px rgba(255, 0, 0, 0.6),
            0 0 75px rgba(0, 0, 255, 0.4);
        color: #ffd700;
        filter: hue-rotate(360deg);
    }
}

.player-stats, .opponent-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Yu-Gi-Oh/Pokémon Style Health Bars */
.health-bar-container {
    width: 280px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    border: 2px solid #ffd700;
    position: relative;
    overflow: hidden;
    margin: 15px auto 10px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.health-bar {
    height: 100%;
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
    position: relative;
    overflow: hidden;
}

.health-bar.player {
    background: linear-gradient(90deg, #00ff88 0%, #00cc66 50%, #00aa44 100%);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.health-bar.opponent {
    background: linear-gradient(90deg, #ff6b6b 0%, #ff4757 50%, #ff3838 100%);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.health-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: healthBarShine 2s ease-in-out infinite;
}

@keyframes healthBarShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.health-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

.health-bar.danger {
    background: linear-gradient(90deg, #ff3838 0%, #ff0000 50%, #cc0000 100%);
    animation: healthDangerPulse 1s ease-in-out infinite;
}

@keyframes healthDangerPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 56, 56, 0.6); }
    50% { box-shadow: 0 0 30px rgba(255, 56, 56, 0.9), 0 0 40px rgba(255, 0, 0, 0.6); }
}

.health-bar.warning {
    background: linear-gradient(90deg, #ffa500 0%, #ff8c00 50%, #ff6b00 100%);
    animation: healthWarningPulse 2s ease-in-out infinite;
}

@keyframes healthWarningPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 165, 0, 0.5); }
    50% { box-shadow: 0 0 25px rgba(255, 165, 0, 0.8); }
}

/* Health Bar Damage Effect */
.health-bar.damage {
    animation: healthDamageFlash 0.3s ease-in-out;
}

@keyframes healthDamageFlash {
    0%, 100% { background: linear-gradient(90deg, #ff3838 0%, #ff0000 50%, #cc0000 100%); }
    50% { background: linear-gradient(90deg, #ffffff 0%, #ffcccc 50%, #ff9999 100%); }
}

/* Health Bar Heal Effect */
.health-bar.heal {
    animation: healthHealFlash 0.3s ease-in-out;
}

@keyframes healthHealFlash {
    0%, 100% { background: linear-gradient(90deg, #00ff88 0%, #00cc66 50%, #00aa44 100%); }
    50% { background: linear-gradient(90deg, #ffffff 0%, #ccffcc 50%, #99ff99 100%); }
}

/* Enhanced Battle Log */
.battle-log {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(26, 26, 46, 0.9) 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 25px 0;
    max-height: 250px;
    overflow-y: auto;
    border: 2px solid #ffd700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
}

.battle-log::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #ff8c00, #ffd700, #ff8c00);
    border-radius: 17px;
    z-index: -1;
    animation: borderGlow 3s linear infinite;
}

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

.battle-log::-webkit-scrollbar {
    width: 6px;
}

.battle-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.battle-log::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-radius: 10px;
}

.battle-log h3 {
    color: #ffd700;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }
    100% { text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.5); }
}

#battleLogContent {
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.6;
}

.log-entry {
    margin: 8px 0;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.log-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.log-entry:hover::before {
    left: 100%;
}

.log-entry.info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #fff;
    border-left: 4px solid #667eea;
}

.log-entry.win {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2) 0%, rgba(0, 200, 0, 0.1) 100%);
    color: #00ff88;
    font-weight: bold;
    border-left: 4px solid #00ff88;
    animation: winPulse 1s ease-in-out 3;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

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

.log-entry.lose {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.2) 0%, rgba(200, 0, 0, 0.1) 100%);
    color: #ff6b6b;
    font-weight: bold;
    border-left: 4px solid #ff6b6b;
    animation: losePulse 1s ease-in-out 2;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
}

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

/* Modern Battle Result Container */
/* Modern TCG-style Battle Result - Horizontal Layout */
.battle-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    margin: 40px auto;
    max-width: 800px;
    border-radius: 25px;
    animation: yugiohResultSlideIn 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.9) 0%, 
        rgba(25, 25, 112, 0.8) 50%, 
        rgba(0, 0, 139, 0.9) 100%
    );
    border: 4px solid transparent;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 120px rgba(75, 0, 130, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.battle-result::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, 
        #ffd700, #ff8c00, #ff4500, #ff0000,
        #ffd700, #ff8c00, #ff4500, #ff0000
    );
    border-radius: 27px;
    z-index: -1;
    animation: yugiohBorderGlow 3s ease-in-out infinite;
    filter: blur(10px);
}

@keyframes yugiohResultSlideIn {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.9) rotateX(15deg);
        filter: blur(10px);
    }
    50% {
        opacity: 0.8;
        transform: translateY(20px) scale(1.02) rotateX(5deg);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}

@keyframes yugiohBorderGlow {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
        filter: blur(10px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
        filter: blur(15px);
    }
}

/* TCG-style slide animation */
@keyframes tcgResultSlide {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Subtle glow animation */
@keyframes tcgGlow {
    0%, 100% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 6px 15px rgba(0, 0, 0, 0.15);
    }
}

/* TCG Victory Style - Professional Design */
.battle-result.victory {
    background: linear-gradient(135deg, 
        rgba(0, 128, 0, 0.9) 0%, 
        rgba(50, 205, 50, 0.8) 25%, 
        rgba(144, 238, 144, 0.7) 50%, 
        rgba(152, 251, 152, 0.8) 75%, 
        rgba(0, 255, 127, 0.9) 100%
    );
    color: #ffffff;
    border: 4px solid #32cd32;
    box-shadow: 
        0 35px 90px rgba(50, 205, 50, 0.4),
        0 0 150px rgba(144, 238, 144, 0.6),
        inset 0 3px 0 rgba(255, 255, 255, 0.5);
    animation: yugiohVictorySlideIn 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.9);
}

.battle-result.victory::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #38a169, #48bb78, #68d391, #38a169);
    border-radius: 20px;
    z-index: -1;
    animation: victoryBorderGlow 3s ease-in-out infinite;
}

/* TCG Defeat Style - Professional Design */
.battle-result.defeat {
    background: linear-gradient(135deg, 
        rgba(139, 0, 0, 0.95) 0%, 
        rgba(178, 34, 34, 0.9) 15%, 
        rgba(220, 20, 60, 0.85) 35%, 
        rgba(255, 69, 0, 0.9) 60%, 
        rgba(255, 99, 71, 0.95) 85%, 
        rgba(139, 0, 0, 0.95) 100%
    );
    color: #ffffff;
    border: 5px solid #dc143c;
    box-shadow: 
        0 40px 120px rgba(220, 20, 60, 0.6),
        0 0 200px rgba(255, 69, 0, 0.8),
        0 0 300px rgba(139, 0, 0, 0.4),
        inset 0 4px 0 rgba(255, 255, 255, 0.6),
        inset 0 -4px 0 rgba(0, 0, 0, 0.4);
    animation: yugiohDefeatSlideIn 2s cubic-bezier(0.4, 0, 0.2, 1), defeatShakeEffect 0.5s ease-in-out 2s 3;
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 1),
        0 0 60px rgba(255, 69, 0, 0.8),
        3px 3px 6px rgba(0, 0, 0, 1);
    position: relative;
    overflow: visible;
}

.battle-result.defeat::after {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 0, 0, 0.3) 0%, transparent 30%),
        radial-gradient(circle at 80% 30%, rgba(255, 69, 0, 0.2) 0%, transparent 25%),
        radial-gradient(circle at 30% 80%, rgba(220, 20, 60, 0.25) 0%, transparent 35%),
        radial-gradient(circle at 70% 70%, rgba(139, 0, 0, 0.2) 0%, transparent 20%);
    pointer-events: none;
    z-index: -1;
    animation: defeatParticleEffect 3s ease-in-out infinite;
    border-radius: 50px;
}

@keyframes yugiohVictorySlideIn {
    0% {
        opacity: 0;
        transform: translateY(80px) scale(0.8) rotateX(20deg);
        filter: blur(15px) hue-rotate(0deg);
    }
    30% {
        opacity: 0.5;
        transform: translateY(40px) scale(0.95) rotateX(10deg);
        filter: blur(8px) hue-rotate(90deg);
    }
    60% {
        opacity: 0.8;
        transform: translateY(10px) scale(1.05) rotateX(5deg);
        filter: blur(4px) hue-rotate(180deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0px) hue-rotate(360deg);
    }
}

@keyframes yugiohDefeatSlideIn {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0.7) rotateX(-30deg) rotateZ(-5deg);
        filter: blur(20px) brightness(0.3) contrast(2) saturate(0.5);
    }
    15% {
        opacity: 0.3;
        transform: translateY(60px) scale(0.85) rotateX(-15deg) rotateZ(3deg);
        filter: blur(15px) brightness(0.5) contrast(1.8) saturate(0.7);
    }
    30% {
        opacity: 0.5;
        transform: translateY(30px) scale(0.95) rotateX(-8deg) rotateZ(-2deg);
        filter: blur(10px) brightness(0.7) contrast(1.5) saturate(0.9);
    }
    50% {
        opacity: 0.8;
        transform: translateY(10px) scale(1.08) rotateX(-3deg) rotateZ(1deg);
        filter: blur(5px) brightness(0.9) contrast(1.2) saturate(1.1);
    }
    70% {
        opacity: 0.9;
        transform: translateY(-5px) scale(1.02) rotateX(2deg) rotateZ(-0.5deg);
        filter: blur(2px) brightness(1.1) contrast(1.1) saturate(1.2);
    }
    85% {
        opacity: 1;
        transform: translateY(2px) scale(0.98) rotateX(-1deg) rotateZ(0.2deg);
        filter: blur(1px) brightness(1.05) contrast(1.05) saturate(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg) rotateZ(0deg);
        filter: blur(0px) brightness(1) contrast(1) saturate(1);
    }
}

.battle-result.defeat::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #e53e3e, #f56565, #fc8181, #e53e3e);
    border-radius: 20px;
    z-index: -1;
    animation: defeatBorderGlow 3s ease-in-out infinite;
}

/* Border Glow Animations */
@keyframes victoryBorderGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

@keyframes defeatBorderGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1) rotate(0deg);
    }
    25% {
        opacity: 0.8;
        transform: scale(1.03) rotate(1deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) rotate(-1deg);
    }
    75% {
        opacity: 0.9;
        transform: scale(1.02) rotate(0.5deg);
    }
}

@keyframes defeatShakeEffect {
    0%, 100% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    10% {
        transform: translateX(-3px) translateY(-2px) rotate(-0.5deg);
    }
    20% {
        transform: translateX(4px) translateY(1px) rotate(0.3deg);
    }
    30% {
        transform: translateX(-2px) translateY(-3px) rotate(-0.2deg);
    }
    40% {
        transform: translateX(3px) translateY(2px) rotate(0.4deg);
    }
    50% {
        transform: translateX(-4px) translateY(-1px) rotate(-0.3deg);
    }
    60% {
        transform: translateX(2px) translateY(3px) rotate(0.2deg);
    }
    70% {
        transform: translateX(-1px) translateY(-2px) rotate(-0.1deg);
    }
    80% {
        transform: translateX(1px) translateY(1px) rotate(0.1deg);
    }
    90% {
        transform: translateX(-1px) translateY(0px) rotate(0deg);
    }
}

@keyframes defeatParticleEffect {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(0deg);
        filter: blur(5px);
    }
    20% {
        opacity: 0.6;
        transform: scale(1.1) rotate(72deg);
        filter: blur(3px);
    }
    40% {
        opacity: 0.8;
        transform: scale(1.3) rotate(144deg);
        filter: blur(2px);
    }
    60% {
        opacity: 1;
        transform: scale(1.5) rotate(216deg);
        filter: blur(1px);
    }
    80% {
        opacity: 0.7;
        transform: scale(1.2) rotate(288deg);
        filter: blur(2px);
    }
    100% {
        opacity: 0.3;
        transform: scale(0.9) rotate(360deg);
        filter: blur(4px);
    }
}

@keyframes defeatCardAnimation {
    0% {
        transform: scale(1.15) rotateX(8deg) rotateY(0deg) rotateZ(0deg);
        filter: brightness(1) contrast(1) saturate(1) blur(0px);
        opacity: 1;
    }
    15% {
        transform: scale(1.1) rotateX(5deg) rotateY(-5deg) rotateZ(-2deg);
        filter: brightness(0.9) contrast(1.2) saturate(1.2) blur(0.5px);
        opacity: 0.95;
    }
    30% {
        transform: scale(1.05) rotateX(0deg) rotateY(-10deg) rotateZ(-5deg);
        filter: brightness(0.8) contrast(1.4) saturate(1.4) blur(1px);
        opacity: 0.9;
    }
    50% {
        transform: scale(0.98) rotateX(-8deg) rotateY(-15deg) rotateZ(-8deg);
        filter: brightness(0.6) contrast(1.8) saturate(0.8) blur(1.5px);
        opacity: 0.8;
    }
    70% {
        transform: scale(0.92) rotateX(-12deg) rotateY(8deg) rotateZ(5deg);
        filter: brightness(0.5) contrast(2) saturate(0.5) blur(2px);
        opacity: 0.75;
    }
    85% {
        transform: scale(0.88) rotateX(-15deg) rotateY(12deg) rotateZ(8deg);
        filter: brightness(0.4) contrast(2.2) saturate(0.3) blur(2.5px);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.85) rotateX(-18deg) rotateY(15deg) rotateZ(10deg);
        filter: brightness(0.3) contrast(2.5) saturate(0.2) blur(3px);
        opacity: 0.65;
    }
}

@keyframes defeatCardShake {
    0%, 100% {
        transform: translateX(0) translateY(0) rotateZ(0deg);
    }
    10% {
        transform: translateX(-4px) translateY(-3px) rotateZ(-1deg);
    }
    20% {
        transform: translateX(5px) translateY(2px) rotateZ(0.8deg);
    }
    30% {
        transform: translateX(-3px) translateY(-4px) rotateZ(-0.6deg);
    }
    40% {
        transform: translateX(4px) translateY(3px) rotateZ(1.2deg);
    }
    50% {
        transform: translateX(-5px) translateY(-2px) rotateZ(-0.9deg);
    }
    60% {
        transform: translateX(3px) translateY(4px) rotateZ(0.7deg);
    }
    70% {
        transform: translateX(-2px) translateY(-3px) rotateZ(-0.4deg);
    }
    80% {
        transform: translateX(2px) translateY(2px) rotateZ(0.3deg);
    }
    90% {
        transform: translateX(-1px) translateY(-1px) rotateZ(-0.1deg);
    }
}

/* TCG Battle Result Content - Horizontal Layout */
.battle-result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
}

.battle-result-title {
    font-size: 48px;
    font-weight: 900;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 6px;
    text-align: center;
    font-family: 'Impact', 'Arial Black', sans-serif;
    background: linear-gradient(45deg, 
        #ffd700, #ff8c00, #ff4500, #ff0000,
        #ffd700, #ff8c00, #ff4500, #ff0000
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 
        0 0 30px rgba(255, 215, 0, 0.8),
        0 0 60px rgba(255, 140, 0, 0.6),
        0 0 100px rgba(255, 69, 0, 0.4);
    animation: yugiohTitleGlow 2s ease-in-out infinite;
}

.battle-result-subtitle {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 25px 0;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    color: #ffffff;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 215, 0, 0.6);
    animation: yugiohSubtitlePulse 3s ease-in-out infinite;
}

@keyframes yugiohTitleGlow {
    0%, 100% {
        text-shadow: 
            0 0 30px rgba(255, 215, 0, 0.8),
            0 0 60px rgba(255, 140, 0, 0.6),
            0 0 100px rgba(255, 69, 0, 0.4);
        filter: brightness(1) hue-rotate(0deg);
    }
    50% {
        text-shadow: 
            0 0 50px rgba(255, 215, 0, 1),
            0 0 100px rgba(255, 140, 0, 0.8),
            0 0 150px rgba(255, 69, 0, 0.6);
        filter: brightness(1.3) hue-rotate(180deg);
    }
}

@keyframes yugiohSubtitlePulse {
    0%, 100% {
        opacity: 0.95;
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 0.8),
            0 0 40px rgba(255, 215, 0, 0.6);
    }
    50% {
        opacity: 1;
        text-shadow: 
            0 0 30px rgba(255, 255, 255, 1),
            0 0 60px rgba(255, 215, 0, 0.8);
    }
}

/* Horizontal Stats Layout */
.battle-result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(25, 25, 112, 0.6) 50%, 
        rgba(0, 0, 139, 0.7) 100%
    );
    border-radius: 20px;
    padding: 30px;
    margin: 25px 0;
    border: 3px solid rgba(255, 215, 0, 0.5);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 50px rgba(255, 215, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 650px;
    backdrop-filter: blur(10px);
    animation: yugiohStatsPulse 4s ease-in-out infinite;
}

.result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.2) 100%
    );
    border-radius: 16px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.result-stat:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 215, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.3) 100%
    );
}

.stat-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    margin-bottom: 12px;
    color: #ffd700;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 140, 0, 0.4);
    animation: yugiohLabelPulse 3s ease-in-out infinite;
}

.stat-value {
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 215, 0, 0.6),
        0 0 80px rgba(255, 140, 0, 0.4);
    font-family: 'Impact', 'Arial Black', sans-serif;
    animation: yugiohValueGlow 2s ease-in-out infinite;
}

@keyframes yugiohLabelPulse {
    0%, 100% {
        opacity: 0.9;
        text-shadow: 
            0 0 15px rgba(255, 215, 0, 0.6),
            0 0 30px rgba(255, 140, 0, 0.4);
    }
    50% {
        opacity: 1;
        text-shadow: 
            0 0 25px rgba(255, 215, 0, 0.8),
            0 0 50px rgba(255, 140, 0, 0.6);
    }
}

@keyframes yugiohValueGlow {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 0.8),
            0 0 40px rgba(255, 215, 0, 0.6),
            0 0 80px rgba(255, 140, 0, 0.4);
        filter: brightness(1);
    }
    50% {
        text-shadow: 
            0 0 30px rgba(255, 255, 255, 1),
            0 0 60px rgba(255, 215, 0, 0.8),
            0 0 120px rgba(255, 140, 0, 0.6);
        filter: brightness(1.3);
    }
}

@keyframes yugiohStatsPulse {
    0%, 100% {
        box-shadow: 
            0 10px 30px rgba(0, 0, 0, 0.4),
            0 0 50px rgba(255, 215, 0, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 
            0 15px 40px rgba(0, 0, 0, 0.5),
            0 0 70px rgba(255, 215, 0, 0.4),
            inset 0 3px 0 rgba(255, 255, 255, 0.3);
        transform: scale(1.02);
    }
}

/* Yu-Gi-Oh/Pokémon Style Action Buttons */
.battle-result-actions {
    display: flex;
    gap: 25px;
    margin-top: 35px;
    justify-content: center;
    width: 100%;
    max-width: 550px;
    perspective: 1000px;
}

.battle-result-actions .btn-primary,
.battle-result-actions .btn-secondary {
    flex: 1;
    padding: 18px 32px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    font-family: 'Impact', 'Arial Black', sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.battle-result-actions .btn-primary {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 30%, #ff6b00 70%, #ff4500 100%);
    color: #1a1a2e;
    border-color: #ffd700;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: yugiohButtonGlow 2s ease-in-out infinite;
}

.battle-result-actions .btn-primary:hover {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b00 30%, #ff4500 70%, #ff0000 100%);
    transform: translateY(-4px) scale(1.05) rotateX(5deg);
    box-shadow: 0 12px 35px rgba(255, 107, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.6);
    animation: yugiohButtonHover 0.5s ease-in-out;
}

.battle-result-actions .btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 30%, #6b46c1 70%, #553c9a 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: pokemonButtonGlow 2s ease-in-out infinite;
}

.battle-result-actions .btn-secondary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #6b46c1 30%, #553c9a 70%, #44337a 100%);
    transform: translateY(-4px) scale(1.05) rotateX(5deg);
    box-shadow: 0 12px 35px rgba(91, 33, 182, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4);
    animation: pokemonButtonHover 0.5s ease-in-out;
}

@keyframes yugiohButtonGlow {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 10px 35px rgba(255, 215, 0, 0.7), 0 0 40px rgba(255, 215, 0, 0.4);
        filter: brightness(1.2);
    }
}

@keyframes yugiohButtonHover {
    0% { transform: translateY(-4px) scale(1.05) rotateX(5deg); }
    50% { transform: translateY(-6px) scale(1.08) rotateX(8deg); }
    100% { transform: translateY(-4px) scale(1.05) rotateX(5deg); }
}

@keyframes pokemonButtonGlow {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 10px 35px rgba(102, 126, 234, 0.7), 0 0 40px rgba(102, 126, 234, 0.4);
        filter: brightness(1.2);
    }
}

@keyframes pokemonButtonHover {
    0% { transform: translateY(-4px) scale(1.05) rotateX(5deg); }
    50% { transform: translateY(-6px) scale(1.08) rotateX(8deg); }
    100% { transform: translateY(-4px) scale(1.05) rotateX(5deg); }
}

/* Mobile Responsiveness for Battle Results */
@media (max-width: 768px) {
    .battle-result {
        margin: 15px 10px;
        padding: 25px 20px;
        max-width: calc(100vw - 20px);
        border-radius: 16px;
    }
    
    .battle-result-title {
        font-size: 28px;
        letter-spacing: 2px;
        margin-bottom: 8px;
    }
    
    .battle-result-subtitle {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .battle-result-stats {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
        margin: 15px 0;
        max-width: 100%;
    }
    
    .result-stat {
        padding: 12px;
    }
    
    .stat-label {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .battle-result-actions {
        flex-direction: column;
        gap: 15px;
        margin-top: 25px;
        max-width: 100%;
    }
    
    .battle-result-actions .btn-primary,
    .battle-result-actions .btn-secondary {
        padding: 14px 24px;
        font-size: 14px;
        letter-spacing: 1px;
    }
}

/* Clean modern TCG styling complete */

/* Legacy animations removed - using clean TCG style */

.result-container h2 {
    font-size: 2.2em;
    margin-bottom: 20px;
}

.result-container h2.win { color: #2f855a; }
.result-container h2.lose { color: #c53030; }
.result-container h2.draw { color: #d69e2e; }

.result-details {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Enhanced Buttons */
.btn-primary, .btn-secondary, .btn-battle {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-secondary {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(113, 128, 150, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(113, 128, 150, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-battle {
    background: linear-gradient(135deg, #ff0000 0%, #ff4500 25%, #ff8c00 50%, #ffd700 75%, #ffff00 100%);
    color: #1a1a2e;
    font-size: 1.5em;
    padding: 22px 45px;
    border: 4px solid #ffd700;
    box-shadow: 
        0 15px 40px rgba(255, 0, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.8),
        0 0 100px rgba(255, 107, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    animation: yugiohBattlePulse 1.5s ease-in-out infinite;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.7),
        0 0 10px rgba(255, 255, 255, 0.8);
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Impact', 'Arial Black', sans-serif;
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    outline: none;
}

.btn-battle:focus {
    outline: 3px solid #ffd700;
    outline-offset: 4px;
    box-shadow: 
        0 20px 50px rgba(255, 0, 0, 0.8),
        0 0 80px rgba(255, 215, 0, 1),
        0 0 150px rgba(255, 107, 0, 0.7),
        inset 0 3px 0 rgba(255, 255, 255, 0.7);
}

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

@keyframes yugiohBattlePulse {
    0%, 100% { 
        box-shadow: 
            0 15px 40px rgba(255, 0, 0, 0.6),
            0 0 60px rgba(255, 215, 0, 0.8),
            0 0 100px rgba(255, 107, 0, 0.5),
            inset 0 2px 0 rgba(255, 255, 255, 0.5);
        transform: scale(1) rotateX(0deg);
        filter: brightness(1) hue-rotate(0deg);
    }
    25% { 
        box-shadow: 
            0 20px 50px rgba(255, 0, 0, 0.8),
            0 0 80px rgba(255, 215, 0, 1),
            0 0 150px rgba(255, 107, 0, 0.7),
            inset 0 3px 0 rgba(255, 255, 255, 0.7);
        transform: scale(1.05) rotateX(5deg);
        filter: brightness(1.2) hue-rotate(45deg);
    }
    50% { 
        box-shadow: 
            0 25px 60px rgba(255, 0, 0, 0.9),
            0 0 100px rgba(255, 215, 0, 1.2),
            0 0 200px rgba(255, 107, 0, 0.9),
            inset 0 4px 0 rgba(255, 255, 255, 0.9);
        transform: scale(1.08) rotateX(0deg);
        filter: brightness(1.4) hue-rotate(90deg);
    }
    75% { 
        box-shadow: 
            0 20px 50px rgba(255, 0, 0, 0.8),
            0 0 80px rgba(255, 215, 0, 1),
            0 0 150px rgba(255, 107, 0, 0.7),
            inset 0 3px 0 rgba(255, 255, 255, 0.7);
        transform: scale(1.05) rotateX(-5deg);
        filter: brightness(1.2) hue-rotate(135deg);
    }
}

.btn-battle:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffff00 0%, #ffd700 25%, #ff8c00 50%, #ff4500 75%, #ff0000 100%);
    transform: translateY(-6px) scale(1.12) rotateX(10deg);
    box-shadow: 
        0 30px 70px rgba(255, 0, 0, 0.9),
        0 0 100px rgba(255, 215, 0, 1.2),
        0 0 250px rgba(255, 107, 0, 0.8),
        inset 0 3px 0 rgba(255, 255, 255, 0.8);
    animation: yugiohBattleHover 0.8s ease-in-out infinite;
    filter: brightness(1.3) saturate(1.5) hue-rotate(180deg);
    text-shadow: 
        3px 3px 6px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(255, 255, 255, 1),
        0 0 40px rgba(255, 215, 0, 0.8);
    letter-spacing: 3px;
}

@keyframes yugiohBattleHover {
    0%, 100% {
        transform: translateY(-6px) scale(1.12) rotateX(10deg);
        box-shadow: 
            0 30px 70px rgba(255, 0, 0, 0.9),
            0 0 100px rgba(255, 215, 0, 1.2),
            0 0 250px rgba(255, 107, 0, 0.8),
            inset 0 3px 0 rgba(255, 255, 255, 0.8);
    }
    50% {
        transform: translateY(-8px) scale(1.15) rotateX(15deg);
        box-shadow: 
            0 35px 80px rgba(255, 0, 0, 1),
            0 0 150px rgba(255, 215, 0, 1.5),
            0 0 300px rgba(255, 107, 0, 1),
            inset 0 4px 0 rgba(255, 255, 255, 1);
    }
}

.btn-battle:hover:not(:disabled)::before {
    left: 100%;
}

.btn-battle:active:not(:disabled) {
    transform: translateY(-3px) scale(1.08) rotateX(5deg);
    box-shadow: 
        0 25px 60px rgba(255, 0, 0, 0.8),
        0 0 80px rgba(255, 215, 0, 1),
        0 0 180px rgba(255, 107, 0, 0.7),
        inset 0 2px 0 rgba(255, 255, 255, 0.7);
    filter: brightness(1.1) saturate(1.3);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-battle:disabled {
    background: linear-gradient(135deg, #666666 0%, #888888 25%, #999999 50%, #777777 75%, #555555 100%);
    border-color: #999999;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
    filter: grayscale(0.8) brightness(0.7);
    animation: none;
    cursor: not-allowed;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-battle:disabled:hover {
    transform: scale(0.95);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    filter: grayscale(0.8) brightness(0.7);
}

.btn-primary:disabled, .btn-battle:disabled {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    animation: none;
    filter: grayscale(0.5);
    opacity: 0.6;
}

.btn-icon, .battle-icon {
    font-size: 1.2em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(245, 101, 101, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 101, 101, 0); }
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

.card-detail {
    text-align: center;
    padding-top: 20px;
}

.card-detail .card-image {
    height: 200px;
    margin-bottom: 20px;
}

.card-detail .card-name {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.card-detail .card-stats {
    justify-content: center;
    gap: 15px;
}

.card-detail .stat {
    padding: 8px 16px;
    font-size: 1.1em;
}

/* Performance optimizations for animations */
@media (prefers-reduced-motion: reduce) {
    .battle-arena,
    .battle-card,
    .vs-text,
    .battle-field::before {
        animation: none !important;
    }
    
    .battle-card.attacking,
    .battle-card.defending,
    .battle-card.winner {
        animation: none !important;
        transform: scale(1.1) !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .battle-field {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .battle-card {
        width: 180px;
        height: 250px;
        animation-duration: 2s !important;
    }
    
    .card-collection {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .vs-text {
        font-size: 2.5em;
    }
    
    /* Reduce animation complexity on mobile */
    .battle-arena {
        animation-duration: 6s !important;
    }
    
    .battle-field::before {
        width: 200px;
        height: 200px;
    }
    
    /* Mobile styling for battle button */
    .btn-battle {
        font-size: 1.2em;
        padding: 18px 35px;
        border-width: 3px;
        box-shadow: 
            0 12px 30px rgba(255, 0, 0, 0.5),
            0 0 40px rgba(255, 215, 0, 0.6),
            0 0 70px rgba(255, 107, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
    
    .btn-battle:hover:not(:disabled) {
        transform: translateY(-4px) scale(1.08) rotateX(8deg);
        box-shadow: 
            0 20px 50px rgba(255, 0, 0, 0.7),
            0 0 70px rgba(255, 215, 0, 0.9),
            0 0 180px rgba(255, 107, 0, 0.6),
            inset 0 2px 0 rgba(255, 255, 255, 0.6);
    }
}

/* Enhanced Game Phases */
.game-phase {
    display: none;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-phase.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: phaseEnter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-phase.exiting {
    opacity: 0;
    transform: translateY(-30px) scale(1.05);
    animation: phaseExit 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes phaseEnter {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9) rotateX(15deg);
        filter: blur(5px);
    }
    50% {
        opacity: 0.7;
        transform: translateY(10px) scale(1.02) rotateX(5deg);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}

@keyframes phaseExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0px);
    }
    50% {
        opacity: 0.3;
        transform: translateY(-20px) scale(1.05) rotateX(-5deg);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.1) rotateX(-15deg);
        filter: blur(5px);
    }
}

/* Phase Transition Effects */
.phase-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(26, 26, 46, 0.9), 
        rgba(102, 126, 234, 0.1), 
        rgba(26, 26, 46, 0.9));
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.phase-transition.active {
    opacity: 1;
    pointer-events: all;
}

.phase-transition-text {
    font-size: 48px;
    font-weight: bold;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: transitionPulse 1s ease-in-out infinite alternate;
}

@keyframes transitionPulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
    100% {
        transform: scale(1.1);
        text-shadow: 0 0 50px rgba(255, 215, 0, 1), 0 0 80px rgba(255, 215, 0, 0.5);
    }
}

/* Animasi */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0,-30px,0); }
    70% { transform: translate3d(0,-15px,0); }
    90% { transform: translate3d(0,-4px,0); }
}
