.fhp-rail {
  --fhp-accent: #d4a853;
  --fhp-accent-strong: #f0c66f;
  --fhp-surface-soft: #1d1d1d;
  --fhp-border: rgba(212, 168, 83, .28);
  --fhp-text: var(--thumb-text-color, #fff);
  --fhp-muted: var(--thumb-info-color, #aaa);
  --fhp-gap: 12px;
  box-sizing: border-box;
  min-width: 0;
  list-style: none;
}

.grid-temp > .fhp-rail--list {
  grid-column: 1 / -1;
  width: 100%;
  margin: 14px 0 18px;
}

.fhp-rail[hidden],
html.am-prime .fhp-rail,
.fhp-rail[data-fh-slot="compact"] {
  display: none !important;
}

.fhp-rail__surface {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: 16px 0;
  overflow: hidden;
  color: var(--fhp-text);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--fhp-border);
  border-bottom: 1px solid var(--fhp-border);
  border-radius: 0;
}

.fhp-rail__header,
.fhp-rail__title-line {
  display: flex;
  align-items: center;
}

.fhp-rail__header {
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 13px;
}

.fhp-rail__heading {
  min-width: 0;
}

.fhp-rail__title-line {
  flex-wrap: wrap;
  gap: 7px;
}

.fhp-rail__crown {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--fhp-accent-strong);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fhp-rail__title {
  margin: 0;
  color: var(--fhp-text);
  font: 700 19px/1.15 "Quicksand", sans-serif;
  letter-spacing: .02em;
}

.fhp-rail__subtitle {
  margin: 4px 0 0;
  color: var(--fhp-muted);
  font-size: 13px;
  line-height: 1.3;
}

.fhp-rail__more {
  flex: 0 0 auto;
  max-width: 230px;
  padding: 7px 0;
  overflow: hidden;
  color: var(--fhp-accent-strong);
  font-size: 13px;
  font-weight: 700;
  text-align: end;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fhp-rail__more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fhp-rail__more:focus-visible,
.fhp-card__media-link:focus-visible,
.fhp-card__title-link:focus-visible,
.fhp-card__source:focus-visible,
.fhp-rail__arrow:focus-visible,
.fhp-rail__track:focus-visible,
.fhp-modal a:focus-visible,
.fhp-modal button:focus-visible,
.fhp-modal video:focus-visible {
  outline: 2px solid var(--fhp-accent-strong);
  outline-offset: 3px;
}

.fhp-rail__viewport {
  position: relative;
  min-width: 0;
}

.fhp-rail__track {
  display: flex;
  gap: var(--fhp-gap);
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  list-style: none;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.fhp-rail__track::-webkit-scrollbar {
  display: none;
}

.fhp-card {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 calc((100% - 36px) / 4);
  min-width: 0;
  scroll-snap-align: start;
}

.fhp-card__media-link,
.fhp-card__title-link,
.fhp-card__source {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.fhp-card__media-link,
.fhp-card__title-link {
  display: block;
}

.fhp-card__media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #080808;
  border-radius: 8px;
}

.fhp-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform .24s ease, opacity .2s ease;
}

.fhp-card__media-link:hover .fhp-card__image,
.fhp-card__media-link:focus-visible .fhp-card__image {
  transform: scale(1.035);
}

.fhp-card.is-image-failed .fhp-card__image {
  display: none;
}

.fhp-card.is-image-failed .fhp-card__media::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  content: "FapHouse";
  color: var(--fhp-accent);
  background: linear-gradient(135deg, #111, #252018);
  font-size: 16px;
  font-weight: 700;
}

.fhp-card__badge {
  position: absolute;
  z-index: 3;
  top: 7px;
  inset-inline-start: 7px;
  box-sizing: border-box;
  max-width: calc(100% - 14px);
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 4px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .3);
  font: 800 10px/1.1 "Roboto", sans-serif;
  letter-spacing: .035em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.fhp-card__badge--creator {
  color: #21170a;
  background: rgba(240, 198, 111, .96);
}

.fhp-card__badge--studio {
  color: #f5d38b;
  background: rgba(11, 11, 11, .9);
  border-color: rgba(240, 198, 111, .55);
}

.fhp-card__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: rgba(7, 7, 7, .7);
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 50%;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .42);
  opacity: .92;
  transform: translate(-50%, -50%);
  transition: background .2s ease, transform .2s ease;
  pointer-events: none;
}

