:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-soft: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: #dce2ff;
  --soft: #aeb8ef;
  --night: #0b1020;
  --navy: #101744;
  --royal: #29306b;
  --field: #101f2b;
  --orange-a: #ff4a4a;
  --orange-b: #ffad0f;
  --green: #78d69b;
}

* {
  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:
    linear-gradient(180deg, rgba(42, 47, 107, 0.92), rgba(20, 26, 70, 0.98) 38%, var(--night) 100%),
    var(--night);
}

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

button {
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font: 800 16px/1.15 "Open Sans", system-ui, sans-serif;
  cursor: pointer;
}

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

.app {
  min-height: 100svh;
}

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

.start-screen {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

.brand-lockup img,
.closing-card img,
.access-blocked-card img {
  display: block;
  width: 296px;
  max-width: 82vw;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.38));
}

.start-card,
.closing-card,
.access-blocked-card {
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px 18px 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

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

h1 {
  font-size: clamp(36px, 8.8vw, 48px);
  font-weight: 900;
  line-height: 1.02;
}

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: 15px 0 0;
  color: var(--soft);
  font-size: clamp(15px, 4.4vw, 19px);
  font-weight: 800;
}

.office-camera-chooser {
  width: 100%;
  margin-top: 16px;
  padding: 20px 16px;
  text-align: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.office-camera-chooser h2 {
  font-size: clamp(24px, 6vw, 30px);
}

.office-camera-chooser p {
  margin: 10px auto 0;
  color: var(--muted);
  font-weight: 700;
}

.office-camera-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.office-camera-option {
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  text-align: left;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
}

.office-camera-option:hover,
.office-camera-option:focus-visible {
  border-color: var(--orange-b);
  outline: none;
}

.office-camera-options:empty {
  display: none;
}

.app.is-location-checking .journey-status {
  visibility: hidden;
}

.app.is-office-camera-selection .start-card {
  display: none;
}

.app.is-office-camera-selection .brand-lockup img {
  width: 240px;
  max-width: 66vw;
}

.app.is-office-camera-selection .office-camera-chooser {
  margin-top: 0;
  padding: 26px 18px 28px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.app.is-office-camera-selection .office-camera-chooser h2 {
  font-size: clamp(24px, 6.4vw, 30px);
  line-height: 1.12;
}

.app.is-office-camera-selection .office-camera-chooser.is-opening {
  min-height: 178px;
  display: grid;
  align-content: center;
}

.tagline {
  margin: 14px auto 0;
  max-width: 340px;
  color: #ffffff;
  font-size: clamp(20px, 5.4vw, 24px);
  font-weight: 900;
  line-height: 1.22;
}

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

#confirmLocationBtn,
.video-message,
.restart-session-btn {
  background: linear-gradient(90deg, var(--orange-a), var(--orange-b));
  box-shadow: 0 14px 34px rgba(255, 118, 32, 0.24);
}

#confirmLocationBtn,
.restart-session-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 342px;
  min-height: 82px;
  padding: 16px 18px;
  text-align: center;
  font-size: clamp(24px, 6vw, 30px);
  line-height: 1.05;
}

.restart-session-btn {
  font-size: clamp(24px, 6vw, 30px);
  line-height: 1.05;
}

.privacy-note {
  margin: 14px auto 0;
  max-width: 340px;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 800;
  line-height: 1.28;
}

.journey-status {
  min-height: 34px;
  margin-top: 14px;
}

.journey-status p {
  margin: 0;
}

#statusText {
  color: #ffffff;
  font-size: clamp(18px, 4.8vw, 22px);
  font-weight: 900;
  line-height: 1.24;
}

.fallback-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

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

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

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

.app.is-pre-reveal[data-screen="video"] .start-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  max-width: none;
  display: flex;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(42, 47, 107, 0.96), rgba(20, 26, 70, 0.99) 38%, var(--night) 100%),
    var(--night);
}

.app.is-pre-reveal[data-screen="video"] .start-card {
  width: min(100%, 430px);
}

.app.is-pre-reveal[data-screen="video"][data-pre-reveal-source="closing"] .start-screen {
  display: none;
}

