/* dg-reels.css — the Reels player (/reels, /reels/{id}; phase 5), as Instagram Reels / TikTok on the web:
   one 9:16 video per screen, snapped while scrolling; a computer keeps the left menu and shows the rail beside the video,
   a phone fills the screen between the header and the bottom bar, the rail over the video.
   --reel-top (the headers' height) and --reel-h (the screen left for one reel) are measured by dg-reels.js. */
html.dg-reels-on { scroll-snap-type: y mandatory; }
body.dg-reels { --reel-top: 112px; --reel-h: calc(100vh - 112px); }
/* the player is the screen itself: never zoomed with the body (the 110 % of dg-look.css), no right column, no pill */
html body.dg-reels .wrap > main:not(.modal):not(.dg-veil) { zoom: 1 !important; }
body.dg-reels .side, body.dg-reels #dgSideMobile, body.dg-reels .newpill, body.dg-reels #dgMore { display: none !important; }
body.dg-reels .wrap { grid-template-columns: 240px minmax(0, 1fr); max-width: 1240px; padding-top: 0; padding-bottom: 0; }
@media (max-width: 1180px) { body.dg-reels .wrap { grid-template-columns: 76px minmax(0, 1fr); } }
@media (max-width: 960px) { body.dg-reels .wrap { grid-template-columns: minmax(0, 1fr); } }