.fhp-card__play svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.fhp-card__media-link:hover .fhp-card__play,
.fhp-card__media-link:focus-visible .fhp-card__play {
  background: rgba(201, 146, 47, .95);
  transform: translate(-50%, -50%) scale(1.08);
}

.fhp-card__duration,
.fhp-card__quality {
  position: absolute;
  z-index: 3;
  bottom: 6px;
  padding: 3px 5px;
  color: #fff;
  background: rgba(0, 0, 0, .82);
  border-radius: 3px;
  font: 700 11px/1 "Roboto", sans-serif;
}

.fhp-card__duration {
  inset-inline-end: 6px;
}

.fhp-card__quality {
  inset-inline-start: 6px;
  color: #16120b;
  background: rgba(240, 198, 111, .95);
}

.fhp-card__title-link {
  display: -webkit-box;
  min-height: 2.55em;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--fhp-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.28;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.fhp-card__title-link:hover {
  color: var(--fhp-accent-strong);
}

.fhp-card__source {
  display: flex;
  max-width: 100%;
  margin: 5px 0 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--fhp-muted);
  font-size: 12px;
  line-height: 1.25;
}

.fhp-card__source[href]:hover {
  color: var(--fhp-accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fhp-card__source--creator {
  color: var(--fhp-accent-strong);
  font-weight: 650;
}

.fhp-card__source-avatar {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: cover;
  background: #111;
  border: 1px solid rgba(240, 198, 111, .42);
  border-radius: 50%;
}

.fhp-card__source-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fhp-rail__arrow {
  position: absolute;
  top: calc(50% - 28px);
  z-index: 4;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(10, 10, 10, .88);
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .38);
  cursor: pointer;
  transform: translateY(-50%);
}

.fhp-rail__arrow--prev {
  inset-inline-start: 7px;
}

.fhp-rail__arrow--next {
  inset-inline-end: 7px;
}

.fhp-rail__arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fhp-rail__arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.fhp-rail__status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.fhp-card--skeleton {
  pointer-events: none;
}

.fhp-card--skeleton .fhp-card__media,
.fhp-card__skeleton-title,
.fhp-card__skeleton-meta {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--fhp-surface-soft);
}

.fhp-card--skeleton .fhp-card__media::after,
.fhp-card__skeleton-title::after,
.fhp-card__skeleton-meta::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .07) 43%, transparent 66%);
  transform: translateX(-100%);
  animation: fhp-skeleton 1.5s ease-in-out infinite;
}

.fhp-card__skeleton-title {
  width: 88%;
  height: 13px;
  margin-top: 10px;
  border-radius: 3px;
}

.fhp-card__skeleton-meta {
  width: 52%;
  height: 10px;
  margin-top: 8px;
  border-radius: 3px;
}

html.light .fhp-rail {
  --fhp-surface-soft: #e9e9e9;
  --fhp-border: rgba(184, 134, 11, .3);
  --fhp-text: #111;
  --fhp-muted: #6f6f6f;
}

body.fhp-modal-open {
  overflow: hidden;
}

.fhp-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  box-sizing: border-box;
  padding: 24px;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .86);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.fhp-modal__dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(270px, .78fr);
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  color: #f7f7f7;
  background: #151515;
  border: 1px solid rgba(240, 198, 111, .32);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .65);
}

.fhp-modal__close {
  position: absolute;
  z-index: 5;
  top: 10px;
  inset-inline-end: 10px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, .75);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  cursor: pointer;
  font: 400 27px/1 Arial, sans-serif;
}

.fhp-modal__close:hover {
  color: #16110a;
  background: #f0c66f;
}

.fhp-modal__player {
  position: relative;
  display: grid;
  min-width: 0;
  align-self: center;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.fhp-modal__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.fhp-modal__info {
  box-sizing: border-box;
  min-width: 0;
  padding: 34px 26px 26px;
  overflow-y: auto;
}

.fhp-modal__brand {
  display: inline-block;
  color: #f0c66f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fhp-modal__title {
  margin: 9px 0 17px;
  color: #fff;
  font: 750 21px/1.25 "Quicksand", sans-serif;
}

.fhp-modal__identity {
  display: flex;
  margin: 0 0 14px;
  align-items: center;
  gap: 10px;
}

.fhp-modal__avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: cover;
  background: #0a0a0a;
  border: 1px solid rgba(240, 198, 111, .45);
  border-radius: 50%;
}