.app.is-pre-reveal[data-screen="video"][data-pre-reveal-source="closing"] .closing-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  width: 100%;
  max-width: none;
  background:
    linear-gradient(180deg, rgba(42, 47, 107, 0.96), rgba(20, 26, 70, 0.99) 38%, var(--night) 100%),
    var(--night);
}

.app.is-pre-reveal[data-screen="video"] .video-screen {
  pointer-events: none;
}

.app.is-pre-reveal[data-screen="video"] .video-message,
.app.is-pre-reveal[data-screen="video"] .inline-close-btn {
  display: none;
}

.video-screen {
  flex-direction: column;
  height: 100svh;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(16, 23, 68, 0.98), var(--night));
  overflow: hidden;
}

.viewer-console {
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto;
  gap: 10px;
  width: 100%;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.viewer-header {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, auto) minmax(120px, 1fr);
  grid-template-areas:
    "brand title session"
    "sponsor sponsor session";
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}

.viewer-header.has-sponsor {
  grid-template-columns: minmax(120px, 1fr) minmax(0, auto) minmax(120px, 1fr);
  grid-template-areas:
    "brand title ."
    "sponsor . session";
}

.viewer-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  min-width: 0;
}

.viewer-header img {
  width: 154px;
  max-width: 28vw;
  height: auto;
}

.viewer-title {
  grid-area: title;
  min-width: 0;
  justify-self: center;
  text-align: center;
}

.viewer-title span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.viewer-title strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1.05;
}

.viewer-session {
  grid-area: session;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.viewer-header.has-sponsor .viewer-session {
  align-self: center;
  justify-content: flex-end;
}

.viewer-url,
.viewer-sponsor {
  flex: 0 0 auto;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(120, 214, 155, 0.14);
  border: 1px solid rgba(120, 214, 155, 0.24);
  white-space: nowrap;
}

.viewer-sponsor {
  grid-area: sponsor;
  justify-self: start;
  max-width: min(34vw, 320px);
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  background: rgba(120, 214, 155, 0.1);
  border-color: rgba(120, 214, 155, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.viewer-sponsor[hidden] {
  display: none;
}

.video-stage {
  position: relative;
  align-self: center;
  width: min(100%, calc((100svh - 144px) * 1.7778));
  max-width: 1280px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #000000;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.64);
}

.video-stage:has(.video-message:not(.is-hidden))::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(135deg, rgba(120, 214, 155, 0.2), transparent 28%),
    linear-gradient(315deg, rgba(255, 173, 15, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(45, 58, 134, 0.98), rgba(15, 28, 58, 0.98));
}

.video-stage:has(.video-message:not(.is-hidden)) .inline-close-btn {
  opacity: 0;
  pointer-events: none;
}

.demo-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  opacity: 1;
  mix-blend-mode: normal;
  background: #000000;
}

.demo-video.has-saved-framing {
  transform-origin: center center;
  will-change: transform;
}

.video-stage:has(.video-message:not(.is-hidden)) .demo-video {
  opacity: 0;
}

.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;
}

.video-message,
.fullscreen-btn,
.inline-close-btn {
  position: absolute;
  z-index: 2;
}

.video-message {
  left: 50%;
  bottom: max(68px, calc(env(safe-area-inset-bottom) + 68px));
  width: min(86%, 460px);
  min-height: 112px;
  transform: translateX(-50%);
  padding: 16px 18px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  opacity: 1;
  overflow: hidden;
  background: linear-gradient(110deg, #ff4d4d 0%, #ff8a17 50%, #ffc13a 100%);
  box-shadow: 0 12px 30px rgba(255, 116, 32, 0.26);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.video-message:not(.is-hidden)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.28) 42%, transparent 72%);
  transform: translateX(-120%);
  animation: liveViewCueSweep 1.45s ease-in-out infinite;
}

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

@keyframes liveViewCueSweep {
  0% {
    transform: translateX(-120%);
  }

  58%,
  100% {
    transform: translateX(120%);
  }
}

