@font-face { font-family: 'Anton'; src: url('/fonts/Anton.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/fonts/Outfit.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/InstrumentSerif-Italic.ttf') format('truetype'); font-style: italic; font-display: swap; }

:root { --bg:#0b0b12; --card:#161622; --line:#2a2a3a; --text:#f4f4f8; --dim:#a3a3b8; --hot:#ffe600; --pop:#ff2e88; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Outfit, system-ui, -apple-system, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
main { max-width: 520px; margin: 0 auto; padding: 0 16px 24px; }
[hidden] { display: none !important; }
a { color: var(--hot); }
h1 { font-family: Anton, Impact, sans-serif; font-weight: 400; font-size: clamp(40px, 12vw, 60px); line-height: 1.02; margin: 18px 0 10px; letter-spacing: .3px; text-transform: uppercase; }
h2 { font-size: 18px; margin: 22px 0 10px; }
.top { display: flex; justify-content: space-between; align-items: center; max-width: 520px; margin: 0 auto; padding: 14px 16px; }
.brand { font-weight: 800; font-size: 18px; text-decoration: none; color: var(--text); }
.badge { font-size: 14px; color: var(--dim); border: 1px solid var(--line); padding: 4px 8px; border-radius: 99px; }
.sub { color: var(--dim); font-size: 17px; line-height: 1.4; margin: 0 0 18px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 160px; border-radius: 22px; cursor: pointer;
  background: linear-gradient(135deg, var(--hot), #ffb800); color: #000; box-shadow: 0 10px 40px rgba(255,230,0,.18); }
.drop:active { transform: scale(.98); }
.drop-big { font-family: Anton, Impact, sans-serif; font-size: 40px; text-transform: uppercase; }
.drop-small { font-size: 14px; font-weight: 600; opacity: .75; }
.private { font-weight: 600; margin: 16px 0 4px; }
.fineprint { color: var(--dim); font-size: 14px; margin: 6px 0; }
.warn { background: #3a1020; border: 1px solid var(--pop); padding: 12px 14px; border-radius: 14px; margin-top: 14px; line-height: 1.4; }
.status { min-height: 22px; color: var(--dim); font-weight: 600; margin: 8px 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.chip small { display: block; font-weight: 500; color: var(--dim); font-size: 14px; }
.chip[aria-pressed="true"] { border-color: var(--hot); box-shadow: inset 0 0 0 1px var(--hot); }
.stage { position: relative; margin: 14px auto 0; width: min(100%, 300px); aspect-ratio: 9/16; border-radius: 18px; overflow: hidden; background: #000; }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.timeline { margin-top: 14px; }
.track { position: relative; height: 44px; }
.track input[type=range] { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.track input[type=range]::-webkit-slider-runnable-track { height: 8px; background: var(--line); border-radius: 8px; }
.track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid var(--hot); }
.track input[type=range]::-moz-range-track { height: 8px; background: var(--line); border-radius: 8px; }
.track input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--hot); }
.lane { position: relative; height: 44px; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; touch-action: none; }
.win { position: absolute; top: 4px; bottom: 4px; min-width: 44px; background: rgba(255,230,0,.35); border: 2px solid var(--hot); border-radius: 9px; cursor: grab; touch-action: none; display: flex; align-items: center; justify-content: center; }
.win span { font-size: 14px; font-weight: 800; color: var(--hot); white-space: nowrap; pointer-events: none; }
.win.dragging { cursor: grabbing; background: rgba(255,230,0,.55); }
.status.found { color: #000; background: var(--hot); font-size: 20px; font-weight: 800; padding: 12px 14px; border-radius: 14px; }
.marks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.mark { position: absolute; top: 8px; width: 4px; height: 28px; margin-left: -2px; background: var(--pop); border-radius: 2px; }
.mark.spike { background: #fff; opacity: .6; width: 2px; }
.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.row.small { font-size: 14px; color: var(--dim); }
.row.btns button { flex: 1; }
button, .solid, .ghost { font: inherit; font-weight: 700; border-radius: 14px; padding: 12px 14px; cursor: pointer; text-align: center; text-decoration: none; }
.solid { background: var(--hot); color: #000; border: 0; }
.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.link { background: none; border: 0; color: var(--dim); text-decoration: underline; padding: 8px 0; }
.big { font-size: 18px; padding: 16px; flex: 1; display: block; }
button:disabled { opacity: .45; cursor: default; }
.hint { color: var(--dim); font-size: 14px; margin: 8px 0; }
.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.style { text-align: left; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.style b { display: block; font-size: 16px; }
.style span { display: block; font-weight: 500; color: var(--dim); font-size: 14px; margin-top: 4px; line-height: 1.3; }
.style[aria-checked="true"] { border-color: var(--hot); box-shadow: inset 0 0 0 2px var(--hot); }
.opts { margin-top: 16px; display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.field input { font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 22px; height: 22px; }
.color { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.color input { width: 44px; height: 36px; border: 0; background: none; padding: 0; }
.seg label { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; font-weight: 600; font-size: 14px; }
.seg input { margin-right: 6px; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.progress { margin-top: 14px; }
.bar { height: 12px; background: var(--line); border-radius: 12px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--hot), var(--pop)); transition: width .15s linear; }
.result video { width: min(100%, 300px); aspect-ratio: 9/16; display: block; margin: 0 auto; border-radius: 18px; background: #000; }
footer { text-align: center; color: var(--dim); font-size: 14px; padding: 24px 16px 40px; border-top: 1px solid var(--line); margin-top: 24px; }
footer a { color: var(--dim); }
.doc { line-height: 1.55; }
.doc h1 { font-size: 44px; }
.doc li { margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #000; font-weight: 700; padding: 10px 16px; border-radius: 99px; z-index: 9; }

.note { background: var(--card); border: 1px solid var(--line); padding: 12px 14px; border-radius: 14px; margin-top: 14px; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 4px 0 8px; font-size: 14px; font-weight: 700; }
.steps li { flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--card); color: var(--dim); border: 1px solid var(--line); }
.steps li.on { color: var(--text); }
.steps li.done { color: #000; background: var(--hot); border-color: var(--hot); }
.stage video#out { position: static; width: 100%; height: 100%; opacity: 1; pointer-events: auto; display: block; background: #000; }
.result { margin-top: 12px; }
.result .save { font-size: 20px; padding: 18px; }
.result .row .big { margin-top: 0; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: flex; gap: 10px; align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(11,11,18,.94); border-top: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dock button { flex: 1; font-size: 18px; padding: 15px 12px; min-height: 52px; }
.dock #export { flex: 2; }
.dock-text { flex: 2; font-weight: 700; }
body:has(.dock:not([hidden])) footer { padding-bottom: 110px; }
footer a { display: inline-block; padding: 12px 8px; min-height: 44px; }
.check { min-height: 44px; }
.link { min-height: 44px; }

body.editing .hero { display: none; }
body.editing main { padding-top: 4px; }
