.hatch-app {
  background: #1c1810;
}

.hatch-app .hatch-week {
  margin: 0 auto 0 12px;
}

.hatch-room {
  background: #2a2416;
  min-height: calc(100svh - 88px);
}

.hatch-app .hack-body {
  position: relative;
  display: block;
  margin-top: 2px;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.hatch-app .ledger {
  padding: 0;
}

.hatch-app .ledger-glass {
  --hatch-green: #7dff6a;
  color: var(--hatch-green);
  font-size: clamp(16px, 2.2vw, 28px);
  line-height: 1.18;
  padding: clamp(8px, 1.2vw, 14px) clamp(10px, 1.5vw, 18px) clamp(6px, 1vw, 12px);
}

.hatch-app .ledger-glass.is-off .hatch-screen,
.hatch-app .ledger-glass.is-off .hatch-glow {
  opacity: 0;
}

.hatch-app .ledger-glass.is-booting {
  animation: hatch-power 0.55s ease-out forwards;
}

.hatch-glow {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow:
    inset 0 0 28px rgba(125, 255, 106, 0.16),
    inset 0 0 80px rgba(0, 0, 0, 0.28);
  mix-blend-mode: screen;
  animation: hatch-flicker 3.2s steps(2, end) infinite;
}

.hatch-screen {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  container-type: size;
}

.hatch-screen .ledger-head {
  font-size: 0.58em;
  letter-spacing: 0.035em;
  flex: 0 0 auto;
}

.hatch-screen .ledger-head p {
  margin: 0;
  text-shadow: 0 0 8px rgba(125, 255, 106, 0.55);
}

.hatch-warn {
  color: #d8ffcc;
}

#hack-pips {
  letter-spacing: 0.18em;
}

.hatch-menu {
  margin-top: 10px;
  flex: 1;
}

.hatch-app .hack-dump {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.hatch-app .hack-line { white-space: pre; }
.hatch-app .hack-addr { opacity: 0.5; }

.hatch-app .hack-word {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  text-shadow: inherit;
  cursor: pointer;
}

.hatch-app .hack-word.is-on,
.hatch-app .hack-word:hover {
  background: #7dff6a;
  color: #031406;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(125, 255, 106, 0.45);
  outline: none;
}

.hatch-app .hack-word.is-dead {
  pointer-events: none;
  color: #1b4a18;
  text-shadow: none;
}

.hatch-app .hack-side {
  position: absolute;
  right: 0;
  bottom: 0;
  width: max-content;
  max-width: 42%;
  max-height: 42%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-size: 0.82em;
  line-height: 1.12;
  overflow: hidden;
  pointer-events: none;
  background: none;
  padding: 0;
}

#hack-log {
  overflow: auto;
  min-height: 0;
  scrollbar-width: none;
}

#hack-log p {
  margin: 0 0 2px;
  color: inherit;
}

.hatch-cursor {
  margin: 8px 0 0;
  min-height: 1.2em;
}

.hatch-caret {
  display: inline-block;
  margin-left: 1px;
  animation: ledger-blink 1.05s steps(1) infinite;
}

.hatch-out {
  margin: 10px 0 0;
  flex: 1;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #7dff6a transparent;
}

.hatch-ticket {
  margin: 8px 0 0;
  max-height: 28%;
  overflow: auto;
  font: inherit;
  font-size: 0.72em;
  color: inherit;
  letter-spacing: 0.03em;
  text-transform: none;
  white-space: pre-wrap;
  word-break: break-all;
  scrollbar-width: thin;
  scrollbar-color: #7dff6a transparent;
}

.hatch-amount {
  appearance: none;
  width: 8ch;
  margin: 0 0 0 6px;
  padding: 0 4px;
  border: 0;
  background: #7dff6a;
  color: #031406;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
}

.hatch-amount:focus {
  outline: none;
}

.hatch-app .ledger-foot {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  padding-top: 0;
  font-size: 0.7em;
}

@media (prefers-reduced-motion: reduce) {
  .hatch-glow,
  .hatch-caret,
  .hatch-app .ledger-glass.is-booting { animation: none; }
}

@keyframes hatch-flicker {
  0%, 87%, 100% { opacity: 0.55; }
  90% { opacity: 0.28; }
  93% { opacity: 0.7; }
}

@keyframes hatch-power {
  0% { filter: brightness(0) contrast(1.4); }
  18% { filter: brightness(2.2) contrast(1.6); }
  32% { filter: brightness(0.2); }
  100% { filter: brightness(1) contrast(1); }
}
