@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Nunito:wght@700;800&display=swap");

:root {
  --bg: #1a1040;
  --win: #2a1860;
  --pink: #ff6bcb;
  --cyan: #5ef0e0;
  --cream: #fff4e0;
  --ink: #1a1030;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  font-family: Nunito, system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 20%, #3a2080 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, #6020a0 0%, transparent 45%),
    var(--bg);
  color: var(--cream);
  overflow: hidden;
  image-rendering: pixelated;
}

#landing {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
#landing.hidden { display: none; }

.window {
  width: min(420px, 94vw);
  background: var(--win);
  border: 4px solid #5a30a0;
  box-shadow: 8px 8px 0 #0a0820, 0 0 40px #ff6bcb44;
}
.titlebar {
  display: flex; align-items: center; gap: 10px;
  background: #1a0a40;
  padding: 8px 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #c8b0ff;
  border-bottom: 3px solid #5a30a0;
}
.dots { display: flex; gap: 4px; }
.dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff6bcb; display: block;
}
.dots i:nth-child(2) { background: #ffd86b; }
.dots i:nth-child(3) { background: #5ef0e0; }

.body { padding: 22px 20px 26px; text-align: center; }
.logo-egg {
  font-size: 52px;
  filter: drop-shadow(0 4px 0 #0008);
  animation: bob 1.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
h1 {
  font-family: "Press Start 2P", monospace;
  font-size: 22px;
  color: var(--pink);
  text-shadow: 3px 3px 0 #0008;
  margin: 10px 0 8px;
}
.tag { font-size: 14px; color: var(--cyan); margin-bottom: 6px; }
.fine { font-size: 11px; color: #a090c8; margin-bottom: 14px; }
.features {
  list-style: none; text-align: left;
  background: #1a0a38;
  border: 3px solid #4a2880;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.features li { margin: 6px 0; }

.dl {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  border: none;
  background: linear-gradient(180deg, #7ef, #2ab);
  color: #062018;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 #0a5060;
  width: 100%;
}
.dl:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a5060; }
.dl:disabled { opacity: 0.6; cursor: wait; }
.status {
  margin-top: 12px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #c8b0ff;
  min-height: 24px;
  line-height: 1.5;
}

/* Desktop layer */
#desk {
  position: fixed; inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 15px, #ffffff04 15px, #ffffff04 16px),
    repeating-linear-gradient(90deg, transparent, transparent 15px, #ffffff04 15px, #ffffff04 16px),
    linear-gradient(160deg, #1a2850 0%, #2a1860 50%, #401860 100%);
  z-index: 5;
}
#desk.hidden { display: none; }

#pet-root {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 148px;
  user-select: none;
  cursor: grab;
  z-index: 20;
}
#pet-root:active { cursor: grabbing; }
#pet {
  width: 128px; height: 128px;
  image-rendering: pixelated;
  background: transparent;
  filter: drop-shadow(0 6px 0 #0006);
}
#bubble {
  position: absolute;
  bottom: 140px;
  right: 0;
  max-width: 260px;
  background: #fff8f0;
  color: #1a1030;
  border: 3px solid #1a1030;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  line-height: 1.55;
  box-shadow: 4px 4px 0 #0005;
}
#bubble.hidden { display: none; }
#bubble::after {
  content: "";
  position: absolute;
  right: 28px; bottom: -10px;
  border: 8px solid transparent;
  border-top-color: #1a1030;
}
#pet-bar {
  display: flex; gap: 4px; justify-content: center; margin-top: 4px;
}
#pet-bar button {
  width: 28px; height: 24px;
  border: 2px solid #3a2080;
  background: #2a1860;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  pointer-events: auto;
}
#pet-bar button:hover { background: #4a30a0; }

#panel {
  position: absolute;
  left: 24px;
  bottom: 24px;
  width: min(340px, 90vw);
  background: #1a1040;
  border: 4px solid #5a30a0;
  box-shadow: 6px 6px 0 #0006;
  z-index: 15;
  pointer-events: auto;
}
#panel.hidden { display: none; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  background: #2a1860;
  padding: 8px 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  border-bottom: 3px solid #5a30a0;
}
#panel-x {
  border: none; background: #c04060; color: #fff;
  width: 22px; height: 22px; cursor: pointer; font-size: 12px;
}
#panel-anim {
  display: flex; gap: 12px; align-items: center;
  padding: 12px;
  border-bottom: 2px solid #3a2080;
}
#anim {
  width: 72px; height: 72px;
  image-rendering: pixelated;
  background: #120828;
  border: 2px solid #4a2880;
}
#panel-caption {
  font-size: 13px;
  color: #e0d0ff;
  line-height: 1.35;
}
#panel-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 10px 12px;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  line-height: 1.7;
  color: #c8b8f0;
}
#panel-list li {
  padding: 4px 6px;
  margin: 3px 0;
  background: #120828;
  border-left: 3px solid var(--pink);
}
#panel-list li.app { border-left-color: var(--cyan); }
#panel-list li.chonk {
  border-left-color: #ffb0d0;
  background: #2a1040;
  color: #ffd0e8;
}
#panel-list li.err { border-left-color: #fc6; color: #fc8; }
