html, body {
  margin: 0; padding: 0;
  background: #000;
  overflow: hidden;
  font-family: 'Menlo', 'Monaco', monospace;
  color: #888;
  height: 100%;
  cursor: none;
  user-select: none;
  --tint: rgba(160, 180, 210, 0.28);
}

canvas {
  display: block;
  opacity: 0;
  transition: opacity 3s ease-in;
  animation: bootsync 1.6s ease-out 1;
}
canvas.on { opacity: 1; }
@keyframes bootsync { 0%{transform:translateY(-2px) skewX(.6deg)} 6%{transform:translateY(3px) skewX(-.5deg)} 12%{transform:translateY(-1px) skewX(.2deg)} 22%,100%{transform:none} }

#hint {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 2.5s ease;
  font-size: 12px;
  letter-spacing: 4px;
  color: #555;
}
#hint.on { opacity: 1; }

#story {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 1.2s ease;
  font-size: 15px;
  color: #aaa;
  pointer-events: none;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: -1px 0 rgba(255,60,60,.16), 1px 0 rgba(60,120,255,.16), 0 0 14px var(--tint);
}
#story .w { opacity: 0; animation: wordin 0.5s ease forwards; }
@keyframes wordin { to { opacity: 1; } }

#escapee {
  position: fixed;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  left: 0; top: 0;
  display: none;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 0 12px #fff, 0 0 24px rgba(255, 255, 255, 0.4);
  transition: left 1.4s cubic-bezier(.4, 0, .2, 1),
              top  1.4s cubic-bezier(.4, 0, .2, 1);
}

#endBtn {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 28px;
  background: transparent;
  color: #666;
  border: 1px solid #222;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2px;
  display: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 1.5s ease, color 0.3s, border-color 0.3s;
}
#endBtn.on { opacity: 1; }
#endBtn:hover { color: #fff; border-color: #555; }

#name-prompt {
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  text-align: center;
}
#name-prompt.on { opacity: 1; pointer-events: auto; }
#name-input {
  width: 200px;
  padding: 8px 12px;
  background: transparent;
  color: #ddd;
  border: 1px solid #333;
  border-bottom: 1px solid #888;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 4px;
  text-align: center;
  outline: none;
  caret-color: #fff;
  cursor: text;
}
#name-input:focus { border-bottom-color: #fff; }
#name-input.shake { animation: shake 0.4s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
.np-hint {
  font-size: 10px;
  color: #444;
  letter-spacing: 3px;
  margin-top: 10px;
  text-transform: uppercase;
}

#fork-prompt {
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, 0);
  display: flex;
  gap: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#fork-prompt.on { opacity: 1; pointer-events: auto; }
#fork-prompt button {
  padding: 10px 28px;
  background: transparent;
  color: #888;
  border: 1px solid #333;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 4px;
  cursor: pointer;
  text-transform: lowercase;
  transition: color 0.2s, border-color 0.2s;
}
#fork-prompt button:hover { color: #fff; border-color: #777; }

#progress {
  position: fixed; top: 14px; right: 14px;
  display: flex; gap: 10px; align-items: baseline;
  opacity: 0; transition: opacity 0.6s ease;
  font-size: 10px; letter-spacing: 3px; color: #777;
  text-transform: uppercase;
  pointer-events: none;
}
#progress.on { opacity: 0.7; }
.pg-n { color: #ddd; font-size: 13px; letter-spacing: 4px; }
.pg-l { color: #666; }

#keys-hint {
  position: fixed; top: 42%; left: 50%;
  transform: translate(-50%, 0);
  display: flex; gap: 14px;
  opacity: 0; transition: opacity 0.6s ease;
  pointer-events: none;
}
#keys-hint.on { opacity: 1; }
#keys-hint kbd {
  display: inline-block;
  padding: 8px 14px;
  background: rgba(20,20,24,0.5);
  border: 1px solid #444;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 3px;
  color: #ccc;
  border-radius: 3px;
}

#color-panels {
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#color-panels.on { opacity: 1; pointer-events: auto; }
.color-panel {
  position: absolute;
  width: 130px; height: 130px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.25s, transform 0.25s;
  border-radius: 50%;
  filter: blur(2px);
}
.color-panel:hover { opacity: 1; transform: scale(1.08); filter: blur(0); }
.cp-tl { top: 60px;    left: 60px; }
.cp-tr { top: 60px;    right: 60px; }
.cp-bl { bottom: 80px; left: 60px; }
.cp-br { bottom: 80px; right: 60px; }
