/* =========================================================================
   Telescoping Video RPG — design system v2 ("Cinema black")
   Near-black canvas, Inter throughout, video as hero.
   Derived from the Claude-design v2 dark spec, with our app-specific
   component classes (.timeline-clip, .pick-card, etc.) re-themed.
   ========================================================================= */

:root {
  /* === Canvas / surfaces ===
     v1's --paper/--ink names are preserved so existing inline styles in the
     templates cascade automatically. The values are now a dark UI. */
  --paper:        #0b0b0e;
  --paper-warm:   #14141a;
  --paper-deep:   #1c1c24;
  --paper-edge:   rgba(255, 255, 255, 0.08);
  --paper-stain:  rgba(255, 255, 255, 0.18);

  /* === Type / ink ===  "ink" is now near-white on the dark canvas. */
  --ink:          #f4f4f7;
  --ink-soft:     #c5c5cf;
  --ink-muted:    #8a8a96;
  --ink-faint:    #56565f;

  /* === Accents — saturated cinema palette ===
     Single hot signal (oxblood) used sparingly: REC, LIVE, primary CTA. */
  --oxblood:      #ff4438;
  --oxblood-deep: #d72c20;
  --moss:         #3dd68c;
  --amber:        #ffb84a;
  --bruise:       #8a7dff;

  /* === Type system === */
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* === Elevation === */
  --shadow-card:  0 1px 0 rgba(0, 0, 0, 0.4),
                  0 2px 8px rgba(0, 0, 0, 0.25),
                  0 24px 60px -30px rgba(0, 0, 0, 0.7);
  --shadow-lift:  0 4px 12px rgba(0, 0, 0, 0.35),
                  0 28px 80px -20px rgba(0, 0, 0, 0.8);
  --shadow-glow:  0 0 0 1px rgba(255, 68, 56, 0.4),
                  0 12px 40px -8px rgba(255, 68, 56, 0.35);

  /* === Legacy compatibility aliases ===
     Older templates (authoring) reference these var names — map them onto
     the v2 system so those pages stay coherent without being touched. */
  --bg:       var(--paper);
  --panel:    var(--paper-warm);
  --panel-2:  var(--paper-deep);
  --border:   var(--paper-edge);
  --text:     var(--ink);
  --muted:    var(--ink-muted);
  --accent:   var(--oxblood);
  --warn:     var(--amber);
  --good:     var(--moss);
  --bad:      var(--oxblood);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  font-feature-settings: "cv11", "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* main is a transparent passthrough — each page owns its own width. */
main { display: block; min-height: 100vh; }

/* === Subtle canvas: soft warm/cool gradient, no noise overlay === */
.paper-bg {
  position: relative;
  background: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(255, 68, 56, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(138, 125, 255, 0.04), transparent 60%);
}
.paper-bg::before { content: none; }
.paper-bg > * { position: relative; z-index: 1; }

/* === Typography ===
   No serifs anywhere. Big headings get tight tracking + 600 weight. */
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.025em; }
.serif   { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; font-style: normal !important; }
.mono    { font-family: var(--font-mono); font-feature-settings: "ss02"; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 12px 0;
  color: var(--ink);
}
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
h4 { font-size: 17px; }
p  { margin: 0 0 12px 0; }

/* Sober links — underlined ink, not a hot accent. Oxblood is reserved
   for REC/LIVE/primary CTA so it stays meaningful. */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.28);
  text-underline-offset: 2px;
}
a:hover { text-decoration-color: var(--ink); }

/* Kill leftover italic transcript / quote styling — v2 has no italics
   anywhere. Catches both `font-style:italic` and `font-style: italic`
   spacings in inline style attributes. */
[style*="italic"] {
  font-style: normal !important;
  font-family: var(--font-sans) !important;
}
em { font-style: normal; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--paper-deep);
  padding: 1px 5px;
  border-radius: 4px;
}

/* === Eyebrow labels === */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow.plain::before { display: none; }

