@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

/* Custom retro styling */
body {
    font-family: 'JetBrains Mono', monospace;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Scanline effect for authentic Game Boy Color feel */
.scanlines::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

/* Retro button styling */
button {
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    box-shadow: 
        inset 1px 1px 0px rgba(255, 255, 255, 0.3),
        inset -1px -1px 0px rgba(0, 0, 0, 0.3);
}

button:active {
    box-shadow: 
        inset -1px -1px 0px rgba(255, 255, 255, 0.3),
        inset 1px 1px 0px rgba(0, 0, 0, 0.3);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card hover effects */
.cursor-pointer:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Custom scrollbar for game log */
.overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: #0f0f23;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 4px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #ffed4e;
}

/* Pixel-perfect font rendering */
.font-pixel {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    text-rendering: optimizeSpeed;
    font-smooth: never;
    -webkit-font-smoothing: none;
}

/* Card animation effects */
@keyframes cardFlip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

.card-flip {
    animation: cardFlip 0.6s ease-in-out;
}

/* Retro glow effect */
.retro-glow {
    box-shadow: 
        0 0 5px #ffd700,
        0 0 10px #ffd700,
        0 0 15px #ffd700;
}

/* Phase transition effect */
@keyframes phaseChange {
    0% { background-color: #ffd700; }
    50% { background-color: #ffed4e; }
    100% { background-color: #ffd700; }
}

.phase-change {
    animation: phaseChange 0.5s ease-in-out;
}

/* Life counter digital display effect */
.life-counter {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
}

/* Card field slot highlighting */
.field-slot {
    transition: all 0.2s ease;
}

.field-slot:hover {
    background-color: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
}

/* Attack animation */
@keyframes attackFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.attack-flash {
    animation: attackFlash 0.3s ease-in-out 3;
}

/* Damage number animation */
@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translateY(0px);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

.damage-float {
    animation: damageFloat 1s ease-out forwards;
}

/* Victory/Defeat modal styling */
.modal-enter {
    animation: modalSlide 0.5s ease-out forwards;
}

@keyframes modalSlide {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .font-pixel {
        font-size: 0.75rem;
    }
    
    .scanlines::before {
        background-size: 100% 3px;
    }
}

/* Hand fan effect for better card display */
.hand-card:nth-child(1) { transform: rotate(-10deg) translateY(5px); }
.hand-card:nth-child(2) { transform: rotate(-5deg) translateY(2px); }
.hand-card:nth-child(3) { transform: rotate(0deg) translateY(0px); }
.hand-card:nth-child(4) { transform: rotate(5deg) translateY(2px); }
.hand-card:nth-child(5) { transform: rotate(10deg) translateY(5px); }

/* Selection ring effect */
.ring-2 {
    position: relative;
}

.ring-2::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid #ff4444;
    border-radius: inherit;
    pointer-events: none;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}