/* Flight observation uses a quiet camera plate and a brighter, state-driven display. */
.watching-page {
  --signal: #95def2;
  --signal-faint: #95def24d;
  --flight-foreground: #edf7fc;
  isolation: isolate;
  color: var(--flight-foreground);
}
.watch[data-view=watching] .dial-edge,
.watch[data-view=watching] .dial-date { z-index: 2; }
.watch[data-view=watching][data-phase=hold] .watching-page,
.watch[data-view=watching][data-stage=failure] .watching-page {
  --signal: #f0ba7a;
  --signal-faint: #f0ba7a55;
}
.observation-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(ellipse at 68% 37%, #1c3547 0%, #091620 44%, #03070a 76%);
}
.observation-backdrop::before,
.observation-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
}
.observation-backdrop::before {
  background: url('assets/cinema-earth.jpg') 62% 64% / cover no-repeat;
  opacity: .62;
}
.watch[data-watch-vehicle=falcon]:not([data-flight-display=true]) .observation-backdrop::before {
  background-image: url('assets/watch-launchpad.jpg');
  background-position: center;
  opacity: .93;
}
.watch[data-view=watching][data-stage=liftoff] .observation-backdrop::before {
  animation: show-orbit .85s ease-out both;
}
@keyframes show-orbit { from { opacity: .18; } to { opacity: .62; } }
.observation-backdrop::after {
  background:
    radial-gradient(ellipse at 50% 47%, transparent 28%, #0205096e 72%, #020509 100%),
    linear-gradient(180deg, #020509 12%, #02050966 34%, #02050922 65%, #020509b5 86%, #020509);
}

.watching-heading {
  top: 94px;
  left: 73px;
  width: 334px;
  z-index: 1;
}
.watching-heading .screen-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--signal);
  font-size: 15px;
  line-height: 19px;
  margin: 0 0 4px;
  letter-spacing: 1.2px;
}
.watching-heading .screen-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}
.watch[data-demo=true] .watching-heading .screen-label { color: #eac393; }
.watching-mission {
  line-height: 1.07;
  font-size: 29px;
  overflow: hidden;
  text-shadow: 0 2px 9px #000c;
}

.flight-field {
  position: absolute;
  top: 147px;
  left: 65px;
  width: 350px;
  height: 155px;
  pointer-events: none;
}
.flight-grid {
  position: absolute;
  inset: 5px 6px 4px;
  background-image:
    linear-gradient(to right, #8fcce91c 1px, transparent 1px),
    linear-gradient(to bottom, #8fcce91c 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: center;
  mask-image: radial-gradient(ellipse at center, #000 16%, #000a 43%, transparent 93%);
}
.flight-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: var(--signal-faint);
  stroke-width: 1;
  fill: none;
}
.flight-frame-axis { opacity: .6; }

.watch[data-view=watching]:not([data-flight-display=true]) .flight-profile { display: none; }
.watch[data-view=watching] .watching-main {
  top: 151px;
  left: 78px;
  width: 324px;
  min-height: 141px;
  text-align: center;
}
.watch[data-view=watching] .watching-state {
  font-size: 23px;
  line-height: 30px;
  color: var(--flight-foreground);
  text-shadow: 0 2px 9px #000c;
}
.watch[data-view=watching] .watching-timer {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: baseline;
  column-gap: 4px;
  width: 100%;
  white-space: nowrap;
  line-height: 1;
  text-shadow: 0 3px 24px #020508;
}
.watch[data-view=watching] #watching-prefix {
  justify-self: end;
  color: var(--signal);
  font: 500 24px/1 var(--clock-face);
}
.watch[data-view=watching] #watching-unit { justify-self: start; }
.watch[data-view=watching] #watching-number {
  font-family: var(--display);
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 90px;
  line-height: 96px;
  letter-spacing: 0;
}
.watch[data-view=watching][data-phase=final] .watching-main { top: 151px; }
.watch[data-view=watching][data-phase=final] #watching-number { font-size: 102px; line-height: 96px; }
.watching-note {
  color: #d6e6ef;
  font-size: 17px;
  line-height: 22px;
  text-shadow: 0 1px 6px #000;
}
.window-progress {
  appearance: none;
  position: absolute;
  top: 301px;
  left: 102px;
  width: 276px;
  height: 2px;
  border: 0;
  border-radius: 2px;
  background: #92c4d134;
  overflow: hidden;
}
.window-progress::-webkit-progress-bar { background: transparent; }
.window-progress::-webkit-progress-value { background: var(--signal); transition: width .3s ease; }
.window-progress::-moz-progress-bar { background: var(--signal); }
@media (prefers-reduced-motion: reduce) {
  .window-progress::-webkit-progress-value { transition: none; }
}

.watch[data-view=watching][data-flight-display=true] .flight-field { height: 125px; }
.watch[data-view=watching][data-flight-display=true] .flight-profile {
  top: 143px;
  left: 66px;
  width: 348px;
  height: 132px;
  color: var(--flight-foreground);
}
.profile-reticle,
.profile-ignition {
  fill: none;
  stroke: currentColor;
  stroke-width: .85;
}
.profile-reticle { opacity: .28; color: var(--signal); }
.profile-ignition { opacity: 0; color: var(--signal); }
.flight-profile[data-stage=liftoff] .profile-ignition { animation: launch-flare 1.15s ease-out both; }
.profile-plan { opacity: .45; color: #a3cbdc; }
.profile-trace {
  color: var(--signal);
  stroke-width: 1.55;
  filter: drop-shadow(0 0 3px #65d8f697);
}
.profile-flame { fill: #a5ecff; filter: drop-shadow(0 0 4px #63c9fa); opacity: .92; }
.flight-profile[data-stage=liftoff] .profile-moving-stack,
.flight-profile[data-stage=landing] .profile-returning-booster {
  filter: drop-shadow(0 0 4px #8fe2ffac);
}
@keyframes launch-flare {
  from { opacity: .92; r: 4px; }
  to { opacity: 0; r: 20px; }
}
.watch[data-view=watching][data-flight-display=true] .watching-main {
  top: 278px;
  left: 70px;
  width: 340px;
  min-height: 29px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.watch[data-view=watching][data-flight-display=true] .watching-state { font-size: 25px; line-height: 29px; }
.watch[data-view=watching][data-flight-display=true] .watching-timer {
  position: static;
  margin-top: 0;
}
.watch[data-view=watching][data-flight-display=true] #watching-number {
  font-size: 20px;
  line-height: 24px;
}

.flight-milestones {
  position: absolute;
  top: 307px;
  left: 94px;
  width: 292px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.flight-milestones li {
  flex: 1 1 0;
  color: #93a7b1;
  font-size: 14px;
  line-height: 17px;
  white-space: nowrap;
  text-align: center;
  border-top: 1px solid #84a7b24a;
}
.flight-milestones li[data-reached=true] { border-top-color: #8fd9ef95; color: #d0eaf4; }
.flight-milestones li[aria-current=step] { border-top: 2px solid var(--signal); color: var(--signal); }
html[lang=en] .flight-milestones li { font-family: var(--display); font-size: 15px; letter-spacing: .3px; }

.watching-actions {
  position: absolute;
  z-index: 6;
  top: 327px;
  left: 68px;
  width: 344px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.watching-actions .webcast-action,
.watch[data-view=watching] .watching-actions button {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-height: 40px;
  padding: 0 13px;
  font-size: 17px;
  line-height: 1.15;
  white-space: nowrap;
  text-decoration: none;
  color: #e4edf1;
  background: #09131eea;
  border: 1px solid #93b5c47c;
  border-radius: 5px;
}
.watch[data-view=watching] .watching-actions .webcast-action { color: #e9fbff; border-color: #90d1e3ab; background: #15313ef5; }
.webcast-action svg { width: 14px; height: 14px; fill: var(--signal); }
.watching-actions :is(a,button):focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
#webcast-unavailable { font-size: 16px; color: #adbdc7; }
/* The feed occupies the center. The mission above and the status below stay readable during playback. */
#watching-page:has(.webcast-player:not([hidden])) > :is(.flight-field, .flight-profile, .window-progress, .flight-milestones, .watching-actions),
#watching-page:has(.webcast-player:not([hidden])) .screen-label { display: none; }
#watching-page:has(.webcast-player:not([hidden])) .watching-heading { top: 85px; left: 111px; width: 258px; }
#watching-page:has(.webcast-player:not([hidden])) .watching-mission { font-size: 28px; line-height: 31px; }
#watching-page:has(.webcast-player:not([hidden])) .watching-main {
  top: 326px;
  left: 82px;
  width: 181px;
  height: 42px;
  min-height: 0;
  gap: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#watching-page:has(.webcast-player:not([hidden])) .watching-state { font-size: 19px; line-height: 21px; }
#watching-page:has(.webcast-player:not([hidden])) .watching-timer {
  position: static;
  margin: 0;
  font-size: 18px;
  line-height: 20px;
}
#watching-page:has(.webcast-player:not([hidden])) #watching-number { font-size: 20px; line-height: 20px; }
.watch[data-view=watching][data-flight-display=true] #watching-number,
#watching-page:has(.webcast-player:not([hidden])) #watching-number {
  font-family: var(--clock-face);
  letter-spacing: var(--readout-tracking);
}
#watching-page:has(.webcast-player:not([hidden])) #watching-unit { font-size: 15px; }
/* Leave room for elapsed minutes to pass 99 while the stream stays open. */
.watch[data-view=watching][data-flight-display=true] .watching-timer,
#watching-page:has(.webcast-player:not([hidden])) .watching-timer {
  grid-template-columns: 22px 88px;
  column-gap: 4px;
  width: auto;
  flex: none;
}
.watch[data-flight-display=true] #watching-prefix,
#watching-page:has(.webcast-player:not([hidden])) #watching-prefix { font-size: 16px; }
#watching-page:has(.webcast-player:not([hidden])) .watching-timer:has(#watching-unit:not(:empty)) {
  grid-template-columns: 22px 2ch 18px;
  font-family: var(--clock-face);
  font-size: 20px;
}
#watching-unit:empty { display: none; }
.watch[data-phase=flight] #watching-number { text-align: right; }
#watching-page:has(.webcast-player:not([hidden])) .watching-note {
  margin: 0;
  font-size: 16px;
  line-height: 19px;
  white-space: nowrap;
}
.watch:not([data-phase=idle]) #watching-page:has(.webcast-player:not([hidden])) .watching-note { display: none; }
.webcast-player { position: absolute; inset: 0; pointer-events: none; }
.webcast-aperture {
  position: absolute;
  top: 121px;
  left: 60px;
  width: 360px;
  height: 203px;
  background: #000;
  box-shadow: 0 0 0 1px var(--signal-faint);
  pointer-events: auto;
}
#webcast-screen, .webcast-feedback { position: absolute; inset: 0; }
#webcast-screen { overflow: auto; }
#webcast-screen iframe, #webcast-screen video { display: block; width: 100%; height: 100%; border: 0; }
#webcast-screen video { object-fit: contain; }
.webcast-feedback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 23px;
  text-align: center;
  pointer-events: none;
}
#webcast-message { max-width: 100%; margin: 0; font-size: 18px; line-height: 1.35; text-wrap: balance; }
#webcast-retry {
  min-height: 40px;
  padding: 4px 18px;
  border: 1px solid var(--signal-faint);
  border-radius: 5px;
  color: var(--flight-foreground);
  background: #10232d;
  pointer-events: auto;
}
.webcast-player .watching-actions {
  top: 327px;
  left: 289px;
  width: 112px;
  pointer-events: auto;
}
.watch[data-view=watching] .view-switch button[data-view=watching][aria-pressed=true] {
  color: #e9faff;
  background: #132a39;
  border-color: #89cbe3b8;
}
