.egg-layer,
.egg-confetti,
.egg-bsod,
.egg-lore,
.egg-ritual,
.egg-sticker,
.egg-cursor-badge,
.egg-f-counter {
  box-sizing: border-box;
}

.egg-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 130;
  overflow: hidden;
}

.egg-pop {
  position: fixed;
  left: var(--egg-x, 50vw);
  top: var(--egg-y, 50vh);
  min-width: 30px;
  padding: 3px 7px;
  color: #050505;
  background: var(--egg-color, #fff200);
  border: 2px solid #050505;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%) rotate(var(--egg-tilt, -4deg));
  animation: egg-pop 760ms steps(7, end) forwards;
}

.egg-confetti {
  pointer-events: none;
  position: fixed;
  left: var(--egg-x, 50vw);
  top: var(--egg-y, 50vh);
  width: 8px;
  height: 12px;
  z-index: 132;
  background: var(--egg-color, #00e7ff);
  border: 1px solid rgba(0, 0, 0, 0.38);
  animation: egg-confetti 980ms ease-out forwards;
}

.egg-toast {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 138;
  width: min(360px, calc(100vw - 24px));
  min-height: 34px;
  padding: 6px 9px;
  color: #050505;
  background: #d7d7d7;
  border: 2px outset #fff;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.egg-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.egg-lore {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.34);
}

.egg-lore.is-open {
  display: grid;
}

.egg-ritual {
  position: fixed;
  inset: 0;
  z-index: 151;
  display: none;
  place-items: end start;
  padding: 18px;
  background: rgba(0, 0, 0, 0.14);
}

.egg-ritual.is-open {
  display: grid;
}

.egg-lore-window {
  width: min(520px, 100%);
  color: #050505;
  background: #c9c9c9;
  border: 2px outset #fff;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.48);
  font-family: Arial, Helvetica, sans-serif;
}

.egg-ritual-window {
  width: min(430px, calc(100vw - 36px));
  max-height: min(420px, calc(100vh - 36px));
  color: #101010;
  background: #d1d1d1;
  border: 2px outset #fff;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.36);
  font-family: "Courier New", Courier, monospace;
  overflow: hidden;
}

.egg-lore-window header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  padding: 3px 6px;
  color: #fff;
  background: linear-gradient(90deg, #00117a, #1745c7 58%, #071058);
  font-size: 0.88rem;
  font-weight: 900;
}

.egg-ritual-window header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 25px;
  padding: 3px 5px 3px 7px;
  color: #dfffee;
  background: #152018;
  border-bottom: 2px solid #a7a7a7;
  font-size: 0.78rem;
  font-weight: 900;
}

.egg-lore-window button {
  min-width: 24px;
  min-height: 22px;
  padding: 0 6px;
  border: 2px outset #fff;
  color: #050505;
  background: #d7d7d7;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
}

.egg-ritual-window button {
  min-width: 22px;
  min-height: 20px;
  padding: 0 6px;
  border: 2px outset #fff;
  color: #050505;
  background: #d7d7d7;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.egg-lore-body {
  padding: 14px;
  border: 2px inset #fff;
  background:
    linear-gradient(90deg, rgba(255, 242, 0, 0.3), transparent 45%),
    #f5f5f5;
}

.egg-ritual-body {
  padding: 10px;
  border: 2px inset #fff;
  background: #f0f0e8;
  font-size: 0.78rem;
  line-height: 1.4;
  overflow: auto;
}

.egg-boot-log {
  margin: 0;
  padding-left: 24px;
}

.egg-boot-log li {
  margin: 0 0 5px;
}

.egg-boot-log span {
  display: inline-block;
  min-width: 72px;
  color: #1b5a3a;
  font-weight: 900;
}

.egg-observatory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.egg-observatory-grid div {
  min-height: 48px;
  padding: 6px;
  background: #101810;
  border: 1px solid #537a5f;
  color: #dfffee;
}

.egg-observatory-grid b,
.egg-observatory-grid span {
  display: block;
}

.egg-observatory-grid b {
  margin-bottom: 2px;
  color: #9ff0b8;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.egg-ritual-note {
  margin: 0 0 8px;
}

.egg-ritual-note:last-child {
  margin-bottom: 0;
}

.egg-lore-body p {
  margin: 0 0 10px;
  line-height: 1.42;
}

.egg-lore-body p:last-child {
  margin-bottom: 0;
}

.egg-sticker {
  position: fixed;
  right: 18px;
  top: 112px;
  z-index: 142;
  display: none;
  width: min(188px, calc(100vw - 36px));
  padding: 9px;
  color: #050505;
  background: #fff200;
  border: 2px solid #050505;
  box-shadow: 6px 7px 0 rgba(0, 0, 0, 0.38);
  font-family: "Courier New", Courier, monospace;
  font-weight: 900;
  line-height: 1.12;
  touch-action: none;
  transform: rotate(-3deg);
  user-select: none;
}

.egg-sticker.is-visible {
  display: block;
}

.egg-sticker.is-dragging {
  cursor: grabbing;
  opacity: 0.95;
}

.egg-sticker button {
  float: right;
  margin: -5px -5px 4px 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px outset #fff;
  background: #d7d7d7;
  color: #050505;
  font: inherit;
  cursor: pointer;
}

.egg-sticker small {
  display: block;
  margin-top: 7px;
  font-size: 0.68rem;
  font-weight: 700;
}

.egg-f-counter {
  position: fixed;
  right: 12px;
  bottom: 52px;
  z-index: 139;
  display: none;
  min-width: 156px;
  padding: 6px 8px;
  color: #fff;
  background: #00117a;
  border: 2px outset #8fc5ff;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.44);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.78rem;
  font-weight: 900;
}

.egg-f-counter.is-visible {
  display: block;
}

.egg-cursor-badge {
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 139;
  display: none;
  padding: 4px 7px;
  color: #050505;
  background: #75ff00;
  border: 2px solid #050505;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.36);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72rem;
  font-weight: 900;
}

.egg-cursor-badge.is-visible {
  display: block;
}

.egg-bsod {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: none;
  padding: min(8vw, 64px);
  color: #fff;
  background: #001a9b;
  font-family: "Courier New", Courier, monospace;
  line-height: 1.48;
}

.egg-bsod.is-visible {
  display: block;
}

.egg-bsod h2 {
  display: inline-block;
  margin: 0 0 28px;
  padding: 2px 14px;
  color: #001a9b;
  background: #c9c9c9;
  font: inherit;
  font-weight: 900;
}

.egg-bsod p {
  max-width: 880px;
  margin: 0 0 18px;
}

.egg-bsod kbd {
  padding: 0 4px;
  color: #001a9b;
  background: #c9c9c9;
  font: inherit;
  font-weight: 900;
}

body.egg-konami {
  filter: saturate(1.28) contrast(1.08);
}

body.egg-konami .browser-window {
  animation: egg-takeover-pulse 1300ms steps(4, end) 3;
}

body.egg-security-7 {
  --egg-security-color: #75ff00;
}

body.egg-security-7 .security-indicator {
  color: #050505;
  background:
    repeating-linear-gradient(45deg, rgba(117, 255, 0, 0.34) 0 6px, transparent 6px 12px),
    #d7d7d7;
  box-shadow: 0 0 0 2px #75ff00 inset;
}

body.egg-security-7 .icon-security {
  filter: hue-rotate(82deg) saturate(1.8);
}

body.egg-cursor-crosshair,
body.egg-cursor-crosshair * {
  cursor: crosshair !important;
}

body.egg-cursor-help,
body.egg-cursor-help * {
  cursor: help !important;
}

body.egg-cursor-wait,
body.egg-cursor-wait * {
  cursor: wait !important;
}

body.egg-cursor-cell,
body.egg-cursor-cell * {
  cursor: cell !important;
}

body.motion-off .egg-pop,
body.motion-off .egg-confetti,
body.motion-off.egg-konami .browser-window,
body.egg-reduced .egg-pop,
body.egg-reduced .egg-confetti,
body.egg-reduced.egg-konami .browser-window {
  animation: none;
}

@keyframes egg-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--egg-tilt, -4deg)) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -64%) rotate(var(--egg-tilt, -4deg)) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -112%) rotate(var(--egg-tilt, -4deg)) scale(0.94);
  }
}

@keyframes egg-confetti {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--egg-dx, 0px)), calc(-50% + var(--egg-dy, 130px))) rotate(var(--egg-spin, 240deg));
  }
}

@keyframes egg-takeover-pulse {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(2px, -1px);
  }
  50% {
    transform: translate(-2px, 1px);
  }
  75% {
    transform: translate(1px, 2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .egg-pop,
  .egg-confetti,
  body.egg-konami .browser-window {
    animation: none;
  }

  .egg-toast,
  .egg-ready button,
  .egg-ready a {
    transition: none;
  }
}

@media (max-width: 760px) {
  .egg-ritual {
    place-items: end center;
    padding: 10px;
  }

  .egg-ritual-window {
    width: calc(100vw - 20px);
  }

  .egg-observatory-grid {
    grid-template-columns: 1fr;
  }

  .egg-toast {
    left: 8px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
  }

  .egg-f-counter {
    right: 8px;
    bottom: calc(130px + env(safe-area-inset-bottom));
  }

  .egg-cursor-badge {
    top: auto;
    right: 8px;
    bottom: calc(174px + env(safe-area-inset-bottom));
  }

  .egg-sticker {
    top: 84px;
    right: 10px;
  }
}
