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

p {
  margin: 0;
}

h3 {
  margin: 0;
}

/* GRID: center column expands to image width */
.dashboard {
  display: grid;
  height: 100vh;
  width: 100vw;

  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr 1fr;

  grid-template-areas:
    "recent counter next"
    "weather counter records";

  gap: 16px;
  padding: 8px;
  background-color: #131313;
  box-sizing: border-box;
  color: #2b2929;
}

#overlay-text {
  position: absolute;
  top: 56.6%;
  left: 50%;
  width: 54.8%;
  height: 28.5%;
  transform: translateX(-50%);
  color: #e6bf14;
  font-family: 'Bahnschrift', sans-serif;
  text-align: center;
  text-shadow: 0 0 5px black;
  z-index: 2;
}

#overlay-text h3 {
  position: absolute;
  top: 8%;
  left: 0;
  width: 100%;
  font-size: clamp(20px, 1.6vw, 32px);
}

#overlay-text p {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: clamp(160px, 10vw, 200px);
  font-weight: 700;
  line-height: 1;
  width: 100%;
}

#footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;              
  display: flex;
  justify-content: center;  
  gap: 1vh;
  z-index: 5;
  transform: translateX(5px);
}

#footer img {
  height: 10vh;
  margin: 0 15px;             
}

/* PANE */
.pane {
  background: #202020;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  font-size: 32px;
  border-radius: 8px;
  border: 1px solid rgba(100, 100, 100, 0.04);
  position: relative;
}

.pane h3 {
  font-size: 3vh;
  color: #e6bf14;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.726);
  text-align: center;
}

.pane p {
  color: #e6bf14;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.726);
}

/* GRID AREAS */
#recent-column { grid-area: recent; }
#weather { grid-area: weather; }
#next-column { grid-area: next; }
#records-column { grid-area: records; }
#center-column { grid-area: counter; }

#next-column,
#recent-column,
#records-column,
#center-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  gap: 16px;
}

#center-column {
  position: relative;
}

.next-status-row {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, 270px), 1fr)
  );
  gap: 16px;
  min-width: 0;
}

.next-status-row > * {
  min-width: 0;
}

#records {
  flex: 1 1 auto;
  min-height: 0;
}

#last-updated {
  flex: 0 0 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #e6bf14;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  padding: 4px 10px;
  box-sizing: border-box;
}

.last-updated-label {
  color: #bfc7d1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#last-updated-time {
  color: #e6bf14;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

#last-updated-time.is-fresh {
  color: #45d483;
}

#last-updated-time.is-aging {
  color: #e6bf14;
}

#last-updated-time.is-stale {
  color: #ef5b5b;
}

#last-updated-time.is-aging,
#last-updated-time.is-stale,
#last-updated-time.is-unknown,
.feed-unavailable {
  animation: timestamp-pulse 2.4s ease-in-out infinite;
}

.feed-unavailable {
  color: #ef4545 !important;
}

@keyframes timestamp-pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.32;
  }
}

@media (prefers-reduced-motion: reduce) {
  #last-updated-time,
  .launch-feed-unavailable {
    animation: none;
  }
}

.disclaimer-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.disclaimer-detail {
  color: #bfc7d1;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

#countdown,
#elapsed {
  flex: 0 0 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#disclaimer {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: calc(100% - 24px);
  padding: 8px 14px;
  border: 1px solid rgba(230, 191, 20, 0.45);
  border-radius: 5px;
  background: rgba(19, 19, 19, 0.82);
  color: #e6bf14;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  pointer-events: none;
}

.countdown-label {
  color: #bfc7d1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.countdown-clock {
  color: #e6bf14;
  font-family: 'Bahnschrift', 'Segoe UI', sans-serif;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 0 8px rgba(230, 191, 20, 0.35);
  transition: opacity 120ms ease, transform 120ms ease;
}

.clock-units {
  width: 218px;
  margin-left: 38px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  color: #9aa4ae;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
}

.clock-note {
  color: #9aa4ae;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.clock-units.is-hidden,
.clock-note.is-hidden {
  display: none;
}

.countdown-clock.tick {
  opacity: 0.72;
  transform: scale(0.98);
}

/* CENTER PANE */
#counter {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

#counter-img {
  height: 100vh;
  width: auto;
  display: block;
}


#weather iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

.weather-overlays {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.nws-overlays {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.nws-weather {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr)) minmax(120px, 1.7fr);
  align-items: stretch;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(230, 191, 20, 0.48);
  border-radius: 6px;
  background: rgba(19, 19, 19, 0.9);
  color: #fff;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.space-weather {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(81, 155, 216, 0.58);
  border-radius: 6px;
  background: rgba(19, 19, 19, 0.9);
  color: #fff;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.nws-alert-list {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(239, 69, 69, 0.78);
  border-radius: 6px;
  background: rgba(28, 15, 15, 0.94);
  color: #fff;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
  animation: alert-panel-enter 280ms ease-out;
}

