/* Enhanced Chess Game Styles - Vibrant & Modern */

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    overflow-x: hidden;
}

/* Vibrant Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(236, 72, 153, 0.6),
                    0 0 60px rgba(168, 85, 247, 0.4),
                    0 0 90px rgba(59, 130, 246, 0.3);
    }
    50% { 
        box-shadow: 0 0 50px rgba(236, 72, 153, 0.9),
                    0 0 100px rgba(168, 85, 247, 0.7),
                    0 0 150px rgba(59, 130, 246, 0.5);
    }
}

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

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

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

/* Animation Classes */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

.glow-animation {
    animation: glow 2s ease-in-out infinite;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

.bounce-animation {
    animation: bounce 1s ease-in-out infinite;
}

/* Vibrant Background with Multiple Gradients */
.animated-bg {
    background: linear-gradient(-45deg, 
        #1e1b4b, 
        #312e81, 
        #4c1d95, 
        #5b21b6,
        #7c3aed,
        #6366f1,
        #3b82f6,
        #0ea5e9
    );
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    position: relative;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(236, 72, 153, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.2) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

/* Enhanced Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.glass-effect-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Canvas Styles with Glow */
canvas {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(168, 85, 247, 0.3);
    transition: all 0.3s ease;
}

canvas:hover {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6),
                0 0 60px rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
}

/* Button Styles - Vibrant & Interactive */
button {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: scale(0.98) translateY(0);
}

/* Gradient Buttons */
.btn-gradient-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-gradient-purple:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.btn-gradient-pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 5px 20px rgba(240, 147, 251, 0.4);
}

.btn-gradient-pink:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    box-shadow: 0 8px 30px rgba(240, 147, 251, 0.6);
}

.btn-gradient-blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 5px 20px rgba(79, 172, 254, 0.4);
}

.btn-gradient-blue:hover {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    box-shadow: 0 8px 30px rgba(79, 172, 254, 0.6);
}

.btn-gradient-green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 5px 20px rgba(67, 233, 123, 0.4);
}

.btn-gradient-green:hover {
    background: linear-gradient(135deg, #38f9d7 0%, #43e97b 100%);
    box-shadow: 0 8px 30px rgba(67, 233, 123, 0.6);
}

.btn-gradient-orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 5px 20px rgba(250, 112, 154, 0.4);
}

.btn-gradient-orange:hover {
    background: linear-gradient(135deg, #fee140 0%, #fa709a 100%);
    box-shadow: 0 8px 30px rgba(250, 112, 154, 0.6);
}

/* Text Effects */
.text-glow {
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.8), 
                 0 0 40px rgba(168, 85, 247, 0.6),
                 0 0 60px rgba(168, 85, 247, 0.4);
}

.text-glow-pink {
    text-shadow: 0 0 20px rgba(236, 72, 153, 0.8), 
                 0 0 40px rgba(236, 72, 153, 0.6),
                 0 0 60px rgba(236, 72, 153, 0.4);
}

.text-glow-blue {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 
                 0 0 40px rgba(59, 130, 246, 0.6),
                 0 0 60px rgba(59, 130, 246, 0.4);
}

.text-rainbow {
    background: linear-gradient(90deg, 
        #ff0080, 
        #ff8c00, 
        #40e0d0, 
        #ff0080
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

/* Input Styles */
input {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4),
                0 0 40px rgba(168, 85, 247, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.status-check {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.status-checkmate {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.status-stalemate {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

/* Difficulty Selector */
.difficulty-option {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.difficulty-option::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.difficulty-option:hover::after {
    transform: scaleX(1);
}

.difficulty-selected {
    transform: scale(1.1);
    font-weight: bold;
}

/* Captured Pieces Display */
.captured-piece {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.captured-piece:hover {
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-hide {
        display: none;
    }
    
    canvas {
        border-radius: 12px;
    }
    
    button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    font-size: 0.85rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Card Effect */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

/* Sparkle Effect */
@keyframes sparkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.sparkle {
    position: relative;
}

.sparkle::before,
.sparkle::after {
    content: '✨';
    position: absolute;
    animation: sparkle 2s ease-in-out infinite;
}

.sparkle::before {
    top: -10px;
    left: -10px;
}

.sparkle::after {
    bottom: -10px;
    right: -10px;
    animation-delay: 1s;
}
