/**
 * POOM Game - Main Stylesheet
 * Estilos para el juego y la interfaz
 */

/* === GAME CONTAINER === */
.poom-game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
    font-family: 'Courier New', Courier, monospace;
    user-select: none;
}

#poom-game-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* === UI OVERLAY === */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
}

#hud-top {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    color: #ff0000;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

/* === CROSSHAIR === */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#crosshair::before,
#crosshair::after {
    content: '';
    position: absolute;
    background: #0f0;
    box-shadow: 0 0 4px #0f0;
}

#crosshair::before {
    top: 11px;
    left: 0;
    width: 24px;
    height: 2px;
}

#crosshair::after {
    top: 0;
    left: 11px;
    width: 2px;
    height: 24px;
}

/* === WEAPON === */
#weapon {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 240px;
    background:
        linear-gradient(90deg, #222 10%, #444 30%, #111 50%, #444 70%, #222 90%),
        repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(0,0,0,0.5) 11px);
    clip-path: polygon(25% 100%, 75% 100%, 65% 0%, 35% 0%);
    transition: transform 0.05s;
    z-index: 2;
}

.shooting-anim {
    transform: translateX(-50%) translateY(15px) !important;
}

/* === MUZZLE FLASH === */
#muzzle-flash {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ffff00 20%, #ff8800 60%, transparent 70%);
    border-radius: 50%;
    opacity: 0.8;
    pointer-events: none;
    transition: transform 0.05s;
    z-index: 1;
}

.flash-active {
    transform: translateX(-50%) scale(1.5) !important;
}

/* === DAMAGE OVERLAY === */
#damage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, transparent 20%, rgba(255,0,0,0.6) 90%);
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
}

/* === START SCREEN === */
#start-screen,
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    pointer-events: auto;
    z-index: 1000;
}

#start-screen h1,
#game-over-screen h1 {
    font-size: 70px;
    margin: 0;
    color: #ff0000;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow: 0 0 20px #900;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { text-shadow: 0 0 20px #900; }
    50% { text-shadow: 0 0 40px #f00; }
    100% { text-shadow: 0 0 20px #900; }
}

#start-screen p,
#game-over-screen p {
    font-size: 22px;
    color: #bbb;
    margin: 10px 0;
    text-align: center;
    max-width: 600px;
    line-height: 1.5;
}

.controls-info {
    background: rgba(255, 0, 0, 0.1);
    padding: 20px;
    border: 2px solid #ff0000;
    border-radius: 10px;
    margin: 20px 0;
}

.poom-btn {
    padding: 20px 50px;
    font-size: 28px;
    font-family: inherit;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    margin: 10px;
}

.poom-btn-primary {
    background: #900;
    color: white;
    border: 2px solid #f00;
    box-shadow: 0 0 15px #f00;
}

.poom-btn-primary:hover:not(:disabled) {
    background: #f00;
    transform: scale(1.05);
}

.poom-btn-primary:disabled {
    background: #555;
    border-color: #777;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.5;
}

.poom-btn-secondary {
    background: #333;
    color: white;
    border: 2px solid #666;
    box-shadow: 0 0 10px #333;
}

.poom-btn-secondary:hover {
    background: #555;
    border-color: #888;
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}

/* === RANK DISPLAY === */
.poom-rank-box {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    color: #000;
}

/* === COOLDOWN NOTICE === */
.poom-notice {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 165, 0, 0.9);
    color: #000;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    z-index: 2000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

#poom-cooldown-timer {
    color: #ff0000;
    font-size: 24px;
}

/* === SECURITY WARNING === */
.poom-security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poom-security-content {
    background: linear-gradient(135deg, #d63638 0%, #8b0000 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 0 50px rgba(214, 54, 56, 0.5);
}

.poom-security-content h2 {
    margin-top: 0;
    font-size: 36px;
}

.poom-security-content p {
    font-size: 18px;
    margin: 15px 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #hud-top {
        font-size: 18px;
        padding: 10px;
    }

    #start-screen h1,
    #game-over-screen h1 {
        font-size: 40px;
    }

    #start-screen p,
    #game-over-screen p {
        font-size: 16px;
    }

    .poom-btn {
        padding: 15px 30px;
        font-size: 20px;
    }

    #weapon {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 480px) {
    #hud-top {
        flex-direction: column;
        font-size: 14px;
    }

    #start-screen h1,
    #game-over-screen h1 {
        font-size: 30px;
    }

    .poom-btn {
        padding: 10px 20px;
        font-size: 16px;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* === LOADING INDICATOR === */
.poom-loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #ff0000;
    animation: spin 1s linear infinite;
}

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

/* === MOBILE CONTROLS === */
.mobile-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

.mobile-controls.hidden {
    display: none !important;
}

/* Joystick base */
.mobile-joystick {
    position: absolute;
    pointer-events: auto;
}

/* Joystick izquierdo (movimiento) */
.mobile-joystick-left {
    bottom: 40px;
    left: 40px;
}

/* Joystick derecho (cámara) */
.mobile-joystick-right {
    bottom: 40px;
    right: 40px;
}

.joystick-base {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255,0,0,0.3) 0%, rgba(255,0,0,0.1) 100%);
    border: 3px solid rgba(255,0,0,0.5);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px rgba(255,0,0,0.3);
}

.joystick-stick {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #ff0000 0%, #990000 100%);
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    transition: all 0.1s;
}

.joystick-label {
    text-align: center;
    color: #ff0000;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

/* Botón de disparo (encima del joystick derecho) */
.mobile-shoot-btn {
    position: absolute;
    bottom: 180px; /* Encima del joystick derecho */
    right: 50px; /* Centrado con el joystick derecho */
    pointer-events: auto;
    z-index: 600;
}

.shoot-btn-inner {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #ff0000 0%, #990000 100%);
    border: 4px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 0 0 30px rgba(255,0,0,0.6), inset 0 0 20px rgba(0,0,0,0.3);
    transition: all 0.1s;
    cursor: pointer;
    user-select: none;
}

.shoot-btn-inner:active {
    transform: scale(0.9);
    box-shadow: 0 0 20px rgba(255,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.5);
}

/* Responsive para tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .mobile-joystick-left {
        bottom: 60px;
        left: 60px;
    }

    .mobile-joystick-right {
        bottom: 60px;
        right: 60px;
    }

    .joystick-base {
        width: 140px;
        height: 140px;
    }

    .mobile-shoot-btn {
        bottom: 220px; /* Encima del joystick derecho más grande */
        right: 70px;
    }

    .shoot-btn-inner {
        width: 100px;
        height: 100px;
        font-size: 48px;
    }
}