.nws-alert-list.is-hidden {
  display: none;
}

.nws-alert-list-header,
.nws-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nws-alert-list-header {
  padding: 7px 12px;
  background: rgba(153, 31, 31, 0.82);
}

.nws-alert-list-title {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nws-alert-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff;
  color: #991f1f;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.nws-alert-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(239, 69, 69, 0.2);
}

.nws-alert-item {
  min-width: 0;
  padding: 8px 10px;
  background: rgba(32, 32, 32, 0.96);
  border-left: 3px solid #e6bf14;
}

.nws-alert-item.is-extreme,
.nws-alert-item.is-severe {
  border-left-color: #ef4545;
}

.nws-alert-event {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nws-alert-severity {
  flex: 0 0 auto;
  color: #e6bf14;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nws-alert-item.is-extreme .nws-alert-severity,
.nws-alert-item.is-severe .nws-alert-severity {
  color: #ff6b6b;
}

.nws-alert-overflow {
  grid-column: 1 / -1;
  padding: 5px 10px;
  background: rgba(32, 32, 32, 0.96);
  color: #f2b0b0;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

@keyframes alert-panel-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.weather-favorability {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: 12px 16px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  background: rgba(19, 19, 19, 0.91);
  color: #fff;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.58);
}

.favorability-header,
.favorability-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-transform: uppercase;
}

.favorability-header {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

#favorability-value {
  color: #e6bf14;
  font-size: 25px;
  line-height: 1;
}

.favorability-track {
  position: relative;
  height: 13px;
  margin: 9px 0 7px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #d93838 0%,
    #e98932 38%,
    #e6bf14 55%,
    #82bd42 73%,
    #2fc878 100%
  );
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.favorability-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 24px;
  border: 2px solid #171717;
  border-radius: 3px;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  transition: left 500ms ease;
}

.favorability-footer {
  color: #bfc7d1;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

#favorability-status {
  color: #e6bf14;
  font-size: 11px;
}

.weather-favorability.is-unavailable .favorability-track {
  filter: grayscale(1);
  opacity: 0.42;
}

.weather-favorability.is-unavailable .favorability-marker {
  display: none;
}

.weather-favorability.is-unavailable #favorability-value,
.weather-favorability.is-unavailable #favorability-status {
  color: #ef4545;
}

.weather-favorability.is-favorable #favorability-value,
.weather-favorability.is-favorable #favorability-status {
  color: #45d483;
}

.weather-favorability.is-marginal #favorability-value,
.weather-favorability.is-marginal #favorability-status {
  color: #e6bf14;
}

.weather-favorability.is-unfavorable #favorability-value,
.weather-favorability.is-unfavorable #favorability-status {
  color: #ef5b5b;
}

.nws-heading,
.nws-stat,
.nws-alert,
.environment-stat,
.nws-unavailable {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 12px 14px;
  background: rgba(32, 32, 32, 0.92);
}

.space-weather .nws-heading {
  color: #77b9ee;
}

.nws-heading {
  color: #e6bf14;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nws-key {
  color: #9aa4ae;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nws-value {
  overflow: hidden;
  color: #fff;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nws-alert.is-clear .nws-value {
  color: #45d483;
}

.nws-alert.is-active .nws-value {
  color: #ef5b5b;
}

.environment-stat.is-clear .nws-value {
  color: #45d483;
}

.environment-stat.is-elevated .nws-value {
  color: #e6bf14;
}

.environment-stat.is-severe .nws-value {
  color: #ef5b5b;
}

.nws-weather.is-unavailable,
.space-weather.is-unavailable {
  grid-template-columns: auto 1fr;
}

.nws-unavailable {
  color: #ef4545;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  animation: timestamp-pulse 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .nws-unavailable,
  .nws-alert-list {
    animation: none;
  }
}

/* LAUNCH PANES: header + scrollable card list */
#next, #recent {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  box-sizing: border-box;
}

#next,
#recent {
  flex: 1 1 auto;
  min-height: 0;
}

.pane-header {
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  flex: 0 0 auto;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: #f2f2f2;
  border-bottom: 2px solid #e6bf14;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.launch-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 8px;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.launch-list.is-awaiting-data .launch-card {
  display: none;
}

.launch-list.is-offline {
  align-items: center;
  justify-content: center !important;
}

