/* 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; }