.fhp-modal__identity-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.fhp-modal__source-label {
  overflow: hidden;
  color: #d7b369;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fhp-modal__source-name {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fhp-modal__details {
  margin: 0 0 18px;
  color: #aaa;
  font-size: 13px;
}

.fhp-modal__cta {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.fhp-modal__cta + .fhp-modal__cta {
  margin-top: 9px;
}

.fhp-modal__cta--primary {
  color: #1b1408;
  background: #f0c66f;
  border: 1px solid #f0c66f;
}

.fhp-modal__cta--primary:hover {
  background: #ffdc92;
}

.fhp-modal__cta--secondary {
  color: #f0c66f;
  background: transparent;
  border: 1px solid rgba(240, 198, 111, .54);
}

.fhp-modal__cta--secondary:hover {
  color: #17120a;
  background: #f0c66f;
}

.fhp-modal__fanclub {
  display: block;
  margin-top: 12px;
  color: #cfcfcf;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: underline;
  text-decoration-color: rgba(240, 198, 111, .55);
  text-underline-offset: 3px;
}

.fhp-modal__fanclub:hover {
  color: #f0c66f;
}

.fhp-empty-replaced {
  display: none !important;
}

.fhp-modal__end {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  padding: 24px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  background: rgba(0, 0, 0, .9);
  text-align: center;
}

.fhp-modal__end-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 750;
}

.fhp-modal__end .fhp-modal__cta {
  width: auto;
  min-width: 210px;
}

.fhp-modal__replay {
  margin: 13px 0 0;
  padding: 7px 12px;
  color: #ddd;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes fhp-skeleton {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1019px) {
  .fhp-rail[data-fh-slot="wide"] {
    display: none !important;
  }

  .fhp-rail[data-fh-slot="compact"] {
    display: list-item !important;
  }

  section.fhp-rail[data-fh-slot="compact"] {
    display: block !important;
  }

  .fhp-card {
    flex-basis: calc((100% - 24px) / 3);
  }
}

@media (min-width: 1020px) {
  .fhp-rail[data-fh-slot="compact"] {
    display: none !important;
  }
}

@media (max-width: 759px) {
  .fhp-modal {
    padding: 0;
    align-items: flex-end;
  }

  .fhp-modal__dialog {
    display: block;
    width: 100%;
    max-height: 95vh;
    max-height: 95dvh;
    overflow-y: auto;
    border-width: 1px 0 0;
    border-radius: 14px 14px 0 0;
  }

  .fhp-modal__player {
    width: 100%;
  }

  .fhp-modal__info {
    padding: 19px 18px max(22px, env(safe-area-inset-bottom));
    overflow: visible;
  }

  .fhp-modal__title {
    margin: 7px 40px 13px 0;
    font-size: 18px;
  }

  .fhp-modal__close {
    top: 8px;
    inset-inline-end: 8px;
  }
}

@media (max-width: 599px) {
  .grid-temp > .fhp-rail--list {
    margin-block: 10px 15px;
  }

  .fhp-rail__surface {
    padding: 13px 0;
  }

  .fhp-rail__header {
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 11px;
  }

  .fhp-rail__title {
    font-size: 17px;
  }

  .fhp-rail__crown {
    width: 20px;
    height: 20px;
  }

  .fhp-rail__subtitle {
    font-size: 12px;
  }

  .fhp-rail__more {
    max-width: 105px;
    padding-bottom: 1px;
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
  }

  .fhp-card {
    flex-basis: calc(80% - 8px);
  }

  .fhp-rail__arrow {
    top: calc(50% - 25px);
    width: 34px;
    height: 34px;
  }

  .fhp-card__play {
    width: 39px;
    height: 39px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fhp-rail__track {
    scroll-behavior: auto;
  }

  .fhp-card__image,
  .fhp-card__play {
    transition: none;
  }

  .fhp-card--skeleton .fhp-card__media::after,
  .fhp-card__skeleton-title::after,
  .fhp-card__skeleton-meta::after {
    animation: none;
  }
}

/* Must come after compact slot rules: hidden always wins after an API failure. */
.fhp-rail[hidden] {
  display: none !important;
}