:root {
  color-scheme: dark;
  --ink: #f7f1df;
  --muted: #c6c0b2;
  --gold: #e8c36d;
  --gold-strong: #ffd980;
  --night: #05070b;
  --panel: rgba(7, 9, 14, 0.94);
  --control: rgba(7, 9, 14, 0.82);
  --control-hover: rgba(31, 28, 23, 0.96);
  --focus: #ffe8a3;
  --danger: #ff9b8a;
  --control-height: 68px;
  --z-hotspot: 10;
  --z-chrome: 20;
  --z-backdrop: 30;
  --z-drawer: 40;
  --z-overlay: 50;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--night);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night);
}

button {
  font: inherit;
}

button:focus-visible,
.hotspot:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(45, 54, 70, 0.18), transparent 48%),
    #030407;
  isolation: isolate;
}

.scene {
  position: relative;
  width: min(100vw, calc(100svh * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: 100svh;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.9);
  container-type: inline-size;
}

.scene__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.scene__poster {
  z-index: 1;
  opacity: 1;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scene__video {
  z-index: 2;
  display: none;
  opacity: 0;
  background: #000;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scene__video.is-ready {
  display: block;
}

.scene__video.is-playing {
  opacity: 1;
}

.scene.is-revealing-poster .scene__video {
  opacity: 0;
  filter: blur(5px);
  transform: scale(1.012);
  transition:
    opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hotspots {
  position: absolute;
  inset: 0;
  z-index: var(--z-hotspot);
  pointer-events: none;
}

.hotspot {
  position: absolute;
  display: grid;
  place-items: end center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  color: #1d1607;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transition:
    background-color 160ms ease-out,
    box-shadow 160ms ease-out,
    transform 160ms ease-out;
}

.hotspot::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: 10px;
  max-width: 220px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #1b1508;
  background: var(--gold-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition:
    opacity 140ms ease-out,
    transform 140ms ease-out;
  pointer-events: none;
}

.hotspot:hover,
.hotspot:focus-visible {
  background: rgba(255, 222, 139, 0.12);
  box-shadow:
    inset 0 0 0 2px rgba(255, 224, 151, 0.92),
    0 0 34px rgba(255, 210, 102, 0.42);
  transform: scale(1.02);
}

.hotspot:hover::after,
.hotspot:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hotspot--quadrant {
  border-radius: 0;
}

.hotspot--orb {
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgb(237 205 255 / 42%);
  animation: orb-prompt 1800ms ease-in-out infinite alternate;
}

.quiz-orb {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 7%;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transition:
    background-color 240ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 240ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-orb:not(.is-revealed):hover,
.quiz-orb:not(.is-revealed):focus-visible {
  box-shadow: 0 0 38px rgb(255 225 132 / 48%);
  transform: scale(1.025);
}

.quiz-orb:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.quiz-orb__question {
  max-width: 24ch;
  color: #fff;
  font-size: clamp(10px, 1.72cqw, 22px);
  font-weight: 720;
  line-height: 1.14;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 2px 8px #000;
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-orb.is-revealed {
  background: radial-gradient(circle, rgb(5 6 9 / 100%) 0 68%, rgb(5 6 9 / 93%) 77%, transparent 88%);
  box-shadow: 0 0 36px 20px rgb(5 6 9 / 92%);
  cursor: default;
}

.quiz-orb.is-revealed .quiz-orb__question {
  opacity: 1;
  transform: scale(1);
}

@keyframes orb-prompt {
  from {
    box-shadow: 0 0 0 2px rgb(237 205 255 / 35%), 0 0 18px rgb(157 61 255 / 20%);
  }
  to {
    box-shadow: 0 0 0 3px rgb(237 205 255 / 72%), 0 0 42px rgb(157 61 255 / 52%);
  }
}

.topbar,
.controls {
  position: fixed;
  left: 50%;
  z-index: var(--z-chrome);
  color: var(--ink);
  background: var(--control);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px) saturate(0.8);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition:
    opacity 180ms ease-out,
    transform 180ms ease-out;
}

.app:hover .topbar,
.app:hover .controls,
.app.controls-visible .topbar,
.app.controls-visible .controls,
.topbar:focus-within,
.controls:focus-within {
  opacity: 1;
  transform: translate(-50%, 0);
}

.topbar {
  top: max(12px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(620px, calc(100vw - 24px));
  min-height: 52px;
  padding: 5px;
  border-radius: 14px;
}

.topbar__title {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
}

.topbar__title > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__counter {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.controls {
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--control-height);
  padding: 6px;
  border-radius: 18px;
}

.icon-button,
.control-button,
.play-button,
.primary-button,
.secondary-button,
.text-button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font-size: 22px;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.control-button {
  display: flex;
  min-width: 108px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 12px;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}

.control-button:hover:not(:disabled) {
  background: var(--control-hover);
}

.control-button:disabled {
  color: #77736b;
  cursor: not-allowed;
}

.control-button--compact {
  min-width: 84px;
  padding-inline: 10px;
  color: var(--muted);
}

.control-button--next {
  color: #201808;
  background: var(--gold);
}

.control-button--next:hover:not(:disabled) {
  background: var(--gold-strong);
}

.play-button {
  display: grid;
  width: 54px;
  height: 54px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: #211806;
  background: var(--gold-strong);
  font-size: 21px;
  font-weight: 800;
  transition: transform 140ms ease-out;
}

.play-button:hover {
  transform: scale(1.05);
}

.video-state {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink);
  background: rgba(5, 7, 11, 0.82);
  font-size: 13px;
}

.video-state__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.scene-list {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  display: flex;
  width: min(430px, 94vw);
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  background: var(--panel);
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.55);
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scene-list.is-open {
  transform: translateX(0);
}

.scene-list__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scene-list__header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  text-wrap: balance;
}

.scene-list__header p,
.scene-list__footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.scene-list__items {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 10px;
}

.scene-jump {
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.scene-jump:hover {
  background: rgba(255, 255, 255, 0.07);
}

.scene-jump.is-current {
  color: #1e1606;
  background: var(--gold);
}

.scene-jump__number {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.scene-jump.is-current .scene-jump__number {
  color: #5b4616;
}

.scene-jump__title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-jump__type {
  color: var(--muted);
  font-size: 15px;
}

.scene-jump.is-current .scene-jump__type {
  color: #5b4616;
}

.scene-list__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.scene-list__footer p {
  max-width: 220px;
  text-align: right;
}

.text-button {
  min-height: 44px;
  padding: 8px 0;
  color: var(--danger);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  border: 0;
  background: rgba(0, 0, 0, 0.54);
  cursor: default;
}

.start-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 42%, rgba(31, 43, 65, 0.52), transparent 48%),
    rgba(2, 4, 7, 0.62);
  backdrop-filter: blur(4px);
  transition:
    opacity 220ms ease-out,
    visibility 220ms ease-out;
}

.start-overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.start-overlay__content {
  width: min(620px, 100%);
  text-align: center;
}

.start-overlay__brand {
  margin: 0 0 14px;
  color: var(--gold-strong);
  font-size: 15px;
  font-weight: 700;
}

.start-overlay h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-wrap: balance;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.85);
}

.start-overlay__content > p:nth-of-type(2) {
  max-width: 54ch;
  margin: 22px auto 0;
  color: #ded8ca;
  font-size: 17px;
  line-height: 1.5;
  text-wrap: pretty;
}

.start-overlay__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 720;
}

.primary-button {
  color: #201706;
  background: var(--gold-strong);
}

.primary-button:hover {
  background: #ffebb8;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: var(--ink);
  background: rgba(5, 7, 11, 0.62);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.start-overlay__note {
  margin: 18px 0 0 !important;
  color: var(--muted) !important;
  font-size: 13px !important;
}

.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: var(--z-overlay);
  max-width: calc(100vw - 28px);
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--ink);
  background: rgba(7, 9, 14, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  transform: translateX(-50%);
}

@media (max-width: 680px) {
  .topbar,
  .controls {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  .topbar {
    top: max(8px, env(safe-area-inset-top));
  }

  .controls {
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
    justify-content: space-between;
    border-radius: 16px;
  }

  .control-button {
    min-width: 56px;
    padding-inline: 12px;
  }

  .control-button--compact {
    min-width: 48px;
  }

  .control-button__label {
    display: none;
  }

  .scene-list__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .scene-list__footer p {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
