.nle-root {
    position: relative;
    width: 100%;
    height: var(--nle-height, 78vh);
    min-height: 540px;
    overflow: hidden;
    background: #1d221b;
    color: #eee6d4;
    border: 1px solid rgba(62, 62, 50, 0.95);
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    user-select: none;
    touch-action: none;
}
.nle-root * { box-sizing: border-box; }
.nle-root:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
}
.nle-canvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
    background: #8096a8;
    cursor: crosshair;
}
.nle-root::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(0,0,0,0.08)),
        radial-gradient(ellipse at center, rgba(255,255,255,0) 45%, rgba(0,0,0,0.18) 100%);
    mix-blend-mode: multiply;
}
.nle-topbar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    pointer-events: none;
    font-size: 13px;
    color: #eee6d4;
    text-shadow: 1px 1px 0 #000;
    z-index: 4;
}
.nle-title,
.nle-status,
.nle-hud,
.nle-help,
.nle-map,
.nle-controls button,
.nle-touch button {
    background: rgba(19, 22, 17, 0.76);
    border: 1px solid rgba(230, 224, 202, 0.38);
    box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 2px 2px 0 rgba(0,0,0,0.22);
}
.nle-title,
.nle-status { padding: 8px 10px; }
.nle-title { font-weight: 700; letter-spacing: 0.1px; }
.nle-status { min-width: 88px; text-align: right; }
.nle-controls {
    position: absolute;
    top: 54px;
    right: 10px;
    z-index: 5;
    display: flex;
    gap: 6px;
    align-items: center;
}
.nle-controls button,
.nle-touch button {
    appearance: none;
    color: #eee6d4;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    text-shadow: 1px 1px 0 #000;
}
.nle-controls button {
    padding: 8px 10px;
    min-width: 84px;
}
.nle-controls button:hover,
.nle-touch button:hover { background: rgba(45, 49, 39, 0.86); }
.nle-controls button:active,
.nle-touch button:active { background: rgba(91, 95, 76, 0.88); }
.nle-hud {
    position: absolute;
    left: 10px;
    bottom: 84px;
    width: min(440px, calc(100% - 20px));
    padding: 10px 11px;
    font-size: 12px;
    line-height: 1.43;
    pointer-events: none;
    white-space: pre-line;
    color: #eee6d4;
    text-shadow: 1px 1px 0 #000;
    z-index: 3;
}
.nle-map {
    position: absolute;
    right: 10px;
    bottom: 84px;
    width: 230px;
    height: 230px;
    display: block;
    pointer-events: none;
    background: rgba(120, 135, 145, 0.88);
    z-index: 3;
}
.nle-map canvas { width: 100%; height: 100%; display: block; }
.nle-map.nle-hidden { display: none; }
.nle-help {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 8px 10px;
    font-size: 12px;
    pointer-events: none;
    color: #eee6d4;
    text-shadow: 1px 1px 0 #000;
    z-index: 3;
}
.nle-touch {
    position: absolute;
    right: 10px;
    top: 96px;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(2, minmax(88px, 1fr));
    gap: 6px;
    opacity: 0.94;
}
.nle-touch.nle-hidden { display: none; }
.nle-touch button {
    padding: 10px 9px;
    min-height: 36px;
}
.nle-touch button[data-nle-hold="forward"] { grid-column: 1 / 3; }
.nle-touch button[data-nle-hold="back"] { grid-column: 1 / 3; }
@media (max-width: 820px) {
    .nle-root { min-height: 640px; height: 84vh; }
    .nle-topbar { font-size: 11px; }
    .nle-controls { top: 48px; left: 10px; right: 10px; justify-content: flex-end; flex-wrap: wrap; }
    .nle-controls button { font-size: 10px; padding: 8px 7px; min-width: 76px; }
    .nle-map { width: 156px; height: 156px; bottom: 136px; }
    .nle-hud { bottom: 136px; font-size: 11px; width: calc(100% - 184px); min-width: 176px; padding: 8px 9px; }
    .nle-help { bottom: 78px; font-size: 10px; padding: 7px 8px; }
    .nle-touch { left: 10px; right: 10px; top: auto; bottom: 10px; grid-template-columns: repeat(6, 1fr); }
    .nle-touch button { padding: 10px 4px; min-height: 44px; font-size: 10px; }
    .nle-touch button[data-nle-hold="forward"],
    .nle-touch button[data-nle-hold="back"] { grid-column: auto; }
}
