/*!
 * BJJ Foundation - Mux Chapter player and playlist
 *
 * Styles for the [f_mux_chapter] shortcode (Code Snippets #39). Loaded only on
 * pages whose content contains that shortcode. See docs/mux-chapter.md.
 *
 * - Sections 1-2: the Chapter widget layout, ported from chapter.css
 *   (#f-video-widget) onto the new .fmc-chapter root so the two
 *   implementations never style each other.
 * - Sections 3-9: the custom Video.js 10 skin from Player Lab
 *   (player-lab.css), with its class prefix renamed fpl- -> fmc-.
 * - Sections 10-12: end screen, completion marks, notices.
 *
 * Colours come from the site-wide palette (snippet #27, --f-*).
 */

/* ------------------------------------------------------------------ */
/* 1. Tokens                                                           */
/* ------------------------------------------------------------------ */
.fmc-chapter {
  --fmc-obsidian: var(--f-obsidian, #131313);
  --fmc-slate: var(--f-slate, #232a2f);
  --fmc-graphite: var(--f-graphite, #292929);
  --fmc-matte: var(--f-matte-white, #e9ede7);
  --fmc-iron: var(--f-iron-red, #9e3223);
  --fmc-orange: var(--f-burnt-orange, #f47721);
  --fmc-muted: rgba(233, 237, 231, 0.62);
  --fmc-line: rgba(233, 237, 231, 0.12);
  --fmc-subheading: 'Archivo Narrow', 'Archivo', sans-serif;
  --fmc-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fmc-ease: cubic-bezier(0.2, 0, 0, 1);
  --fmc-btn: 40px;
  --fmc-icon: 22px;
}

@media (pointer: coarse) {
  .fmc-chapter { --fmc-btn: 44px; --fmc-icon: 24px; }
}

/* ------------------------------------------------------------------ */
/* 2. Chapter widget layout (from chapter.css #f-video-widget)         */
/* ------------------------------------------------------------------ */
.fmc-chapter {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(260px, 1fr);
  gap: 18px;
  width: 100%;
  color: var(--f-white, #fff);
  font-family: 'Archivo Narrow', sans-serif;
  text-align: left;
}

.fmc-chapter *,
.fmc-chapter *::before,
.fmc-chapter *::after { box-sizing: border-box; }

/* Single lesson ([f_mux_free_lesson], homepage): same skin, one column, no playlist. */
.fmc-chapter.fmc-single { display: block; }

.fmc-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.fmc-screen {
  position: relative;
  width: 100%;
  border-radius: 3px;
}

/* Previous / next Chapter navigation */
.fmc-navigation {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.fmc-nav-button {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 1 44%;
  min-width: 0;
  padding: 12px 18px;
  background: transparent;
  border: 1px solid var(--f-steel, #555);
  border-radius: 3px;
  color: var(--f-white, #fff) !important;
  text-decoration: none !important;
  transition: background-color .2s ease, border-color .2s ease;
}

.fmc-nav-button:hover,
.fmc-nav-button:focus-visible {
  background: var(--f-iron-red, #9e3223);
  border-color: var(--f-iron-red, #9e3223);
  color: var(--f-white, #fff);
}

.fmc-nav-text { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.fmc-nav-label { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; line-height: 1.2; }
.fmc-nav-title { font-size: 14px; font-weight: 400; line-height: 1.3; }
.fmc-nav-arrow { flex-shrink: 0; font-size: 22px; line-height: 1; }

.fmc-next {
  margin-left: auto;
  justify-content: flex-end;
  text-align: right;
}

/* Playlist: matches the player column height on desktop (JS sets the height). */
.fmc-playlist {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 0;
  align-self: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--f-charcoal, #191b1c);
  border-radius: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--f-steel, #555) var(--f-charcoal, #191b1c);
}

.fmc-playlist::-webkit-scrollbar { width: 7px; }
.fmc-playlist::-webkit-scrollbar-track { background: var(--f-charcoal, #191b1c); }
.fmc-playlist::-webkit-scrollbar-thumb { background: var(--f-steel, #555); border-radius: 4px; }

.fmc-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 9px 42px 9px 9px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--f-steel, #555);
  border-radius: 0;
  background: transparent;
  color: var(--f-matte-white, #e9ede7);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .2s ease;
}

.fmc-item:last-child { border-bottom: 0; }

.fmc-item:hover {
  background-color: var(--f-graphite, #292929);
  color: var(--f-white, #fff);
}

.fmc-item:focus-visible {
  outline: 2px solid var(--f-burnt-orange, #f47721);
  outline-offset: -2px;
}

.fmc-item.active,
.fmc-item.active:hover {
  background: var(--f-iron-red, #9e3223);
  color: var(--f-white, #fff);
}

.fmc-thumb {
  display: block;
  flex: 0 0 36%;
  max-width: 178px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--f-obsidian, #131313);
}

.fmc-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fmc-item-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

/* Tablet / mobile */
@media (max-width: 980px) {
  .fmc-chapter { grid-template-columns: 1fr; }
  .fmc-playlist { height: auto !important; max-height: 400px; }
  .fmc-navigation { order: -1; }
  .fmc-thumb { max-width: 120px; }
}

@media (max-width: 600px) {
  .fmc-chapter,
  .fmc-main { gap: 14px; }
  .fmc-navigation { gap: 10px; }
  .fmc-nav-button { flex: 1 1 0; padding: 10px; gap: 10px; }
  .fmc-nav-label { font-size: 11px; }
  .fmc-nav-title { font-size: 12px; }
  .fmc-nav-arrow { font-size: 17px; }
  .fmc-item-title { font-size: 15px; }
  .fmc-thumb { max-width: 100px; }
}

/* ------------------------------------------------------------------ */
/* 3. Player surface                                                   */
/* ------------------------------------------------------------------ */
.fmc-chapter video-player,
.fmc-chapter media-controls,
.fmc-chapter media-error-dialog { display: contents; }

.fmc-skin {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border-radius: 4px;
  color: var(--fmc-matte);
  font-family: var(--fmc-mono);
  outline: none;
  container: fmc-player / inline-size;
  -webkit-tap-highlight-color: transparent;
}

.fmc-skin:focus-visible { box-shadow: 0 0 0 2px var(--fmc-orange); }

.fmc-skin:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; }
.fmc-skin:-webkit-full-screen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; }

.fmc-skin mux-video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  --media-object-fit: contain;
}

/* Poster (derived from the signed thumbnail token). */
.fmc-poster { position: absolute; inset: 0; display: block; pointer-events: none; }
.fmc-poster:not([data-visible]) { display: none; }
.fmc-poster img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fmc-poster img:not([src]) { visibility: hidden; }

/* Hide the cursor when the viewer is idle during playback. */
.fmc-skin:has(media-controls:not([data-visible])):has(.fmc-bigplay[data-started]) { cursor: none; }

/* ------------------------------------------------------------------ */
/* 4. Center play button and buffering                                 */
/* ------------------------------------------------------------------ */
.fmc-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(233, 237, 231, 0.2);
  box-shadow: none;
  color: var(--fmc-matte);
  cursor: pointer;
  translate: -50% -50%;
  transition: background-color 0.2s var(--fmc-ease), border-color 0.2s var(--fmc-ease);
}
/* The play path is already drawn right of center in its 24px box, which
   optically centers the triangle in the circle; no extra offset needed. */
.fmc-bigplay svg { width: 26px; height: 26px; display: block; fill: currentColor; shape-rendering: geometricPrecision; }
.fmc-bigplay:hover { background-color: rgba(0, 0, 0, 0.84); border-color: rgba(233, 237, 231, 0.3); }
.fmc-bigplay:focus-visible { outline: 2px solid var(--fmc-matte); outline-offset: 3px; }
.fmc-bigplay[data-started] { display: none; }

.fmc-buffering {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.fmc-buffering:not([data-visible]) { display: none; }
.fmc-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(233, 237, 231, 0.2);
  border-top-color: var(--fmc-iron);
  animation: fmc-spin 0.8s linear infinite;
}
@keyframes fmc-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* 5. Control bar                                                      */
/* ------------------------------------------------------------------ */
.fmc-backdrop {
  position: absolute;
  inset: auto 0 0;
  height: 132px;
  z-index: 25;
  pointer-events: none;
  background: linear-gradient(to top, rgba(19, 19, 19, 0.92) 0%, rgba(19, 19, 19, 0.55) 45%, rgba(19, 19, 19, 0) 100%);
  transition: opacity 0.25s var(--fmc-ease);
}

.fmc-top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 26;
  padding: 16px 18px 40px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(19, 19, 19, 0.7), rgba(19, 19, 19, 0));
  transition: opacity 0.25s var(--fmc-ease);
}
.fmc-top-eyebrow { display: block; font: 500 11px/1.3 var(--fmc-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fmc-muted); }
.fmc-top-title { display: block; margin-top: 2px; font: 700 18px/1.2 var(--fmc-subheading); color: var(--fmc-matte); }

.fmc-bar {
  position: absolute;
  inset: auto 0 0;
  z-index: 30;
  padding: 0 12px 8px;
  transition: opacity 0.25s var(--fmc-ease);
}

/* Visibility: hidden before playback starts and while the viewer is idle,
   but never while something in the bar has keyboard focus. */
.fmc-skin:has(.fmc-bigplay:not([data-started])) .fmc-bar,
.fmc-skin:has(.fmc-bigplay:not([data-started])) .fmc-backdrop,
media-controls:not([data-visible]) .fmc-bar:not(:has(:focus-visible)),
media-controls:not([data-visible]) .fmc-backdrop,
media-controls:not([data-visible]) .fmc-top {
  opacity: 0;
  pointer-events: none;
}
.fmc-skin:has(.fmc-bigplay:not([data-started])) .fmc-top { opacity: 1; }

.fmc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fmc-group { display: flex; align-items: center; gap: 2px; min-width: 0; }

/* Buttons */
.fmc-btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--fmc-btn);
  height: var(--fmc-btn);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--fmc-matte);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.15s var(--fmc-ease), color 0.15s var(--fmc-ease);
}
.fmc-btn svg { width: var(--fmc-icon); height: var(--fmc-icon); display: block; fill: currentColor; }
.fmc-btn:hover { background: rgba(233, 237, 231, 0.1); }
.fmc-btn:focus-visible { outline: 2px solid var(--fmc-orange); outline-offset: -2px; }
.fmc-btn[aria-expanded='true'],
.fmc-btn[data-open] { color: var(--fmc-matte); background: rgba(158, 50, 35, 0.85); }
.fmc-btn[data-hidden],
.fmc-btn[hidden] { display: none; }

/* State-dependent icons */
.fmc-play:not([data-paused]) .fmc-i-play,
.fmc-play[data-paused] .fmc-i-pause,
.fmc-play[data-ended] .fmc-i-play,
.fmc-play[data-ended] .fmc-i-pause,
.fmc-play:not([data-ended]) .fmc-i-restart,
.fmc-mute:not([data-muted]):not([data-volume-level='off']) .fmc-i-muted,
.fmc-mute:is([data-muted], [data-volume-level='off']) .fmc-i-vol-high,
.fmc-mute:is([data-muted], [data-volume-level='off']) .fmc-i-vol-low,
.fmc-mute:not([data-muted]):is([data-volume-level='low'], [data-volume-level='medium']) .fmc-i-vol-high,
.fmc-mute:not([data-muted]):not([data-volume-level='low']):not([data-volume-level='medium']) .fmc-i-vol-low,
.fmc-fullscreen[data-fullscreen] .fmc-i-fs-enter,
.fmc-fullscreen:not([data-fullscreen]) .fmc-i-fs-exit { display: none; }

/* Speed button shows the current rate as text */
.fmc-speed { width: auto; min-width: var(--fmc-btn); padding: 0 8px; }
.fmc-speed-label { font: 600 13px/1 var(--fmc-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* Quality button: hidden when the engine exposes no rendition choice
   (native HLS in Safari/iOS, or a single rendition). */
.fmc-quality-wrap { display: contents; }
.fmc-quality-wrap:has(media-quality-radio-group[hidden]) .fmc-quality,
.fmc-quality-wrap:has(media-quality-radio-group[data-hidden]) .fmc-quality { display: none; }

/* Volume: slider expands on hover/focus (mouse); hidden where the
   platform does not allow setting volume (iOS). */
.fmc-volume { display: flex; align-items: center; }
.fmc-volume-slider {
  position: relative;
  display: flex;
  align-items: center;
  width: 0;
  height: var(--fmc-btn);
  margin: 0;
  opacity: 0;
  cursor: pointer;
  transition: width 0.2s var(--fmc-ease), opacity 0.2s var(--fmc-ease), margin 0.2s var(--fmc-ease);
  touch-action: none;
}
.fmc-volume:hover .fmc-volume-slider,
.fmc-volume:focus-within .fmc-volume-slider,
.fmc-volume-slider[data-dragging] { width: 76px; margin: 0 10px 0 4px; opacity: 1; }
.fmc-volume-slider[data-hidden],
.fmc-volume-slider[data-availability='unsupported'] { display: none; }
.fmc-volume-slider:focus-visible { outline: 2px solid var(--fmc-orange); outline-offset: 4px; border-radius: 2px; }
@media (pointer: coarse) {
  .fmc-volume-slider { display: none; }
}

.fmc-vtrack { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgba(233, 237, 231, 0.3); overflow: hidden; }
.fmc-vfill { position: absolute; inset: 0 auto 0 0; width: var(--media-slider-fill, 0%); background: var(--fmc-matte); }
.fmc-vthumb {
  position: absolute;
  left: var(--media-slider-fill, 0%);
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fmc-matte);
  translate: -50% -50%;
}

/* Time */
.fmc-time {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font: 500 13px/1 var(--fmc-mono);
  font-variant-numeric: tabular-nums;
  color: var(--fmc-matte);
  white-space: nowrap;
}
.fmc-time .fmc-duration { color: var(--fmc-muted); }
.fmc-time-sep { color: var(--fmc-muted); }

/* ------------------------------------------------------------------ */
/* 6. Timeline                                                         */
/* ------------------------------------------------------------------ */
.fmc-timeline {
  position: relative;
  display: flex;
  align-items: center;
  height: 24px;
  margin: 0 6px 2px;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.fmc-ttrack {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(233, 237, 231, 0.22);
  overflow: hidden;
  transition: height 0.15s var(--fmc-ease);
}
.fmc-timeline:is([data-pointing], [data-dragging], :focus-visible) .fmc-ttrack { height: 6px; }
.fmc-tbuffer,
.fmc-tfill { position: absolute; inset: 0 auto 0 0; }
.fmc-tbuffer { width: var(--media-slider-buffer, 0%); background: rgba(233, 237, 231, 0.32); }
.fmc-tfill { width: var(--media-slider-fill, 0%); background: var(--fmc-iron); }
.fmc-tthumb {
  position: absolute;
  left: var(--media-slider-fill, 0%);
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fmc-matte);
  box-shadow: 0 0 0 3px rgba(158, 50, 35, 0.9);
  translate: -50% -50%;
  scale: 0;
  transition: scale 0.15s var(--fmc-ease);
}
.fmc-timeline:is([data-pointing], [data-dragging], :focus-visible) .fmc-tthumb { scale: 1; }
.fmc-timeline:focus-visible .fmc-tthumb { box-shadow: 0 0 0 3px var(--fmc-orange); }
@media (pointer: coarse) { .fmc-tthumb { scale: 1; width: 16px; height: 16px; } }

/* Hover preview: storyboard frame + time */
.fmc-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  display: grid;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s var(--fmc-ease);
}
.fmc-timeline:is([data-pointing], [data-dragging]) .fmc-preview { opacity: 1; }
.fmc-thumbnail { display: block; max-width: 176px; overflow: hidden; border-radius: 3px; border: 1px solid rgba(233, 237, 231, 0.25); background: var(--fmc-obsidian); }
.fmc-thumbnail[data-hidden],
.fmc-thumbnail[data-error] { display: none; }
.fmc-thumbnail img { display: block; }
.fmc-preview-time {
  padding: 3px 7px;
  border-radius: 3px;
  background: rgba(19, 19, 19, 0.9);
  font: 600 12px/1 var(--fmc-mono);
  font-variant-numeric: tabular-nums;
  color: var(--fmc-matte);
}

/* ------------------------------------------------------------------ */
/* 7. Menus (speed, quality)                                           */
/* ------------------------------------------------------------------ */
.fmc-menu {
  margin: 0;
  padding: 6px;
  min-width: 168px;
  max-height: var(--media-menu-available-height, 320px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--fmc-line);
  border-radius: 6px;
  background: rgba(35, 42, 47, 0.97);
  color: var(--fmc-matte);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font: 400 13px/1.2 var(--fmc-mono);
  --media-menu-side-offset: 10px;
  --media-popover-side-offset: 10px;
  transition: opacity 0.15s var(--fmc-ease), transform 0.15s var(--fmc-ease);
}
.fmc-menu[data-starting-style],
.fmc-menu[data-ending-style] { opacity: 0; transform: translateY(4px); }
.fmc-menu-content { display: grid; gap: 2px; }
.fmc-menu-heading {
  justify-self: stretch;
  text-align: left;
  padding: 6px 10px 8px;
  font: 700 12px/1 var(--fmc-subheading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fmc-muted);
  border-bottom: 1px solid var(--fmc-line);
  margin-bottom: 4px;
}
.fmc-menu-group { display: grid; gap: 2px; }
.fmc-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 4px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.fmc-menu-item[data-highlighted],
.fmc-menu-item:hover { background: var(--fmc-graphite); }
.fmc-menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--fmc-orange); }
.fmc-menu-item[aria-checked='true'] { color: var(--fmc-matte); font-weight: 600; }
.fmc-menu-check { width: 16px; height: 16px; color: var(--fmc-iron); opacity: 0; }
.fmc-menu-item[aria-checked='true'] .fmc-menu-check { opacity: 1; }
.fmc-menu-check svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.fmc-menu-tier { margin-left: 4px; font-size: 10px; color: var(--fmc-orange); }
.fmc-menu-badge { font-size: 11px; color: var(--fmc-muted); }

/* ------------------------------------------------------------------ */
/* 8. Error dialog and seek feedback                                   */
/* ------------------------------------------------------------------ */
.fmc-error {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100% - 32px));
  padding: 20px;
  border-left: 3px solid var(--fmc-iron);
  border-radius: 4px;
  background: rgba(35, 42, 47, 0.97);
  color: var(--fmc-matte);
  transform: translate(-50%, -50%);
}
.fmc-error:not([data-open]) { display: none; }
.fmc-error-title { font: 700 18px/1.2 var(--fmc-subheading); }
.fmc-error-text { font: 400 13px/1.5 var(--fmc-mono); color: var(--fmc-muted); }
.fmc-error-close {
  justify-self: start;
  padding: 8px 14px;
  border: 1px solid rgba(233, 237, 231, 0.3);
  border-radius: 4px;
  background: transparent;
  color: var(--fmc-matte);
  font: 600 12px/1 var(--fmc-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.fmc-error-close:hover { background: var(--fmc-iron); border-color: var(--fmc-iron); }

.fmc-seek-ind {
  position: absolute;
  top: 50%;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(19, 19, 19, 0.7);
  font: 600 13px/1 var(--fmc-mono);
  pointer-events: none;
  translate: 0 -50%;
  opacity: 0;
  transition: opacity 0.2s var(--fmc-ease);
}
.fmc-seek-ind[data-direction='backward'] { left: 12%; }
.fmc-seek-ind[data-direction='forward'] { right: 12%; }
.fmc-seek-ind[data-open],
.fmc-seek-ind[data-visible] { opacity: 1; }

.fmc-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* 9. Small players                                                    */
/* ------------------------------------------------------------------ */
@container fmc-player (max-width: 520px) {
  .fmc-bar { padding: 0 6px 4px; }
  .fmc-time { margin-left: 2px; font-size: 12px; }
  .fmc-time .fmc-time-sep,
  .fmc-time .fmc-duration { display: none; }
  .fmc-top { padding: 10px 12px 28px; }
  .fmc-top-title { font-size: 15px; }
  .fmc-bigplay { width: 60px; height: 60px; }
  .fmc-bigplay svg { width: 23px; height: 23px; }
}

/* ------------------------------------------------------------------ */
/* 10. End screen after the Chapter's last video (from chapter.css)    */
/*     Inside the player container, so it also shows in fullscreen.    */
/* ------------------------------------------------------------------ */
.fmc-end-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  background: rgba(19, 19, 19, 0.97);
  color: var(--f-white, #fff);
  text-align: center;
  font-family: 'Archivo Narrow', sans-serif;
}
.fmc-end-screen[hidden] { display: none !important; }
.fmc-end-content { width: 100%; max-width: 680px; }
.fmc-end-label {
  margin-bottom: 0;
  color: var(--f-ice-gray, #c7d8d7);
  font-size: clamp(12px, 1.6vw, 16px);
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.2;
}
.fmc-end-label::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  margin: 16px auto;
  background: var(--f-iron-red, #9e3223);
}
.fmc-end-title {
  margin-bottom: clamp(14px, 3vw, 30px);
  color: var(--f-white, #fff);
  font-size: clamp(20px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.fmc-end-title:empty { display: none; }
.fmc-end-label:empty::after { margin-top: 0; }
/* End-card button = a standard Divi button. Divi 5 loads its base .et_pb_button rules only on pages that
   contain a Button module; Chapter pages have none, so the theme's colours, padding (.3em 1em), border and
   hover arrow apply but the button stayed `display: inline` (31 px tall instead of 41 px) in the card's
   font. These are the only properties that differed from a live Divi button (computed-style diff,
   2026-11-17); everything else still comes from the theme. Scoped to the end card. */
.fmc-end-screen a.et_pb_button.fmc-end-proceed {
  display: inline-block;
  font-family: var(--et_global_body_font, 'Roboto Mono');
  letter-spacing: 1px;
  --et-pb-icon-self-align: center;
}
.fmc-end-screen a.et_pb_button.fmc-end-proceed::after {
  box-sizing: content-box;
  font-size: inherit;
  line-height: 1em;
  margin-left: 0.3em;
}
/* Divi buttons are 14 px at 980 px and below (padding and arrow are em-based, so they scale with it). */
@media (max-width: 980px) {
  .fmc-end-screen a.et_pb_button.fmc-end-proceed { font-size: 14px; }
}
/* Curriculum-completion card (Chapter 33): message + secondary link */
.fmc-end-message {
  max-width: 520px;
  margin: 0 auto clamp(14px, 3vw, 28px);
  color: var(--f-ice-gray, #c7d8d7);
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 400;
  line-height: 1.45;
}
.fmc-end-message:empty { display: none; }
.fmc-end-secondary {
  display: block;
  margin-top: clamp(12px, 2vw, 20px);
  color: var(--f-ice-gray, #c7d8d7);
  font-size: clamp(12px, 1.6vw, 15px);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.fmc-end-secondary:hover,
.fmc-end-secondary:focus-visible { color: var(--f-white, #fff); }
.fmc-end-secondary[hidden] { display: none !important; }
@media (max-width: 480px) {
  .fmc-end-screen { padding: 12px; }
}

/* ------------------------------------------------------------------ */
/* 11. Completion marks (from chapter.js + chapter.css)                */
/* ------------------------------------------------------------------ */
.fmc-completion-mark {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #6FAF83;
  background: transparent;
  color: #6FAF83;
  font: bold 11px/1 Arial, sans-serif;
  pointer-events: none;
}
.fmc-item.active .fmc-completion-mark {
  color: #FFFFFF;
  border-color: #FFFFFF;
}

/* ------------------------------------------------------------------ */
/* 12. Notices and configuration errors                                */
/* ------------------------------------------------------------------ */
.fmc-notice {
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 45;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--fmc-orange);
  border-radius: 3px;
  background: rgba(35, 42, 47, 0.95);
  color: var(--fmc-matte);
  font: 400 13px/1.45 var(--fmc-mono);
  translate: -50% 0;
  pointer-events: none;
}
.fmc-notice[hidden] { display: none; }

.fmc-config-error {
  padding: 14px 16px;
  border-left: 3px solid var(--f-iron-red, #9e3223);
  background: var(--f-slate, #232a2f);
  color: var(--f-matte-white, #e9ede7);
  font: 400 14px/1.5 'Roboto Mono', monospace;
}

@media (prefers-reduced-motion: reduce) {
  .fmc-chapter * { transition: none !important; animation-duration: 0s !important; }
  .fmc-spinner { animation: fmc-spin 1.6s linear infinite !important; }
}