.launch-feed-unavailable {
  color: #ef4545;
  font-size: clamp(18px, 1.45vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  animation: timestamp-pulse 2.4s ease-in-out infinite;
}

.launch-card {
  background: #2a2a2a;
  border-left: 3px solid #e6bf14;
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/*
 * Display as many full-size launch cards as each pane's height allows.
 * JavaScript hides any card that cannot fit completely on shorter screens.
 */
#recent .launch-list,
#next .launch-list {
  justify-content: flex-start;
  overflow: hidden;
}

#recent .launch-card,
#next .launch-card {
  flex: 0 0 auto;
}

.launch-card.is-hidden {
  display: none;
}

.launch-date {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e6bf14;
  margin-bottom: 2px;
}

.launch-title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.launch-meta {
  font-size: 22px;
  font-weight: 600;
  color: #bfc7d1;
  margin-top: 3px;
}

.launch-pad {
  font-size: 20px;
  color: #9aa4ae;
  margin-top: 1px;
}

.launch-payload {
  display: -webkit-box;
  overflow: hidden;
  font-size: 20px;
  color: #cfcfcf;
  margin-top: 4px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* METRICS PANE */
#records {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  box-sizing: border-box;
}

.metrics-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.metric-hero-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  background: #2a2a2a;
  border-top: 4px solid #e6bf14;
  border-radius: 6px;
  padding: 14px 8px;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.metric-hero-record {
  padding-top: 12px;
  padding-bottom: 10px;
}

.metric-record-period {
  min-height: 1.2em;
  margin-top: 7px;
  font-size: clamp(12px, 0.72vw, 15px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #aeb9c4;
}

.metric-value {
  font-size: clamp(34px, 2.15vw, 44px);
  font-weight: 800;
  color: #e6bf14;
  line-height: 1.1;
}

.metric-label {
  font-size: clamp(14px, 0.82vw, 17px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bfc7d1;
  margin-top: 6px;
}

.metric-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.metrics-body.is-expanded .metric-grid {
  flex: 1 1 auto;
  grid-auto-rows: minmax(0, 1fr);
}

.metric-cell.is-hidden {
  display: none;
}

.metric-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #262626;
  border-left: 3px solid #4a4a4a;
  border-radius: 4px;
  padding: 7px 10px;
}

.mc-key {
  font-size: clamp(16px, 0.9vw, 18px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9aa4ae;
}

.mc-val {
  font-size: clamp(24px, 1.3vw, 28px);
  font-weight: 700;
  color: #ffffff;
  margin-top: 1px;
}

.metric-payload-counts {
  grid-column: 1 / -1;
}

.payload-count-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.payload-count-list div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.payload-count-list span {
  overflow: hidden;
  color: #bfc7d1;
  font-size: clamp(14px, 0.78vw, 16px);
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.payload-count-list strong {
  color: #ffffff;
  font-size: clamp(25px, 1.4vw, 29px);
  line-height: 1.2;
}

/* Primary deployment target: a full-screen 1920x1080 television. */
@media (min-width: 1800px) and (min-height: 1000px) {
  .dashboard {
    gap: 12px;
  }

  #next-column,
  #recent-column,
  #records-column,
  #center-column,
  .next-status-row {
    gap: 12px;
  }

  #counter-img {
    height: calc(100vh - 16px);
  }

  #countdown,
  #elapsed {
    flex-basis: 98px;
  }

  .countdown-label {
    font-size: 14px;
  }

  .countdown-clock {
    font-size: 38px;
  }

  .clock-units,
  .clock-note {
    font-size: 11px;
  }

  .pane-header {
    font-size: 28px;
  }

  .launch-card {
    padding: 10px 14px;
  }

  .launch-date,
  .launch-title {
    font-size: 28px;
  }

  .launch-meta {
    font-size: 22px;
  }

  .launch-payload {
    font-size: 20px;
    line-height: 1.25;
  }

  .launch-pad {
    display: block;
    font-size: 20px;
  }

  #next,
  #recent {
    padding: 9px 11px;
  }

  .pane-header {
    margin-bottom: 7px;
    padding-bottom: 6px;
  }

  #records {
    padding: 10px 12px;
  }

  .metrics-body,
  .metric-hero-row {
    gap: 10px;
  }

  .metric-hero {
    min-height: 98px;
    padding: 11px 7px;
  }

  .metric-record-period {
    margin-top: 5px;
  }

  .metric-cell {
    padding: 8px 11px;
  }

  #last-updated {
    flex-basis: 76px;
  }

  .last-updated-label {
    font-size: 13px;
  }

  #last-updated-time {
    font-size: 20px;
  }

  .disclaimer-title {
    font-size: 18px;
  }

  .disclaimer-detail {
    font-size: 13px;
  }
}
