/* Reusable slot demo player — click-to-start iframe + chrome + CTA */

.demo-player {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 100%;
  background: var(--color-surface-elevated, #0d0a1a);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 0.75rem);
  overflow: hidden;
  box-shadow: var(--shadow-lg, 0 8px 28px rgba(0, 0, 0, 0.35));
}

.demo-player__chrome {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 5;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: calc(0.5rem + env(safe-area-inset-top, 0px)) 0.65rem 0.5rem;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    transparent 100%
  );
}

.demo-player__chrome[hidden] {
  display: none !important;
}

.demo-player__chrome-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  pointer-events: auto;
}

.demo-player__tool {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm, 0.5rem);
  background: rgba(10, 7, 20, 0.82);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: var(--font-body-weight-bold, 700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
  backdrop-filter: blur(6px);
}

.demo-player__tool:hover,
.demo-player__tool:focus-visible {
  border-color: var(--color-accent, #39ff14);
  color: var(--color-accent, #39ff14);
  outline: none;
}

.demo-player__tool-icon {
  font-size: 1rem;
  line-height: 1;
  font-weight: 800;
}

.demo-player__tool--close:hover,
.demo-player__tool--close:focus-visible {
  border-color: #ff5c5c;
  color: #ff8a8a;
}

.demo-player__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(70vh, 42rem);
  min-height: 16rem;
  background: #000;
  overflow: hidden;
  isolation: isolate;
}

.demo-player--page .demo-player__frame {
  min-height: 18rem;
}

.demo-player__frame iframe,
.demo-player__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  z-index: 2;
  max-width: 100%;
  max-height: 100%;
}

.demo-player--fullscreen .demo-player__frame,
.demo-player--immersive .demo-player__frame {
  max-height: none;
  min-height: 0;
  aspect-ratio: auto;
  height: 100%;
  background: #000;
}

.demo-player--immersive {
  position: fixed;
  inset: 0;
  z-index: 900;
  width: 100%;
  max-width: none;
  height: 100dvh;
  height: 100svh;
  margin: 0;
  border-radius: 0;
  border-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #000;
}

.demo-player--fullscreen .demo-player__chrome,
.demo-player--immersive .demo-player__chrome {
  padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
  padding-right: calc(0.65rem + env(safe-area-inset-right, 0px));
}

.demo-player--immersive .demo-player__cta {
  padding-bottom: calc(var(--space-3, 0.75rem) + env(safe-area-inset-bottom, 0px));
}

html.demo-immersive,
body.demo-immersive {
  overflow: hidden;
  touch-action: none;
}

.demo-player__frame > picture {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 0;
}

.demo-player__frame > picture[hidden] {
  display: none !important;
}

.demo-player__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.demo-player__veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3, 0.75rem);
  padding: var(--space-4, 1rem);
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.72) 100%);
  z-index: 3;
}

.demo-player__veil[hidden] {
  display: none !important;
}

.demo-player--live .demo-player__veil,
.demo-player--live .demo-player__frame > picture {
  display: none !important;
}

.demo-player--loading .demo-player__veil {
  background: rgba(0, 0, 0, 0.78);
}

.demo-player__hint {
  margin: 0;
  text-align: center;
  color: var(--color-accent, #39ff14);
  font-weight: var(--font-body-weight-bold, 700);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: var(--font-size-sm, 0.875rem);
}

.demo-player__start {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(14rem, calc(100% - 2rem));
  min-height: 2.85rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid color-mix(in srgb, var(--color-accent, #39ff14) 75%, #fff);
  border-radius: var(--radius-button, 999px);
  background: var(--btn-bg-primary, var(--color-accent, #39ff14));
  color: var(--btn-color-primary, var(--color-on-accent, #0a0714));
  font: inherit;
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: var(--font-body-weight-bold, 700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: var(--btn-shadow-primary, 0 4px 20px rgba(57, 255, 20, 0.35));
}

.demo-player__start:hover,
.demo-player__start:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.demo-player__error {
  display: grid;
  gap: var(--space-3, 0.75rem);
  justify-items: center;
  max-width: 28rem;
  text-align: center;
}

.demo-player__error[hidden] {
  display: none !important;
}

.demo-player__fallback {
  margin: 0;
  color: var(--color-text, #fff);
  font-size: var(--font-size-sm, 0.875rem);
  line-height: var(--line-height-relaxed, 1.5);
}

.demo-player__fallback-link {
  color: var(--color-accent, #39ff14);
  font-weight: var(--font-body-weight-medium, 600);
}

.demo-player__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3, 0.75rem);
  width: 100%;
  margin-inline: auto;
  padding: var(--space-3, 0.75rem);
  text-align: center;
  background: var(--color-surface, #0a0714);
  border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
}

.demo-player__cta .ig-cta-primary,
.demo-player__cta-btn {
  min-width: min(14rem, 100%);
  touch-action: manipulation;
}

.demo-player__disclaimer {
  margin: var(--space-2, 0.5rem) 0 0;
  font-size: var(--font-size-xs, 0.75rem);
  line-height: var(--line-height-relaxed, 1.5);
  color: var(--color-muted, #a8a0b8);
  text-align: center;
}

.demo-player__disclaimer a {
  color: var(--color-accent, #39ff14);
  font-weight: var(--font-body-weight-medium, 600);
}

@media (max-width: 900px) {
  .demo-player__tool-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .demo-player__tool {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.4rem;
  }

}

@media (max-width: 720px) {
  .demo-player__chrome {
    justify-content: flex-end;
    padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 0.5rem 0.45rem;
  }

  .demo-player__chrome-actions {
    width: auto;
    justify-content: flex-end;
  }

  .demo-player__tool {
    flex: 0 0 auto;
  }

  .demo-player__frame,
  .demo-player--page .demo-player__frame {
    aspect-ratio: auto;
    width: 100%;
    height: min(68svh, 30rem);
    min-height: 17rem;
    max-height: none;
  }

  .demo-player__veil {
    padding: var(--space-3, 0.75rem);
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    align-content: end;
  }

  .demo-player__start {
    width: min(100%, 16rem);
  }

  .demo-player__cta {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: calc(var(--space-3, 0.75rem) + env(safe-area-inset-bottom, 0px));
  }

  .demo-player__cta .ig-cta-primary,
  .demo-player__cta-btn {
    width: 100%;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .demo-player__frame,
  .demo-player--page .demo-player__frame {
    height: min(78svh, 100%);
    min-height: 12rem;
  }

  .demo-player__chrome-actions {
    width: auto;
    margin-left: auto;
  }
}
