/* Styles for mc-extras.js (KaitlynCraft extras). Uses the Monocraft font and
   .mc-button / .mc-flash styles defined in prank.html. */

/* Pixel art stays crisp (beats `body.minecraft img { image-rendering: auto }`) */
html body img.mcx-px { image-rendering: pixelated; }

/* ---- 1. Advancement toasts ---- */
.mcx-toast {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 4500;
  width: 320px;
  height: 64px;
  box-sizing: border-box;
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: url('somemorestuff/minecraft/toast_advancement.png') 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
  font-family: 'Monocraft', monospace;
  font-size: 13px;
  line-height: 1.3;
  pointer-events: none;
  animation: mcx-toast-in 0.45s ease-out both;
}
.mcx-toast.out { animation: mcx-toast-out 0.45s ease-in both; }
img.mcx-toast-icon { width: 32px; flex: none; }
.mcx-toast-title { color: #ffff55; }
.mcx-toast.challenge .mcx-toast-title { color: #ff55ff; }
.mcx-toast-desc { color: #fff; }
@keyframes mcx-toast-in { from { transform: translateX(120%); } }
@keyframes mcx-toast-out { to { transform: translateX(120%); } }

/* ---- 2. Chat ---- */
.mcx-chat {
  position: fixed;
  left: 8px;
  bottom: 76px; /* above the grass strip */
  z-index: 2600;
  width: min(560px, 80vw);
  font-family: 'Monocraft', monospace;
  font-size: 15px;
  line-height: 1.45;
  pointer-events: none;
}
.mcx-chat-line {
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 6px;
  text-shadow: 2px 2px 0 #3f3f3f;
  transition: opacity 1s;
  animation: mc-fade-in 0.2s ease-out;
}
.mcx-chat-line.old { opacity: 0; }
.mcx-white { color: #fff; }
.mcx-yellow { color: #ffff55; }
.mcx-gray { color: #aaaaaa; font-style: italic; }
.mcx-red { color: #ff5555; }

/* ---- 3. Creeper + death screen ---- */
.mcx-creeper {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
img.mcx-creeper-face {
  width: min(70vmin, 640px);
  transform: translateY(110%);
  transition: transform 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
  filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.8));
}
.mcx-creeper.in img.mcx-creeper-face { transform: translateY(8%); }
img.mcx-creeper-face.fuse { animation: mcx-fuse 0.25s steps(2) infinite; }
@keyframes mcx-fuse {
  0% { transform: translateY(8%) scale(1); filter: brightness(1); }
  100% { transform: translateY(8%) scale(1.12); filter: brightness(3); }
}
.mcx-death {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(rgba(80, 0, 0, 0.55), rgba(160, 0, 0, 0.7));
  font-family: 'Monocraft', monospace;
  color: #fff;
  text-shadow: 3px 3px 0 #3f3f3f;
  animation: mc-fade-in 0.6s ease-out;
}
.mcx-death h1 { font-size: clamp(36px, 5vw, 72px); font-weight: 400; margin: 0 0 10px; }
.mcx-death p { margin: 0; font-size: clamp(14px, 1.4vw, 22px); }
.mcx-death .mc-button,
.mcx-panel .mc-button {
  width: min(400px, 80vw);
  margin: 8px 0 0;
  font-size: 16px;
}
.mcx-death .mcx-respawn { margin-top: 30px; }

/* ---- 4. Herobrine peeking ---- */
.mcx-hb {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2500;
  width: clamp(150px, 13vw, 260px);
  aspect-ratio: 2 / 3;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}
.mcx-hb canvas, .mcx-cam-hb canvas { display: block; width: 100%; height: 100%; }

/* ---- 5. Mining ---- */
img.mcx-crack {
  position: fixed;
  left: 0;
  top: 0;
  width: 48px;
  z-index: 4800;
  display: none;
  pointer-events: none;
  opacity: 0.85;
}
.mcx-particle {
  position: fixed;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  z-index: 4800;
  pointer-events: none;
  background: url('somemorestuff/minecraft/dirt.png') 0 0 / 32px 32px;
  image-rendering: pixelated;
}

/* ---- 6. Stampede ---- */
img.mcx-stampede {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2400;
  pointer-events: none;
}

/* ---- 7. Pet speech bubble ---- */
.mcx-bubble {
  position: fixed;
  z-index: 2650;
  max-width: 240px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid #fff;
  color: #fff;
  font-family: 'Monocraft', monospace;
  font-size: 13px;
  pointer-events: none;
  animation: mc-fade-in 0.15s ease-out;
}

/* ---- 9. Anti-virus panel (Minecraft GUI style) ---- */
.mcx-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4000;
  width: min(520px, 90vw);
  box-sizing: border-box;
  padding: 18px 20px;
  background: #c6c6c6;
  border: 4px solid;
  border-color: #fff #555 #555 #fff;
  box-shadow: 0 0 0 4px #000, 0 20px 40px rgba(0, 0, 0, 0.6);
  font-family: 'Monocraft', monospace;
  color: #3f3f3f;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: mc-fade-in 0.2s ease-out;
}
.mcx-panel-title { font-size: 18px; margin-bottom: 10px; }
.mcx-panel .mcx-red { color: #aa0000; }
.mcx-scan-status { margin-bottom: 8px; }
.mcx-bar {
  width: 100%;
  height: 12px;
  background: #3a3a3a;
  border: 2px solid #000;
}
.mcx-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(#80ff20, #3c9c00); /* XP bar green */
}
.mcx-scan-file {
  width: 100%;
  min-height: 1.4em;
  margin-top: 6px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcx-scan-results { width: 100%; margin-top: 6px; }
.mcx-panel-buttons { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* ---- 11. Fake webcam ---- */
.mcx-cam {
  position: fixed;
  z-index: 2700;
  width: clamp(200px, 17vw, 320px);
  aspect-ratio: 4 / 3;
  background: #000;
  border: 3px solid #222;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  font-family: 'Monocraft', monospace;
  transition: left 0.4s, top 0.4s, right 0.4s, bottom 0.4s;
  animation: mc-fade-in 0.4s ease-out;
}
.mcx-cam.tl { left: 12px; top: 12px; }
.mcx-cam.tr { right: 12px; top: 90px; } /* below the toasts */
.mcx-cam.bl { left: 12px; bottom: 90px; }
.mcx-cam.br { right: 12px; bottom: 90px; }
.mcx-noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0.35;
}
.mcx-cam-hb {
  position: absolute;
  inset: 0;
  filter: grayscale(1) sepia(1) hue-rotate(70deg) saturate(2.5) contrast(1.2) brightness(0.9); /* night vision */
}
.mcx-cam::after { /* scanlines over everything */
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.25) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.mcx-cam-rec {
  position: absolute;
  left: 8px;
  top: 6px;
  z-index: 1;
  color: #ff3030;
  font-size: 13px;
  animation: mcx-blink 1s steps(2) infinite;
}
@keyframes mcx-blink { 50% { opacity: 0; } }
.mcx-cam-label {
  position: absolute;
  left: 8px;
  bottom: 6px;
  z-index: 1;
  color: #d0ffd0;
  font-size: 10px;
}
.mcx-cam-x {
  position: absolute;
  right: 4px;
  top: 2px;
  z-index: 2;
  border: 0;
  background: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* ---- 12. Hacker Typer terminal ---- */
.mcx-term {
  position: fixed;
  right: 12px;
  bottom: 80px;
  z-index: 2750;
  width: min(460px, 92vw);
  height: min(280px, 40vh);
  background: #050805;
  border: 2px solid #2bff2b;
  box-shadow: 0 0 18px rgba(43, 255, 43, 0.35), 0 10px 30px rgba(0, 0, 0, 0.7);
  font-family: 'Monocraft', monospace;
  overflow: hidden;
  animation: mc-fade-in 0.3s ease-out;
}
.mcx-term.hidden { display: none; }
.mcx-term-rain { position: absolute; inset: 0; width: 100%; height: 100%; }
.mcx-term-bar {
  position: relative;
  background: #0f2b0f;
  color: #8dff8d;
  font-size: 12px;
  padding: 3px 8px;
  border-bottom: 1px solid #2bff2b;
}
.mcx-term-x {
  position: absolute;
  right: 4px;
  top: 0;
  border: 0;
  background: none;
  color: #8dff8d;
  font-size: 16px;
  cursor: pointer;
}
.mcx-term-out {
  position: absolute;
  inset: 22px 0 0 0;
  margin: 0;
  padding: 6px 8px;
  color: #3cff3c;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: hidden;
  text-shadow: 0 0 4px rgba(60, 255, 60, 0.6);
}
.mcx-term-out::after { content: '█'; animation: mcx-blink 1s steps(2) infinite; }
.mcx-access {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4900;
  padding: 24px 48px;
  font-family: 'Monocraft', monospace;
  font-size: clamp(28px, 5vw, 64px);
  border: 4px solid;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: none;
  animation: mcx-blink 0.4s steps(2) 3;
}
.mcx-access.granted { color: #3cff3c; border-color: #3cff3c; box-shadow: 0 0 40px #3cff3c; }
.mcx-access.denied { color: #ff3c3c; border-color: #ff3c3c; box-shadow: 0 0 40px #ff3c3c; }

/* ---- 13. Full-screen matrix rain (on ACCESS GRANTED) ---- */
canvas.mcx-matrix-full {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 4800;
  pointer-events: none;
  background: #000;
  transition: opacity 0.6s;
}
canvas.mcx-matrix-full.out { opacity: 0; }

/* ---- 16. Fake right-click menu ---- */
.mcx-menu {
  position: fixed;
  z-index: 6000;
  min-width: 200px;
  padding: 4px;
  background: rgba(16, 0, 16, 0.92);
  border: 2px solid #2a0a5e;
  box-shadow: inset 0 0 0 2px #5000ff40, 0 8px 20px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  animation: mc-fade-in 0.1s ease-out;
}
.mcx-menu-item {
  border: 0;
  background: none;
  color: #fff;
  font-family: 'Monocraft', monospace;
  font-size: 13px;
  text-align: left;
  padding: 6px 10px;
  text-shadow: 2px 2px 0 #3f3f3f;
  cursor: pointer;
}
.mcx-menu-item:hover { background: rgba(255, 255, 255, 0.15); color: #ffff55; }
