/* Custom styles for KillShot game */

/* Horror-themed animations */
@keyframes bloodDrip {
    0% { transform: translateY(-10px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(10px); opacity: 0; }
}

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

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

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

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a00000;
}

/* Loading animation for screenshots */
.screenshot-loading {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hover effects */
.guess-input:focus {
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.3);
}

/* Modal backdrop blur */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Game complete animations */
.game-complete {
    animation: fadeInUp 0.5s ease-out;
}

/* Screenshot reveal effect */
.screenshot-reveal {
    transition: all 0.3s ease-in-out;
}

/* Blood red glow effect */
.blood-glow {
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
}

/* Responsive design helpers */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .font-horror {
        font-size: 2rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-dark-gray {
        background-color: #000000;
    }
    
    .text-gray-400 {
        color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for accessibility */
.focus-visible:focus-visible {
    outline: 2px solid #8B0000;
    outline-offset: 2px;
}

/* Custom button styles */
.btn-horror {
    background: linear-gradient(135deg, #8B0000, #a00000);
    transition: all 0.3s ease;
}

.btn-horror:hover {
    background: linear-gradient(135deg, #a00000, #c00000);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
}

.btn-horror:active {
    transform: translateY(0);
}

/* Screenshot container styles */
.screenshot-container {
    position: relative;
    overflow: hidden;
}

/* Removed diagonal red line overlay that was appearing across screenshots */

/* Guess history styles */
.guess-history {
    max-height: 200px;
    overflow-y: auto;
}

.guess-item {
    transition: all 0.2s ease;
}

.guess-item:hover {
    background-color: rgba(139, 0, 0, 0.1);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading states */
.loading-pulse {
    animation: pulse 2s infinite;
}

/* Error states */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success states */
.success-bounce {
    animation: bounce 0.6s ease-in-out;
}

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

/* Age verification blur effects */
.screenshot-blur {
    filter: blur(10px);
    -webkit-filter: blur(10px); /* Safari/iOS support */
    transition: filter 0.3s ease, -webkit-filter 0.3s ease;
    transform: translateZ(0); /* Force hardware acceleration */
    -webkit-transform: translateZ(0); /* Safari support */
    will-change: filter, transform; /* Optimize for changes */
    backface-visibility: hidden; /* Prevent flickering on mobile */
    -webkit-backface-visibility: hidden;
    position: relative; /* Ensure proper stacking */
    isolation: isolate; /* Create new stacking context */
}

.screenshot-blur:hover {
    filter: blur(15px);
    -webkit-filter: blur(15px);
}

/* Container for screenshot to contain blur overflow */
.screenshot-container {
    overflow: hidden;
    border-radius: inherit;
    transform: translateZ(0); /* Create stacking context */
    -webkit-transform: translateZ(0);
    position: relative;
    isolation: isolate;
    /* Force GPU acceleration on mobile */
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

/* Mobile-specific blur enhancements */
@media (max-width: 768px) {
    .screenshot-blur {
        filter: blur(15px); /* Stronger blur on mobile */
        -webkit-filter: blur(15px);
        /* Additional mobile optimizations */
        -webkit-perspective: 1000px;
        perspective: 1000px;
    }
    
    .screenshot-container {
        /* Ensure containment on mobile */
        contain: layout style paint;
        -webkit-contain: layout style paint;
    }
}