/* The public player and discovery share the child app's portrait frame. */
body.page-cartoons-explode,
body.page-cartoons-explode :is(.site-page-fill, #site-main) { background: #f2f0ed !important; }
body.page-cartoons-explode #cartoons-explode-root.reel-app {
  width: min(100%, 448px);
  margin-inline: auto;
  contain: layout;
}
body.page-cartoons-explode #cartoons-explode-root:is(.ce-mode-reels,.ce-mode-explore) #ceMain.reel-frame {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #101014;
}

#cartoons-explode-root #ceReelsShell {
  --reel-edge: 12px;
  --reel-top: max(10px, env(safe-area-inset-top));
  --reel-bottom: max(12px, env(safe-area-inset-bottom));
  position: absolute;
  inset: 0;
  isolation: isolate;
}

#cartoons-explode-root #reelsFeed {
  overflow: hidden auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

body.page-cartoons-explode #cartoons-explode-root .reel-slide.reel {
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #101014;
}

body.page-cartoons-explode #cartoons-explode-root .reel-slide .reel-bg {
  position: absolute;
  inset: 0;
  background: #101014;
}

body.page-cartoons-explode #cartoons-explode-root .reel-slide .reel-bg .ce-reel-video,
body.page-cartoons-explode #cartoons-explode-root .reel-slide .reel-bg .reel-poster { object-fit: cover; }

body.page-cartoons-explode #cartoons-explode-root .reel-slide.ce-wide-media .reel-bg .ce-reel-video { object-fit: contain; }
@media (min-aspect-ratio: 4/5) {
  body.page-cartoons-explode #cartoons-explode-root .reel-slide .reel-bg .ce-reel-video,
  body.page-cartoons-explode #cartoons-explode-root .reel-slide .reel-bg .reel-poster { object-fit: contain; }
}

body.page-cartoons-explode #cartoons-explode-root .reel-topbar {
  inset: 0 0 auto;
  padding: var(--reel-top) max(var(--reel-edge), env(safe-area-inset-right)) 22px max(var(--reel-edge), env(safe-area-inset-left));
  color: #fff;
  pointer-events: none;
  background: linear-gradient(180deg, #0009, transparent);
}

body.page-cartoons-explode #cartoons-explode-root .reel-topbar .icon-btn,
body.page-cartoons-explode #cartoons-explode-root .ce-step-controls .icon-btn,
body.page-cartoons-explode #cartoons-explode-root .ce-mute-fab {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  color: #fff;
  border: 1px solid #ffffff44;
  border-radius: 50%;
  background: #17141cc9;
}

body.page-cartoons-explode #cartoons-explode-root .reel-topbar .title { color: #fff; font-size: 1.05rem; }
body.page-cartoons-explode #cartoons-explode-root .ce-mute-fab {
  top: var(--reel-top);
  right: max(calc(var(--reel-edge) + 52px), calc(env(safe-area-inset-right) + 52px));
  left: auto;
  bottom: auto;
}

body.page-cartoons-explode #cartoons-explode-root .reel-actions.action-sidebar {
  right: auto !important;
  left: max(var(--reel-edge), env(safe-area-inset-left)) !important;
  bottom: calc(var(--reel-bottom) + 18px);
  gap: clamp(3px, 1.1vh, 12px);
}
body.page-cartoons-explode #cartoons-explode-root .reel-actions .action-avatar-wrap { display: none; }
body.page-cartoons-explode #cartoons-explode-root .reel-actions .action-btn { gap: 1px; min-width: 44px; }
body.page-cartoons-explode #cartoons-explode-root .reel-actions .action-circle { width: 44px; height: 44px; background: #17141ca8; }
body.page-cartoons-explode #cartoons-explode-root .reel-actions .action-count { color: #fff; text-shadow: 0 1px 3px #000; }
body.page-cartoons-explode #cartoons-explode-root .reel-caption {
  position: absolute;
  right: max(var(--reel-edge), env(safe-area-inset-right));
  left: max(84px, calc(env(safe-area-inset-left) + 76px));
  bottom: calc(var(--reel-bottom) + 14px);
  width: auto;
  max-width: 600px;
  margin-left: auto;
  padding: 0;
  text-align: start;
}
body.page-cartoons-explode #cartoons-explode-root .reel-caption .ce-reel-title { font-size: clamp(18px, 2.2vw, 28px); }
body.page-cartoons-explode #cartoons-explode-root .reel-caption .ce-reel-desc { margin: 4px 0; color: #fff; }
body.page-cartoons-explode #cartoons-explode-root .reel-bg::after {
  height: min(45%, 280px);
  background: linear-gradient(0deg, #000c, transparent);
}

.ce-step-controls {
  position: absolute;
  z-index: 8;
  right: max(var(--reel-edge), env(safe-area-inset-right));
  top: 50%;
  display: grid;
  gap: 8px;
  transform: translateY(-50%);
}
.ce-step-controls svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ce-step-controls :disabled { opacity: .35; }
#ceReelsShell:has(.reel-slide.is-active.ce-quiz-open) .ce-step-controls,
#ceReelsShell:has(.reel-slide.is-active.ce-quiz-open) .reel-topbar { visibility: hidden; }
#ceReelsShell:has(.reel-slide.is-active.ce-quiz-open) #reelsFeed { overflow-y: hidden; }
.page-cartoons-explode #ceReelBootPh { pointer-events: none; }
@media (max-height: 610px) {
  body.page-cartoons-explode #cartoons-explode-root .reel-actions .ce-action-label { display: none; }
  body.page-cartoons-explode #cartoons-explode-root .reel-actions.action-sidebar { gap: 2px; }
}
@media (max-height: 390px) {
  body.page-cartoons-explode #cartoons-explode-root .reel-actions.action-sidebar { display: grid; grid-template-columns: repeat(2, 44px); }
  body.page-cartoons-explode #cartoons-explode-root .reel-caption { left: 122px; }
}
@media (min-aspect-ratio: 4/5) and (min-width: 700px) {
  /* Contained media can have side gutters. Keep actions and captions on the picture. */
  #cartoons-explode-root .reel-slide {
    --picture-edge: max(var(--reel-edge), calc((100% - var(--reels-height) * var(--picture-ratio, .5625)) / 2 + 12px));
  }
  body.page-cartoons-explode #cartoons-explode-root .reel-slide .reel-actions.action-sidebar {
    left: var(--picture-edge) !important;
  }
  body.page-cartoons-explode #cartoons-explode-root .reel-slide .reel-caption {
    right: var(--picture-edge);
    left: calc(var(--picture-edge) + 74px);
  }
}
