* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111;
    font-family: Arial, Helvetica, sans-serif;
}

#game {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#gameCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* HUD */

#hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.top-left {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 260px;
}

.player-name {
    color: white;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px #000;
}

.stat {
    margin-bottom: 7px;
}

.stat span {
    display: block;
    color: white;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 3px;
}

.bar {
    width: 220px;
    height: 10px;
    background: rgba(0,0,0,.7);
    border: 1px solid rgba(255,255,255,.4);
}

.bar div {
    width: 100%;
    height: 100%;
    background: #e53935;
    transition: width .15s;
}

.bar.armor div {
    background: #2196f3;
}

.wanted {
    position: absolute;
    top: 25px;
    right: 220px;
    font-size: 28px;
    color: #fff;
    text-shadow: 2px 2px 4px #000;
}

.money {
    position: absolute;
    right: 25px;
    top: 20px;
    color: #7cff72;
    font-size: 27px;
    font-weight: bold;
    text-shadow: 2px 2px 5px #000;
}

.mission {
    position: absolute;
    left: 20px;
    bottom: 30px;
    width: 280px;
    padding: 14px 18px;
    background: rgba(0,0,0,.72);
    border-left: 4px solid #ffd400;
    color: white;
}

.mission-title {
    color: #ffd400;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
}

#missionText {
    font-size: 14px;
}

.minimap {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 190px;
    height: 190px;
    padding: 5px;
    background: rgba(0,0,0,.65);
    border: 2px solid rgba(255,255,255,.65);
    border-radius: 4px;
}

#miniMap {
    width: 180px;
    height: 180px;
}

/* Vehicle */

#vehicleInfo {
    position: absolute;
    right: 225px;
    bottom: 30px;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    color: white;
    text-shadow: 2px 2px 4px #000;
}

#vehicleStatus {
    font-size: 16px;
    font-weight: bold;
}

#speed {
    font-size: 28px;
    font-weight: 900;
}

/* Mobile */

#mobileControls {
    display: none;
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.movement {
    position: absolute;
    left: 20px;
    bottom: 25px;
    pointer-events: auto;
    text-align: center;
}

.movement button,
.actions button {
    width: 58px;
    height: 58px;
    margin: 3px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: white;
    font-size: 21px;
    touch-action: none;
}

.actions {
    position: absolute;
    right: 20px;
    bottom: 25px;
    display: flex;
    pointer-events: auto;
}

.actions button {
    width: 68px;
    height: 68px;
    font-size: 28px;
}

#message {
    position: absolute;
    left: 50%;
    top: 18%;
    transform: translateX(-50%);
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 5px #000;
    opacity: 0;
    transition: opacity .2s;
}

/* Mobile */

@media (max-width: 800px) {

    #mobileControls {
        display: block;
    }

    .minimap {
        width: 130px;
        height: 130px;
        right: 10px;
        bottom: 150px;
    }

    #miniMap {
        width: 120px;
        height: 120px;
    }

    .top-left {
        left: 10px;
        top: 10px;
        width: 180px;
    }

    .player-name {
        font-size: 14px;
    }

    .bar {
        width: 160px;
    }

    .wanted {
        top: 10px;
        right: 10px;
        font-size: 21px;
    }

    .money {
        top: 42px;
        right: 10px;
        font-size: 20px;
    }

    .mission {
        bottom: 150px;
        left: 10px;
        width: 210px;
    }
}