/* Real One Editor: a phone-first editor in the shape people already know from reel apps.
   True black, the video's amber, Anton for the lyric, a plain sans for the UI. */
:root {
  --bg: #000; --panel: #0f0f11; --panel2: #18181c; --line: #2a2a30; --ink: #fff; --soft: #a9a9b0;
  --acc: #f2a541; --display: "Anton", "Arial Narrow", sans-serif; --ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 16px; }
body { overflow: hidden; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.accent { color: var(--acc); }

.stage { height: 100vh; height: 100svh; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4vw; padding: 16px 3vw; }
.side { align-self: center; max-width: 440px; }
.side-l { justify-self: end; }
.side-r { justify-self: start; }
.big { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(44px, 4.6vw, 88px); line-height: .92; margin: 0 0 22px; }
.say { font-size: 22px; line-height: 1.35; margin: 0 0 16px; font-weight: 500; }
.honest { color: var(--soft); font-size: 17px; line-height: 1.4; margin: 0; }
.side-r .lab { margin-bottom: 8px; }
.status { font-size: 22px; line-height: 1.3; font-weight: 600; margin: 0 0 14px; }
.mini { font-family: var(--mono); font-size: 15px; line-height: 1.5; color: var(--soft); white-space: pre-wrap; margin: 0; max-height: 46vh; overflow: hidden; }

/* the phone */
.phone { position: relative; height: calc(100svh - 32px); max-height: 1040px; aspect-ratio: 9 / 19.5; background: var(--panel);
  border: 2px solid #26262b; border-radius: 46px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 0 10px #0a0a0b; }
.bar { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 0; }
.x { width: 44px; height: 44px; display: grid; place-items: center; }
.x svg, .tools svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.name { font-family: var(--display); text-transform: uppercase; font-size: 22px; letter-spacing: .02em; }
.export { height: 40px; padding: 0 18px; border-radius: 20px; border: 0; background: var(--acc); color: #000; font-weight: 700; }

.view { position: relative; flex: 1; min-height: 0; margin: 0 10px; border-radius: 14px; overflow: hidden; background: #111; container-type: size; }
#frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#parts-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pv { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.62); padding: 5px 10px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.trk { position: absolute; right: 10px; top: 10px; background: var(--acc); color: #000; padding: 5px 10px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.fxtag { position: absolute; left: 10px; bottom: 10px; right: 10px; font-size: 14px; font-weight: 700; color: #ffd9a6; text-shadow: 0 1px 3px #000; }
.fxtag:empty { display: none; }

.card { position: absolute; left: 6%; right: 6%; text-align: center; font-family: var(--display); text-transform: uppercase;
  font-size: 10.5cqw; line-height: .95; color: #fff; padding: 6px 8px; cursor: pointer; outline: none;
  text-shadow: 0 0 2px #000, 0 0 6px rgba(0,0,0,.95), 0 2px 10px rgba(0,0,0,.7); transition: top .35s, bottom .35s, transform .35s; }
.card .now { color: var(--c, #fff); }
.card[data-place="top"] { top: 8%; bottom: auto; transform: none; }
.card[data-place="bottom"] { bottom: 12%; top: auto; transform: none; }
.card[data-place="world"] { top: 34%; bottom: auto; font-size: 8cqw; transform: perspective(520px) rotateX(16deg) rotateY(-22deg) scale(.78); opacity: .96; }
.card.sel { outline: 2px dashed var(--acc); outline-offset: 4px; }
.card.sel::before, .card.sel::after { content: ""; position: absolute; width: 12px; height: 12px; background: var(--acc); border-radius: 2px; }
.card.sel::before { left: -10px; top: -10px; }
.card.sel::after { right: -10px; bottom: -10px; }

.time { height: 36px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-size: 15px; color: var(--soft); font-variant-numeric: tabular-nums; }
.time .hint { color: var(--ink); font-weight: 600; }

/* the timeline */
.tl { position: relative; flex: none; padding: 4px 0 8px 12px; border-top: 1px solid var(--line); overflow: hidden; }
.trk-row { display: flex; gap: 4px; height: 40px; margin-top: 6px; overflow: hidden; }
.secs button { flex: none; height: 36px; border: 0; border-radius: 8px; padding: 0 12px; font-size: 16px; font-weight: 700; color: #000; }
.secs button[aria-pressed="true"] { outline: 2px solid #fff; outline-offset: 1px; }
.lines button { flex: none; max-width: 150px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2);
  padding: 0 10px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.lines button[aria-pressed="true"] { border-color: var(--acc); background: #2a2114; color: #ffd9a6; }
.lines button .pl { display: inline-block; margin-right: 6px; color: var(--acc); font-weight: 700; }
.fxrow { height: 30px; }
.fxrow span { flex: none; height: 28px; border-radius: 7px; background: #4a1f0c; color: #ffb36b; font-size: 15px; font-weight: 700; padding: 4px 10px; white-space: nowrap; }
.fxrow .empty { background: transparent; color: var(--soft); font-weight: 500; padding-left: 2px; }
.head { position: absolute; left: 40%; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.6); }

/* the tools */
.tools { flex: none; height: 82px; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--panel); position: relative; z-index: 3; }
.tools button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--soft); min-height: 44px; }
.tools button[aria-pressed="true"] { color: var(--acc); }
.tools button[aria-pressed="true"] svg { stroke: var(--acc); }

/* the bottom sheet */
.sheet { position: relative; flex: none; z-index: 2; max-height: 52%; overflow: auto; background: var(--panel2);
  border-radius: 20px 20px 0 0; padding: 8px 18px 14px; margin-top: 8px; box-shadow: 0 -12px 30px rgba(0,0,0,.6); }
/* a tool open: the preview shrinks above it (never covered) and the timeline steps aside, as reel editors do */
.phone.open .tl, .phone.open .time { display: none; }
#clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.phone.fx .sheet { max-height: 40%; }
.phone.fx .card { display: none; }
.chips.one { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips.one button { flex: none; }
.heat { margin-top: 0; }
#fire-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fxlist { list-style: none; margin: 8px 0 0; padding: 0; }
.fxlist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #2b170c; color: #ffd0a0; border-radius: 12px; padding: 8px 12px; font-size: 16px; font-weight: 600; margin-top: 6px; }
.fxlist button { min-height: 36px; border: 0; background: none; color: var(--soft); font-size: 15px; text-decoration: underline; }
.heat { margin-top: 12px; background: #000; border: 1px solid #3a2a18; border-radius: 14px; padding: 10px 14px 12px; }
.heat .row2 .lab { color: #ffd0a0; font-size: 17px; }
.heat input[type=range] { height: 34px; accent-color: #ff7a1a; }
.heat .val { font-family: var(--display); font-size: 26px; color: #ffb36b; min-width: 64px; text-align: right; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: #3a3a42; margin: 2px auto 10px; }
.ptitle { font-family: var(--display); text-transform: uppercase; font-size: 26px; margin: 0 0 8px; }
.lab { font-size: 16px; font-weight: 600; color: var(--soft); margin: 12px 0 8px; }
.line-big { font-family: var(--display); text-transform: uppercase; font-size: 30px; line-height: 1; margin: 0; color: var(--acc); }
.note { font-size: 16px; color: var(--soft); line-height: 1.35; margin: 10px 0 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tiles.four { grid-template-columns: repeat(4, 1fr); }
.tiles button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 16px; font-weight: 700; padding: 8px; }
.tiles button[aria-pressed="true"] { border-color: var(--acc); background: #2a2114; color: var(--acc); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chips button { min-height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); padding: 0 16px; font-size: 16px; font-weight: 600; }
.chips button[aria-pressed="true"] { background: var(--acc); color: #000; border-color: var(--acc); }
.row2 { display: flex; align-items: center; gap: 12px; }
.row2 .lab { margin: 0; white-space: nowrap; }
.row2 input { flex: 1; accent-color: var(--acc); }
.go { min-height: 50px; width: 100%; border-radius: 14px; border: 0; background: var(--acc); color: #000; font-weight: 800; font-size: 17px; margin-top: 10px; }
.go:disabled { background: #3a3a42; color: #8a8a92; cursor: default; }
.ghost { min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 16px; }
.ghost:disabled { opacity: .4; cursor: default; }
.outs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.outs .go { grid-column: 1 / -1; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sw { width: 52px; height: 52px; border-radius: 50%; border: 3px solid transparent; outline: 1px solid #3a3a42; }
.sw[aria-pressed="true"] { border-color: #fff; }
.sw-any { width: auto; height: 52px; border-radius: 26px; outline: 1px solid #3a3a42; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 6px; font-weight: 600; background: var(--panel); }
.sw-any input { width: 40px; height: 40px; border: 0; padding: 0; background: none; border-radius: 50%; }
textarea { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 16px; line-height: 1.4; resize: none; }
textarea.changed { border-color: var(--acc); }
.cmd { font-family: var(--mono); font-size: 14px; line-height: 1.5; white-space: pre-wrap; background: #000; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 10px; max-height: 200px; overflow: auto; }
.done { background: #3fae5a !important; color: #000 !important; }
button:focus-visible, .card:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

@media (max-width: 1100px) { .side-r { display: none; } .stage { grid-template-columns: 1fr auto; } }
@media (max-width: 760px) {
  body { overflow: auto; }
  .stage { display: block; padding: 0; height: auto; }
  .side { display: none; }
  .phone { width: 100vw; height: 100vh; height: 100svh; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
