:root {
    color-scheme: dark;
    font-family: system-ui, sans-serif;
    background: #101615;
    color: #e8e9dd;
    --muted: #a5b0a5;
    --line: #35423b;
    --acid: #b7eb91;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.demo {
    display: flex;
    flex-direction: column;
    width: min(100% - 64px, 1320px);
    min-height: 100svh;
    margin: auto;
    padding-block: 16px 24px;
}
.masthead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 54px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}
.brand {
    font: 900 1.44rem/1 system-ui, sans-serif;
    letter-spacing: .18em;
    color: var(--acid);
}
.masthead-label { color: var(--muted); font-size: .875rem; }
.viewport {
    position: relative;
    isolation: isolate;
    flex: 1 0 auto;
    min-height: max(460px, calc(100svh - 173px));
    overflow: hidden;
    border: 1px solid var(--line);
    background: radial-gradient(ellipse at 54% 46%, #26342c, #151f1b 57%, #101614 96%);
}
.scene { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.scene[data-target] { cursor: crosshair; }
.scene[data-dragging] { cursor: grabbing; }
.scene canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.scene-heading, .readout { position: absolute; pointer-events: none; z-index: 1; }
.scene-heading { inset: 27px auto auto 30px; }
.eyebrow, .readout span {
    margin: 0;
    color: var(--acid);
    font: 600 .8125rem/1.2 ui-monospace, monospace;
    letter-spacing: .13em;
}
h1 {
    margin: 9px 0 0;
    font-size: clamp(2rem, 4.25vw, 4.4rem);
    font-weight: 750;
    letter-spacing: -.055em;
    line-height: .92;
}
.readout {
    inset: auto 28px 25px auto;
    display: grid;
    justify-items: end;
    gap: 6px;
}
.readout span { color: var(--muted); }
.readout output { font: 500 1.8rem/1 ui-monospace, monospace; color: var(--acid); }
.fallback { position: absolute; inset: 50% 20px auto; text-align: center; color: var(--muted); }
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
}
.controls p { color: var(--muted); margin: 0; line-height: 1.45; }
.actions { display: flex; gap: 8px; }
.button {
    border: 1px solid #506358;
    background: #1d2a23;
    color: #e8e9dd;
    font: 650 .9375rem/1 system-ui, sans-serif;
    white-space: nowrap;
    padding: 13px 18px;
    cursor: pointer;
}
.button:hover { background: #2a3c30; }
.button-primary { background: var(--acid); border-color: var(--acid); color: #162316; }
.button-primary:hover { background: #ccf7ad; }
.button:focus-visible { outline: 2px solid #eef4d9; outline-offset: 3px; }
.button:disabled { opacity: .52; cursor: default; }
@media (max-width: 680px) {
    .demo { width: calc(100% - 24px); padding: 4px 0 14px; }
    .masthead { margin-bottom: 8px; }
    .viewport { min-height: max(390px, calc(100svh - 186px)); }
    .scene-heading { inset: 17px auto auto 16px; }
    .readout { inset: auto 14px 14px auto; }
    .controls { align-items: flex-start; flex-direction: column; gap: 10px; padding-top: 12px; }
}