/* === Buttons — pill, tech-product feel === */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  border-radius: 999px;
  text-decoration: none;
  min-height: 42px;
  transition: transform 0.08s ease, background 0.12s, color 0.12s, border-color 0.12s;
  box-shadow: none;
}
button:hover, .btn:hover { background: #fff; border-color: #fff; color: #000; transform: translateY(-1px); text-decoration: none; }
button:active, .btn:active { transform: translateY(0); }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.18);
}
button.secondary:hover, .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--ink);
}
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
button.ghost:hover, .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
button.danger, .btn.danger, button.bad, .btn.bad {
  background: var(--oxblood);
  border-color: var(--oxblood);
  color: #fff;
}
button.danger:hover, .btn.danger:hover, button.bad:hover, .btn.bad:hover {
  background: var(--oxblood-deep);
  border-color: var(--oxblood-deep);
  color: #fff;
}
button.warn, .btn.warn { background: var(--amber); border-color: var(--amber); color: #000; }
button:disabled, .btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* === Chips / tags — pill === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}
.chip.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.good  { color: var(--moss);   border-color: rgba(61, 214, 140, 0.4); background: rgba(61, 214, 140, 0.08); }
.chip.warn  { color: var(--amber);  border-color: rgba(255, 184, 74, 0.4); background: rgba(255, 184, 74, 0.08); }
.chip.bad   { color: var(--oxblood); border-color: rgba(255, 68, 56, 0.4); background: rgba(255, 68, 56, 0.08); }
.chip.live  { color: #fff; background: var(--oxblood); border-color: var(--oxblood); }

/* === Live dot === */
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}

