/* ── Magic 8-Ball / Kuro's Oracle ── */
#magic8ball {
  position: fixed;
  z-index: 50;
  cursor: grab;
  user-select: none;
  text-align: center;
  animation: m8b-fadein 0.5s ease forwards;
  transform-origin: top left;
}
#magic8ball:active { cursor: grabbing; }

.m8b-ball {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #3a3a4a 0%, #111118 60%, #0a0a12 100%);
  box-shadow: 0 0 22px rgba(120,80,220,0.35), 0 0 50px rgba(0,200,255,0.15), inset 0 2px 8px rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: m8b-glow 4s ease-in-out infinite;
}

.m8b-number {
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 10px rgba(180,140,255,0.7);
  line-height: 1;
  margin-bottom: 2px;
  pointer-events: none;
}

.m8b-window {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #0d0d2a;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(100,180,255,0.3);
  pointer-events: none;
}

.m8b-triangle {
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-top: 46px solid #1a1a4a;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#m8b-answer {
  position: absolute;
  top: -42px;
  left: -22px;
  width: 44px;
  font-size: 0.38rem;
  font-weight: 700;
  color: #00ffe0;
  text-shadow: 0 0 6px rgba(0,255,200,0.8);
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

#m8b-label {
  margin-top: 6px;
  font-size: 0.72rem;
  color: rgba(180,140,255,0.85);
  text-shadow: 0 0 8px rgba(140,100,255,0.6);
  letter-spacing: 0.05em;
}

@keyframes m8b-glow {
  0%,100% { box-shadow: 0 0 22px rgba(120,80,220,0.35), 0 0 50px rgba(0,200,255,0.15), inset 0 2px 8px rgba(255,255,255,0.08); }
  50%      { box-shadow: 0 0 36px rgba(120,80,220,0.6),  0 0 70px rgba(0,200,255,0.28), inset 0 2px 8px rgba(255,255,255,0.08); }
}

@keyframes m8b-fadein {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes m8b-shake {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(-14deg); }
  30%  { transform: rotate(12deg); }
  45%  { transform: rotate(-10deg); }
  60%  { transform: rotate(8deg); }
  75%  { transform: rotate(-5deg); }
  90%  { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

/* magic8ball resize handles — dot style for round widget */
.m8b-resize-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: 51;
}
.m8b-resize-tl { top: 0; left: 0; cursor: nwse-resize; }
.m8b-resize-tr { top: 0; right: 0; cursor: nesw-resize; }
.m8b-resize-bl { bottom: 0; left: 0; cursor: nesw-resize; }
.m8b-resize-br { bottom: 0; right: 0; cursor: nwse-resize; }
.m8b-resize-tl::after,
.m8b-resize-tr::after,
.m8b-resize-bl::after,
.m8b-resize-br::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(160, 120, 255, 0.35);
  transition: background 0.15s;
}
.m8b-resize-handle:hover::after { background: rgba(180, 140, 255, 0.9); }
.m8b-resize-tl::after { top: 3px; left: 3px; }
.m8b-resize-tr::after { top: 3px; right: 3px; }
.m8b-resize-bl::after { bottom: 3px; left: 3px; }
.m8b-resize-br::after { bottom: 3px; right: 3px; }

/* ── Wormhole Background ── */
#wormhole-bg {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  opacity: 0.4;
}

/* ── Magnetar Widget ── */
#magnetar {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
}

#magnetar-canvas {
  border-radius: 50%;
  display: block;
  border: 2px solid rgba(200, 80, 255, 0.45);
  box-shadow: 0 0 22px rgba(200, 60, 255, 0.55), 0 0 50px rgba(255, 80, 200, 0.3), inset 0 0 18px rgba(180, 0, 255, 0.2);
  animation: magnetar-glow 2.4s ease-in-out infinite alternate;
}

#magnetar-label {
  font-size: 0.55rem;
  font-family: monospace;
  letter-spacing: 0.14em;
  color: #df80ff;
  text-shadow: 0 0 7px rgba(200, 80, 255, 0.9);
  margin-top: 4px;
  text-transform: uppercase;
}

@keyframes magnetar-glow {
  from { box-shadow: 0 0 18px rgba(200, 60, 255, 0.45), 0 0 40px rgba(255, 80, 200, 0.25), inset 0 0 12px rgba(180, 0, 255, 0.15); }
  to   { box-shadow: 0 0 40px rgba(220, 80, 255, 0.85), 0 0 80px rgba(255, 100, 220, 0.5), inset 0 0 28px rgba(200, 0, 255, 0.35); }
}

