.doom {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #fff;
    font: 600 14px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0.12em;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.doom [hidden] {
    display: none !important;
}

.doom .screen {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* SDL keeps a 640x480 buffer; letterbox it instead of stretching on portrait screens */
    outline: none;
}

.doom .cover,
.doom .paused {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 9%;
    border: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}
.doom .cover {
    background: #000 url(/poster.png) center / contain no-repeat;
}
.doom .paused {
    align-items: center;
    padding: 0;
    background: rgb(0 0 0 / 0.55);
}
.doom .label {
    padding: 0.5em 0.9em;
    border: 2px solid #b11;
    background: rgb(0 0 0 / 0.8);
}
.doom .cover:hover .label,
.doom .cover:focus-visible .label {
    background: #b11;
}

/* Touch controls: phones only. Two zones split the screen; buttons sit on top of the right one. */
.doom .touch {
    display: none;
    position: absolute;
    inset: 0;
}
@media (pointer: coarse) {
    .doom .touch {
        display: block;
    }
}
.doom .move-zone,
.doom .look-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    touch-action: none;
}
.doom .move-zone {
    left: 0;
}
.doom .look-zone {
    right: 0;
}

/* Joystick base rests bottom-left and jumps to wherever the thumb lands (joystick.js sets left/top). */
.doom .stick {
    position: absolute;
    left: 64px;
    top: calc(100% - 64px);
    width: 96px;
    height: 96px;
    margin: -48px 0 0 -48px;
    border: 1px solid rgb(255 255 255 / 0.3);
    border-radius: 50%;
    background: rgb(255 255 255 / 0.08);
    pointer-events: none;
}
.doom .stick.active {
    background: rgb(255 255 255 / 0.15);
}
.doom .knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.35);
}

.doom .actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    align-items: end;
    justify-items: center;
}
.doom .actions button {
    width: 52px;
    height: 52px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 50%;
    background: rgb(255 255 255 / 0.15);
    color: #fff;
    font: inherit;
    font-size: 11px;
    letter-spacing: 0;
    touch-action: none;
}
.doom .actions .weapon {
    grid-area: 1 / 2;
    width: 40px;
    height: 40px;
    font-size: 9px;
}
.doom .actions .use {
    grid-area: 2 / 1;
}
.doom .actions .fire {
    grid-area: 2 / 2;
    width: 72px;
    height: 72px;
    border-color: #b11;
    background: rgb(187 17 17 / 0.35);
}
