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

.demo-player {
  --demo-accent: var(--accent-gold, #ffcc29);
  --demo-accent-hot: var(--accent-orange, #ff7e00);
  --demo-surface: #000f24;
  --demo-border: var(--glass-border, rgba(255, 255, 255, 0.12));
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 1.25rem 0 0.35rem;
  background: var(--demo-surface);
  border: 1px solid var(--demo-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.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: 0.5rem;
  background: rgba(0, 16, 38, 0.92);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.demo-player__tool:hover,
.demo-player__tool:focus-visible {
  border-color: var(--demo-accent);
  color: var(--demo-accent);
  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(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: 0.75rem;
  padding: 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(--demo-accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 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: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--demo-accent-hot), var(--accent-red, #e60000));
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 10px 28px rgba(230, 0, 0, 0.35);
}

.demo-player__start:hover,
.demo-player__start:focus-visible {
  transform: translateY(-1px);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.demo-player__error {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  max-width: 28rem;
  text-align: center;
}

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

.demo-player__fallback {
  margin: 0;
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.5;
}

.demo-player__fallback-link {
  color: var(--demo-accent);
  font-weight: 700;
}

.demo-player__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin-inline: auto;
  padding: 0.75rem;
  text-align: center;
  background: rgba(0, 16, 38, 0.96);
  border-top: 1px solid var(--demo-border);
}

.demo-player__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(14rem, 100%);
  min-height: 2.75rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--demo-accent-hot), var(--accent-red, #e60000));
  color: #fff !important;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  touch-action: manipulation;
  box-shadow: 0 8px 22px rgba(230, 0, 0, 0.32);
}

.demo-player__cta-btn:hover {
  color: #fff !important;
}

.demo-player__disclaimer {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(203, 213, 224, 0.55);
  text-align: center;
}

.demo-player__disclaimer a {
  color: var(--demo-accent);
  font-weight: 700;
}

@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: 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(0.75rem + env(safe-area-inset-bottom, 0px));
  }

  .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;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-player__start {
    transition: none;
  }
}