/* === Cards & panels === */
.card, .panel {
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.panel { padding: 22px; margin-bottom: 20px; }
.panel-2 {
  background: var(--paper-deep);
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  padding: 12px 14px;
}

/* === Ornamental divider === */
.rule { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.4; }

/* === Form controls === */
input[type="text"], input[type="email"], input[type="number"],
input[type="password"], select, textarea {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  padding: 11px 13px;
  width: 100%;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
textarea { font-family: var(--font-sans); resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
label {
  display: block;
  margin: 14px 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: padding-box; }

/* === Layout helpers === */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.muted   { color: var(--ink-muted); }
.faint   { color: var(--ink-faint); }
.tabular { font-variant-numeric: tabular-nums; }

.container        { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 920px;  margin: 0 auto; padding: 0 32px; }
.phone-wrap       { max-width: 460px;  margin: 0 auto; padding: 28px 18px 90px; }

/* Desktop-first host console: keep a min-width so the 3-column layout
   doesn't crumble; the page scrolls horizontally below it. */
.desktop-surface { min-width: 1200px; }

/* Multi-column grids used on the marketing / library surfaces. Pulled into
   a class so the @media block below can collapse them on phones — inline
   `grid-template-columns` styles outrank @media and can't be overridden. */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr;     gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* Sidebar layout (scenario detail: scrollable content + sticky "Create
   session" card on the right). At desktop width the aside sticks at top:24px
   so the CTA stays in view while reading lore. */
.grid-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}

/* Scene-arc row on scenario detail: [SCENE NN/T+XX | title + question | duration].
   Inline grid moved to a class so the mobile @media can re-stack it without
   fighting inline-style specificity. */
.scene-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 64px;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--paper-edge);
  align-items: baseline;
}

/* ─────────────────────── Mobile breakpoint ────────────────────────
   The site renders desktop-first; this block is the only place that
   adjusts layout for narrow viewports. Player surfaces (join/play) use
   `.phone-wrap` which is already mobile-shaped — this block targets the
   rest (homepage, scenario library, host console, /me) so a phone
   visitor doesn't see crushed 3-column grids and an oversized hero. */
@media (max-width: 720px) {
  .container        { padding: 0 16px; }
  .container-narrow { padding: 0 16px; }
  .grid-3           { grid-template-columns: 1fr; gap: 14px; }
  .grid-2           { grid-template-columns: 1fr; gap: 14px; }
  /* Stats grid: 4-col at desktop, 2×2 on mobile (numbers read better in pairs
     than stacked 4-tall). */
  .grid-4           { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-sidebar     { grid-template-columns: 1fr; gap: 32px; }
  /* The aside's sticky position only makes sense beside the content. Once
     stacked it IS the whole page width and sticky becomes confusing.
     `order: -1` lifts it above the main content div so the "Start a session"
     CTA sits right under the hero — players reading on a phone shouldn't
     have to scroll past the world/roles/arc to find the button. */
  .grid-sidebar > aside { position: static !important; order: -1; }
  /* Arc rows: drop the 3-column grid and let each cell own its own line.
     Title gets full width (no more 125px-wide crushed column on iPhone)
     and duration falls below in mono. */
  .scene-row        { grid-template-columns: 1fr; gap: 6px; padding: 14px 0; }
  .scene-row > :last-child { text-align: left !important; }
  /* Hero headline overflows at 54px+ on a 393px iPhone — clamp it. */
  .display-hero     { font-size: 36px !important; line-height: 1.08; }
  /* Header nav bar has a right-aligned eyebrow label (e.g. "My account",
     "Sign in") that clashes with the fixed auth widget at top-right.
     Hide it — the page heading below gives context on mobile. */
  .nav-eyebrow      { display: none; }
}

/* === Brand mark === */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-size: 20px; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px;
  background: var(--ink); color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 700;
  border-radius: 6px;
}

/* =========================================================================
   Cinematic cover plates — used by the scenario library card hero on the
   landing page (.stripe-art.mood-breach etc.). Renders as a moody gradient
   + vignette + film grain instead of the v1 diagonal-stripe placeholder.
   ========================================================================= */
.stripe-art {
  position: relative;
  overflow: hidden;
  background: #07070a;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
}
.stripe-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 60% at 50% 70%, rgba(0, 0, 0, 0.8), transparent 60%),
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%);
  pointer-events: none;
}
.stripe-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.stripe-art .stripe-label {
  position: relative;
  z-index: 2;
  margin: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

/* Mood variants — pick one per scenario card via CoverArt(mood=…). */
.stripe-art.mood-breach {
  background:
    radial-gradient(ellipse 60% 80% at 30% 20%, rgba(60, 90, 130, 0.5), transparent 60%),
    linear-gradient(180deg, #0a1018 0%, #131b26 50%, #060810 100%);
}
.stripe-art.mood-warm {
  background:
    radial-gradient(ellipse 50% 70% at 60% 30%, rgba(255, 180, 80, 0.45), transparent 60%),
    linear-gradient(180deg, #1a1208 0%, #2a1d0c 60%, #0c0805 100%);
}
.stripe-art.mood-blood {
  background:
    radial-gradient(ellipse 60% 80% at 30% 70%, rgba(255, 68, 56, 0.3), transparent 60%),
    linear-gradient(180deg, #1a0608 0%, #2a0810 50%, #0a0204 100%);
}
.stripe-art.mood-moss {
  background:
    radial-gradient(ellipse 60% 80% at 70% 30%, rgba(80, 140, 90, 0.35), transparent 60%),
    linear-gradient(180deg, #08120a 0%, #131c12 50%, #060a06 100%);
}

/* === App component classes (re-themed for v2 dark) ===================== */

/* Card that is itself a link — lifts on hover, never underlines. */
a.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.14s ease, transform 0.1s ease, border-color 0.12s;
}
a.card-link:hover {
  text-decoration: none;
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Radio-card pickers — clickable cards backing a hidden radio input. */
.pick-card {
  display: block;
  position: relative;
  cursor: pointer;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pick-card:last-child { margin-bottom: 0; }
.pick-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick-card:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.18); }
.pick-card:has(input:checked) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pick-card:has(input:checked):hover { background: #fff; }
.pick-card .pc-title { font-weight: 600; font-size: 14px; }
.pick-card .pc-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  margin-top: 2px;
  opacity: 0.6;
}
.pick-card .pc-desc { font-size: 12.5px; margin-top: 4px; opacity: 0.78; line-height: 1.45; }

/* Role picker cards (join page). */
.character-card {
  display: block;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.character-card.taken { opacity: 0.55; }
.character-card strong { display: block; font-family: var(--font-sans); font-size: 17px; font-weight: 600; }

/* Shared "story so far" timeline clip. Vertical stack — big video on top,
   info below, fullscreen button to the side of the video. */
.timeline-clip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--paper-edge);
}
.timeline-clip:last-child { border-bottom: none; }
.timeline-clip video {
  width: 100%; max-width: 320px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #06060a;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--paper-edge);
}
.timeline-clip .info { min-width: 0; }
/* Element-fullscreen must letterbox, never crop. object-fit:cover (right for
   the inline 9/16 thumbnails) follows the element into fullscreen, where it
   crop-zooms a portrait clip to fill a landscape monitor — the "zoomed in"
   desktop bug. Fullscreen keeps the same framing the clip has inline / on a
   phone. */
video:fullscreen { object-fit: contain !important; background: #000; }
video:-webkit-full-screen { object-fit: contain !important; background: #000; }
.timeline-clip .fs-btn { width: 100%; max-width: 320px; }
.timeline-clip .placeholder {
  width: 100%; max-width: 320px;
  aspect-ratio: 9 / 16;
  background: #06060a;
  border-radius: 10px;
  border: 1px solid var(--paper-edge);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  font-family: var(--font-mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.14em;
  text-align: center; padding: 12px;
}

/* Countdown / prompt panel (player). */
.countdown {
  font-family: var(--font-display);
  font-size: 48px; font-weight: 600; text-align: center;
  margin: 16px 0; font-variant-numeric: tabular-nums;
}
.prompt-box {
  font-family: var(--font-sans);
  font-size: 16px; line-height: 1.6;
  padding: 18px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--oxblood);
  border-radius: 8px;
  margin-bottom: 14px;
  color: var(--ink);
}

/* Desktop browser-recording preview UI. On phones the record button just
   triggers a native <input type="file" capture> — none of this applies. */
.rec-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin: 12px 0 14px;
}
.rec-wrap video {
  width: 100%; max-width: 320px;
  aspect-ratio: 9 / 16;
  background: #06060a;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--paper-edge);
  /* Mirror the preview only — recorded stream is unaffected */
  transform: scaleX(-1);
}
.rec-wrap .rec-hint {
  margin: 0;
  font-size: 14px;
  text-align: center;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
/* Teleprompter: a compact copy of the story prompt that sits with the camera
   preview (and the review player), so the player can read their direction
   while performing instead of scrolling back up. */
.rec-wrap .rec-prompt {
  width: 100%; max-width: 320px;
  max-height: 132px; overflow-y: auto;
  font-size: 13px; line-height: 1.55;
  padding: 10px 12px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--oxblood);
  border-radius: 8px;
  white-space: pre-wrap;
  color: var(--ink);
}
/* Review step (watch your take before submitting): show the TRUE recording —
   no mirror (that's a preview-only affordance) and no crop (contain + the
   clip's own aspect, so what you approve is what uploads). */
.rec-wrap.review video {
  transform: none;
  object-fit: contain;
  aspect-ratio: auto;
  max-height: 52vh;
}
.rec-wrap .rec-btn-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.rec-wrap .rec-btn-row > * { flex: 1; }
.rec-dot {
  display: inline-block; width: 12px; height: 12px;
  background: var(--paper); border-radius: 50%;
}
.rec-square {
  display: inline-block; width: 12px; height: 12px;
  background: var(--paper); border-radius: 2px;
}

/* "or upload an existing video" fallback link under the desktop Record
   button. Override the global label styling (mono uppercase form-label
   look) since this is a content link, not a form label. */
.rec-fallback { margin-top: 14px; text-align: center; }
.rec-fallback .rec-fallback-link {
  display: inline-block;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}
.rec-fallback .rec-fallback-link:hover { color: var(--ink-soft); }

/* Record button + upload progress (player). */
.record-input { display: none; }
.record-button {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 22px; font-size: 16px; width: 100%;
  background: var(--oxblood); border-color: var(--oxblood); color: #fff;
  box-shadow: 0 4px 14px rgba(255, 68, 56, 0.30), 0 0 0 6px rgba(255, 68, 56, 0.09);
}
.record-button:hover { background: var(--oxblood-deep); border-color: var(--oxblood-deep); color: #fff; }
.upload-progress {
  width: 100%; height: 8px; margin-top: 10px;
  background: var(--paper-deep); border-radius: 4px; overflow: hidden;
}
.upload-progress > div {
  height: 100%; width: 0;
  background: var(--moss);
  transition: width 0.2s ease;
}

/* HUD stat block (host header). Lives on the dark page bg in v2 (no
   inverted bar), so values use --ink (near-white) and labels --ink-muted. */
.hud-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud-stat .v {
  font-family: var(--font-display); font-size: 26px; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.hud-stat .k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--ink-muted); text-transform: uppercase;
}

/* === Cinematic video frame primitive (v2 new) =========================
   Optional richer thumbnail w/ HUD label, caption, play overlay. Not yet
   adopted by .timeline-clip — kept available for future use. */
.v-frame {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #06060a;
  isolation: isolate;
}
.v-frame::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.45) 100%);
}
.v-frame .v-hud {
  position: absolute; z-index: 2;
  top: 10px; left: 10px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.v-frame .v-caption {
  position: absolute; z-index: 2;
  left: 12px; right: 12px; bottom: 12px;
  font-size: 14.5px; font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.01em;
}
.v-frame .v-play {
  position: absolute; z-index: 3; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.v-frame:hover .v-play { opacity: 1; }
.v-frame .v-play > div {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; padding-left: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* === Selection === */
::selection { background: rgba(255, 68, 56, 0.35); color: #fff; }
