* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: Arial, sans-serif;
}

#game {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

#gameCanvas {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    display: block;
}

#hud {
    position: absolute;
    left: 15px;
    right: 15px;
    top: 15px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
    z-index: 5;
}

.hudBox {
    background: rgba(0, 0, 0, .65);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    padding: 9px 12px;
    color: white;
    font-size: 13px;
    backdrop-filter: blur(5px);
}

#message {
    position: absolute;
    left: 50%;
    top: 82%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 8px #000;
    opacity: 0;
    transition: opacity .2s;
    z-index: 10;
    text-align: center;
    width: 90%;
}

#crosshair {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,.75);
    font-size: 22px;
    z-index: 4;
    pointer-events: none;
}

.screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle,
        rgba(50,0,0,.15),
        rgba(0,0,0,.92));
}

.hidden {
    display: none !important;
}

.panel {
    width: min(440px, 90%);
    padding: 35px 25px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 15px;
    background: rgba(8,8,8,.94);
    box-shadow: 0 0 70px rgba(0,0,0,.9);
    text-align: center;
    color: white;
}

.skull {
    font-size: 58px;
    margin-bottom: 10px;
}

.panel h1 {
    color: #d00;
    letter-spacing: 4px;
    font-size: 30px;
    text-shadow: 0 0 20px #500;
}

.panel h2 {
    color: #aaa;
    font-size: 15px;
    letter-spacing: 5px;
    margin-top: 5px;
}

.panel p {
    color: #ccc;
    line-height: 1.7;
    margin: 22px 0;
}

.panel button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 15px;
    background: #a40000;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: .2s;
}

.panel button:hover {
    background: #d00000;
    transform: scale(1.02);
}

.panel small {
    display: block;
    color: #777;
    line-height: 1.8;
    margin-top: 20px;
}

#mobileControls {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

#joystick {
    position: absolute;
    left: 25px;
    bottom: 30px;
    width: 125px;
    height: 125px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.2);
    background: rgba(0,0,0,.25);
    pointer-events: auto;
    touch-action: none;
}

#stick {
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    border: 1px solid rgba(255,255,255,.4);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#mobileActions {
    position: absolute;
    right: 22px;
    bottom: 35px;
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

#mobileActions button {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(0,0,0,.55);
    color: white;
    font-size: 24px;
    touch-action: none;
}

@media (min-width: 800px) {
    #mobileControls {
        display: none;
    }
}

@media (max-width: 600px) {

    #hud {
        top: 8px;
        left: 7px;
        right: 7px;
    }

    .hudBox {
        padding: 7px;
        font-size: 10px;
    }

    .panel h1 {
        font-size: 23px;
    }
}