/* Gainbus Teleprompter-App. Dark by use scene (filming, a phone in front of the face), Campera Media tones:
   warm off-white text, red only for recording. Inter is the CI face; the prompter offers two iOS faces besides. */
@font-face { font-family: "Inter"; src: url("fonts/Inter-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0E0F10; --panel: #17191B; --panel-2: #1F2124; --line: #2C2F33;
  --text: #F2F0EA; --text-2: #A9ADB3; --red: #EE4B43; --red-text: #FF7A72; --green: #4DB37A; --yellow: #E8C547;
  --r: 14px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 "Inter", -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
::selection { background: color-mix(in srgb, var(--red) 40%, transparent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Unlock and list ---------- */
.page { min-height: 100dvh; padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 28px); max-width: 640px; margin: 0 auto; display: grid; align-content: start; gap: 22px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.45; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--text-2); }
.field input { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 17px; }
.note { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.note.warn { border-color: color-mix(in srgb, var(--yellow) 45%, var(--line)); }
.group { display: grid; gap: 8px; }
.group h2 { margin: 6px 0 2px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); text-align: left; }
.item:active { background: var(--panel-2); }
.item .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-size: 13px; font-weight: 600; }
.item b { display: block; font-weight: 600; line-height: 1.3; }
.item .meta { display: block; margin-top: 3px; font-size: 13px; color: var(--text-2); }
.item .go { color: var(--text-2); display: grid; }
.item .go svg { width: 16px; height: 16px; }

/* ---------- Prompter ---------- */
.stage { position: fixed; inset: 0; background: #000; overflow: hidden; }
.stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage > video.selfie { transform: scaleX(-1); }
.stage .nocam { position: absolute; inset: auto 16px calc(var(--safe-b) + 170px); margin: 0; text-align: center; }
.pane { position: absolute; left: 0; right: 0; top: 0; padding-top: var(--safe-t); overflow: hidden; touch-action: none; }
.pane-in { position: relative; height: 100%; overflow: hidden; }
.txt { position: absolute; left: 0; right: 0; top: 0; padding: 0 22px 60vh; will-change: transform; }
.txt.mirror { transform-origin: center; }
.txt p { margin: 0 0 0.55em; font-weight: 600; line-height: 1.28; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.txt h3 { margin: 0.4em 0 0.5em; font-size: 0.55em; font-weight: 700; letter-spacing: 0.02em; opacity: 0.7; }
.txt .pause { white-space: nowrap; font-size: 0.5em; font-weight: 600; opacity: 0.6; padding: 0 0.3em; border-radius: 0.3em; background: color-mix(in srgb, currentColor 14%, transparent); vertical-align: 0.25em; }
.mark { position: absolute; left: 0; width: 10px; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 10px solid var(--red); margin-top: -9px; pointer-events: none; }
.f-inter { font-family: "Inter", system-ui, sans-serif; }
.f-rounded { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; }
.f-serif { font-family: ui-serif, "New York", Georgia, serif; }

.bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(var(--safe-b) + 14px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0)); }
.bar .left, .bar .right { display: flex; gap: 8px; align-items: center; }
.bar .right { justify-content: flex-end; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(30,32,35,0.82); color: var(--text); }
.round svg { width: 20px; height: 20px; }
.rec { width: 74px; height: 74px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.92); background: transparent; display: grid; place-items: center; padding: 0; }
.rec i { width: 56px; height: 56px; border-radius: 50%; background: var(--red); transition: border-radius 160ms cubic-bezier(.2,.8,.2,1), width 160ms cubic-bezier(.2,.8,.2,1), height 160ms cubic-bezier(.2,.8,.2,1); }
.rec.on i { width: 28px; height: 28px; border-radius: 7px; }
.rec:disabled { opacity: 0.4; }
.wpm { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 22px; background: rgba(30,32,35,0.82); }
.wpm button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; }
.wpm span { min-width: 44px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.1; }
.wpm small { display: block; font-size: 10px; font-weight: 500; color: var(--text-2); }
.meta-row { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 108px); display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.meta-row > * { pointer-events: auto; }
.clock { padding: 5px 10px; border-radius: 10px; background: rgba(14,15,16,0.72); font-size: 14px; }
.clock.live { color: #fff; background: color-mix(in srgb, var(--red) 82%, transparent); }
.count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 140px; font-weight: 700; color: #fff; text-shadow: 0 2px 30px rgba(0,0,0,0.6); pointer-events: none; }

/* ---------- Upload to Gainbus: one block on the list, in the settings and over the camera ---------- */
.up { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.up[hidden] { display: none; }
.up-text { display: grid; gap: 2px; min-width: 0; font-size: 13px; color: var(--text-2); }
.up-text b { font-size: 14px; font-weight: 600; color: var(--text); }
.up-track { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; }
.up-track i { display: block; height: 100%; background: var(--text); transform-origin: left; transition: transform 320ms cubic-bezier(.2,.8,.2,1); }
.up[data-state=done] .up-track i { background: var(--green); }
.up[data-state=stop] { border-color: color-mix(in srgb, var(--yellow) 45%, var(--line)); }
.up:is([data-state=wait], [data-state=stop], [data-state=none]) .up-track { display: none; }
.up .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.stage:has(.up-float:not([hidden])) .nocam { bottom: calc(var(--safe-b) + 256px); }
.up-float { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 162px); max-width: 420px; margin: 0 auto; background: rgba(14,15,16,0.8); border-color: transparent; }
@media (prefers-reduced-motion: reduce) { .up-track i { transition: none; } }

/* ---------- Sheets ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,0.45); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 62dvh; overflow: auto; padding: 18px 16px calc(var(--safe-b) + 18px); border-radius: 20px 20px 0 0; background: var(--panel); border-top: 1px solid var(--line); display: grid; gap: 16px; box-shadow: 0 -10px 40px rgba(0,0,0,0.4); }
.sheet h2 { margin: 0; font-size: 18px; padding-right: 90px; }
.sheet-done { position: absolute; top: 10px; right: 10px; min-height: 40px; }
.row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.row input[type=range] { width: 100%; accent-color: var(--text); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg); }
.seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 600; }
.seg button[aria-pressed=true] { background: var(--panel-2); color: var(--text); }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); }
.swatches button[aria-pressed=true] { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--text); }
.take-sheet { max-height: 92dvh; }
.take-video { display: block; width: 100%; max-height: 52dvh; border-radius: 12px; background: #000; object-fit: contain; }
.takes { display: grid; gap: 8px; }
.takes .btn { justify-content: space-between; font-variant-numeric: tabular-nums; }
.takes .btn .muted { font-weight: 500; }
.actions { display: grid; grid-auto-flow: column; gap: 10px; }
