body {
    margin: 0;
    padding: 0;
    background: linear-gradient(45deg, #0a0a23, #1a1a3a);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace;
    color: white;
    overflow: hidden;
}

.game-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    position: relative;
}

#gameCanvas {
    border: 2px solid #00ffff;
    background: #000000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    cursor: pointer;
}

.hud {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 10px 20px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8);
}

.score { color: #00ff00; }
.level { color: #ffff00; }
.debris-count { color: #ff6600; }
.shockwaves { color: #ff00ff; }

.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: rgba(10, 10, 35, 0.95);
    padding: 30px 40px;
    border-radius: 15px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.6);
    text-align: center;
    font-family: 'Courier New', monospace;
    color: white;
    width: 90%;
    max-width: 500px;
}

.popup-content h2 {
    color: #00ff00;
    margin-top: 0;
    text-shadow: 0 0 10px #00ff00;
}

.popup-content p {
    color: #00ffff;
    margin-bottom: 25px;
}

.popup-content input {
    background: #000;
    border: 1px solid #00ffff;
    color: #ffff00;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    text-align: center;
    width: 80%;
    margin-bottom: 20px;
    border-radius: 5px;
}
 .popup-content input::placeholder {
    color: #ffff00;
    opacity: 0.5;
}

.popup-content button, #generate-report-btn {
    background: transparent;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
    margin-top: 10px;
}

.popup-content button:hover, #generate-report-btn:hover {
    background: #00ff00;
    color: #0a0a23;
    box-shadow: 0 0 15px #00ff00;
}

#generate-report-btn {
    border-color: #ffff00;
    color: #ffff00;
}
#generate-report-btn:hover {
     background: #ffff00;
     box-shadow: 0 0 15px #ffff00;
}

#instructions-text, #briefing-text {
    text-align: left;
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #00ffff;
    padding: 15px;
    border-radius: 5px;
    background: #00000044;
    line-height: 1.6;
}
#instructions-text strong, #briefing-text strong {
    color: #00ffff;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
}
.instruction-section {
    margin-bottom: 15px;
}
.instruction-section p, #briefing-text p {
    margin: 2px 0 2px 10px;
    padding: 0;
    color: white;
}

/* Classe per nascondere gli elementi */
.hud-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Transizione fluida per TUTTI gli elementi dell'HUD tramite la classe comune */
.hud-element {
    transition: opacity 0.5s ease-in-out;
}

footer {
    position: fixed;
    bottom: 5px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    pointer-events: none;
}