:root {
  --bg-top: #253066;
  --bg-mid: #10183a;
  --bg-bottom: #050812;
  --text: #ffffff;
  --muted: #d7dcf6;
  --soft: #aeb8eb;
  --cta-a: #f04438;
  --cta-b: #f59e0b;
  --panel: rgba(255, 255, 255, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, var(--bg-top) 0%, var(--bg-mid) 43%, var(--bg-bottom) 100%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100svh;
}

.start-screen,
.video-screen,
.closing-screen {
  min-height: 100svh;
}

.start-screen {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.brand-lockup {
  margin: 0 0 10px;
  text-align: center;
}

.brand-lockup img {
  display: block;
  width: 164px;
  max-width: 48vw;
  height: auto;
  margin: 0 auto;
}

.start-card,
.closing-card {
  text-align: center;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px 16px 22px;
}

h1,
h2 {
  font-family: "Roboto", sans-serif;
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(31px, 8.4vw, 42px);
  font-weight: 900;
  line-height: 1.04;
}

h1 span {
  display: block;
}

.headline-row {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.flag-mark {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 0.95em;
  flex: 0 0 22px;
}

.flag-mark::before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 4px;
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
}

.flag-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.06em;
  width: 0;
  height: 0;
  border-top: 0.22em solid transparent;
  border-bottom: 0.22em solid transparent;
  border-left: 0.58em solid #ef3b3b;
}

.course-line {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 4.9vw, 21px);
  font-weight: 700;
}

.tagline {
  margin: 10px 0 0;
  font-size: clamp(14px, 4.3vw, 18px);
  font-weight: 700;
  line-height: 1.32;
}

.button-wrap {
  display: flex;
  justify-content: center;
  margin-top: 17px;
}

button,
.closing-link {
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--cta-a), var(--cta-b));
  font: 800 16px/1.15 "Open Sans", system-ui, sans-serif;
}

button {
  width: 100%;
  max-width: 342px;
  min-height: 50px;
  padding: 14px 16px;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.92;
}

button.is-loading {
  color: rgba(255, 255, 255, 0.72);
}

.privacy-note {
  margin: 12px auto 0;
  max-width: 340px;
  color: #d2d8ff;
  font-size: 11px;
  line-height: 1.36;
}

.journey-status {
  min-height: 76px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.journey-status p {
  margin: 0;
}

#statusText {
  font-weight: 800;
  font-size: 16px;
}

.fallback-note {
  margin-top: 8px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.video-screen,
.closing-screen {
  display: none;
}

.app[data-screen="video"] .start-screen,
.app[data-screen="closing"] .start-screen {
  display: none;
}

.app[data-screen="video"] .video-screen,
.app[data-screen="closing"] .closing-screen {
  display: flex;
}

.video-screen {
  flex-direction: column;
  min-height: 100svh;
  height: 100svh;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  background: #030407;
  overflow: hidden;
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 4px 2px 10px;
}

.viewer-header img {
  width: 128px;
  max-width: 45vw;
  height: auto;
}

.viewer-header span {
  color: #dce2ff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.video-stage {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #000000;
}

.demo-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000000;
}

.demo-video::-webkit-media-controls,
.demo-video::-webkit-media-controls-enclosure,
.demo-video::-webkit-media-controls-panel,
.demo-video::-webkit-media-controls-play-button,
.demo-video::-webkit-media-controls-start-playback-button {
  display: none !important;
  opacity: 0 !important;
}

.liveview-overlay,
.sponsor-slot,
.viewer-url,
.video-message,
.resume-recovery-btn,
.inline-watch-btn,
.inline-close-btn {
  position: absolute;
  z-index: 2;
}

.liveview-overlay {
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  width: clamp(126px, 34vw, 172px);
  height: auto;
  z-index: 3;
  opacity: 0.94;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.46)) drop-shadow(0 1px 6px rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

.sponsor-slot {
  top: max(15px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.sponsor-slot span {
  display: block;
  color: #ffffff;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.video-message {
  left: 50%;
  top: 54%;
  width: min(82%, 420px);
  transform: translate(-50%, -50%);
  padding: 15px 18px;
  border-radius: 999px;
  text-align: center;
  background: rgba(0, 0, 0, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  opacity: 1;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.35s ease;
}

.video-message.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.video-message.is-action {
  background: linear-gradient(90deg, var(--cta-a), var(--cta-b));
  border-color: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1.02);
}

.resume-recovery-btn {
  left: 50%;
  top: 54%;
  width: min(260px, calc(100% - 56px));
  min-height: 50px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cta-a), var(--cta-b));
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
  z-index: 5;
}

.resume-recovery-btn[hidden] {
  display: none;
}

.inline-watch-btn {
  left: 50%;
  top: calc(54% + 52px);
  width: auto;
  max-width: calc(100% - 56px);
  min-height: 0;
  transform: translateX(-50%);
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.inline-close-btn {
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: auto;
  max-width: none;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
}

.inline-watch-btn[hidden],
.inline-close-btn[hidden] {
  display: none;
}

.viewer-url {
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.app.is-fullscreen-active .inline-watch-btn,
.app.is-fullscreen-active .inline-close-btn,
.app.is-fullscreen-active .viewer-url,
.app.is-fullscreen-active .video-message {
  display: none;
}

.app.is-fullscreen-active .video-screen {
  padding: 0;
}

.app.is-fullscreen-active .viewer-header {
  display: none;
}

.app.is-fullscreen-active .video-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  border-radius: 0;
  z-index: 20;
}

.app.is-fullscreen-active .liveview-overlay {
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  width: clamp(118px, 28vw, 168px);
}

.app.is-fullscreen-active .sponsor-slot {
  top: max(16px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  background: rgba(0, 0, 0, 0.5);
}

.closing-screen {
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}

.closing-card {
  width: min(100%, 430px);
}

.closing-card img {
  display: block;
  width: 160px;
  max-width: 52vw;
  height: auto;
  margin: 0 auto 16px;
}

.closing-card h2 {
  font-size: 34px;
  line-height: 1.05;
}

.closing-card p {
  margin: 12px auto 0;
  max-width: 330px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.38;
  font-weight: 700;
}

.closing-link {
  display: inline-block;
  margin-top: 18px;
  padding: 14px 20px;
  text-decoration: none;
}

.restart-session-btn {
  display: block;
  margin: 12px auto 0;
  max-width: 330px;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.restart-status {
  min-height: 24px;
  margin-top: 14px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
}

@media (max-width: 700px) and (orientation: portrait) {
  .start-screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .start-card {
    padding: 18px 14px 20px;
  }

  .brand-lockup img {
    width: 156px;
  }

  h1 {
    font-size: clamp(30px, 9vw, 40px);
  }

  .video-stage {
    border-radius: 12px;
  }

}

@media (orientation: landscape) {
  .video-screen {
    padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .viewer-header {
    min-height: 34px;
    padding: 0 2px 6px;
  }

  .viewer-header img {
    width: 116px;
  }

  .viewer-header span {
    font-size: 11px;
  }

  .video-stage {
    border-radius: 10px;
  }

  .liveview-overlay {
    top: max(12px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    width: min(188px, 24vw);
  }

  .sponsor-slot {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }

  .video-message {
    top: 50%;
    width: min(320px, 42vw);
    font-size: 15px;
  }

  .inline-watch-btn {
    left: 50%;
    top: calc(50% + 48px);
    transform: translateX(-50%);
  }

  .inline-close-btn {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .viewer-url {
    left: 14px;
    bottom: 19px;
    transform: none;
  }
}