#dgFeed.dg-reels-feed { display: flex; flex-direction: column; align-items: center; }
.dg-reel { scroll-snap-align: start; scroll-margin-top: var(--reel-top); height: var(--reel-h); width: 100%; display: flex; align-items: center; justify-content: center; padding: 12px 0; margin: 0 !important; background: none; border: 0; box-shadow: none; }
/* a computer: the video never taller than 760 px (a 1000 px+ screen keeps a phone-sized reel, centred) */
.dg-reel-stage { position: relative; height: min(100%, 760px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 12px; overflow: visible; background: #000 var(--poster, none) center / cover no-repeat; }
.dg-reel-v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 12px; display: block; }
.dg-reel-tap { position: absolute; inset: 0; z-index: 1; background: none; border: 0; cursor: pointer; border-radius: 12px; }
.dg-reel-paused { position: absolute; left: 50%; top: 50%; z-index: 2; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: rgba(0, 0, 0, .45); display: none; place-items: center; pointer-events: none; }
.dg-reel-paused img { width: 30px; height: 30px; filter: brightness(0) invert(1); margin-left: 4px; }
.dg-reel.paused .dg-reel-paused { display: grid; }
.dg-reel-mute { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; cursor: pointer; }
.dg-reel-mute svg { width: 20px; height: 20px; }
.dg-reel-mute .on, body.dg-sound .dg-reel-mute .off { display: none; }
body.dg-sound .dg-reel-mute .on { display: block; }

/* the author + the caption, at the bottom over a shade */
.dg-reel-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 60px 14px 18px; color: #fff; border-radius: 0 0 12px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .62)); pointer-events: none; }
.dg-reel-info a, .dg-reel-info button, .dg-reel-cap { pointer-events: auto; }
.dg-reel-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dg-reel-av { width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font: 800 13px Poppins, system-ui, sans-serif; color: #fff; border: 1.5px solid #fff; }
.dg-reel-av img { width: 100%; height: 100%; object-fit: cover; }
.dg-reel-name { font: 600 15px Inter, system-ui, sans-serif; color: #fff !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-reel-vb { flex: none; }
.dg-reel .dg-reel-who .dg-fol { flex: none; color: #fff !important; border: 1px solid rgba(255, 255, 255, .7) !important; background: transparent !important; padding: 3px 12px; border-radius: 8px; font: 600 13px Inter, system-ui, sans-serif; }
.dg-reel-cap { margin-top: 8px; font: 400 14px/1.4 Inter, system-ui, sans-serif; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; overflow-wrap: anywhere; }
.dg-reel-cap.open { -webkit-line-clamp: unset; display: block; max-height: 40vh; overflow-y: auto; }
.dg-reel-cap a { color: #fff; font-weight: 600; }

/* the rail: beside the video on a computer, over it on a phone */
.dg-reel-rail { position: absolute; left: calc(100% + 14px); bottom: 12px; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.dg-reel-act { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--dg-ink, #0F1419); font: 600 12px Inter, system-ui, sans-serif; text-decoration: none; }
.dg-reel-act { min-width: 44px; }
.dg-reel-act img { width: 28px !important; height: 28px !important; max-width: none; flex: none; }
.dg-reel-act .on, .dg-reel-act.active .off { display: none; }
.dg-reel-act.active .on { display: block; }
.dg-reel-act[disabled] { opacity: .45; cursor: default; }

.dg-reel-bar { position: absolute; left: 12px; right: 12px; bottom: 6px; z-index: 3; height: 2px; background: rgba(255, 255, 255, .3); border-radius: 2px; overflow: hidden; pointer-events: none; }
.dg-reel-bar i { display: block; height: 100%; width: 0; background: #fff; }

/* desktop: ↑ ↓ to the next / previous reel (as Instagram) */
.dg-reel-nav { position: fixed; right: 28px; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 12px; }
.dg-reel-nav button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #EFF3F4; display: grid; place-items: center; cursor: pointer; }
.dg-reel-nav button:hover { background: #E1E8ED; }
.dg-reel-nav img { width: 10px; height: 18px; transform: rotate(90deg); filter: brightness(0); }
.dg-reel-nav [data-reel-go="-1"] img { transform: rotate(-90deg); }
.dg-reels-empty { text-align: center; color: var(--mute); padding: 80px 16px; }

@media (max-width: 767px) {
  body.dg-reels { background: #000; }
  body.dg-reels .wrap { padding: 0 !important; }
  .dg-reel { padding: 0; }
  .dg-reel-stage { width: 100%; aspect-ratio: auto; border-radius: 0; }
  .dg-reel-v, .dg-reel-tap { border-radius: 0; }
  .dg-reel-info { border-radius: 0; padding-right: 72px; padding-bottom: 22px; }
  .dg-reel-rail { left: auto; right: 10px; bottom: 22px; }
  .dg-reel-act { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
  .dg-reel-act img { filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
  .dg-reel-act img[src*="dgc-48"], .dg-reel-act.active .on { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
  .dg-reel-nav { display: none; }
  .dg-reels-empty { color: #fff; }
}

/* one creator's reels (from their profile): the way back, and ← → beside the video instead of ↑ ↓ (as Instagram's viewer) */
.dg-reels-of { position: fixed; z-index: 20; top: calc(var(--reel-top) + 14px); left: max(16px, calc(50% - 600px + 264px)); display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; background: #EFF3F4; font: 600 14px Inter, system-ui, sans-serif; color: var(--dg-ink, #0F1419); }
.dg-reels-of img { width: 8px; height: 14px; filter: brightness(0); }
body.dg-reels-creator .dg-reel-nav { flex-direction: row; top: 50%; left: var(--reel-cx, 50%); right: auto; width: 0; height: 44px; transform: translateY(-50%); gap: 0; }
body.dg-reels-creator .dg-reel-nav button { position: absolute; top: 0; }
body.dg-reels-creator .dg-reel-nav [data-reel-go="-1"] { right: calc(var(--reel-w, 440px) / 2 + 24px); }
body.dg-reels-creator .dg-reel-nav [data-reel-go="1"] { left: calc(var(--reel-w, 440px) / 2 + 82px); }
body.dg-reels-creator .dg-reel-nav img { transform: none; }
body.dg-reels-creator .dg-reel-nav [data-reel-go="-1"] img { transform: rotate(180deg); }
@media (max-width: 1180px) { .dg-reels-of { left: 92px; } }
@media (max-width: 767px) { .dg-reels-of { left: 12px; top: calc(var(--reel-top) + 10px); background: rgba(0, 0, 0, .45); color: #fff; } .dg-reels-of img { filter: none; } }
/* the Follow button over the video: white, whatever its state (the look's grey "Following" is for white cards) */
html body.dg-reels .dg-reel .dg-reel-who .dg-fol, html body.dg-reels .dg-reel .dg-reel-who .dg-fol.on { color: #fff !important; border-color: rgba(255, 255, 255, .75) !important; background: rgba(0, 0, 0, .15) !important; }

/* the views: a counter, not a button */
.dg-reel-views { cursor: default; }
/* the ⋯ always visible: a light disc behind it (desktop) */
.dg-reel-act.dg-more { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; justify-content: center; background: #EFF3F4; }
.dg-reel-act.dg-more img { width: 22px !important; height: 22px !important; }
@media (max-width: 767px) {
  .dg-reel-stage { height: 100%; }
  .dg-reel-act.dg-more { background: rgba(0, 0, 0, .35); }
}

/* the reel's sound (phase 5): under the caption, -> its page (/audio/{id}), as TikTok / Instagram */
.dg-reel-snd { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; max-width: 100%; color: #fff !important; font: 500 13px Inter, system-ui, sans-serif; text-decoration: none; pointer-events: auto; }
.dg-reel-snd img { width: 14px; height: 14px; flex: none; filter: brightness(0) invert(1); }
.dg-reel-snd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-reel-snd.cut { opacity: .75; font-style: italic; }
.dg-reel.snd-on .dg-reel-snd img { animation: dgspin 3s linear infinite; }
@keyframes dgspin { to { transform: rotate(360deg); } }

/* the rail's author (owner 2026-10-26, as TikTok): the avatar, its red + follows; the sound's disc at the bottom, turning */
.dg-reel-me { position: relative; margin-bottom: 10px; }
.dg-reel-rav { display: block; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 2px solid #fff; }
.dg-reel-rav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dg-reel-plus { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; background: #E21B2D; display: grid; place-items: center; cursor: pointer; }
.dg-reel-plus img { width: 12px; height: 12px; filter: brightness(0) invert(1); }
.dg-reel-disc { width: 42px; height: 42px; border-radius: 50%; padding: 7px; background: radial-gradient(circle, #333 0 55%, #111 56% 100%); box-shadow: 0 0 0 2px rgba(255,255,255,.15); animation: dgDisc 6s linear infinite; }
.dg-reel-disc img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.dg-reel-disc img.nd { filter: brightness(0) invert(1); object-fit: contain; padding: 3px; }
.dg-reel.paused .dg-reel-disc { animation-play-state: paused; }
@keyframes dgDisc { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dg-reel-disc { animation: none; } }
/* the rail's photos (author, sound) are pictures, not icons: never the icons' white filter nor their size */
.dg-reel-rail .dg-reel-rav img, .dg-reel-rail .dg-reel-disc img:not(.nd) { filter: none !important; width: 100% !important; height: 100% !important; opacity: 1 !important; }
.dg-reel-rail .dg-reel-me, .dg-reel-rail .dg-reel-disc { display: block; }

/* ---- owner 2026-10-28 (New comments #4) ----------------------------------------------------------------------------
   a phone: the reels full screen — no header, no bottom bar; the back pill alone, quiet (opacity .4) until touched */
@media (max-width: 767px) {
  body.dg-reels .hd, body.dg-reels .m2, body.dg-reels .bb { display: none !important; }
  .dg-reels-of { top: 10px !important; opacity: .4; transition: opacity .2s; }
  .dg-reels-of:hover, .dg-reels-of:focus, .dg-reels-of:active { opacity: 1; }
  /* the rail: at most half the screen's height — smaller icons, less space between them */
  .dg-reel-rail { gap: 6px; bottom: 18px; max-height: 50vh; justify-content: flex-end; }
  .dg-reel-act { font-size: 11px; gap: 1px; min-width: 38px; }
  .dg-reel-act img { width: 23px !important; height: 23px !important; }
  .dg-reel-rail .dg-reel-rav { width: 38px !important; height: 38px !important; }
  .dg-reel-act.dg-more { width: 32px; height: 32px; min-width: 32px; }
  .dg-reel-act.dg-more img { width: 18px !important; height: 18px !important; }
  .dg-reel-rail .dg-reel-disc { width: 32px !important; height: 32px !important; }
}
.dg-reels-of-vb { width: 15px; height: 15px; flex: none; }
/* a computer: the rail at most 60 % of the screen's height; the left menu shows its icons only */
@media (min-width: 768px) {
  .dg-reel-rail { gap: 10px; max-height: 60vh; }
  .dg-reel-act img { width: 24px !important; height: 24px !important; }
  body.dg-reels .nav span { display: none !important; }
  body.dg-reels .nav .cta { padding: 10px !important; }
}
/* the + on the author's avatar: our red, centred on the avatar's bottom edge */
.dg-reel-rail .dg-reel-me { position: relative; padding-bottom: 8px; }
.dg-reel-rail .dg-reel-plus { background: #E21B2D !important; bottom: 0 !important; width: 20px; height: 20px; border: 2px solid #fff; box-sizing: content-box; }
.dg-reel-rail .dg-reel-plus img { filter: brightness(0) invert(1) !important; width: 12px !important; height: 12px !important; }

/* ---- Reels, owner 2026-10-28 (his mock-up) ---------------------------------------------------------------------------
   top-left: ← (the homepage) + the author's name (their profile); the author row at the bottom goes (the avatar is on top
   of the rail); the page's own pill gives way to it */
.dg-reel-top { position: absolute; top: 12px; left: 12px; right: 60px; z-index: 3; display: flex; align-items: center; gap: 6px; min-width: 0; pointer-events: none; }
.dg-reel-top a, .dg-reel-top img { pointer-events: auto; }
.dg-reel-home { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .35); }
.dg-reel-home img { width: 9px; height: 16px; filter: brightness(0) invert(1); }
.dg-reel-tname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff !important; font: 600 15px Inter, system-ui, sans-serif; text-decoration: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.dg-reel-top .dg-reel-vb { width: 15px; height: 15px; flex: none; }
.dg-reel-who, .dg-reels-of { display: none !important; }
.dg-reel-info { padding-top: 40px; }
/* the + on the author's avatar: its inner circle and + only (no outer white ring) */
html .dg-reel-rail .dg-reel-plus { border: 0 !important; width: 20px !important; height: 20px !important; box-sizing: border-box; }
html .dg-reel-rail .dg-reel-plus img { width: 16px !important; height: 16px !important; }
/* the rail: the bottom-right half of the reel; more room between views, like, comments, repost, Gifts and save only */
html .dg-reel-rail { height: 50%; max-height: none; justify-content: flex-start; gap: 6px; }
html .dg-reel-rail > .ogapoll-pc-like, html .dg-reel-rail > [data-cmt], html .dg-reel-rail > .dg-repost, html .dg-reel-rail > .dg-gift, html .dg-reel-rail > .ogapoll-pc-save { margin-top: auto; }
html .dg-reel-rail > .dg-more { margin-top: 10px; }
@media (max-width: 767px) { html .dg-reel-rail { bottom: 18px; } }
/* a computer: no second header on Reels, so the left menu starts right under the header, level with the reel (owner 2026-10-28) */
@media (min-width: 961px) { body.dg-reels .nav { top: calc(var(--reel-top, 56px) + 6px) !important; } }
/* the rail on a computer (owner 2026-10-28): up to 60 % of the reel, anchored at the bottom and growing UPWARD; every counter
   keeps its line even at 0, so a number appearing never moves the others */
@media (min-width: 768px) {
  html .dg-reel-rail { height: 60%; justify-content: flex-end; gap: 4px; }
  html .dg-reel-rail > .dg-reel-act:not(.dg-reel-me):not(.dg-more):not(.dg-reel-disc) { min-height: 44px; justify-content: flex-start; }
}
html body .dg-reel-rail > .dg-reel-act > span.dg-zero { display: block !important; visibility: hidden; }   /* a 0 keeps its room, invisible */
@media (max-width: 767px) {
  html .dg-reel-rail { justify-content: flex-end; }
  html .dg-reel-rail > .dg-reel-act:not(.dg-reel-me):not(.dg-more):not(.dg-reel-disc) { min-height: 38px; justify-content: flex-start; }
}
/* a computer: everything fits in the 60 % (no overlap at the bottom): a compact avatar, ⋯ and sound disc */
@media (min-width: 768px) {
  html .dg-reel-rail { gap: 0; }
  html .dg-reel-rail > .dg-reel-act:not(.dg-reel-me):not(.dg-more):not(.dg-reel-disc) { min-height: 40px; }
  html .dg-reel-rail .dg-reel-rav { width: 42px !important; height: 42px !important; }
  html .dg-reel-rail > .dg-more { width: 32px; height: 32px; min-width: 32px; margin-top: 8px; }
  html .dg-reel-rail > .dg-more img { width: 18px !important; height: 18px !important; }
  html .dg-reel-rail > .dg-reel-disc { width: 34px !important; height: 34px !important; padding: 5px; margin-top: 8px; box-sizing: border-box; }
}
/* the rail, final spacing (owner 2026-10-28): each counter = its icon + its number right under it (1 px), then the SAME
   space before the next icon — a number never touches the next icon; no extra room under the avatar when it has no + */
html .dg-reel-rail { gap: clamp(6px, 1.5vh, 12px) !important; }
html .dg-reel-rail > .dg-reel-act { margin-top: 0 !important; }
html .dg-reel-rail > .dg-reel-act:not(.dg-reel-me):not(.dg-more):not(.dg-reel-disc) { min-height: 0 !important; gap: 1px !important; line-height: 14px; }
html .dg-reel-rail > .dg-reel-act > span { line-height: 14px; height: 14px; }
html .dg-reel-rail > .dg-reel-me { padding-bottom: 0 !important; margin-bottom: 0 !important; }
html .dg-reel-rail > .dg-reel-me:has(.dg-reel-plus) { margin-bottom: 6px !important; }
html .dg-reel-rail .dg-reel-plus { bottom: -8px !important; }
/* the sound's disc: a circle, never an oval (the rail's 44 px min-width does not apply to it) */
html .dg-reel-rail > .dg-reel-disc { min-width: 0 !important; width: 34px !important; height: 34px !important; aspect-ratio: 1; flex: none; }
@media (max-width: 767px) { html .dg-reel-rail > .dg-reel-disc { width: 32px !important; height: 32px !important; } }
html .dg-reel-rail { gap: clamp(6px, 1.3vh, 11px) !important; }
/* the video views are always shown on the rail, even 0 (owner 2026-10-29) — the other counters keep their room when at 0 */
html body .dg-reel-rail > .dg-reel-views > span.dg-zero { visibility: visible !important; font-size: inherit !important; }
/* a computer: Reels' left menu is the homepage's icon mode in full (owner 2026-10-29) — a 76 px column, the round + to
   create, no language / Terms / Privacy row (they stay on the other pages) */
@media (min-width: 961px) {
  body.dg-reels .wrap { grid-template-columns: 76px minmax(0, 1fr) !important; }
  body.dg-reels #dgNav .cta { width: 44px; height: 44px; padding: 0 !important; margin-left: 6px; justify-content: center; }
  body.dg-reels .nav .dg-sfoot-nav { display: none !important; }
  body.dg-reels .nav .dg-msg-badge { position: absolute; top: 2px; left: 34px; margin: 0; }
}