@keyframes magnetar-fadein {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}


/* ── Magnetar Warp Field Rings ── */
#mgt-warp-field {
  position: fixed;
  pointer-events: none;
  z-index: 49;
  width: 0;
  height: 0;
}

.mgt-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 80, 255, 0.5);
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  animation: mgt-ring-expand 2.2s ease-out infinite;
}
.mgt-ring:nth-child(1) { animation-delay: 0s; }
.mgt-ring:nth-child(2) { animation-delay: 0.55s; }
.mgt-ring:nth-child(3) { animation-delay: 1.1s; }
.mgt-ring:nth-child(4) { animation-delay: 1.65s; }

@keyframes mgt-ring-expand {
  0%   { width: 20px;  height: 20px;  opacity: 0.9; border-color: rgba(220, 80, 255, 0.65); }
  60%  { border-color: rgba(180, 60, 255, 0.2); }
  100% { width: 800px; height: 800px; opacity: 0;   border-color: rgba(160, 40, 255, 0); }
}

/* ── Prophecy Child ── */
#prophecy-child {
  max-width: 660px;
  margin: 1.6rem auto 0;
  position: relative;
  background: linear-gradient(135deg, rgba(255,120,180,0.04) 0%, rgba(180,80,255,0.07) 100%);
  border: 1px solid rgba(255,130,200,0.25);
  border-radius: 8px;
  padding: 1.2rem 1.6rem 1rem;
  box-shadow: 0 0 22px rgba(255,100,180,0.06), inset 0 0 20px rgba(80,0,40,0.08);
  animation: pc-breathe 8s ease-in-out infinite;
  text-align: center;
}
#prophecy-child::before,
#prophecy-child::after,
#prophecy-child .pc-corner-tr,
#prophecy-child .pc-corner-bl {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-color: rgba(255,130,200,0.55);
  border-style: solid;
}
#prophecy-child::before { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
#prophecy-child::after  { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }
#prophecy-child .pc-corner-tr { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
#prophecy-child .pc-corner-bl { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.pc-title {
  font-size: clamp(0.68rem, 1.4vw, 0.82rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f472b6;
  text-shadow: 0 0 10px rgba(244,114,182,0.7);
  animation: pc-title-pulse 4s ease-in-out infinite;
  margin-bottom: 0.2rem;
}
.pc-subtitle {
  font-size: clamp(0.55rem, 1.1vw, 0.67rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(244,114,182,0.5);
  margin-bottom: 1rem;
}
.pc-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.pc-ascii {
  font-size: clamp(0.62rem, 1.4vw, 0.82rem);
  line-height: 1.25;
  white-space: pre;
  margin: 0;
  background: linear-gradient(160deg, #f9a8d4, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pc-bounce 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(244,114,182,0.5));
}
.pc-speech {
  position: relative;
  background: rgba(18,7,28,0.88);
  border: 1px solid rgba(255,130,200,0.35);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  max-width: 260px;
  min-height: 3.5em;
  text-align: left;
  box-shadow: 0 0 16px rgba(244,114,182,0.12);
}
.pc-speech::before {
  content: '';
  position: absolute;
  left: -9px; top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: rgba(255,130,200,0.35);
  border-left: 0;
}
.pc-speech-text {
  font-size: clamp(0.6rem, 1.2vw, 0.7rem);
  color: #f9a8d4;
  line-height: 1.65;
  letter-spacing: 0.04em;
  min-height: 2.5em;
}
.pc-cursor {
  display: inline-block;
  width: 6px;
  height: 0.85em;
  background: #f472b6;
  vertical-align: text-bottom;
  animation: cp-blink 0.72s step-end infinite;
}
.pc-sig {
  margin-top: 0.85rem;
  font-size: clamp(0.5rem, 0.95vw, 0.58rem);
  color: rgba(244,114,182,0.4);
  letter-spacing: 0.08em;
  text-align: right;
}
@keyframes pc-breathe {
  0%,100% { box-shadow: 0 0 22px rgba(255,100,180,0.06), inset 0 0 20px rgba(80,0,40,0.08); }
  50%      { box-shadow: 0 0 38px rgba(255,100,180,0.14), inset 0 0 28px rgba(140,0,80,0.12); }
}
@keyframes pc-title-pulse {
  0%,100% { text-shadow: 0 0 10px rgba(244,114,182,0.7); }
  50%     { text-shadow: 0 0 20px rgba(244,114,182,1), 0 0 36px rgba(192,132,252,0.5); }
}
@keyframes pc-bounce {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-7px) rotate(2deg); }
}

