/* Video page (/v/{id}) — red-grid/red-upload concept synthesis (2026-07-12).
   Linked in-body from embed.html.j2 (same pattern as home.css / upload.css)
   so it lands AFTER base.css in document order and wins equal-specificity
   overrides. Tokens (cherry oklch, warm inks, grade colors, fonts, radii)
   all come from base.css :root — nothing is restated here. Everything is
   scoped to .video-stage / .v-* so other pages keep their base.css look. */

/* ───── Stage ───── */
.shell.video-stage {
  padding-top: 56px;
  padding-bottom: 56px;
}

/* ───── Chips — shared action language (red-grid .chips/.chip) ───── */
.video-stage .chips {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.video-stage .chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-500);
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.video-stage .chip:hover {
  color: var(--ink-800);
  border-color: var(--red-500);
  background: var(--ink-100);
}
/* .primary doubles as embed.js's active/success state (reactions toggle
   it, copy buttons flash it) — same fill as a concept .chip.active. */
.video-stage .chip.active,
.video-stage .chip.primary,
.video-stage .chip.chip-primary {
  background: var(--red-500);
  color: var(--ink-0);
  border-color: var(--red-500);
}
.video-stage .chip.chip-primary:hover {
  background: var(--red-400);
  border-color: var(--red-400);
  color: var(--ink-0);
}
.video-stage .chip.chip-danger {
  color: var(--red-400);
  border-color: color-mix(in oklch, var(--red-500), transparent 50%);
}
.video-stage .chip.chip-danger:hover {
  color: var(--red-400);
  border-color: var(--red-500);
  background: color-mix(in oklch, var(--red-500), transparent 92%);
}
.video-stage .chip:disabled { opacity: 0.5; cursor: default; }
.video-stage .chip-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-500);
  margin-right: 2px;
}

/* ───── 1 · Hero row — compact, doesn't compete with the video ───── */
.v-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px 24px;
  flex-wrap: wrap;
  margin: 2px 0 18px;
}
.v-hero-main { min-width: 0; }
.v-eyebrow {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.v-mode {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-800);
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  padding: 3px 8px;
  border-radius: 4px;
}
.v-diffpill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  padding: 3px 10px;
  border-radius: 999px;
}
.v-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-900);
  margin: 0;
  word-break: break-word;
}
.v-sub {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-500);
}

/* Right side: big grade + score (Display) + acc (mono). */
.v-hero-score {
  display: flex; align-items: center;
  gap: 14px;
  margin-left: auto;
  text-align: right;
}
/* Base.css's generic .grade is a 44px absolute glass square (thumbnail
   badge) — re-shape it into the concept's solid inline badge here. */
.v-hero .grade {
  position: static;
  width: auto; height: auto;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--rad-sm);
  backdrop-filter: none;
  letter-spacing: 0.02em;
}
.v-hero .grade.ss { background: var(--grade-ss); color: var(--ink-0); }
.v-hero .grade.s  { background: var(--grade-s);  color: var(--ink-0); }
.v-hero .grade.a  { background: var(--grade-a);  color: var(--ink-0); }
.v-hero .grade.b  { background: var(--grade-b);  color: var(--ink-0); }
.v-hero .grade.c  { background: var(--grade-c);  color: var(--ink-0); }
.v-hero .grade.d  { background: var(--grade-d);  color: var(--ink-0); }
.v-nums {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 3px;
}
.v-scoreval {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink-900);
}
.v-accval {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-700);
}

/* ───── 2 · Player region ───── */
.v-playerbox .player-shell {
  background: var(--ink-50);
  border: 1px solid var(--ink-300);
  border-radius: var(--rad-md);
  overflow: hidden;
}
/* Drop base.css's cherry hairline — concept wants a quiet frame so the
   video itself is the loudest thing on the page. */
.v-playerbox .player-shell::before { content: none; }
.v-playerbox video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* DMCA banner (was inline styles). Literal hues on purpose — a legal
   notice shouldn't re-tint with the theme. */
