/* ===== VISUAL CALC GAME ===== */

.vc-question {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  min-height: 1.6em;
  text-shadow: 0 2px 8px rgba(139, 92, 246, 0.8);
}

/* Stage */
.vc-stage {
  width: 100%;
  max-width: 520px;
  height: 200px;
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* Divider shown in add/sub mode */
.vc-stage.split::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 10%;
  height: 80%;
  width: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 1px;
  transform: translateX(-50%);
}

/* Dots */
.dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5); /* extra 3d pop for dots */
}

/* Legend */
.vc-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: center;
}
.vc-legend .leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.vc-legend .leg-dot {
  display: inline-block;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  opacity: 0.85;
  flex-shrink: 0;
}
.vc-legend .leg-dot.lg { width: 20px; height: 20px; }
.vc-legend .leg-dot.md { width: 14px; height: 14px; }
.vc-legend .leg-dot.sm { width:  8px; height:  8px; }

/* Answer area */
.answer-area {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.number-input {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  width: 140px;
  padding: 10px 12px;
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.5);
  letter-spacing: 2px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

/* Numpad */
.numpad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.numpad-btn {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 0;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s;
}
.numpad-btn:hover  { 
  background: rgba(255,255,255,0.15); 
  border-color: rgba(139, 92, 246, 0.6); 
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); 
  transform: translateY(-2px);
}
.numpad-btn:active { background: var(--primary); border-color: var(--primary); transform: scale(0.95); }

.numpad-btn.del {
  background: rgba(236, 72, 153, 0.1);
  border-color: rgba(236, 72, 153, 0.3);
  color: var(--secondary);
}
.numpad-btn.del:hover { background: rgba(236, 72, 153, 0.2); box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3); }

.numpad-btn.ok {
  grid-column: 4;
  grid-row: 2 / 4;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}
.numpad-btn.ok:hover  { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5); }
.numpad-btn.ok:active { filter: brightness(0.9); }

.numpad-btn.zero {
  grid-column: 1 / 4;
}

/* Flash feedback */
.flash-correct { animation: flashGreen 0.4s; }
.flash-wrong   { animation: flashRed   0.4s; }

@keyframes flashGreen {
  0%, 100% { background: transparent; }
  50%       { background: rgba(16, 185, 129, 0.2);  }
}
@keyframes flashRed {
  0%, 100% { background: transparent; }
  50%       { background: rgba(236, 72, 153, 0.2);  }
}

@media (max-width: 400px) {
  .numpad { max-width: 280px; gap: 6px; }
  .numpad-btn { padding: 12px 0; font-size: 1.15rem; }
  .vc-stage { height: 170px; }
}
