.operations {
  display: contents;
}

body {
  position: relative;
  isolation: isolate;
  background: #000;
}

body::before {
  z-index: 1;
}

main {
  z-index: 2;
}

.news-stack {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

#news-takeover {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .42;
  animation: news-feed-takeover 2.6s steps(1, end) infinite;
}

@keyframes news-feed-takeover {
  0%, 21%, 25%, 63%, 67%, 100% {
    opacity: .4;
    filter: none;
    transform: translateX(0);
  }
  22% {
    opacity: .18;
    filter: contrast(1.2) brightness(1.08);
    transform: translateX(-2px);
  }
  23% {
    opacity: .64;
    filter: contrast(1.16) brightness(1.08);
    transform: translateX(3px);
  }
  24% {
    opacity: .32;
    transform: translateX(-1px);
  }
  64% {
    opacity: .58;
    filter: contrast(1.18);
    transform: translateX(-3px);
  }
  65% {
    opacity: .2;
    transform: translateX(2px);
  }
  66% {
    opacity: .44;
    transform: translateX(0);
  }
}

.mascot-status {
  position: absolute;
  top: clamp(72px, 7vw, 90px);
  right: clamp(30px, 5vw, 58px);
  z-index: 3;
  width: 220px;
  padding: 0 12px 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 117, 187, .36);
  background:
    linear-gradient(120deg, rgba(0, 28, 63, .24), transparent 48%),
    rgba(1, 4, 8, .82);
  box-shadow:
    inset 0 0 20px rgba(0, 28, 63, .16),
    3px 3px 0 rgba(0, 28, 63, .18),
    0 0 18px rgba(0, 117, 187, .05);
}

.operations-title {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 30px;
  margin: 0 -12px 8px;
  padding: 0 10px 0 26px;
  border-bottom: 1px solid rgba(0, 117, 187, .26);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 117, 187, .05) 0 1px,
      transparent 1px 7px
    ),
    rgba(0, 28, 63, .24);
}

.operations-title::before {
  content: "";
  position: absolute;
  left: 11px;
  width: 6px;
  height: 6px;
  border: 1px solid #0075bb;
  background: rgba(0, 28, 63, .72);
  box-shadow: 0 0 7px rgba(0, 117, 187, .36);
}

.mascot-grid {
  grid-template-columns: 1fr;
  margin-top: 0;
  border-top: 0;
  border-bottom: 0;
}

.mascot-record {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 2px;
  border-right: 0;
  border-bottom: 1px solid rgba(0, 28, 63, .62);
}

.mascot-record:nth-child(2),
.mascot-record:nth-child(-n+2) {
  border-right: 0;
  border-bottom: 1px solid rgba(0, 28, 63, .62);
}

.mascot-record:last-child {
  border-bottom: 0;
}

.mascot-name {
  font-size: 13px;
}

.mascot-state {
  font-size: 10px;
  letter-spacing: .1em;
  text-align: right;
}

.mascot-state--returned {
  color: #d7efff;
  font-size: 9px;
  line-height: 1.15;
  text-align: right;
}

.mascot-state--returned::before {
  border-color: #79d8ff;
  background: #00a8ed;
  box-shadow:
    inset 0 0 2px rgba(255, 255, 255, .9),
    0 0 5px #00a8ed,
    0 0 12px rgba(0, 168, 237, .9);
}

.progress-block {
  position: relative;
  order: -1;
  justify-self: center;
  width: min(640px, 70vw);
  margin: 0 0 clamp(30px, 4vw, 54px);
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 10px;
  color: #7890a5;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .18em;
}

.progress-header span:first-child {
  display: none;
}

.progress-track {
  height: 9px;
  border-color: rgba(0, 117, 187, .5);
  box-shadow:
    0 0 14px rgba(0, 117, 187, .12),
    -8px 0 0 -7px rgba(0, 117, 187, .7),
    8px 0 0 -7px rgba(0, 117, 187, .7);
}

.progress-fill {
  width: 80%;
}