.v-playerbox .dmca-banner {
  background: #3b1f24;
  color: #ffd2d2;
  border: 1px solid #6a3940;
  border-radius: var(--rad-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13.5px;
  line-height: 1.45;
}
.v-playerbox .dmca-banner a { color: #ffd2d2; text-decoration: underline; }

/* Owner-facing deleted banner + restore. */
.v-deleted {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-800);
  border: 1px solid color-mix(in oklch, var(--red-500), transparent 50%);
  background: color-mix(in oklch, var(--red-500), transparent 92%);
  border-radius: var(--rad-md);
}

/* Transport row under the player: quality picker left, actions right. */
.v-transport {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}
/* embed.js paints the active q-btn's inline border/color with
   var(--accent) — map it onto the cherry ramp so the JS highlight
   speaks the palette. */
.v-transport .quality-picker { --accent: var(--red-400); }
.v-transport .v-actions { margin-left: auto; }

/* ───── 3 · Metadata + actions strip ───── */
.v-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 0;
  border-top: 1px solid color-mix(in oklch, var(--ink-300), transparent 40%);
  border-bottom: 1px solid color-mix(in oklch, var(--ink-300), transparent 40%);
}
.v-strip-meta {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-500);
  min-width: 0;
}
.v-name {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  color: var(--red-400);
  text-decoration: none;
}
.v-name:hover { color: var(--red-500); text-decoration: underline; }
.v-osu {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  text-decoration: none;
  border: 1px solid var(--ink-300);
  border-radius: 4px;
  padding: 1px 6px;
  transition: color 120ms ease, border-color 120ms ease;
}
.v-osu:hover { color: var(--red-400); border-color: var(--red-500); }
.v-meta-link {
  color: var(--ink-800);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-500);
}
.v-meta-link:hover { color: var(--red-400); border-bottom-color: var(--red-500); }
.v-dim { color: var(--ink-500); }
.v-views { color: var(--ink-500); white-space: nowrap; }
.v-views #viewCount { color: var(--ink-800); font-weight: 600; }
.v-strip-actions {
  display: flex; align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Owner controls — compact chip menu (native <details>, zero extra JS). */
.v-manage { position: relative; }
.v-manage > summary { list-style: none; }
.v-manage > summary::-webkit-details-marker { display: none; }
.v-manage[open] > summary.chip {
  color: var(--ink-800);
  border-color: var(--red-500);
}
.v-manage-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: min(320px, 88vw);
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--ink-50);
  border: 1px solid var(--ink-300);
  border-radius: var(--rad-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.v-manage-row {
  display: flex; align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-500);
}
.v-manage-pop select {
  flex: 1; min-width: 0;
  background: var(--ink-100);
  color: var(--ink-800);
  border: 1px solid var(--ink-300);
  border-radius: var(--rad-sm);
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.v-share-row { display: flex; gap: 6px; }
.v-share-row input {
  flex: 1; min-width: 0;
  background: var(--ink-100);
  color: var(--ink-700);
  border: 1px solid var(--ink-300);
  border-radius: var(--rad-sm);
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.v-manage-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-500);
  min-height: 1em;
}
.v-managemsg {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
  min-height: 1em;
}

