@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&display=swap');

body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #e0e0e0;
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    /* Safe area for notch/home bar on iOS */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
}

canvas {
    image-rendering: pixelated;
    display: block;
    width: 100%;
    height: 100%;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: none;
    text-shadow: 2px 2px #000;
}

/* ── HP bars ── */
.hp-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.hp-label {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
    width: 36px;
    flex-shrink: 0;
}

.hp-bar {
    width: 160px;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
}

.hp-fill {
    height: 100%;
    transition: width 0.2s ease;
}

.hp-fill.cyan {
    background: linear-gradient(90deg, #00ffff, #0088ff);
    box-shadow: 0 0 8px #00ffff;
}

.hp-fill.orange {
    background: linear-gradient(90deg, #ffaa00, #ff6600);
    box-shadow: 0 0 8px #ffaa00;
}

/* ── Vertical flight energy bar (right side) ── */
#flight-energy-bar {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 160px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(0,255,255,0.4);
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
    pointer-events: none;
}

#flight-energy-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, #00ffff, #0088ff);
    box-shadow: 0 0 8px #00ffff;
    transition: height 0.2s ease;
}

#status-text {
    font-size: 14px;
    font-weight: bold;
    color: #00ffff;
    letter-spacing: 1px;
}

#weapon-text {
    font-size: 11px;
    font-weight: bold;
    color: #888;
    letter-spacing: 0.5px;
    margin-top: 4px;
    transition: color 0.1s;
}

#controls-hint {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* Mobile Controls */
#virtual-controls {
    display: none; /* Hidden by default, show on mobile */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#joystick-zone {
    position: absolute;
    bottom: 50px;
    left: 50px;
    width: 150px;
    height: 150px;
    pointer-events: auto;
}

#joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    top: 15px;
    left: 15px;
}

#joystick-knob {
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 255, 0.5);
    border: 2px solid #00ffff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px #00ffff;
}

/* L invertido: EJECT topo-direita, SHOT meio-direita, JUMP baixo-esquerda */
#action-zone {
    position: absolute;
    bottom: 7%;
    right: 20px;
    width: 180px;
    height: 240px;
    pointer-events: none;
}

#btn-eject {
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: auto;
}

#btn-shoot {
    position: absolute;
    top: 76px;
    right: 0;
    pointer-events: auto;
}

#btn-jump {
    position: absolute;
    bottom: 0;
    right: 90px;
    pointer-events: auto;
}



.touch-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #00ffff;
    font-weight: bold;
    font-size: 14px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
    background: rgba(0, 255, 255, 0.2);
    transform: scale(0.95);
}

#btn-eject {
    width: 56px !important;
    height: 56px !important;
    font-size: 9px;
    border-color: #ffaa00 !important;
    color: #ffaa00 !important;
}


/* Start overlay — fullscreen trigger */
#start-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#start-content {
    text-align: center;
}

#start-title {
    font-size: 32px;
    font-weight: 700;
    color: #00ffff;
    letter-spacing: 4px;
    text-shadow: 0 0 20px #00ffff;
    margin-bottom: 24px;
}

#start-tap {
    font-size: 16px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 2px;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* Orientation Warning */
#orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.warning-content {
    padding: 20px;
}

.rotate-icon {
    font-size: 50px;
    margin-bottom: 20px;
    animation: rotate 2s infinite linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Media Queries for Mobile/Handheld */
@media (pointer: coarse) {
    #virtual-controls {
        display: block;
    }
    #controls-hint {
        display: none;
    }
}

@media screen and (orientation: portrait) {
    #orientation-warning {
        display: flex;
    }
}
