:root {
  --navy: #020d22;
  --navy-2: #041c46;
  --panel: rgba(0, 0, 0, 0.46);
  --white: #ffffff;
  --muted: #c2d3ef;
  --red: #b00000;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --app-width: 100vw;
  --app-height: 100dvh;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body.allow-browser-collapse {
  height: calc(var(--app-height) + 72px);
  overflow-y: auto;
}

button {
  font: inherit;
}

.experience {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--app-width);
  height: var(--app-height);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(circle at 8% 90%, rgba(80, 16, 82, 0.58), transparent 24%),
    radial-gradient(circle at 93% 5%, rgba(36, 83, 145, 0.52), transparent 27%),
    var(--navy);
}

.player,
.rotate-prompt {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--app-width);
  height: var(--app-height);
}

.player {
  display: grid;
  place-items: center;
  padding:
    calc(14px + var(--safe-top))
    calc(18px + var(--safe-right))
    calc(18px + var(--safe-bottom))
    calc(18px + var(--safe-left));
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.slide-frame {
  width: min(calc(var(--app-width) - 36px), calc((var(--app-height) - 16px) * 16 / 9));
  aspect-ratio: 16 / 9;
  margin: 0;
  border-radius: clamp(0px, 1.4vw, 12px);
  overflow: hidden;
  background: #061a3a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.slide-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

.progress {
  position: fixed;
  z-index: 4;
  top: calc(9px + var(--safe-top));
  left: calc(82px + var(--safe-left));
  right: calc(82px + var(--safe-right));
  display: grid;
  grid-template-columns: repeat(42, minmax(3px, 1fr));
  gap: 3px;
  pointer-events: none;
}

.progress span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.progress span.is-read {
  background: rgba(255, 255, 255, 0.96);
}

.orientation-note {
  position: fixed;
  z-index: 8;
  top: calc(22px + var(--safe-top));
  left: 50%;
  display: none;
  max-width: min(360px, calc(100vw - 28px));
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  backdrop-filter: blur(10px);
}

.tap-zone {
  position: fixed;
  z-index: 7;
  top: 0;
  bottom: 0;
  width: 42vw;
  min-width: 150px;
  border: 0;
  padding: 0;
  color: var(--white);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tap-zone-left {
  left: 0;
}

.tap-zone-right {
  right: 0;
}

.tap-zone span {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.92);
  font-size: 32px;
  font-weight: 700;
  opacity: 0.72;
  transition: opacity 160ms ease, background 160ms ease;
}

.tap-zone-left span {
  left: calc(20px + var(--safe-left));
}

.tap-zone-right span {
  right: calc(20px + var(--safe-right));
}

.tap-zone:focus-visible span,
.tap-zone:hover span {
  opacity: 1;
  background: rgba(0, 0, 0, 0.42);
}

.status {
  position: fixed;
  z-index: 8;
  left: calc(20px + var(--safe-left));
  bottom: calc(14px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.status span:first-child {
  color: var(--white);
  font-weight: 700;
}

.fullscreen-control {
  position: fixed;
  z-index: 9;
  right: calc(20px + var(--safe-right));
  bottom: calc(14px + var(--safe-bottom));
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.fullscreen-control:focus-visible,
.fullscreen-control:hover {
  background: rgba(0, 0, 0, 0.58);
}

body.is-focus-mode .hint {
  display: none;
}

body.is-focus-mode .fullscreen-control {
  opacity: 0.42;
}

.rotate-prompt {
  z-index: 10;
  display: none;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 84%, rgba(80, 16, 82, 0.72), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(36, 83, 145, 0.62), transparent 34%),
    var(--navy);
}

.rotate-card {
  width: min(420px, 92vw);
  display: grid;
  justify-items: center;
  gap: 15px;
  text-align: center;
}

.mini-phone {
  width: 116px;
  height: 178px;
  padding: 10px;
  border-radius: 26px;
  border: 8px solid rgba(255, 255, 255, 0.92);
  transform: rotate(90deg);
}

.mini-phone div {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(176, 0, 0, 0.84), rgba(176, 0, 0, 0) 32%),
    var(--navy-2);
}

.eyebrow {
  margin: 8px 0 0;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rotate-card h1 {
  max-width: 330px;
  margin: 0;
  font-size: clamp(34px, 10vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.prompt-copy {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

@media (max-height: 460px) {
  .hint {
    display: none;
  }

  .status {
    font-size: 11px;
    padding: 8px 11px;
  }

  .fullscreen-control {
    font-size: 11px;
    padding: 8px 11px;
  }
}

@media (hover: none) {
  .tap-zone span {
    opacity: 0.46;
  }
}

@media (orientation: portrait) and (max-width: 920px) {
  .orientation-note {
    display: block;
  }

  .player {
    padding:
      calc(74px + var(--safe-top))
      calc(10px + var(--safe-right))
      calc(116px + var(--safe-bottom))
      calc(10px + var(--safe-left));
  }

  .slide-frame {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: none;
    border-radius: 8px;
  }

  .progress {
    top: calc(10px + var(--safe-top));
    left: calc(14px + var(--safe-left));
    right: calc(14px + var(--safe-right));
    gap: 2px;
  }

  .progress span {
    height: 3px;
  }

  .tap-zone {
    top: auto;
    bottom: calc(18px + var(--safe-bottom));
    width: min(176px, calc((100vw - 42px) / 2));
    min-width: 0;
    height: 68px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(10px);
  }

  .tap-zone-left {
    left: calc(14px + var(--safe-left));
    right: auto;
  }

  .tap-zone-right {
    left: auto;
    right: calc(14px + var(--safe-right));
  }

  .tap-zone span,
  .tap-zone-left span,
  .tap-zone-right span {
    top: 50%;
    left: 50%;
    right: auto;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: transparent;
    font-size: 34px;
    opacity: 1;
  }

  .status {
    left: 50%;
    bottom: calc(96px + var(--safe-bottom));
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .status .hint {
    display: none;
  }

  .fullscreen-control {
    top: calc(42px + var(--safe-top));
    right: calc(14px + var(--safe-right));
    bottom: auto;
  }
}
