:root { color-scheme: dark; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #0b1019; color: #e9edf5; font-synthesis: none; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
.stage { position: fixed; inset: 0; overflow: hidden; background: #172230; }
canvas { width: 100%; height: 100%; display: block; }
body[data-state="ready"] canvas { cursor: grab; touch-action: none; user-select: none; }
body[data-state="ready"] canvas.dragging { cursor: grabbing; }
.brand { position: absolute; z-index: 1; top: calc(20px + env(safe-area-inset-top)); left: calc(20px + env(safe-area-inset-left)); display: inline-flex; gap: 11px; align-items: center; color: #e9edf5; text-decoration: none; font-size: 21px; font-weight: 650; letter-spacing: -.6px; }
.brand svg, .brand-dot { color: #8ce6cf; }
.brand:focus-visible { outline: 2px solid #8ce6cf; outline-offset: 4px; }
.metrics { position: absolute; z-index: 1; bottom: calc(20px + env(safe-area-inset-bottom)); left: calc(20px + env(safe-area-inset-left)); display: flex; align-items: center; gap: 13px; color: #9aaabc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; letter-spacing: 1px; font-variant-numeric: tabular-nums; pointer-events: none; }
.divider { height: 10px; width: 1px; background: #455063; }
button { border: 1px solid #3a4656; border-radius: 8px; background: #0b1019b3; color: #c6d0de; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 12px; cursor: pointer; }
button:hover:enabled { background: #233142; border-color: #65788d; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible { outline: 2px solid #8ce6cf; outline-offset: 3px; }
.icon-button { position: absolute; z-index: 1; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); width: 44px; height: 44px; padding: 0; }
.icon-button, .icon-button:hover:enabled { border: 0; background: transparent; color: #fff; }
.fullscreen-exit, .icon-button[data-active="true"] .fullscreen-enter { display: none; }
.icon-button[data-active="true"] .fullscreen-exit { display: initial; }
.render-controls { position: absolute; z-index: 1; right: calc(20px + env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); width: 220px; max-width: calc(100% - 40px); display: grid; gap: 12px; }
.control-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 11px; color: #c6d0de; }
.control-label output { color: #9aaabc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; }
.control-value { display: flex; align-items: center; }
.control-step { display: none; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 24px; margin: 2px 0 0; padding: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: #526174; border-radius: 1px; }
input[type="range"]::-moz-range-track { height: 2px; background: #526174; border-radius: 1px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 10px; height: 10px; margin-top: -4px; border: 0; border-radius: 50%; background: #fff; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: #fff; }
input[type="range"]:focus-visible { outline: 2px solid #8ce6cf; outline-offset: 2px; border-radius: 3px; }
input[type="range"]:disabled { opacity: .4; cursor: default; }
.overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 32px; text-align: center; background: #101824ee; color: #b8c5d6; font-size: 14px; }
.overlay p { max-width: 540px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.spinner { width: 24px; height: 24px; border: 2px solid #354453; border-top-color: #8ce6cf; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.no-script { position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; margin: 0; background: #642424; padding: 16px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (max-width: 540px) {
  .metrics { bottom: calc(170px + env(safe-area-inset-bottom)); }
  .render-controls { width: 280px; gap: 0; }
  .control-label { align-items: center; }
  .control-value output { min-width: 52px; text-align: center; }
  .control-step { display: inline-flex; width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: #fff; font-size: 24px; font-weight: 300; }
  .control-step:hover:enabled { background: #ffffff0a; }
  .control input[type="range"] { display: none; }
}
