:root {
  --bg: #06070b;
  --panel: #0c0e14;
  --line: #1c202b;
  --line-hi: #2b3142;
  --text: #eceae6;
  --dim: #8a8f9d;
  --coral: #ff6452;
  --pink: #ff3763;
  --orange: #ff7038;
  --blue: #1ba4ff;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --sans: Outfit, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(1100px 620px at 50% -12%, #11131c 0%, var(--bg) 62%) no-repeat var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 20px;
}

.head,
.bar,
.note {
  width: 100%;
  max-width: 1920px;
}

.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.01em;
}

h1 span {
  color: var(--dim);
}

.sub {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

/* The film. Its internal resolution is fixed; CSS only scales it. */
.stage {
  position: relative;
  width: min(100%, calc((100vh - 214px) * 16 / 9));
  max-width: 1920px;
  min-width: 320px;
  aspect-ratio: 16 / 9;
  background: #04050a;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.5s ease;
}

.stage[data-state='held'] {
  border-color: rgba(255, 100, 82, 0.55);
}

#film {
  display: block;
  width: 100%;
  height: 100%;
}

.veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: #04050a;
  color: var(--dim);
  font-size: 14px;
}

.veil[hidden] {
  display: none;
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #141722;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #1a1e2c;
  border-color: var(--line-hi);
}

.btn:focus-visible,
.scrub:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn.primary {
  min-width: 104px;
}

.btn.accent {
  border-color: transparent;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  color: #fff;
  font-weight: 600;
}

.btn.accent:hover {
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

#free[aria-pressed='true'] {
  border-color: var(--blue);
  background: #14233a;
}

.stage[data-cam='free'] #film {
  cursor: grab;
}

.stage[data-cam='free'] #film:active {
  cursor: grabbing;
}

.scrub {
  flex: 1 1 220px;
  min-width: 160px;
  height: 22px;
  margin: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

.clock {
  min-width: 122px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.sep {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: var(--line);
}

.field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 13px;
}

select {
  appearance: none;
  border: 1px solid var(--line);
  background: #141722;
  color: var(--text);
  font: inherit;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.note {
  margin: 0;
  min-height: 18px;
  color: var(--dim);
  font-size: 12.5px;
}

@media (max-width: 720px) {
  .page {
    padding: 12px;
  }
  .sep {
    display: none;
  }
  .clock {
    text-align: left;
  }
}