.fullscreen-btn,
.inline-close-btn {
  width: auto;
  min-width: 128px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(5, 8, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  font-weight: 800;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

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

.inline-close-btn {
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(255, 74, 74, 0.8), rgba(255, 173, 15, 0.8));
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-weight: 900;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(2px);
}

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

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

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

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

.rotate-guidance {
  align-self: center;
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.18;
  backdrop-filter: blur(12px);
}

.rotate-guidance strong,
.rotate-guidance span {
  display: block;
}

.rotate-guidance span {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 800;
}

.closing-screen,
.access-blocked-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,
.access-blocked-card {
  width: min(100%, 430px);
}

.closing-card img,
.access-blocked-card img {
  margin-bottom: 16px;
}

.closing-card h2,
.access-blocked-card h2 {
  font-size: clamp(38px, 10vw, 48px);
  line-height: 1.05;
}

.access-blocked-card h2 {
  font-size: clamp(27px, 8vw, 34px);
}

.access-blocked-copy {
  margin: 16px auto 0;
  max-width: 360px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.42;
}

.access-blocked-copy p {
  margin: 0;
}

.access-blocked-copy p + p {
  margin-top: 12px;
}

.access-blocked-actions {
  margin-top: 20px;
}

.restart-session-btn,
.access-retry-btn {
  display: block;
  margin: 20px auto 0;
}

.access-retry-btn {
  width: 100%;
  max-width: 342px;
  min-height: 56px;
  margin-top: 0;
  background: linear-gradient(90deg, var(--orange-a), var(--orange-b));
  box-shadow: 0 14px 34px rgba(255, 118, 32, 0.24);
}

.site-visit-btn {
  display: block;
  width: 100%;
  max-width: 342px;
  min-height: 48px;
  margin: 12px auto 0;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

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

.access-help {
  margin: 12px auto 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
}

@media (max-width: 700px) and (orientation: portrait) {
  .start-card {
    padding: 22px 16px 24px;
  }

  .brand-lockup img,
  .closing-card img,
  .access-blocked-card img {
    width: 296px;
  }

  h1 {
    font-size: clamp(32px, 9.2vw, 42px);
  }

  .video-screen {
    padding: max(8px, env(safe-area-inset-top)) 6px max(8px, env(safe-area-inset-bottom));
  }

  .viewer-console {
    grid-template-rows: auto auto auto;
    align-content: start;
    gap: 10px;
  }

  .viewer-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand title"
      "sponsor session";
    gap: 8px;
    padding: 8px;
  }

  .viewer-header.has-sponsor {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand title"
      "sponsor session";
  }

  .viewer-header img {
    width: 124px;
    max-width: 42vw;
  }

  .viewer-title {
    justify-self: end;
    text-align: right;
  }

  .viewer-title strong {
    font-size: 17px;
  }

  .viewer-url {
    font-size: 11px;
    padding: 6px 8px;
  }

  .viewer-session {
    justify-content: flex-end;
  }

  .viewer-sponsor {
    justify-self: start;
    max-width: 52vw;
    font-size: 11px;
    padding: 6px 9px;
  }

  .video-stage {
    width: 100%;
  }

  .video-message {
    bottom: 62px;
    width: min(84%, 360px);
    font-size: 15px;
  }

  .fullscreen-btn,
  .inline-close-btn {
    min-width: 118px;
    min-height: 40px;
    padding: 9px 13px;
    font-size: 12px;
  }

  .inline-close-btn {
    top: 12px;
  }

  .rotate-guidance {
    width: min(100%, 360px);
    padding: 8px 12px;
    font-size: 15px;
  }
}

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

  .viewer-console {
    gap: 5px;
  }

  .viewer-header {
    grid-template-areas:
      "brand title ."
      "sponsor . session";
    padding: 5px 8px;
  }

  .viewer-header.has-sponsor {
    grid-template-areas:
      "brand title ."
      "sponsor . session";
  }

  .viewer-session {
    align-self: center;
    justify-self: end;
  }

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

  .viewer-title strong {
    font-size: 13px;
  }

  .viewer-title span {
    font-size: 7px;
  }

  .viewer-url {
    font-size: 10px;
    padding: 5px 7px;
  }

  .viewer-sponsor {
    max-width: min(30vw, 260px);
    font-size: 9px;
    padding: 5px 7px;
  }

  .video-stage {
    width: min(100%, calc((100svh - 92px) * 1.7778));
  }

  .video-message {
    width: min(360px, 48vw);
    font-size: 14px;
    bottom: 58px;
  }

  .fullscreen-btn,
  .inline-close-btn {
    min-width: 104px;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 11px;
  }

  .rotate-guidance {
    display: none;
  }
}
