* { box-sizing: border-box; }
:root {
    color-scheme: dark;
    font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
    color: #edf1f5;
    background: #090909;
    --muted: #9ca9bf;
    --mint: #b9e8df;
    --line: #3a455c;
}
[hidden] { display: none !important; }
body { margin: 0; overflow: hidden; }
#stage {
    position: fixed;
    inset: 0;
    background: #090909;
}
#stage canvas { display: block; touch-action: none; cursor: grab; }
#stage canvas.dragging { cursor: grabbing; }
.mast {
    position: fixed;
    top: clamp(1.1rem,4.2vw,3.5rem);
    left: clamp(1.2rem,4.3vw,4.5rem);
    right: clamp(1.2rem,4.3vw,4.5rem);
    display: flex;
    align-items: start;
    justify-content: space-between;
    pointer-events: none;
}
button, input, select, textarea { font: inherit; }
button {
    color: #edf1f5;
    background: #20283d;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: .52rem .8rem;
    cursor: pointer;
}
button:hover { background: #303b54; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #acd4db;
    outline-offset: 3px;
}
#toggle { pointer-events: auto; font-size: .8rem; }
kbd {
    margin-left: .45rem;
    padding: .04rem .25rem;
    border: 1px solid #525e73;
    border-radius: 3px;
    color: #d4deea;
    font: .7rem ui-monospace, Consolas, monospace;
}
#settings {
    position: fixed;
    top: clamp(4.25rem,8.4vw,8rem);
    right: clamp(1.2rem,4.3vw,4.5rem);
    width: min(320px,calc(100% - 2.4rem));
    max-height: calc(100dvh - 8.05rem);
    padding: 1.15rem;
    overflow: auto;
    background: #151c30ed;
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: 0 18px 70px #06071074;
}
.panel-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 .9rem; }
.panel-title h2 { margin: 0; font-size: 1rem; font-weight: 620; }
.quiet { padding: .2rem; border: 0; background: transparent; color: var(--muted); font-size: .74rem; }
.field { display: grid; gap: .29rem; min-width: 0; }
.field label, .value label { font-size: .77rem; color: #d3dbe7; }
select, textarea, input[type=number] {
    min-width: 0;
    width: 100%;
    background: #0e1527;
    color: #edf1f5;
    border: 1px solid #43506a;
    border-radius: 4px;
    padding: .38rem .42rem;
    font-size: .8rem;
}
.custom { margin-top: .8rem; }
textarea { resize: vertical; max-height: 6.5rem; }
#values { display: grid; gap: .65rem; margin: .85rem 0; }
.value { display: grid; grid-template-columns: minmax(0,1fr) 64px; align-items: center; gap: .16rem .7rem; }
.value input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: #abd8cf; margin: 0; }
.value input[type=number] { padding: .24rem .34rem; text-align: right; font-variant-numeric: tabular-nums; }
.accent { width: 100%; color: var(--mint); background: #263d44; }
#error {
    position: fixed;
    inset: 40% 1rem auto;
    margin: 0;
    text-align: center;
    color: #ffd6a8;
}
@media (max-width: 650px) {
    #settings { top: 4.4rem; }
}


#toggle { margin-left: auto; background: #101010e8; border-color: #565656; }
#settings { background: #141414f0; border-color: #454545; }
