/* ==========================================================================
   KANINCHEN (MAGIC SWAP) SPECIFIC STYLES
   ========================================================================== */

/* Custom Color Palette for the Magician Rabbit (Purple / Gold theme) */
:root {
  --c-fox-main: #8a2be2;      /* Magic Purple */
  --c-fox-light: #b388ff;
  --c-fox-dark: #4a148c;
  
  --c-magic-gold: #ffd700;
  --c-magic-glow: rgba(255, 215, 0, 0.6);
  
  --c-board-bg: #2d1b4e;      /* Deep purple board */
  --c-board-border: #ffd700;
  --c-text: #ffffff;
  --c-text-muted: #b388ff;
  
  /* Shared variables to override */
  --c-correct: #4caf50;
  --c-wrong: #f44336;
}

/* ── OVERRIDES & BACKGROUNDS ──────────────────────────────────────────── */
.intro-bg,
.levelup-bg {
  filter: brightness(0.7) contrast(1.1);
}

.intro-badge {
  background: var(--c-fox-main);
  color: #fff;
  border: 2px solid var(--c-magic-gold);
}

.btn-start {
  background: linear-gradient(135deg, var(--c-fox-main), var(--c-fox-dark));
  border: 2px solid var(--c-magic-gold);
  color: #fff;
}

.btn-start:hover {
  background: linear-gradient(135deg, var(--c-fox-light), var(--c-fox-main));
  box-shadow: 0 0 15px var(--c-magic-glow);
}

/* ── MAGIC WORKSHOP BOARD ────────────────────────────────────────────── */
.workshop-panel {
  background: var(--c-board-bg);
  border-color: var(--c-board-border);
  box-shadow: 0 0 30px rgba(74, 20, 140, 0.5), inset 0 0 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.magic-stage {
  width: 100%;
  max-width: 600px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px dashed var(--c-fox-light);
  border-radius: var(--r-l);
  padding: 30px 20px;
  text-align: center;
  position: relative;
}

.stage-title {
  font-family: var(--f-display);
  font-size: 1.8rem;
  color: var(--c-magic-gold);
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ── EQUATION AREA (DRAG & DROP) ──────────────────────────────────────── */
.equation-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  font-family: var(--f-board);
  font-size: 3rem;
  color: white;
}

.operator, .equals {
  font-size: 3.5rem;
  color: var(--c-magic-gold);
  text-shadow: 0 2px 10px var(--c-magic-glow);
  width: 40px;
  text-align: center;
}

/* DRAG SLOTS & CARDS */
.slot {
  width: 80px;
  height: 90px;
  background: rgba(255,255,255,0.1);
  border: 3px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--r-m);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

.slot.drag-over {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--c-magic-gold);
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--c-magic-glow);
}

.number-card {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #fff, #f0f0f0);
  color: var(--c-fox-dark);
  border-radius: calc(var(--r-m) - 2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: bold;
  cursor: grab;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  touch-action: none; /* for pointer events / drag */
  z-index: 10;
  transition: transform 0.2s, box-shadow 0.2s;
}

.number-card:active, .number-card.dragging {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  z-index: 100;
}

.result-box {
  width: 90px;
  height: 90px;
  background: var(--c-fox-dark);
  border: 3px solid var(--c-magic-gold);
  border-radius: var(--r-m);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: bold;
  color: white;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
  position: relative;
}

.result-box.magic-active {
  animation: magicPulse 1s infinite alternate;
}

/* ── PREDICTION SECTION ──────────────────────────────────────────────── */
.prediction-section {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--r-m);
  padding: 20px;
  margin-top: 20px;
}

.prediction-section h3 {
  font-family: var(--f-display);
  font-size: 1.6rem;
  color: var(--c-fox-light);
  margin-bottom: 15px;
  text-align: center;
}

.prediction-options {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-pred {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--c-fox-light);
  color: white;
  padding: 12px 10px;
  border-radius: var(--r-m);
  font-family: var(--f-display);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pred:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-pred.selected {
  background: var(--c-fox-main);
  border-color: var(--c-magic-gold);
  box-shadow: 0 0 10px var(--c-magic-glow);
}

.btn-pred:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── MAGIC ANIMATIONS ────────────────────────────────────────────────── */
@keyframes magicPulse {
  0% { box-shadow: 0 0 5px var(--c-magic-gold), inset 0 0 15px rgba(0,0,0,0.5); }
  100% { box-shadow: 0 0 25px var(--c-magic-gold), inset 0 0 10px var(--c-magic-gold); }
}

.magic-sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkleAnim 0.8s ease-out forwards;
}

@keyframes sparkleAnim {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.5) rotate(180deg); opacity: 1; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* Action buttons */
.btn-action-magic {
  background: linear-gradient(135deg, var(--c-fox-main), var(--c-fox-dark));
  border: 2px solid var(--c-magic-gold);
  color: white;
  font-family: var(--f-display);
  font-size: 1.5rem;
  padding: 12px 30px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  margin-top: 20px;
}

.btn-action-magic:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.5), 0 0 15px var(--c-magic-glow);
}

.btn-action-magic:active {
  transform: translateY(1px);
}
