@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 0%, #04040f 0%, #000 70%);
    font-family: 'Press Start 2P', monospace;
    touch-action: none;
}

#wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 480px;
    gap: 0;
    padding: 2px 4px;
}

#hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 5px 8px;
    font-size: clamp(5px, 1.5vw, 9px);
    color: #44f;
    background: #020208;
    border: 2px solid #112;
    border-bottom: none;
    letter-spacing: 1px;
}

.hb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px
}

.hl {
    color: #224;
    font-size: .75em
}

.hv {
    color: #88f;
    text-shadow: 0 0 8px #44f
}

.hv.red {
    color: #f66;
    text-shadow: 0 0 8px #f33
}

.hv.gold {
    color: #ff0;
    text-shadow: 0 0 8px #aa0
}

#cw {
    position: relative;
    width: 100%;
    border: 2px solid #113;
    box-shadow: 0 0 60px rgba(30, 30, 255, .2), inset 0 0 30px rgba(0, 0, 0, .6);
    background: #000;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges
}

#scan {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(0, 0, 0, .15) 3px, rgba(0, 0, 0, .15) 4px);
}

#vign {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}

#ov {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 8, .92);
    gap: 14px;
    padding: 20px;
    text-align: center;
    z-index: 10;
}

#ov.hide {
    display: none
}

#ov-t {
    font-size: clamp(18px, 5.5vw, 36px);
    color: #44f;
    letter-spacing: 4px;
    text-shadow: 0 0 20px #44f, 0 0 40px #22a, 0 0 60px #115;
    animation: pulse 2s ease-in-out infinite alternate
}

@keyframes pulse {
    from {
        text-shadow: 0 0 10px #44f
    }

    to {
        text-shadow: 0 0 40px #44f, 0 0 80px #22a
    }
}

#ov-s {
    font-size: clamp(8px, 2.3vw, 13px);
    color: #f66;
    text-shadow: 0 0 12px #f33
}

#ov-i {
    font-size: clamp(5px, 1.4vw, 8px);
    color: #668;
    line-height: 2.4;
    max-width: 300px
}

.btn {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(7px, 2vw, 11px);
    color: #000;
    background: #44f;
    border: none;
    padding: 10px 22px;
    cursor: pointer;
    box-shadow: 0 5px 0 #114, 0 0 25px #44f4;
    transition: transform .08s;
    letter-spacing: 1px;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #114
}

.btn:hover {
    background: #66f
}

#dpad {
    display: none;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    gap: 8px;
    margin-top: 4px;
}

.dp-lr {
    display: flex;
    gap: 6px
}

.dp {
    font-size: 22px;
    min-width: 52px;
    height: 44px;
    background: rgba(80, 80, 255, .15);
    border: 2px solid rgba(80, 80, 255, .35);
    color: #88f;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.dp:active {
    background: rgba(80, 80, 255, .4)
}

.dp.fire {
    background: rgba(255, 50, 50, .15);
    border-color: rgba(255, 50, 50, .4);
    color: #f66;
    min-width: 80px
}

.dp.fire:active {
    background: rgba(255, 50, 50, .4)
}

@media(pointer:coarse) {
    #dpad {
        display: flex
    }
}