:root {
  color-scheme: dark;
  --page: #101112;
  --surface: #191b1c;
  --line: #323535;
  --ink: #f0f3f0;
  --muted: #a2a9a4;
  --green: #a7f2be;
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
[hidden] { display: none !important; }
button, textarea, select, input { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.topbar { max-width: 1100px; margin: auto; display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; }
.brand { display: flex; gap: 11px; align-items: center; font-weight: 680; font-size: 1.28rem; letter-spacing: -.045em; }
.brand-mark { width: 25px; height: 18px; border: 2px solid var(--green); border-radius: 4px; position: relative; }
.brand-mark::after { content: ""; position: absolute; width: 10px; height: 5px; top: 4px; left: 5px; border-top: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: skewX(-27deg); }
.connection { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .86rem; }
.connection span { width: 7px; height: 7px; border-radius: 50%; background: #bc9b65; }
.connection.ready span { background: var(--green); }
main { width: min(100% - 56px, 1044px); margin: 6px auto 42px; }
.stage { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.stage-top { padding: 14px 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
h1 { font-size: 1.06rem; margin: 0; letter-spacing: -.028em; font-weight: 650; }
.format { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.viewport { position: relative; width: 100%; aspect-ratio: 832 / 480; background: #0d1010; }
.viewport canvas, .viewport video, .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; }
.placeholder { display: grid; align-content: center; justify-items: center; gap: 20px; color: var(--muted);
  background: radial-gradient(ellipse at center, #202c27, transparent 63%), #101414; }
.placeholder p { margin: 0 12px; text-align: center; }
.viewfinder { width: 96px; height: 68px; position: relative; display: grid; place-items: center; color: #7a9e88; }
.viewfinder i { position: absolute; width: 20px; height: 16px; border: solid currentColor; border-width: 0; }
.viewfinder i:nth-child(1) { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.viewfinder i:nth-child(2) { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.viewfinder i:nth-child(3) { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.viewfinder i:nth-child(4) { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
.viewfinder b { width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; }
.stage-bottom { padding: 13px 20px 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.stats { display: flex; gap: clamp(18px, 5vw, 53px); }
.stats div { display: grid; }
.stats strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .79rem; }
progress { width: 100%; height: 2px; display: block; border: 0; appearance: none; background: #303333; }
progress::-webkit-progress-bar { background: #303333; }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.composer { margin-top: 18px; padding: 16px 18px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.composer > label { font-weight: 620; font-size: .95rem; }
textarea { display: block; width: 100%; min-height: 76px; margin-top: 8px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); resize: vertical; background: #111414; color: var(--ink); }
.composer-bottom, .settings, .actions, .clip-actions { display: flex; gap: 10px; align-items: center; }
.composer-bottom { margin-top: 12px; justify-content: space-between; flex-wrap: wrap; align-items: flex-end; }
.settings { align-items: flex-end; flex-wrap: wrap; }
.control { display: grid; gap: 4px; }
.control > span { color: var(--muted); font-size: .82rem; }
select, input { min-height: 41px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #131616; color: var(--ink); font-size: .89rem; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, #afb8b1 50%), linear-gradient(135deg, #afb8b1 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.seed input { width: 110px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; padding: 8px 14px; text-decoration: none; border-radius: 8px; font-size: .88rem; white-space: nowrap; }
.primary { background: var(--green); color: #132319; border: 1px solid var(--green); font-weight: 700; }
.secondary { background: #202423; color: var(--ink); border: 1px solid var(--line); }
.notice { color: var(--muted); margin: 9px 0 0; min-height: 1.2em; font-size: .87rem; }
.notice:empty { display: none; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.examples button { color: var(--muted); border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 5px 12px; font-size: .86rem; }
.examples button:hover, .secondary:hover { color: var(--ink); border-color: #59615c; }
@media (max-width: 570px) {
  .topbar { padding: 17px 14px; }
  main { width: calc(100% - 28px); margin-top: 1px; }
  .stage-top, .stage-bottom { padding-inline: 12px; }
  .composer { padding-inline: 12px; }
  .actions { width: 100%; justify-content: flex-end; }
  input, select { font-size: 1rem; }
}
