* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #080b12;
    font-family: Arial, Helvetica, sans-serif;
    color: white;
    user-select: none;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
}

#game {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 1400px;
    overflow: hidden;
    background: #101722;
}

#gameCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* ================= HUD ================= */

.hud {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;

    display: flex;
    align-items: center;
    gap: 10px;

    pointer-events: none;
    z-index: 5;
}

.hudBox {
    min-width: 115px;
    padding: 8px 12px;

    display: flex;
    align-items: center;
    gap: 9px;

    background: rgba(7, 11, 18, 0.84);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;

    backdrop-filter: blur(6px);
}

.hudIcon {
    font-size: 23px;
}

.hudBox small {
    display: block;
    color: #9ba8b8;
    font-size: 9px;
    letter-spacing: 1px;
}

.hudBox strong {
    display: block;
    margin-top: 2px;
    font-size: 17px;
}

.waveBox {
    margin-left: auto;

    padding: 11px 18px;

    border-radius: 10px;

    background: rgba(255, 102, 0, 0.88);

    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
}

#waveText {
    font-size: 20px;
}

/* ================= RELOAD ================= */

#reloadText {
    position: absolute;

    left: 50%;
    top: 54%;

    transform: translate(-50%, -50%);

    padding: 10px 18px;

    border-radius: 8px;

    background: rgba(0,0,0,0.78);

    color: #ffd166;

    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;

    display: none;

    z-index: 8;
}

/* ================= SCREENS ================= */

.screen {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle at center,
            rgba(255,75,0,0.13),
            rgba(0,0,0,0.88)
        );

    z-index: 20;
}

.hidden {
    display: none !important;
}

.menuCard {
    width: min(430px, 90vw);

    padding: 35px 28px;

    text-align: center;

    background: rgba(13, 19, 29, 0.96);

    border: 1px solid rgba(255,255,255,0.12);

    border-radius: 20px;

    box-shadow:
        0 25px 70px rgba(0,0,0,0.55),
        inset 0 0 30px rgba(255,80,0,0.04);
}

.gameLogo {
    font-size: 35px;
    font-weight: 900;
    line-height: 1.05;

    color: #ffffff;

    text-shadow:
        0 3px 15px rgba(255,70,0,0.4);
}

.gameLogo span {
    display: block;
    font-size: 50px;
    margin-bottom: 6px;
}

.gameLogo b {
    display: block;
    color: #ff6b21;
}

.subtitle {
    margin-top: 12px;
    margin-bottom: 25px;

    color: #8e9aaa;
    font-size: 13px;
}

.mainBtn {
    width: 100%;

    padding: 15px 20px;

    border: 0;
    border-radius: 10px;

    background: linear-gradient(
        135deg,
        #ff7a18,
        #ff3d00
    );

    color: white;

    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;

    cursor: pointer;

    box-shadow:
        0 8px 25px rgba(255,70,0,0.25);

    transition: transform .15s;
}

.mainBtn:hover {
    transform: translateY(-2px);
}

.mainBtn:active {
    transform: scale(.97);
}

.controlsInfo {
    margin-top: 22px;

    padding-top: 18px;

    border-top: 1px solid rgba(255,255,255,0.08);

    text-align: left;

    color: #9ca8b7;

    font-size: 12px;
    line-height: 1.9;
}

.controlsInfo b {
    color: white;
}

.gameOverTitle {
    font-size: 38px;
    font-weight: 900;

    color: #ff4d25;

    text-shadow:
        0 0 25px rgba(255,60,0,.35);
}

.finalStats {
    display: flex;
    justify-content: space-around;

    margin: 28px 0;
}

.finalStats div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.finalStats span {
    color: #8490a0;
    font-size: 10px;
    letter-spacing: 1px;
}

.finalStats strong {
    font-size: 24px;
}

/* ================= MOBILE ================= */

#mobileControls {
    position: absolute;
    inset: 0;

    pointer-events: none;

    z-index: 10;

    display: none;
}

#joystick {
    position: absolute;

    left: 25px;
    bottom: 30px;

    width: 120px;
    height: 120px;

    border-radius: 50%;

    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(255,255,255,0.14);

    pointer-events: auto;
}

#stick {
    position: absolute;

    width: 48px;
    height: 48px;

    left: 34px;
    top: 34px;

    border-radius: 50%;

    background: rgba(255,110,30,0.85);

    box-shadow:
        0 5px 18px rgba(0,0,0,.3);
}

#mobileFire,
#mobileReload {
    position: absolute;

    border: 0;
    border-radius: 50%;

    color: white;

    pointer-events: auto;

    touch-action: none;
}

#mobileFire {
    right: 25px;
    bottom: 32px;

    width: 85px;
    height: 85px;

    background: rgba(255,65,15,.82);

    font-size: 30px;
}

#mobileReload {
    right: 125px;
    bottom: 40px;

    width: 55px;
    height: 55px;

    background: rgba(30,35,45,.9);

    font-size: 28px;
}

#mobileFire:active {
    transform: scale(.92);
}

/* ================= RESPONSIVE ================= */

@media (max-width: 700px) {

    .hud {
        top: 8px;
        left: 8px;
        right: 8px;

        gap: 5px;
    }

    .hudBox {
        min-width: 0;
        padding: 6px 8px;
    }

    .hudIcon {
        font-size: 17px;
    }

    .hudBox small {
        font-size: 7px;
    }

    .hudBox strong {
        font-size: 13px;
    }

    .waveBox {
        padding: 7px 10px;
        font-size: 9px;
    }

    #waveText {
        font-size: 15px;
    }

    #mobileControls {
        display: block;
    }

    .controlsInfo {
        font-size: 11px;
    }
}

@media (max-height: 550px) {

    .menuCard {
        padding: 20px;
    }

    .gameLogo {
        font-size: 27px;
    }

    .gameLogo span {
        font-size: 35px;
    }

    .controlsInfo {
        display: none;
    }
}

