/*
 * Magic 8 Ball Premium Stylesheet
 * Integrates with Core CMS theme variables.
 */
.magic-8ball-wrapper {
  margin-top: 40px;
  margin-bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.eightball-container {
  text-align: center;
  position: relative;
  perspective: 1200px;
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
}

.ball {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #444, #000);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  margin: 2rem auto;
  cursor: pointer;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.ball::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 60%;
  height: 40%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: rotate(-30deg);
  filter: blur(4px);
}

.inner-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  background: #050510; /* Deep aether dark blue */
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 4px solid var(--card-bg, #ffffff);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
  transition: border-color 0.3s ease;
}

.triangle-container {
  position: relative;
  width: 95%;
  height: 95%;
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.triangle-container svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.7));
  transition: transform 0.5s ease;
}

.triangle-container.inverted svg {
  transform: rotate(180deg);
}

.triangle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%; /* Restrict width so it stays in the triangle bounds */
  transform: translate(-50%, -40%); /* Slightly lower because upright triangle is wider at bottom */
  color: #c9d6df; /* Soft glowing steel blue */
  text-align: center;
  font-size: 0.85rem;
  font-weight: bold;
  pointer-events: none;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
  line-height: 1.3;
  transition: transform 0.5s ease, opacity 0.5s ease;
  word-wrap: break-word;
}

.triangle-container.inverted .triangle-text {
  transform: translate(-50%, -60%); /* Slightly higher because inverted triangle is wider at top */
}

/* Glassmorphic ask button */
.magic-8ball-wrapper button {
  background-color: var(--primary-color, #3b82f6);
  color: #ffffff;
  font-size: 1.1rem;
  padding: 12px 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.15s ease-in-out;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1rem;
  font-weight: 600;
}

.magic-8ball-wrapper button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background-color: var(--primary-color-hover, #2563eb);
}

.magic-8ball-wrapper button:active {
  transform: translateY(0);
}

@keyframes shake {
  0% { transform: rotate(0deg) scale(1); }
  15% { transform: rotate(12deg) scale(0.95); }
  30% { transform: rotate(-12deg) scale(0.95); }
  45% { transform: rotate(8deg) scale(1.02); }
  60% { transform: rotate(-8deg) scale(1); }
  75% { transform: rotate(4deg) scale(1); }
  90% { transform: rotate(-4deg) scale(1); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

.shake {
  animation: shake 0.8s ease-in-out;
}

.float {
  animation: float 4s ease-in-out infinite;
}

@media (max-width: 600px) {
  .ball {
    width: 260px;
    height: 260px;
  }
  .inner-circle {
    width: 130px;
    height: 130px;
    border-width: 3px;
  }
  .triangle-text {
    font-size: 0.75rem;
  }
}
