:root {
  --rad: 14px 9px 16px 10px / 10px 15px 9px 14px;
  --rad-sm: 9px 6px 11px 7px / 7px 10px 6px 9px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #FDF8C4;
  font-family: "Comic Neue", "Comic Sans MS", cursive;
  font-weight: 700;
  color: #111;
}

img { user-select: none; -webkit-user-drag: none; }

#stage {
  position: fixed;
  left: 0;
  top: 0;
  width: 2832px;
  height: 1344px;
  transform-origin: 0 0;
  opacity: 0;
  transition: opacity 250ms ease;
}
html.karpet-ready #stage { opacity: 1; }

#plate-wrap {
  position: absolute;
  left: 0;
  top: 0;
  width: 2832px;
  height: 1344px;
  z-index: 0;
  pointer-events: none;
}
#plate {
  display: block;
  width: 2832px;
  height: 1344px;
  transform-origin: 1416px 672px;
}

#safe {
  position: absolute;
  left: 392px;
  top: 96px;
  width: 2048px;
  height: 1152px;
  z-index: 1;
}

#artwork {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#shadow {
  position: absolute;
  left: 1045px;
  top: 750px;
  width: 570px;
  height: 100px;
  border-radius: 50%;
  background: rgba(120, 110, 70, .25);
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  opacity: 0;
  z-index: 10;
}

#splash {
  position: absolute;
  left: 1030px;
  top: 860px;
  width: 1320px;
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  opacity: 0;
  z-index: 15;
}
#splash img { display: block; width: 100%; height: auto; }

#carpet {
  position: absolute;
  inset: 0;
  transform-origin: 1024px 820px;
  z-index: 20;
}
.frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  visibility: hidden;
  opacity: 0;
}
.frame.on { visibility: visible; opacity: 1; }

#impact {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 25;
  opacity: 0;
}
#impact line {
  stroke: #111;
  stroke-width: 7;
  stroke-linecap: round;
  fill: none;
}

/* ---------- header ---------- */
#header { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
#logo-wrap { position: absolute; left: 48px; top: 26px; margin: 0; }
#logo { display: block; width: 470px; height: auto; }

#ticker {
  position: absolute;
  left: 548px;
  top: 64px;
  height: 58px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: #F66508;
  color: #fff;
  font-size: 34px;
  letter-spacing: .5px;
  border: 6px solid #111;
  border-radius: var(--rad-sm);
  box-shadow: 9px 9px 0 #111;
}

/* ---------- status box ---------- */
#status {
  position: absolute;
  left: 1590px;
  top: 40px;
  width: 400px;
  height: 174px;
  background: #FFFFFA;
  border: 7px solid #111;
  border-radius: var(--rad);
  box-shadow: 10px 10px 0 #111;
  z-index: 40;
}
#status-row1 {
  position: absolute;
  left: 16px;
  top: 6px;
  font-size: 38px;
  line-height: 46px;
  white-space: nowrap;
}
#mon-lv { font-size: 30px; margin-left: 10px; }

#mute {
  position: absolute;
  right: 12px;
  top: 6px;
  width: 44px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #111;
}
#mute svg {
  display: block;
  width: 44px;
  height: 36px;
  fill: none;
  stroke: #111;
  stroke-width: 3.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
#mute .spk-body { fill: #111; }
#mute.muted .spk-wave1, #mute.muted .spk-wave2 { display: none; }

#alt-label { position: absolute; left: 16px; top: 66px; font-size: 30px; }
#alt-bar {
  position: absolute;
  left: 90px;
  top: 68px;
  width: 208px;
  height: 26px;
  background: #EBE8D7;
  border: 5px solid #111;
  border-radius: 4px;
  overflow: hidden;
}
#alt-fill { height: 100%; width: 0%; background: #50C878; }
#alt-value { position: absolute; right: 16px; top: 66px; font-size: 30px; text-align: right; }
#flights-row { position: absolute; left: 16px; top: 120px; font-size: 28px; white-space: nowrap; }
#flights { display: inline-block; }