.signal-quote {
  justify-self: center;
  width: min(760px, 78vw);
  margin: 0 0 clamp(26px, 3.8vw, 48px);
  color: #a9bed0;
  font: 400 clamp(14px, 1.35vw, 19px)/1.65 Adventure, "Arial Narrow", sans-serif;
  letter-spacing: .09em;
  text-align: center;
  text-wrap: balance;
}

.command-console {
  position: relative;
  justify-self: center;
  width: min(620px, 80vw);
  margin: clamp(34px, 4.5vw, 58px) 0 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.command-label {
  display: block;
  min-height: 0;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.command-label::before {
  content: none;
}

.command-entry {
  margin-top: 0;
  border: 0;
  border-bottom: 1px solid rgba(0, 117, 187, .42);
  background: rgba(0, 3, 7, .42);
  box-shadow: inset 0 -8px 18px rgba(0, 28, 63, .08);
}

.command-entry button {
  background: transparent;
}

.command-output {
  min-height: 32px;
  margin-top: 6px;
  padding: 6px 0;
  border-left: 0;
  background: transparent;
}

.command-output.has-transmission {
  max-height: min(220px, 35svh);
}

.command-response--unity {
  display: grid;
  gap: 6px;
  color: #b6c6d5;
}

.command-response-line {
  display: block;
}

.command-response-line--condition {
  margin-top: 6px;
}

.command-keyword {
  display: inline-block;
  padding: 0 3px;
  border-bottom: 1px solid rgba(0, 168, 237, .72);
  background: rgba(0, 117, 187, .28);
  color: #eaf4ff;
  font-family: Adventure, "Arial Narrow", sans-serif;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(0, 117, 187, .58);
}

@media (max-width: 720px) {
  main {
    padding-top: calc(env(safe-area-inset-top, 0px) + 220px);
  }

  .mascot-status {
    top: calc(env(safe-area-inset-top, 0px) + 62px);
    right: clamp(15px, 5vw, 26px);
    width: min(166px, 46vw);
    padding: 0 9px 9px;
  }

  .operations-title {
    min-height: 27px;
    margin: 0 -9px 6px;
    padding-left: 23px;
    font-size: 10px;
  }

  .operations-title::before {
    left: 9px;
    width: 5px;
    height: 5px;
  }

  .mascot-record,
  .mascot-record:nth-child(2),
  .mascot-record:nth-child(-n+2) {
    grid-template-columns: minmax(0, 1fr) minmax(68px, auto);
    gap: 4px;
    padding: 6px 1px;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 28, 63, .62);
  }

  .mascot-record:last-child {
    border-bottom: 0;
  }

  .mascot-name {
    font-size: 11px;
  }

  .mascot-state {
    font-size: 9px;
    letter-spacing: .06em;
  }

  .mascot-state--returned {
    font-size: 8px;
    text-align: right;
  }

  .progress-block {
    width: min(430px, 76vw);
    margin-bottom: 30px;
  }

  .signal-quote {
    width: min(430px, 82vw);
    margin-bottom: 30px;
    font-size: 13px;
    line-height: 1.55;
    letter-spacing: .06em;
  }

  .command-console {
    width: min(430px, 84vw);
    margin-top: 32px;
  }

  .command-entry {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .command-entry button {
    grid-column: auto;
    width: auto;
    border-top: 0;
    border-left: 1px solid rgba(0, 117, 187, .36);
  }
}

@media (prefers-reduced-motion: reduce) {
  #news-takeover {
    animation: none;
    opacity: .24;
  }
}

@media (max-width: 360px) {
  main {
    padding-top: calc(env(safe-area-inset-top, 0px) + 208px);
  }

  .mascot-status {
    width: min(150px, 45vw);
  }

  .progress-block {
    width: min(296px, 78vw);
  }

  .command-console {
    width: min(296px, 88vw);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  main {
    padding-top: 58px;
    padding-bottom: 30px;
  }

  .mascot-status {
    top: 50px;
    right: 24px;
    width: 174px;
  }

  .mascot-record {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .progress-block {
    width: min(440px, 55vw);
    margin-bottom: 18px;
  }

  .command-console {
    width: min(480px, 62vw);
    margin-top: 22px;
  }
}
