:root { --jb-intro-ready: 1; }

/* Estilos aislados: solo se aplican mientras existe la introducción. */
html.jb-intro-active,
html.jb-intro-active body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

html.jb-intro-active #app {
  pointer-events: none;
}

.jb-intro {
  --jb-intro-ready: 1;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #08060d;
  color: #fff;
  opacity: 1;
  transition: opacity 400ms ease;
  isolation: isolate;
}

.jb-intro--closing {
  opacity: 0;
}

.jb-intro__panel {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
}

.jb-intro__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: #08060d;
}

.jb-intro__controls {
  display: contents;
}

.jb-intro__skip,
.jb-intro__sound {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 4px;
  background: rgba(8,6,13,.85);
  color: #fff;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.jb-intro__skip {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}

.jb-intro__sound {
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
}

.jb-intro__skip:hover,
.jb-intro__sound:hover {
  background: #1d1234;
  border-color: #fff;
}

.jb-intro__skip:focus-visible,
.jb-intro__sound:focus-visible {
  outline: 2px solid var(--kp-gold, #e9cb8b);
  outline-offset: 3px;
}

.jb-intro__sound:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (min-width: 900px) and (orientation: landscape) and (any-pointer: fine) {
  .jb-intro--desktop {
    box-sizing: border-box;
    padding: 24px;
    background: rgba(8, 6, 13, .45);
    overflow: auto;
  }

  .jb-intro--desktop .jb-intro__panel {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    width: min(400px, calc((100vh - 172px) * .5625));
    width: min(400px, calc((100dvh - 172px) * .5625));
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: #100b1b;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .65);
  }

  .jb-intro--desktop .jb-intro__video {
    position: relative;
    inset: auto;
    flex: 0 1 auto;
    min-height: 0;
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 9 / 16;
    background: #08060d;
  }

  .jb-intro--desktop .jb-intro__controls {
    box-sizing: border-box;
    display: grid;
    flex: none;
    gap: 8px;
    padding: 12px;
    background: #100b1b;
  }

  .jb-intro--desktop .jb-intro__skip,
  .jb-intro--desktop .jb-intro__sound {
    position: static;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 6px;
  }

  .jb-intro--desktop .jb-intro__skip {
    border-color: var(--kp-gold, #d9b55b);
    background: var(--kp-gold, #d9b55b);
    color: #140b24;
  }

  .jb-intro--desktop .jb-intro__skip:hover {
    border-color: var(--kp-gold-600, #c6a247);
    background: var(--kp-gold-600, #c6a247);
  }

  .jb-intro--desktop .jb-intro__sound {
    border-color: rgba(255, 255, 255, .32);
    background: transparent;
  }

  .jb-intro--desktop .jb-intro__sound:hover {
    border-color: rgba(255, 255, 255, .65);
    background: #1d1234;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.jb-intro-available .jb-intro__replay {
    display: none !important;
  }
  .jb-intro {
    transition: none;
  }
}

/* La presentación puede repetirse desde la portada de ordenador. */
.jb-intro__replay {
  display: none;
}

@media (min-width: 900px) and (orientation: landscape) and (any-pointer: fine) {
  html.jb-intro-available .jb-intro__replay {
    display: inline-flex !important;
  }
}
