/* Shared controls inherit the site's surfaces; only the video stage is dark. */
.uc-reels-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--uc-surface, #fff); border: 1px solid var(--uc-border, #e5e7eb);
  border-radius: var(--uc-radius-card, 14px); margin-bottom: 12px;
  font-family: inherit;
}
body .reels-wrapper[data-modern-reels][data-source] {
  position: relative; inset: auto; width: 100%; max-width: 880px; margin: 0 auto;
  height: min(740px, calc(100dvh - 180px)); min-height: 410px; overflow: hidden;
  border-radius: var(--uc-radius-card, 16px); background: #101214; color: #fff;
  isolation: isolate;
}
body.unity-next-theme .unity-next-reels-stage:has([data-modern-reels]) {
  max-width: 880px; min-height: 0; border: 0; background: transparent; box-shadow: none; overflow: visible; border-radius: 0;
}
body .reels-wrapper[data-modern-reels][data-source] .reel-container { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; }
body .reels-wrapper[data-modern-reels][data-source] .reel-container > .position-relative,
body .reels-wrapper[data-modern-reels][data-source] .reel-video-wrapper { height: 100%; }
body .reels-wrapper[data-modern-reels][data-source] .reel-video-container { position: relative; height: 100%; max-width: 100%; width: 100%; border-radius: 0; }
body .reels-wrapper[data-modern-reels][data-source] .uc-reel-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #101214; touch-action: pan-x; cursor: pointer; }
body .reels-wrapper[data-modern-reels][data-source] .video-caption { bottom: 85px; right: 76px; padding: 12px 0 12px 16px; max-height: 22%; overflow-y: auto; }
body .reels-wrapper[data-modern-reels][data-source] .video-caption-overlay { pointer-events: none; }
body .reels-wrapper[data-modern-reels][data-source] .video-controlls { bottom: 95px; right: 18px; }
body .reels-wrapper[data-modern-reels][data-source] .reel-prev-btn,
body .reels-wrapper[data-modern-reels][data-source] .reel-next-btn { display: block; position: absolute; z-index: 6; right: 18px; left: auto; width: 44px; height: 44px; border: 1px solid #ffffff40; border-radius: 50%; background: #15191dcc; color: #fff; }
body .reels-wrapper[data-modern-reels][data-source] .reel-prev-btn { top: 18px; bottom: auto; }
body .reels-wrapper[data-modern-reels][data-source] .reel-next-btn { top: 72px; bottom: auto; }
body .reels-wrapper[data-modern-reels][data-source] .reel-prev-btn i, body .reels-wrapper[data-modern-reels][data-source] .reel-next-btn i { font-size: 22px; }
body .reels-wrapper[data-modern-reels][data-source] button:disabled { opacity: .3; cursor: default; }
.uc-reels-controls { position: absolute; z-index: 8; inset: auto 0 16px; display: flex; align-items: center; gap: 8px; padding: 18px 18px 8px; background: linear-gradient(transparent, #000b); color: white; }
.uc-reels-controls button { border: 0; border-radius: 50%; width: 42px; height: 42px; color: #fff; background: #ffffff26; flex-shrink: 0; }
.uc-reels-auto { display: flex; align-items: center; gap: 7px; margin: 0 0 0 6px; font-size: 12px; cursor: pointer; }
.uc-reels-auto input { accent-color: var(--uc-primary, #d35b19); width: 16px; height: 16px; }
[data-reels-position] { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; opacity: .6; }
.uc-reels-progress { position: absolute; z-index: 9; bottom: 0; left: 16px; width: calc(100% - 32px); height: 20px; margin: 0; accent-color: var(--uc-primary, #d35b19); cursor: pointer; }
.uc-reels-notice { position: absolute; z-index: 9; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(360px, calc(100% - 80px)); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 20px; border: 1px solid #ffffff30; border-radius: var(--uc-radius-card, 14px); background: #15191dee; color: #fff; text-align: center; }
.uc-reels-notice span { flex-basis: 100%; line-height: 1.6; }
[data-modern-reels] [hidden] { display: none !important; }
[data-modern-reels] :focus-visible, .uc-reels-header :focus-visible { outline: 3px solid var(--uc-primary, #ef7a32); outline-offset: 3px; }
[data-modern-reels].is-buffering::after { content: ''; position: absolute; z-index: 7; top: 45%; left: calc(50% - 16px); width: 32px; height: 32px; border: 3px solid #ffffff40; border-top-color: white; border-radius: 50%; animation: uc-reels-spin .8s linear infinite; pointer-events: none; }
body .reels-wrapper[data-modern-reels][data-source] .reel-comments-wrapper { z-index: 10; height: 100%; bottom: 0; }
@keyframes uc-reels-spin { to { transform: rotate(360deg); } }
body.night-mode .uc-reels-header { background: var(--uc-night-surface, #242526); border-color: var(--uc-night-border, #3a3b3c); }
@media (max-width: 767px) {
  .unity-next-reels-page { margin-top: 8px !important; }
  .uc-reels-header { margin: 0 0 8px; padding: 8px 12px; }
  body .reels-wrapper[data-modern-reels][data-source] { height: calc(100dvh - 172px); min-height: 310px; border-radius: var(--uc-radius-card, 12px); }
  .uc-reels-controls { gap: 4px; padding-inline: 10px; }
  .uc-reels-auto { font-size: 11px; }
  [data-reels-position] { display: none; }
  body .reels-wrapper[data-modern-reels][data-source] .reel-comments-wrapper { width: 100%; max-height: 80%; top: auto; }
}
@media (prefers-reduced-motion: reduce) { [data-modern-reels].is-buffering::after { animation: none; } }

.uc-reel-author { display: block; color: #fff; font-weight: 600; margin-bottom: 6px; }
.uc-reel-author:hover { color: #fff; text-decoration: underline; }

@media (min-width: 768px) and (max-width: 991px) {
  body .reels-wrapper[data-modern-reels][data-source] { height: calc(100dvh - 180px); }
  body .reels-wrapper[data-modern-reels][data-source] .reel-comments-wrapper { width: 100%; }
}

.uc-reels-header .uc-reels-add { width: 38px; height: 38px; padding: 0; flex-shrink: 0; margin-left: auto; border-radius: var(--uc-radius-button, 10px); }

.uc-reels-header h1 { margin: 0; font-family: inherit; font-size: 24px; font-weight: 700; line-height: 1.25; color: var(--uc-text, #101828); }
body.night-mode .uc-reels-header h1 { color: var(--uc-night-text, #e4e6eb); }