/* ---------- dialog ---------- */
#dialog {
  position: absolute;
  left: 376px;
  top: 872px;
  width: 820px;
  height: 220px;
  background: #FFFFFA;
  border: 8px solid #111;
  border-radius: var(--rad);
  box-shadow: 12px 12px 0 #111;
  z-index: 40;
}
#dialog::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 3px solid #111;
  border-radius: 8px;
  pointer-events: none;
}
#msg {
  position: absolute;
  left: 54px;
  top: 30px;
  width: 690px;
  height: 160px;
  font-size: 64px;
  line-height: 80px;
  white-space: pre-line;
  color: #111;
}
#arrow {
  position: absolute;
  left: 742px;
  top: 131px;
  font-size: 40px;
  color: #111;
  animation: blink 1s steps(1) infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ---------- command box ---------- */
#command {
  position: absolute;
  left: 1212px;
  top: 872px;
  width: 460px;
  height: 220px;
  background: #FFFFFA;
  border: 8px solid #111;
  border-radius: var(--rad);
  box-shadow: 12px 12px 0 #111;
  z-index: 40;
}
#fly {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 404px;
  height: 164px;
  font-family: inherit;
  font-weight: 700;
  font-size: 96px;
  letter-spacing: 2px;
  color: #fff;
  background: #F66508;
  border: 8px solid #111;
  border-radius: var(--rad);
  box-shadow: 8px 8px 0 #111;
  cursor: pointer;
  translate: 0 0;
  scale: 1;
  transition: translate .12s, box-shadow .12s;
}
#command.small #fly { left: 20px; top: 18px; width: 404px; height: 104px; font-size: 58px; }
#fly:not(:disabled):hover { translate: 0 -3px; box-shadow: 11px 11px 0 #111; }
#fly:not(:disabled):active { translate: 6px 6px; box-shadow: 3px 3px 0 #111; }
#fly:disabled { background: #BEBEBA; cursor: default; }
#fly.pulse:not(:disabled) { animation: fly-pulse 2.4s steps(2) infinite; }
@keyframes fly-pulse { 0% { scale: 1; } 50% { scale: 1.03; } 100% { scale: 1; } }

#launch-row {
  position: absolute;
  left: 20px;
  top: 136px;
  width: 404px;
  height: 50px;
  display: grid;
  grid-template-columns: 72px 1fr 1.25fr;
  gap: 12px;
}
#launch-row[hidden] { display: none; }
.launch-btn {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 700;
  font-size: 28px;
  color: #111;
  text-decoration: none;
  background: #FFEC96;
  border: 5px solid #111;
  border-radius: var(--rad-sm);
  box-shadow: 5px 5px 0 #111;
  cursor: pointer;
  translate: 0 0;
  transition: translate .12s, box-shadow .12s;
}
a.launch-btn, a.launch-btn:link, a.launch-btn:visited, a.launch-btn:hover, a.launch-btn:active, a.launch-btn:focus {
  text-decoration: none;
}
#btn-copy { background: #AADCFF; }
.launch-btn:not(.is-disabled):hover { translate: 0 -3px; box-shadow: 7px 7px 0 #111; }
.launch-btn:not(.is-disabled):active { translate: 4px 4px; box-shadow: 2px 2px 0 #111; }
.launch-btn.is-disabled,
#btn-copy.is-disabled {
  background: #D8D5C4;
  color: #777;
  box-shadow: none;
  cursor: default;
}

#copy-feedback {
  position: absolute;
  left: 1440px;
  top: 820px;
  width: 220px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #FFEC96;
  font-size: 28px;
  border-radius: 25px;
  z-index: 50;
}
#copy-feedback[hidden] { display: none; }

button:focus, a:focus { outline: none; }
body.kbd button:focus, body.kbd a:focus { outline: 5px solid #111; outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  #stage { transition: none; }
  #arrow { animation: none; opacity: 1; }
  #fly.pulse { animation: none; }
}
