/* --- CONFIGURAÇÕES GERAIS E RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #050505;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    padding: 10px;
}

/* --- HUD (SISTEMA DE PONTOS) --- */
#hud {
    width: 95%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: clamp(8px, 2.5vw, 12px); /* Fonte se ajusta ao tamanho da tela */
    color: #b19cd9;
    text-shadow: 0 0 5px #b19cd9;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- ARENA DE JOGO (RESPONSIVA) --- */
.game-arena {
    position: relative;
    width: 95vw;
    height: 60vh; /* Altura menor para garantir espaço pro joystick no mobile */
    max-width: 400px;
    max-height: 600px;
    border: 3px solid #b19cd9;
    background: radial-gradient(circle at 50% 50%, #1a0033 0%, #000 100%);
    overflow: hidden;
    box-shadow: 0 0 25px rgba(177, 156, 217, 0.3);
    border-radius: 12px;
}

/* ANIMAÇÃO CRÍTICA (ARENA PISCANDO) */
@keyframes criticalAlert {
    0% { border-color: #b19cd9; }
    50% { border-color: #ff0055; box-shadow: 0 0 20px #ff0055; }
    100% { border-color: #b19cd9; }
}

.arena-critical-mode {
    animation: criticalAlert 0.8s infinite;
}

/* --- TERMINAL DE BOOT (CORRIGIDO) --- */
#boot-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    padding: clamp(15px, 5%, 25px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto; /* Permite rolar se o texto for maior que a arena */
}

#boot-text {
    font-size: clamp(12px, 3.5vw, 18px); /* Letras não ficam mais gigantes */
    line-height: 1.4;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.4);
}

#nick-selection {
    margin-top: 15px;
    width: 100%;
}

#nick-selection p {
    font-size: clamp(10px, 3vw, 14px);
    margin-bottom: 10px;
}

#player-nick {
    background: transparent;
    border: none;
    border-bottom: 2px solid #00ff41;
    color: #00ff41;
    font-size: clamp(16px, 4.5vw, 22px);
    width: 60%;
    outline: none;
    text-transform: uppercase;
}

#btn-ok {
    background: #00ff41;
    color: #000;
    font-family: 'Press Start 2P';
    font-size: 10px;
    padding: 8px 15px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 10px;
}

/* --- NAVE ESPACIAL CSS --- */
#ship-container {
    position: absolute;
    width: 35px;
    height: 35px;
    z-index: 10;
}

.ship-body {
    position: absolute;
    top: 5px;
    left: 10px;
    width: 15px;
    height: 22px;
    background: #eee;
    border-radius: 50% 50% 20% 20%;
}

.ship-cockpit {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 7px;
    height: 8px;
    background: #4deeea;
    border-radius: 50%;
    box-shadow: 0 0 10px #4deeea;
}

.ship-wing {
    position: absolute;
    top: 12px;
    width: 10px;
    height: 12px;
    background: #b19cd9;
}
.ship-wing.left { left: 0; transform: skewY(-20deg); }
.ship-wing.right { right: 0; transform: skewY(20deg); }

.engine-fire {
    position: absolute;
    bottom: -4px;
    left: 13px;
    width: 9px;
    height: 12px;
    background: linear-gradient(to bottom, #ff0055, transparent);
    border-radius: 50%;
    animation: enginePulse 0.2s infinite alternate;
}

@keyframes enginePulse {
    0% { height: 10px; opacity: 0.7; }
    100% { height: 18px; opacity: 1; }
}

/* --- JOYSTICK (PROPORCIONAL) --- */
#joystick-container {
    margin-top: 20px;
    width: clamp(100px, 25vw, 130px);
    height: clamp(100px, 25vw, 130px);
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystick-base {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(177, 156, 217, 0.4);
    border-radius: 50%;
    position: relative;
}

#joystick-stick {
    width: 45%;
    height: 45%;
    background: #b19cd9;
    border-radius: 50%;
    position: absolute;
    top: 27.5%;
    left: 27.5%;
    box-shadow: 0 0 15px #b19cd9;
}

/* --- MENUS E TELAS --- */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 90;
    text-align: center;
    padding: 20px;
}

.menu-box h1 {
    font-size: clamp(18px, 6vw, 24px);
    margin-bottom: 15px;
}

.menu-box p {
    font-size: clamp(8px, 2.5vw, 10px);
    line-height: 1.6;
}

.start-btn {
    background: transparent;
    border: 2px solid #b19cd9;
    color: #b19cd9;
    padding: 15px 30px;
    font-family: 'Press Start 2P';
    font-size: 10px;
    margin-top: 25px;
    cursor: pointer;
}

/* TERMINAL DE BOOT CORRIGIDO */
#boot-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    padding: 20px;
    z-index: 100;
    
    /* Alinhamento no Topo */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: flex-start;
    overflow-y: auto;
}

#boot-text {
    /* Tipografia Fluida: Min 12px, Ideal 3.5vw, Max 18px */
    font-size: clamp(12px, 3.5vw, 18px) !important; 
    line-height: 1.5;
    text-align: left;
    width: 100%;
}

/* Ajuste do Título da Arena (Sistemas Danificados) */
#emergency-alert {
    position: absolute;
    top: 10px;
    width: 100%;
    text-align: center;
    font-size: clamp(10px, 3vw, 16px); /* Responsivo */
    z-index: 5;
}

/* Garante que o alerta comece invisível */
#emergency-alert {
    display: none; 
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    z-index: 5;
}

/* Classe que o JS usará para mostrar o alerta */
.alert-visible {
    display: block !important;
}

/* --- NOVO ASTEROIDE ROCHOSO --- */
.obstacle {
    position: absolute;
    width: 32px;
    height: 32px;
    
    /* Gradiente para dar volume 3D */
    background: radial-gradient(circle at 30% 30%, #666 0%, #333 60%, #111 100%);
    
    /* Formato irregular de pedra */
    border-radius: 60% 40% 70% 30% / 50% 60% 30% 70%;
    
    /* Brilho neon ao redor */
    box-shadow: 
        inset -3px -3px 6px rgba(0,0,0,0.6),
        0 0 12px rgba(177, 156, 217, 0.5);
    
    z-index: 5;
    animation: rotateAsteroid 4s linear infinite;
}

/* Crateras do Asteroide */
.obstacle::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    top: 20%;
    left: 20%;
    box-shadow: 10px 12px 0 rgba(0,0,0,0.3);
}

/* Estilo do item de vida que cai do topo */
.life-item {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: #2ecc71; /* Verde esmeralda */
    border-radius: 50%; /* Formato circular */
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 0 15px #2ecc71;
    z-index: 5;
    animation: pulseLife 1s infinite alternate;
}

/* Animação para o item pulsar e chamar atenção */
@keyframes pulseLife {
    from { transform: scale(1); box-shadow: 0 0 10px #2ecc71; }
    to { transform: scale(1.2); box-shadow: 0 0 20px #2ecc71; }
}



/* Animação de rotação contínua */
@keyframes rotateAsteroid {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estilo do item de vida (✚) - Garanta que tenha esse nome */
.life-item {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #2ecc71, #27ae60);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 15px #2ecc71;
    z-index: 6;
}

