@font-face {
  font-family: Sun;
  src: url('./assets/fonts/SUNTT5.ttf') format('truetype');
  font-weight: 400;
}

@font-face {
  font-family: Sun;
  src: url('./assets/fonts/SUNTT7.ttf') format('truetype');
  font-weight: 700;
}

:root {
  --navy: #242D50;
  --yellow: #FDC300;
  --cream: #FFEED4;
  --orange: #F39100;
  --pink: #E6007E;
  --gold: #B3935F;
  --white: #FFFFFF;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--cream);
  color: var(--navy);
  font-family: Sun, Arial, sans-serif;
}

html[data-showcase="static"] body {
  background:
    linear-gradient(rgba(16, 16, 20, 0.18), rgba(16, 16, 20, 0.18)),
    url('./assets/device/framebg3d.jpg') center center / cover no-repeat fixed;
}

html[data-showcase="static"] #showcaseShell {
  width: min(100vw, calc((100vh - 62px) * 1200 / 2232));
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 10px;
}

html[data-showcase="static"] #deviceFrame {
  position: relative;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 78px);
  aspect-ratio: 1200 / 2232;
  flex: 0 1 auto;
}

html[data-showcase="static"] #deviceImage {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

#previewSurface {
  width: min(100%, calc(100vh / 2));
  height: min(100%, calc(100vw * 2));
  aspect-ratio: 1080 / 2160;
  overflow: hidden;
  background: var(--cream);
}

html[data-showcase="static"] #previewSurface {
  position: absolute;
  z-index: 2;
  left: 13.333333%;
  top: 11.290323%;
  width: 72.75%;
  height: 78.136201%;
  aspect-ratio: auto;
}

#app {
  width: 100%;
  height: 100%;
}

html[data-showcase="static"] .showcaseCredit {
  width: min(86%, 360px);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(36, 45, 80, 0.76);
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1.2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

html[data-showcase="static"] .showcaseCredit a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

html[data-showcase="static"] .showcaseCredit a:hover {
  color: var(--navy);
}

html[data-showcase="static"] .showcaseCredit img {
  width: 76px;
  height: auto;
  display: block;
}

html[data-showcase="static"] .showcaseCredit small {
  display: block;
  color: rgba(36, 45, 80, 0.56);
  font-size: 10px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  html[data-showcase="static"] #showcaseShell {
    gap: 7px;
    padding-bottom: 7px;
  }

  html[data-showcase="static"] #deviceFrame {
    max-height: calc(100vh - 68px);
  }

  html[data-showcase="static"] .showcaseCredit {
    width: min(calc(100% - 48px), 340px);
    gap: 7px;
    padding: 7px 10px;
    font-size: 10px;
  }

  html[data-showcase="static"] .showcaseCredit img {
    width: 62px;
  }

  html[data-showcase="static"] .showcaseCredit small {
    font-size: 9px;
  }
}

/* On a phone the training is the experience, while preserving its 1080 x 2160 canvas. */
@media (max-width: 640px), (orientation: landscape) and (max-height: 640px) {
  html[data-showcase="static"],
  html[data-showcase="static"] body {
    display: grid;
    min-height: 100svh;
    background: #101014;
  }

  html[data-showcase="static"] body {
    place-items: center;
  }

  html[data-showcase="static"] #showcaseShell,
  html[data-showcase="static"] #deviceFrame,
  html[data-showcase="static"] #previewSurface {
    background: #101014;
  }

  html[data-showcase="static"] #showcaseShell,
  html[data-showcase="static"] #deviceFrame {
    width: 100%;
    height: 100svh;
    max-height: none;
    margin: 0;
    padding: 0;
  }

  html[data-showcase="static"] #showcaseShell {
    display: grid;
    place-items: center;
  }

  html[data-showcase="static"] #deviceFrame {
    display: grid;
    place-items: center;
    position: relative;
    aspect-ratio: auto;
  }

  html[data-showcase="static"] #deviceImage,
  html[data-showcase="static"] .showcaseCredit {
    display: none;
  }

  html[data-showcase="static"] #previewSurface {
    position: relative;
    inset: auto;
    width: min(100vw, calc(100svh / 2));
    height: min(100svh, calc(100vw * 2));
    max-height: none;
    margin: 0;
    aspect-ratio: 1080 / 2160;
  }
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
}

