/* HandShooter Styles */

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

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0f;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Animated Background */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(160, 32, 240, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 60, 60, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 80%, rgba(60, 60, 255, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, #0a0a0f 0%, #1a1a2e 100%);
    z-index: 0;
}

/* Camera Container - Center Bottom */
.camera-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    z-index: 100;
}

.camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
}

/* Game Canvas */
#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Score Display */
.score-display {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 12px;
    padding: 15px 25px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.score-value {
    font-size: 36px;
    font-weight: 700;
    color: #a855f7;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* Crosshair */
.crosshair {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 50;
    transform: translate(-50%, -50%);
    display: none;
}

.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #ff3333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.8);
}

.crosshair-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.5;
    }
}

/* Muzzle Flash Effect */
.muzzle-flash {
    position: fixed;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 100, 0.9) 0%, rgba(255, 150, 50, 0.6) 30%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 60;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition: none;
}

.muzzle-flash.active {
    animation: flash 0.15s ease-out;
}

@keyframes flash {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* Hit Indicator */
.hit-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 70;
    opacity: 0;
    pointer-events: none;
}

.hit-indicator.active {
    animation: hitPop 0.5s ease-out;
}

.hit-text {
    font-size: 48px;
    font-weight: 700;
    color: #00ff00;
    text-shadow:
        0 0 10px rgba(0, 255, 0, 0.8),
        0 0 30px rgba(0, 255, 0, 0.5);
    letter-spacing: 4px;
}

@keyframes hitPop {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1) translateY(-30px);
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(168, 85, 247, 0.1);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

/* Permission Overlay */
.permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.permission-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.permission-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.permission-content h2 {
    color: #fff;
    font-size: 32px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #a855f7, #ff3366);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.permission-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.gesture-instructions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.gesture-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
}

.gesture-icon {
    font-size: 28px;
}

.gesture-demo span:last-child {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(168, 85, 247, 0.4);
}

/* Screen Flash on Shot */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
}

.screen-flash.active {
    animation: screenFlash 0.1s ease-out;
}

@keyframes screenFlash {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}