* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0d0d0d;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  overflow: hidden;
}

#terminal-wrapper {
  width: 72%;
  height: 62vh;
  background: #1e1e1e;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(255,255,255,0.08), 0 20px 60px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#titlebar {
  background: #2d2d2d;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green  { background: #28c941; }

#titlebar-label {
  color: #888;
  font-size: 12px;
  margin-left: auto;
  margin-right: auto;
  transform: translateX(-18px);
}

#output {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

#output::-webkit-scrollbar { width: 5px; }
#output::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

.output-line { white-space: pre-wrap; word-break: break-all; }
.output-line.cmd { color: #a8d8a8; }
.output-line.response { color: #c8c8c8; }
.output-line.system { color: #666; }
.output-line.error { color: #ff6b6b; }
.output-line.success { color: #69db7c; }

#input-row {
  display: flex;
  align-items: center;
  padding: 10px 16px 14px;
  border-top: 1px solid #2a2a2a;
  flex-shrink: 0;
}

#prompt {
  color: #69db7c;
  font-size: 14px;
  white-space: nowrap;
  margin-right: 6px;
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 14px;
  caret-color: #69db7c;
}

/* ── Overlay base ─────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.overlay.clickable { pointer-events: all; cursor: pointer; }

/* ── Matrix rain ──────────────────────────────────────────── */
#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.4s;
}
#matrix-canvas.active { opacity: 1; }

/* ── Glitch / explosion ───────────────────────────────────── */
@keyframes shake {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  10% { transform: translate(-8px, 4px) rotate(-1deg); }
  20% { transform: translate(8px, -4px) rotate(1deg); }
  30% { transform: translate(-6px, 6px) rotate(-0.5deg); }
  40% { transform: translate(6px, -6px) rotate(0.5deg); }
  50% { transform: translate(-4px, 2px) rotate(-0.3deg); }
  60% { transform: translate(4px, -2px) rotate(0.3deg); }
  70% { transform: translate(-2px, 4px) rotate(0deg); }
}

@keyframes glitch-flicker {
  0%,100% { opacity: 1; filter: none; }
  15% { filter: hue-rotate(90deg) saturate(3) brightness(1.4); }
  30% { opacity: 0.7; filter: hue-rotate(180deg) saturate(5); }
  45% { filter: invert(1); }
  60% { opacity: 0.9; filter: hue-rotate(270deg) saturate(4) brightness(0.7); }
  75% { filter: none; }
}

.glitching {
  animation: shake 0.15s linear infinite, glitch-flicker 0.2s linear infinite;
}

#glitch-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: none;
  pointer-events: none;
}
#glitch-overlay.active { display: block; }

/* ── ACCESS GRANTED ───────────────────────────────────────── */
#access-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
#access-overlay.active { opacity: 1; }

#access-stamp {
  border: 6px solid #00ff41;
  color: #00ff41;
  font-size: clamp(36px, 6vw, 80px);
  font-weight: 900;
  padding: 20px 40px;
  text-transform: uppercase;
  letter-spacing: 8px;
  text-shadow: 0 0 20px #00ff41, 0 0 40px #00ff41;
  box-shadow: 0 0 30px #00ff41, inset 0 0 30px rgba(0,255,65,0.1);
  transform: scale(0) rotate(-12deg);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(0,0,0,0.7);
}
#access-overlay.active #access-stamp { transform: scale(1) rotate(-12deg); }

/* ── Cat overlay ──────────────────────────────────────────── */
#cat-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0,0,0,0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
}
#cat-overlay.active { display: flex; }
#cat-overlay img {
  max-width: 60vw;
  max-height: 60vh;
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(255,255,255,0.3);
}
#cat-overlay p {
  color: #fff;
  font-size: 18px;
  margin-top: 18px;
  opacity: 0.6;
}

/* ── Confetti canvas ──────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  display: none;
}
#confetti-canvas.active { display: block; }

/* ── Name tag ─────────────────────────────────────────────── */
#nametag-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}
#nametag-overlay.active { opacity: 1; }

#nametag {
  background: #fff;
  width: 340px;
  border-radius: 8px;
  padding: 18px 24px 28px;
  box-shadow: 6px 6px 0 #000, 0 0 0 3px #000;
  transform: scale(0) rotate(-6deg);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.6);
  font-family: 'JetBrains Mono', monospace;
}
#nametag-overlay.active #nametag { transform: scale(1) rotate(-6deg); }

#nametag-hello {
  background: #e63946;
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 6px 0;
  border-radius: 4px 4px 0 0;
  margin: -18px -24px 10px;
  border-bottom: 3px solid #000;
}
#nametag-my-name-is {
  color: #333;
  font-size: 13px;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
#nametag-name {
  color: #000;
  font-size: clamp(18px, 3.5vw, 32px);
  font-weight: 900;
  text-align: center;
  word-break: break-all;
  line-height: 1.2;
}

/* ── Shooting stars canvas ────────────────────────────────── */
#stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  display: none;
}
#stars-canvas.active { display: block; }
