:root {
    color-scheme: dark;
    font-family: "Courier New", monospace;
    background: #10200f;
}

* { box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 30%, #496326 0, #223819 34%, #10200f 65%, #080b07 100%);
}

body {
    display: grid;
    place-items: center;
    touch-action: none;
    user-select: none;
}

#stage {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(96vw, 156vh, 1280px);
    border: clamp(2px, .5vw, 7px) solid #49301c;
    outline: 1px solid #a47639;
    box-shadow: 0 0 0 2px #080706, 0 0 42px rgba(91,127,43,.22), 0 18px 70px #000;
    background: #050504;
}

#stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,.026) 0, rgba(0,0,0,.026) 1px, transparent 1px, transparent 4px);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    image-rendering: pixelated;
    cursor: crosshair;
    outline: none;
}

canvas:focus-visible { box-shadow: inset 0 0 0 2px #d9b55f; }

.hud-strip {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    min-height: clamp(24px, 3vw, 38px);
    padding: clamp(5px, .65vw, 9px) clamp(9px, 1vw, 14px);
    color: #ffeba6;
    background: linear-gradient(180deg, #24180f, #120d0a);
    font-size: clamp(10px, 1.05vw, 14px);
    font-weight: bold;
    line-height: 1.25;
    letter-spacing: .035em;
}

.hud-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1em;
    border-bottom: 2px solid #8a6138;
}

#hud-location { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud-time { color: #d5a93f; white-space: nowrap; text-align: center; }
#hud-condition { color: #d75b48; text-align: right; white-space: nowrap; }

.hud-bottom {
    border-top: 2px solid #8a6138;
    color: #e5c47b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[hidden] { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-resolution: 1.5dppx) {
    canvas { image-rendering: auto; }
}

@media (prefers-reduced-motion: reduce) {
    #stage::after { display: none; }
}