/* ───── Judgments + perf (quiet mono detail zone) ───── */
.v-detail {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
/* Judgment strip + transport chips share one row: judgments left,
   chips right. margin-right:auto on the strip pushes chips over; on
   narrow viewports the wrapper wraps and everything stacks cleanly. */
.v-postplayer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  max-width: 100%;
}
.v-postplayer .judgment-strip {
  margin-right: auto;
}
.v-postplayer .v-actions {
  margin-left: auto;
}
.judgment-strip {
  display: flex; flex-wrap: wrap;
  gap: 6px 18px;
  width: fit-content; max-width: 100%;   /* max-content made the strip refuse to wrap on phones */
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: color-mix(in oklch, var(--ink-100), transparent 30%);
  border: 1px solid color-mix(in oklch, var(--ink-300), transparent 40%);
  border-radius: var(--rad-md);
}
.judgment-strip .j {
  display: inline-flex; align-items: baseline;
  gap: 6px;
}
.judgment-strip .j .label {
  font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.judgment-strip .j .val { color: var(--ink-800); font-weight: 600; }
/* Hue per judgment so the eye picks "Miss" out fast (same set base.css
   uses for the old detail-head strip). */
.judgment-strip .j-320 .label { color: #ffd35c; }
.judgment-strip .j-300 .label { color: #b8e3ff; }
.judgment-strip .j-200 .label { color: #f4b66c; }
.judgment-strip .j-100 .label { color: #71d090; }
.judgment-strip .j-50  .label { color: #a09898; }
.judgment-strip .j-miss .label { color: #ff7878; }
:root[data-theme="light"] .judgment-strip .j-320 .label { color: #a67c00; }
:root[data-theme="light"] .judgment-strip .j-300 .label { color: #2a7ab8; }
:root[data-theme="light"] .judgment-strip .j-200 .label { color: #b56a1e; }
:root[data-theme="light"] .judgment-strip .j-100 .label { color: #22824a; }
:root[data-theme="light"] .judgment-strip .j-50  .label { color: #6f6666; }
:root[data-theme="light"] .judgment-strip .j-miss .label { color: #c23434; }

.v-perf {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
}
.v-perf summary { cursor: pointer; list-style: none; }
.v-perf summary::-webkit-details-marker { display: none; }
.v-perf summary .tri { opacity: 0.65; }
.v-perf strong { color: var(--ink-700); font-weight: 600; }
.v-perf-grid {
  display: flex; flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  padding-left: 14px;
}
.v-perf-grid .k { opacity: 0.7; }

/* ───── 4 · Comments ───── */
.v-comments { margin-top: 34px; }
.v-comments-headrow {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 4px;
}
.v-comments-head {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ink-800);
}
.v-comments-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-500);
}
.v-compose {
  display: flex; flex-direction: column;
  gap: 8px;
  margin: 14px 0 4px;
}
.v-compose textarea {
  min-height: 72px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-800);
  background: color-mix(in oklch, var(--ink-100), transparent 30%);
  border: 1px solid var(--ink-300);
  border-radius: var(--rad-sm);
  resize: vertical;
}
.v-compose textarea::placeholder { color: var(--ink-500); }
.v-compose textarea:focus { outline: none; border-color: var(--red-500); }
.v-compose-row {
  display: flex; align-items: center;
  gap: 12px;
}
.v-compose-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-500);
}
.v-compose-status {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  min-height: 1em;
  text-align: right;
}
.v-login-note {
  margin: 14px 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-500);
}
.v-login-note a { color: var(--red-400); text-decoration: none; font-weight: 700; }
.v-login-note a:hover { text-decoration: underline; }

/* Comment rows — flat divider list (concept), overriding base.css's
   boxed cards. embed.js renders .comment/.author/.when/.comment-text. */
.v-comment-list {
  display: flex; flex-direction: column;
  margin-top: 8px;
}
.v-comment-empty {
  padding: 18px 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: italic;
  color: var(--ink-500);
}
.v-comments .comment {
  background: transparent;
  border: 0;
  border-top: 1px solid color-mix(in oklch, var(--ink-300), transparent 40%);
  border-radius: 0;
  padding: 14px 2px;
}
.v-comments .comment .comment-head {
  font-family: var(--font-mono);
  font-size: 12px;
}
.v-comments .comment .author { color: var(--red-400); }
.v-comments .comment .when {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.v-comments .comment .when a { color: var(--ink-500); text-decoration: none; }
.v-comments .comment .when a:hover { color: var(--red-400); text-decoration: underline; }
.v-comments .comment .comment-text {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-800);
}

/* ───── 5 · Related rails — home-gallery card language ───── */
.v-related {
  display: flex; flex-direction: column;
  gap: 28px;
  margin-top: 38px;
}
.v-rail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.v-rail-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ink-800);
}
.v-rail-title a { color: var(--red-400); text-decoration: none; }
.v-rail-title a:hover { color: var(--red-500); text-decoration: underline; }
.v-rail-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-500);
}
/* Hard 12-column grid, span-3 cards (4 across) — identical breakpoints
   to home.css so the two pages read as one system. */
.v-related .grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.v-related .grid > .card { grid-column: span 3; text-decoration: none; color: inherit; }
@media (max-width: 1080px) { .v-related .grid > .card { grid-column: span 4; } }
@media (max-width: 820px)  { .v-related .grid > .card { grid-column: span 6; } }
@media (max-width: 520px)  { .v-related .grid > .card { grid-column: span 12; } }

/* Card body — Sora at card scale (home.css parity overrides on top of
   base.css's poster-style card). */
.v-related .card .body { padding: 12px 14px 14px; gap: 6px; }
.v-related .card .diff { font-size: 10px; color: var(--ink-500); }
.v-related .card .song {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-800);
}
.v-related .card .stats { gap: 10px; margin-top: 0; }
.v-related .card .player {
  border-top: 0;
  padding-top: 0;
  margin-top: auto;
  text-transform: none;
  letter-spacing: 0.02em;
}
.v-related .card .thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, oklch(0.07 0.01 25 / 0.55) 100%);
  pointer-events: none;
}
.v-related .card .grade {
  top: 8px; right: 8px;
  width: auto; height: auto;
  display: inline-block;
  font-size: 18px;
  padding: 3px 10px;
  border: 0; border-radius: 4px;
  backdrop-filter: none;
  letter-spacing: 0.02em; line-height: 1.2;
  z-index: 2;
}
.v-related .card .grade.ss { background: var(--grade-ss); color: var(--ink-0); }
.v-related .card .grade.s  { background: var(--grade-s);  color: var(--ink-0); }
.v-related .card .grade.a  { background: var(--grade-a);  color: var(--ink-0); }
.v-related .card .grade.b  { background: var(--grade-b);  color: var(--ink-0); }
.v-related .card .grade.c  { background: var(--grade-c);  color: var(--ink-0); }
.v-related .card .grade.d  { background: var(--grade-d);  color: var(--ink-0); }
.v-related .card .thumb .mode-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  background: color-mix(in oklch, var(--ink-0), transparent 15%);
  color: var(--ink-800);
  padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* ───── Responsive ───── */
@media (max-width: 720px) {
  .shell.video-stage { padding-top: 20px; }
  .v-hero { align-items: flex-start; flex-direction: column; margin-bottom: 14px; }
  .v-hero-score { margin-left: 0; text-align: left; }
  .v-nums { align-items: flex-start; }
  .v-transport .v-actions { margin-left: 0; }
  .v-strip-actions { margin-left: 0; }
}
