.ss-shorts {
  position: relative;
  width: 100%;
  --ss-visible-desktop: 4;
  --ss-visible-tablet: 3;
  --ss-visible-mobile: 1;
  --ss-title-lines: 3;
  --ss-modal-width: 720px;
  --ss-modal-max-height: 88vh;
  --ss-bg: #0f172a;
  --ss-surface: #0b1536;
  --ss-text: #ffffff;
  --ss-text-muted: rgba(255, 255, 255, 0.75);
  --ss-accent: #991b1b;
  --ss-arrow-bg: #ffffff;
  --ss-arrow-text: #991b1b;
  --ss-button-bg: #ffffff;
  --ss-button-text: #991b1b;
  --ss-meta-dot: rgba(255, 255, 255, 0.55);
  color: var(--ss-text);
}

.ss-shorts--light {
  --ss-bg: #f8fafc;
  --ss-surface: #ffffff;
  --ss-text: #0f172a;
  --ss-text-muted: rgba(15, 23, 42, 0.72);
  --ss-accent: #991b1b;
  --ss-arrow-bg: #ffffff;
  --ss-arrow-text: #991b1b;
  --ss-button-bg: #991b1b;
  --ss-button-text: #ffffff;
  --ss-meta-dot: rgba(15, 23, 42, 0.3);
}

.ss-shorts--dark {
  --ss-bg: #0f172a;
  --ss-surface: #0b1536;
  --ss-text: #ffffff;
  --ss-text-muted: rgba(255, 255, 255, 0.75);
  --ss-accent: #991b1b;
  --ss-arrow-bg: #ffffff;
  --ss-arrow-text: #991b1b;
  --ss-button-bg: #ffffff;
  --ss-button-text: #991b1b;
  --ss-meta-dot: rgba(255, 255, 255, 0.55);
}

.ss-shorts__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.ss-shorts__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ss-text);
  opacity: 0.85;
  margin-bottom: 8px;
}

.ss-shorts__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
  color: var(--ss-text);
}

.ss-shorts__actions {
  display: flex;
  gap: 10px;
}

.ss-shorts__arrow {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--ss-arrow-bg);
  color: var(--ss-arrow-text);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ss-shorts__arrow[disabled] {
  opacity: 0.45;
  cursor: default;
}

.ss-shorts__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.ss-shorts__viewport::-webkit-scrollbar {
  display: none;
}

.ss-shorts__track {
  display: grid;
  grid-auto-flow: column;
  gap: 18px;
  grid-auto-columns: calc((100% - (18px * (var(--ss-visible-desktop) - 1))) / var(--ss-visible-desktop));
}

.ss-short-card {
  position: relative;
  scroll-snap-align: start;
  border-radius: 28px;
  overflow: hidden;
  background: var(--ss-surface);
  color: var(--ss-text);
  box-shadow: 0 18px 50px rgba(2, 8, 23, 0.18);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.ss-short-card:hover,
.ss-short-card:focus-within,
.ss-short-card.is-active {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(2, 8, 23, 0.22);
}

.ss-short-card__thumb-wrap {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #0b1120;
}

.ss-short-card__thumb,
.ss-short-card__preview,
.ss-short-card__player,
.ss-short-card__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ss-short-card__thumb {
  object-fit: cover;
  display: block;
}

.ss-short-card__preview {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 2;
}

.ss-short-card.is-previewing .ss-short-card__preview,
.ss-short-card.is-playing .ss-short-card__preview {
  opacity: 1;
  visibility: visible;
}

.ss-short-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.72) 0%, rgba(2, 6, 23, 0.08) 50%, rgba(2, 6, 23, 0.16) 100%);
  pointer-events: none;
  z-index: 1;
}

.ss-short-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 4;
}

.ss-short-card__play-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  animation: ss-short-pulse 1.8s infinite ease-out;
  backdrop-filter: blur(6px);
}

.ss-short-card__play-icon {
  position: relative;
  z-index: 2;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ss-accent);
  font-size: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.ss-short-card.is-previewing .ss-short-card__play,
.ss-short-card.is-playing .ss-short-card__play {
  opacity: 0;
  pointer-events: none;
}

.ss-short-card__content {
  padding: 16px 16px 18px;
}

.ss-short-card__title {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ss-text);
  display: -webkit-box;
  -webkit-line-clamp: var(--ss-title-lines);
  line-clamp: var(--ss-title-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.45em * var(--ss-title-lines));
}

.ss-short-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ss-text-muted);
  margin-bottom: 14px;
}

.ss-short-card__dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--ss-meta-dot);
}

.ss-short-card__buttons {
  display: flex;
}

.ss-short-card__button {
  flex: 1 1 auto;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  padding: 0 14px;
}

.ss-short-card__button--watch {
  background: var(--ss-button-bg);
  color: var(--ss-button-text);
}

.ss-shorts-modal[hidden] {
  display: none !important;
}

.ss-shorts-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
}

.ss-shorts-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
}

.ss-shorts-modal__dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2147483647;
  width: min(92vw, var(--ss-modal-width));
  max-width: var(--ss-modal-width);
}

.ss-shorts-modal__player {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: var(--ss-modal-max-height);
  border-radius: 24px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.ss-shorts-modal__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ss-shorts-modal__close {
  position: absolute;
  right: 0;
  top: -54px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #991b1b;
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
}

html.ss-shorts-modal-open,
body.ss-shorts-modal-open {
  overflow: hidden;
}

.ss-shorts-error,
.ss-shorts-empty {
  padding: 16px 18px;
  border-radius: 18px;
  background: #f8fafc;
  color: #0f172a;
}

@keyframes ss-short-pulse {
  0% {
    transform: scale(0.88);
    opacity: 0.78;
  }
  70% {
    transform: scale(1.18);
    opacity: 0;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@media (max-width: 1180px) {
  .ss-shorts__track {
    grid-auto-columns: calc((100% - (18px * (var(--ss-visible-tablet) - 1))) / var(--ss-visible-tablet));
  }
}

@media (max-width: 767px) {
  .ss-shorts__header {
    align-items: start;
    flex-direction: column;
  }

  .ss-shorts__actions {
    align-self: flex-end;
  }

  .ss-shorts__track {
    grid-auto-columns: calc((100% - (18px * (var(--ss-visible-mobile) - 1))) / var(--ss-visible-mobile));
  }

  .ss-short-card__play {
    width: 74px;
    height: 74px;
  }

  .ss-short-card__play-icon {
    width: 74px;
    height: 74px;
    font-size: 28px;
  }

  .ss-shorts-modal__dialog {
    width: min(94vw, 460px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ss-short-card,
  .ss-short-card__preview,
  .ss-short-card__play-ring {
    transition: none;
    animation: none;
  }
}