@font-face {
  font-family: "Inter Tight";
  src: url("/inter-tight-500-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --page: #1c1c1e;
  --surface: #18181b;
  --raised: #212124;
  --soft: #29292d;
  --line: #3a3a40;
  --text: #f6f6f7;
  --muted: #a5a5ad;
  --faint: #707079;
  --blue: #2693ff;
  --blue-strong: #087fe9;
  --green: #36bf8c;
  --red: #ee3a43;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; touch-action: manipulation; background: var(--page); color: var(--text);
  font: 16px/1.4 "Inter Tight", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
button, .btn { font: inherit; color: var(--text); cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.screen { display: flex; flex-direction: column; height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.screen[hidden] { display: none; }

.banner { position: fixed; z-index: 10; top: calc(env(safe-area-inset-top) + 8px); left: 12px; right: 12px;
  background: #3d2f05; color: #ffd58a; border: 1px solid #6b5212; padding: 12px 14px; border-radius: var(--radius);
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px;
  border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line); font-weight: 600; text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-strong); }
.btn.block { width: 100%; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); }
.icon-btn:active { background: var(--soft); }
.icon-btn.on { color: var(--blue); background: rgba(38,147,255,.14); }
/* Same look as the share page's tracer button: round blue when on. */
.trace-btn img { width: 25px; height: 25px; display: block; }
.trace-btn.on { background: #168cf0; border-radius: 50%; box-shadow: 0 4px 12px rgba(22,140,240,.3); }
.icon-btn.small { width: 34px; height: 38px; color: var(--text); }
.link-btn { color: var(--muted); font-size: 15px; padding: 10px; text-decoration: underline; text-underline-offset: 3px; }

/* load */
.load { justify-content: center; align-items: center; padding-left: 16px; padding-right: 16px; }
.load-card { width: 100%; max-width: 420px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand b { color: var(--blue); }
.load h1 { margin: 22px 0 6px; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
.sub { margin: 0; color: var(--muted); }
#load-form { margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.link-field { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 6px 6px 14px; }
.link-field:focus-within { border-color: var(--blue); }
#link-input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: none; border: 0; outline: 0; padding: 8px 0; }
#link-input::placeholder { color: var(--faint); }
.error { margin: 0; color: #ff8a8f; font-size: 14px; }
.steps { list-style: none; margin: 28px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; color: var(--muted); font-size: 15px; }
.steps li { display: flex; align-items: center; gap: 12px; }
.steps span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--text); font-size: 13px; font-weight: 700; flex: none; }

/* studio */
/* Back on the left, actions on the right; the title takes the space between. */
.topbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; padding: 6px 8px; }
.topbar-side { display: flex; align-items: center; gap: 4px; }
.topbar-side.right { justify-content: flex-end; }
.swing-title { min-width: 0; max-width: 52vw; text-align: center; display: flex; align-items: baseline; justify-content: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swing-title small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.stage-wrap { flex: 1; min-height: 0; position: relative; display: flex; justify-content: center; align-items: center; padding: 0 8px; }
#stage { height: 100%; max-width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 16px; touch-action: none; }
.studio.recording #stage { box-shadow: 0 0 0 3px var(--red); }
.rec-badge { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: center;
  background: rgba(0,0,0,.65); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-badge[hidden] { display: none; }
.rec-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.rec-badge .limit { color: var(--muted); font-weight: 500; }
@keyframes blink { 50% { opacity: .25; } }
/* Guideline tray: a row under the top bar, so it never covers the video or the controls. */
.guideline-tray { display: flex; justify-content: center; gap: 6px; padding: 2px 8px 8px; overflow-x: auto; }
.guideline-tray[hidden] { display: none; }
.guideline-button { width: 46px; height: 46px; flex: none; display: grid; place-items: center; padding: 3px; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--line); }
.guideline-button img { height: 34px; width: auto; display: block; object-fit: contain; pointer-events: none; }
.guideline-button.is-active { background: #168cf0; border-color: #168cf0; box-shadow: 0 4px 12px rgba(22,140,240,.3); }
.guides-btn { position: relative; }
/* Two guideline icons stacked on one golfer: guides_dtl.png (spine + head line), guides_fo.svg (head circle + core box). */
.guides-btn img { height: 27px; width: auto; display: block; }
.guides-btn .badge { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #ffd100; }
.guides-btn .badge[hidden] { display: none; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; font-weight: 700;
  text-shadow: 0 4px 30px rgba(0,0,0,.6); pointer-events: none; }
.countdown[hidden] { display: none; }
.hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 40px);
  background: rgba(0,0,0,.75); padding: 8px 14px; border-radius: 999px; font-size: 14px; text-align: center; pointer-events: none; }
.hint[hidden] { display: none; }

.dock { padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 10px; }
/* Phase strip + frame ruler, ported from the share page (share_swing_web/assets/css/styles.css). */
.timeline { display: flex; flex-direction: column; gap: 4px; background: rgba(10,10,12,.9);
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 4px; }
.phase-strip { --phase-count: 10; display: grid; grid-template-columns: repeat(var(--phase-count), minmax(0, 1fr)); column-gap: 1px; }
.phase-strip[hidden] { display: none; }
.phase-button { min-width: 0; height: 52px; display: flex; align-items: center; justify-content: center; padding: 4px 0;
  overflow: hidden; border-radius: 11px; }
.phase-button img { width: auto; height: clamp(30px, 9vw, 40px); display: block; pointer-events: none; }
.phase-button.is-active { background: #168cf0; box-shadow: 0 4px 12px rgba(22,140,240,.3); }
.playback { display: flex; align-items: center; gap: 4px; }
.frame-scrubber { --ruler-offset: 0px; --ruler-width: 0px; flex: 1; min-width: 0; position: relative; height: 40px;
  overflow: hidden; background: #09090b; border-radius: 10px; cursor: ew-resize; touch-action: none; }
.frame-ruler { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--ruler-width);
  background-image:
    linear-gradient(to right, rgba(255,255,255,.92) 0 2px, transparent 2px),
    linear-gradient(to right, rgba(255,255,255,.84) 0 1px, transparent 1px),
    linear-gradient(to right, rgba(255,255,255,.76) 0 1px, transparent 1px);
  background-position: left center; background-repeat: repeat-x; background-size: 120px 16px, 60px 12px, 12px 8px;
  transform: translateX(calc(0px - var(--ruler-offset))); pointer-events: none; will-change: transform; }
.frame-ruler::before { content: ""; position: absolute; top: 50%; right: 0; width: 2px; height: 16px;
  background: rgba(255,255,255,.92); transform: translateY(-50%); }
.frame-ruler::after { content: ""; position: absolute; top: 50%; right: 0; left: 0; height: 1px;
  background: rgba(255,255,255,.76); transform: translateY(-50%); }
.frame-playhead { position: absolute; z-index: 1; top: 2px; bottom: 2px; left: 50%; width: 3px; background: #ff6f6f;
  transform: translateX(-50%); pointer-events: none; }
.frame-scrubber.is-scrubbing { cursor: grabbing; }
.tools { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 5px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tool.on { background: var(--blue); color: #fff; }
.tool.mode { min-width: 58px; margin-left: 2px; border-left: 1px solid var(--line); border-radius: 0 12px 12px 0; color: var(--text); }
.tool.mode.fading { color: #ffd60a; }
.bottom-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.colors { display: flex; gap: 5px; }
.color { width: 23px; height: 23px; flex: none; border-radius: 50%; background: var(--c); border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--page); }
.color.on { border-color: var(--text); }
.colors, .edit { display: flex; align-items: center; height: 70px; }
.edit { justify-content: flex-end; gap: 4px; }
.edit .icon-btn { color: var(--text); }
.rec-btn { width: 70px; height: 70px; border-radius: 50%; border: 4px solid var(--text); display: grid; place-items: center; }
.rec-btn span { width: 52px; height: 52px; border-radius: 50%; background: var(--red); transition: all .2s ease; }
.rec-btn.recording span { width: 26px; height: 26px; border-radius: 6px; }
.studio.recording .topbar #back-btn { visibility: hidden; }

/* result */
.result { padding-left: 16px; padding-right: 16px; gap: 14px; max-width: 520px; margin: 0 auto; width: 100%; }
.result-head { padding-top: 14px; }
.result-head h2 { margin: 0 0 2px; font-size: 22px; }
#result-video { flex: 1; min-height: 0; width: 100%; background: #000; border-radius: 16px; }
.result-actions { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; align-items: center; }

@media (max-width: 360px) {
  .color { width: 19px; height: 19px; }
  .colors { gap: 4px; }
  .rec-btn { width: 62px; height: 62px; }
  .rec-btn span { width: 46px; height: 46px; }
}

.zoom-reset { position: absolute; top: 12px; right: 20px; background: rgba(0,0,0,.65); }
.zoom-reset[hidden] { display: none; }
