/* ==========================================================================
   Hidden layer — reachable only through the three window controls.
   Nothing in the visible UI refers to any of this.
   ========================================================================== */

.egg {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  font-family: var(--font-mono);
}
.egg.is-open { display: block; }

.egg__close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: #f8f8f2;
  cursor: pointer;
}
.egg__close:hover { background: rgba(255, 255, 255, 0.12); }
.egg__close svg { width: 1.1rem; height: 1.1rem; }

.egg__hint {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: rgba(248, 248, 242, 0.35);
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   GREEN — the shell
   -------------------------------------------------------------------------- */

.egg--shell {
  background: #1a1b23;
  color: #f8f8f2;
  padding: clamp(1rem, 3vw, 2.5rem);
  overflow: hidden;
}
.egg--shell.is-open { display: flex; flex-direction: column; }

.shell__out {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: clamp(0.75rem, 0.68rem + 0.3vw, 0.88rem);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.shell__out::-webkit-scrollbar { width: 8px; }
.shell__out::-webkit-scrollbar-thumb { background: #44475a; border-radius: 4px; }

.shell__line { margin: 0; }
.shell__prompt-line { display: flex; gap: 0.5rem; align-items: baseline; flex: none; padding-top: 0.4rem; }

.shell__ps1 { color: #50fa7b; font-weight: 600; flex: none; }
.shell__ps1 b { color: #bd93f9; font-weight: 600; }

.shell__in {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: #f8f8f2;
  font: inherit;
  font-size: clamp(0.75rem, 0.68rem + 0.3vw, 0.88rem);
  outline: none;
  caret-color: #50fa7b;
}

.c-purple { color: #bd93f9; }
.c-cyan   { color: #8be9fd; }
.c-green  { color: #50fa7b; }
.c-pink   { color: #ff79c6; }
.c-yellow { color: #f1fa8c; }
.c-orange { color: #ffb86c; }
.c-red    { color: #ff5555; }
.c-dim    { color: #6272a4; }
.egg a { color: #8be9fd; text-decoration: underline; }
.egg a:hover { color: #50fa7b; }

.shell__banner { color: #bd93f9; line-height: 1.25; font-size: clamp(0.5rem, 1.5vw, 0.8rem); }

/* --------------------------------------------------------------------------
   YELLOW — the arcade
   -------------------------------------------------------------------------- */

.egg--arcade {
  background:
    radial-gradient(80% 60% at 50% 0%, #2b2340 0%, transparent 70%),
    linear-gradient(180deg, #191a21 0%, #10111a 100%);
  color: #f8f8f2;
}
.egg--arcade.is-open { display: grid; place-items: center; padding: 1rem; }

.arcade {
  width: min(30rem, 100%);
  text-align: center;
}
.arcade__title {
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f1fa8c;
}
.arcade__sub { margin: 0.35rem 0 1.1rem; font-size: 0.76rem; color: #6272a4; }

.arcade__screen {
  position: relative;
  border: 1px solid #44475a;
  border-radius: 10px;
  background: #12131a;
  box-shadow: 0 0 0 6px rgba(189, 147, 249, 0.06), 0 24px 60px -20px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.arcade__screen canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }

.arcade__hud {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #44475a;
  font-size: 0.74rem;
  color: #6272a4;
}
.arcade__hud b { color: #50fa7b; font-weight: 600; }

.arcade__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(18, 19, 26, 0.92);
  text-align: center;
}
.arcade__overlay[hidden] { display: none; }
.arcade__overlay h3 { font-size: 1rem; color: #ff79c6; }
.arcade__overlay p { margin: 0; font-size: 0.76rem; color: #6272a4; }

.arcade__btn {
  margin-top: 0.35rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid #bd93f9;
  border-radius: 6px;
  background: transparent;
  color: #bd93f9;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.arcade__btn:hover { background: #bd93f9; color: #21222c; }

.arcade__keys { margin-top: 0.9rem; font-size: 0.7rem; color: #6272a4; }
.arcade__keys kbd {
  padding: 0.1rem 0.35rem;
  border: 1px solid #44475a;
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #a5aacb;
}

/* --------------------------------------------------------------------------
   RED — the shutdown
   -------------------------------------------------------------------------- */

.egg--halt { background: #000; color: #d7dae3; }
.egg--halt.is-open { display: grid; place-items: center; padding: 1.5rem; }

.halt {
  width: min(34rem, 100%);
  font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.85rem);
  line-height: 1.9;
}
.halt__log { margin: 0 0 1.25rem; white-space: pre-wrap; }
.halt__ok { color: #50fa7b; }
.halt__warn { color: #f1fa8c; }

.halt__card {
  border-left: 2px solid #bd93f9;
  padding: 0.25rem 0 0.25rem 1rem;
  color: #a5aacb;
}
.halt__card strong { color: #f8f8f2; }

.halt__cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  translate: 0 0.15em;
  background: #50fa7b;
  animation: egg-blink 1.05s steps(2, start) infinite;
}
@keyframes egg-blink { 50% { opacity: 0; } }

/* the whole shell folds away when the machine "halts" or minimises */
.workbench, .titlebar, .statusbar { transition: transform 0.45s var(--ease), opacity 0.45s var(--ease); }
body.is-eggd .titlebar,
body.is-eggd .workbench,
body.is-eggd .statusbar {
  transform: scale(0.965);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .halt__cursor { animation: none; }
  .workbench, .titlebar, .statusbar { transition: none; }
}