.loading {
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.menu {
  overflow-y: auto;
  background: var(--cream);
  padding-bottom: 40px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menuHeader {
  padding: 38px 24px 20px;
}

.menuHeader img {
  display: block;
  width: 100%;
  height: 64px;
  margin-bottom: 24px;
  object-fit: contain;
}

.menuHeader h1 {
  margin: 0 0 10px;
  font-size: 31px;
  line-height: 1.12;
}

.menuHeader p {
  margin: 0;
  color: var(--navy);
  opacity: 0.72;
  font-size: 15px;
  line-height: 1.45;
}

.menuBody {
  padding: 18px 16px;
}

.fullStart {
  width: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px;
  margin-bottom: 27px;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--navy);
  text-align: left;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(243, 145, 0, 0.25);
}

.fullStart small {
  display: block;
  margin-top: 5px;
  opacity: 0.72;
  font-weight: 400;
}

.sectionLabel {
  display: block;
  margin-bottom: 14px;
  color: var(--navy);
  opacity: 0.7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.moduleGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.moduleCard {
  position: relative;
  min-height: 126px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--white);
  color: var(--navy);
  text-align: left;
  box-shadow: 0 2px 8px rgba(36, 45, 80, 0.06);
}

.moduleCard.done {
  border-color: var(--navy);
  background: var(--cream);
}

.moduleStatus {
  display: inline-block;
  margin-bottom: 11px;
  padding: 5px 8px;
  border-radius: 14px;
  background: var(--cream);
  font-size: 10px;
  font-weight: 700;
}

.moduleCard.done .moduleStatus {
  background: var(--navy);
  color: var(--white);
}

.moduleNo {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.moduleTitle {
  display: block;
  padding-right: 10px;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
}

.secondaryActions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.secondaryBtn {
  min-height: 48px;
  border: 1px solid rgba(36, 45, 80, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.secondaryBtnDanger {
  border-color: rgba(164, 9, 30, 0.22);
  color: #A4091E;
}

.videoScreen,
.exercise {
  background: #000;
  color: #fff;
}

.media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

#exerciseOverlay {
  position: absolute;
  z-index: 12;
  inset: 0;
  pointer-events: none;
}

.progress {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  transition: opacity 500ms ease;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--yellow);
}

.topbar {
  position: absolute;
  z-index: 5;
  top: 3px;
  left: 0;
  right: 0;
  min-height: 76px;
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 18px 16px 16px;
  background: rgba(36, 45, 80, 0.84);
  transition: opacity 500ms ease;
}

.progress.isFaded,
.topbar.isFaded {
  opacity: 0;
  pointer-events: none;
}

.back {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
}

.topbar small {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar strong {
  display: block;
  max-width: 215px;
  margin-top: 3px;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skip {
  position: absolute;
  z-index: 8;
  top: 22px;
  right: 14px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
}

.bottomAction {
  position: absolute;
  z-index: 8;
  bottom: 35px;
  left: 20px;
  right: 20px;
}

.bottomAction:not([hidden]) {
  animation: exercise-action-fade 240ms linear both;
}

@keyframes exercise-action-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.primary {
  width: 100%;
  padding: 18px 14px;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 17px;
  font-weight: 700;
}

.placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 28px;
  background: var(--navy);
  text-align: center;
}

.placeholder h2 {
  margin: 0;
  color: #fff;
}

.placeholder p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.5;
}

.instruction {
  position: absolute;
  z-index: 12;
  width: 84%;
  padding: calc(14px * var(--ui-scale, 1)) calc(18px * var(--ui-scale, 1));
  border: calc(1.5px * var(--ui-scale, 1)) solid rgba(36, 45, 80, 0.28);
  border-radius: calc(12px * var(--ui-scale, 1));
  background: var(--cream);
  color: var(--navy);
  font-size: calc(14px * var(--ui-scale, 1));
  font-weight: 700;
  line-height: calc(20.3px * var(--ui-scale, 1));
  text-align: center;
  box-shadow: 0 calc(8px * var(--ui-scale, 1)) calc(24px * var(--ui-scale, 1)) rgba(8, 16, 45, 0.16);
  animation: instruction-enter 260ms cubic-bezier(.2, .85, .3, 1) both;
}

.instruction::before,
.instruction::after {
  content: "";
  position: absolute;
  left: var(--tooltip-arrow-x, 50%);
  width: calc(14px * var(--ui-scale, 1));
  height: calc(14px * var(--ui-scale, 1));
  background: var(--cream);
  transform: translateX(-50%);
}

.instruction::before {
  display: none;
}

.instruction[data-pointer="down"]::after {
  bottom: calc(-8px * var(--ui-scale, 1));
  border-right: calc(1.5px * var(--ui-scale, 1)) solid rgba(36, 45, 80, 0.28);
  border-bottom: calc(1.5px * var(--ui-scale, 1)) solid rgba(36, 45, 80, 0.28);
  transform: translateX(-50%) rotate(45deg);
}

.instruction[data-pointer="up"]::after {
  top: calc(-8px * var(--ui-scale, 1));
  border-left: calc(1.5px * var(--ui-scale, 1)) solid rgba(36, 45, 80, 0.28);
  border-top: calc(1.5px * var(--ui-scale, 1)) solid rgba(36, 45, 80, 0.28);
  transform: translateX(-50%) rotate(45deg);
}

.visualHighlight {
  position: absolute;
  z-index: 11;
  overflow: hidden;
  border-radius: 999px;
  background: transparent;
  pointer-events: none;
  transform: rotate(-0.8deg);
}

.visualHighlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(253, 195, 0, 0.28);
  transform: scaleX(0);
  transform-origin: left center;
  animation: visual-highlight-marker-draw 1.35s ease-out forwards;
  animation-delay: var(--highlight-delay, 0ms);
}

@keyframes visual-highlight-marker-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes instruction-enter {
  from {
    opacity: 0;
    transform: scale(.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pauseCard {
  position: absolute;
  z-index: 24;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(30px * var(--ui-scale, 1));
  text-align: center;
  animation: pause-card-enter 260ms cubic-bezier(.2, .85, .3, 1) both;
  pointer-events: auto;
}

@keyframes pause-card-enter {
  from {
    opacity: 0;
    transform: scale(.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pauseCard p {
  margin: 0 0 calc(32px * var(--ui-scale, 1));
  font-size: calc(24px * var(--ui-scale, 1));
  font-weight: 700;
  line-height: calc(34px * var(--ui-scale, 1));
}

.pauseCard button {
  min-width: calc(220px * var(--ui-scale, 1));
  padding: calc(17px * var(--ui-scale, 1)) calc(34px * var(--ui-scale, 1));
  border-radius: calc(16px * var(--ui-scale, 1));
  font-size: calc(17px * var(--ui-scale, 1));
  font-weight: 700;
  pointer-events: auto;
}

.exerciseBackHotspot {
  position: absolute;
  z-index: 80;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.backConfirm {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(36, 45, 80, 0.48);
}

.backConfirmBox {
  width: min(86%, 420px);
  padding: 28px;
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.backConfirmBox strong {
  display: block;
  margin-bottom: 10px;
  font-size: 24px;
}

.backConfirmBox p {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.35;
}

.backConfirmBox div {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.backConfirmBox button {
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}

.backConfirmBox button.dangerAction {
  color: #A4091E;
}

.exitScreen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 28px;
  background: var(--cream);
  color: var(--navy);
  text-align: center;
}

.exitScreen h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

.exitScreen p {
  margin: 0 0 32px;
  max-width: 320px;
  color: rgba(36, 45, 80, 0.72);
  font-size: 16px;
  line-height: 1.45;
}

.preExercise {
  background: var(--cream);
  color: var(--navy);
}

.preExercise p {
  font-weight: 700;
}

.preExercise button {
  width: min(92%, 360px);
  background: var(--yellow);
  color: var(--navy);
}

.hotspot {
  position: absolute;
  z-index: 13;
  border: 0;
  border-radius: 20px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  pointer-events: auto;
}

.markerHintAnimation {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(132px * var(--ui-scale, 1));
  height: calc(132px * var(--ui-scale, 1));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.markerWave {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.markerWave {
  width: 118px;
  height: 118px;
  opacity: 0;
  border-style: solid;
  border-color: #E6007E;
  background: transparent;
  animation: markerRadiowave 2.2s ease-out infinite both;
}

.markerWaveInner {
  border-width: 2.5px;
  animation-delay: 0.18s;
}

.markerWaveOuter {
  border-width: 2px;
  animation-delay: 0.72s;
}

@keyframes markerRadiowave {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  8% {
    opacity: 0;
  }
  22% {
    opacity: 0.34;
  }
  82% {
    opacity: 0.1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.52);
  }
}


.phoneStage {
  position: absolute;
  z-index: 30;
  inset: 0;
  background: var(--yellow);
  pointer-events: auto;
}

.phoneStage.isSeamless {
  background: transparent;
}

.phoneStage iframe {
  position: absolute;
  z-index: 1;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  display: block;
  border: 0;
  background: var(--yellow);
  pointer-events: auto;
}

.phoneStage.isSeamless iframe {
  opacity: 0;
  background: transparent;
}

.phoneStage.isSeamless.isReady iframe {
  opacity: 1;
}

.phoneStage.isRetained {
  z-index: 20;
  pointer-events: none;
}

.phoneStage.isRetained iframe {
  pointer-events: none;
}

.complete,
.allDone {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 28px;
  text-align: center;
}

.complete {
  background: var(--cream);
}

.allDone {
  background: var(--cream);
  color: var(--navy);
}

.trophy {
  margin-bottom: 20px;
  font-size: 58px;
}

.complete h1,
.allDone h1 {
  margin: 0 0 12px;
  font-size: 26px;
}

.complete p,
.allDone p {
  margin: 0 0 40px;
  line-height: 1.55;
  opacity: 0.78;
}

.complete .primary,
.allDone .primary {
  margin-bottom: 12px;
}

.ghost {
  width: 100%;
  padding: 17px 14px;
  border: 2px solid var(--gold);
  border-radius: 16px;
  background: transparent;
  color: var(--navy);
}
