/**
 * HTML5 Shooter Game Styles with Touch Controls
 */

.html5-shooter-container {
    max-width: 100%;
    margin: 20px auto;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    border: 2px solid #333;
    border-bottom: none;
    font-size: 16px;
    font-weight: bold;
}

.score-display, .lives-display, .level-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-value, .lives-value, .level-value {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

.game-canvas-container {
    position: relative;
    display: inline-block;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.game-canvas-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.game-message {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #444;
}

.message-title {
    font-size: 32px;
    margin: 0 0 15px 0;
    color: #ff6b6b;
}

.message-text {
    font-size: 18px;
    margin: 0 0 20px 0;
    color: #cccccc;
}

.restart-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Touch Controls */
.touch-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.dpad-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.dpad {
    position: relative;
    width: 120px;
    height: 120px;
}

.dpad-button {
    position: absolute;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4a5568, #2d3748);
    border: 2px solid #718096;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.dpad-button:active,
.dpad-button.active {
    background: linear-gradient(135deg, #63b3ed, #4299e1);
    border-color: #90cdf4;
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dpad-up {
    top: 0;
    left: 40px;
}

.dpad-down {
    bottom: 0;
    left: 40px;
}

.dpad-left {
    top: 40px;
    left: 0;
}

.dpad-right {
    top: 40px;
    right: 0;
}

.dpad-center {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-middle {
    width: 20px;
    height: 20px;
    background: #2d3748;
    border-radius: 50%;
    border: 2px solid #4a5568;
}

.fire-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.fire-button,
.pause-button,
.start-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.fire-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border-color: #ff8e8e;
}

.fire-button:active,
.fire-button.active {
    background: linear-gradient(135deg, #ff5252, #e53e3e);
    transform: scale(0.95);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.pause-button {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    border-color: #ffcc80;
    width: 60px;
    height: 60px;
    font-size: 18px;
}

.pause-button:active,
.pause-button.active {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    transform: scale(0.95);
}

.start-button {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    border-color: #81c784;
}

.start-button:active,
.start-button.active {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    .html5-shooter-container {
        margin: 10px;
    }
    
    .game-header {
        font-size: 14px;
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .touch-controls {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .dpad {
        width: 100px;
        height: 100px;
    }
    
    .dpad-button {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .dpad-up, .dpad-down {
        left: 32.5px;
    }
    
    .dpad-left, .dpad-right {
        top: 32.5px;
    }
    
    .dpad-center {
        top: 32.5px;
        left: 32.5px;
        width: 35px;
        height: 35px;
    }
    
    .fire-button {
        width: 70px;
        height: 70px;
        font-size: 12px;
    }
    
    .pause-button,
    .start-button {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .game-header {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .dpad {
        width: 90px;
        height: 90px;
    }
    
    .dpad-button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .dpad-up, .dpad-down {
        left: 30px;
    }
    
    .dpad-left, .dpad-right {
        top: 30px;
    }
    
    .dpad-center {
        top: 30px;
        left: 30px;
        width: 30px;
        height: 30px;
    }
    
    .fire-button {
        width: 60px;
        height: 60px;
        font-size: 11px;
    }
    
    .pause-button,
    .start-button {
        width: 45px;
        height: 45px;
        font-size: 14px;
    }
}

/* Show touch controls on touch devices or when explicitly enabled */
@media (hover: hover) and (pointer: fine) {
    .touch-controls {
        display: none;
    }
    
    /* Force show touch controls for testing/debugging */
    .html5-shooter-container.force-touch-controls .touch-controls,
    .html5-shooter-container.touch-device .touch-controls {
        display: flex !important;
    }
}

/* Animation effects */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.dpad-button:hover,
.fire-button:hover,
.pause-button:hover,
.start-button:hover {
    animation: pulse 0.5s ease-in-out;
}

/* Game canvas container responsive */
.game-canvas-container {
    width: 100%;
    max-width: 800px;
}

.game-canvas-container canvas {
    width: 100%;
    height: auto;
    max-height: 400px;
}
