/* ==========================================================================
   SUPERNOVA 24 - COSMIC "MAKE 24" MATH GAME STYLESHEET
   Touch-Friendly, Holographic Cards, Neon Operators, Particle Merges
   ========================================================================== */

.s24-arena-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
}

/* Top HUD Bar */
.s24-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.s24-hud-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.s24-stat-pill {
  background: #111a2e;
  border: 1px solid #2563eb;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 700;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.s24-stat-pill.timer {
  border-color: #f59e0b;
  color: #fcd34d;
}

/* Difficulty Selector */
.s24-diff-group {
  display: flex;
  background: #0f172a;
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid #334155;
  gap: 4px;
}

.s24-diff-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.s24-diff-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
}

/* Target Mode Selector Bar */
.s24-mode-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  width: 100%;
}

.s24-mode-pill {
  background: #111a2e;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.s24-mode-pill:hover {
  border-color: #fbbf24;
  color: #ffffff;
}

.s24-mode-pill.active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: #fbbf24;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

/* Cosmic Mission Header */
.s24-header-box {
  text-align: center;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.s24-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #60a5fa, #c084fc, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.s24-target-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid #f59e0b;
  padding: 6px 18px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.5px;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  margin-bottom: 4px;
}

.s24-subtitle {
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
}

/* Equation Preview Bar */
.s24-equation-bar {
  width: 100%;
  background: #111a2e;
  border: 2px dashed #3b82f6;
  border-radius: 16px;
  padding: 12px 20px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 24px;
  transition: all 0.2s ease;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.s24-equation-bar.active {
  border-style: solid;
  border-color: #60a5fa;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.15);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* Interactive Cards Grid */
.s24-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 680px;
  margin-bottom: 24px;
  perspective: 1000px;
}

@media (max-width: 600px) {
  .s24-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.s24-card {
  aspect-ratio: 1 / 1.15;
  min-height: 110px;
  background: linear-gradient(145deg, #172033, #0f172a);
  border: 2px solid #2d3b55;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.s24-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: #60a5fa;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.4), 0 0 15px rgba(96, 165, 250, 0.2);
}

.s24-card.selected {
  border-color: #f59e0b;
  background: linear-gradient(145deg, #2563eb, #1e3a8a);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.6), 0 0 15px rgba(96, 165, 250, 0.5);
  transform: translateY(-6px) scale(1.06);
}

.s24-card.solved-winner {
  border: 3px solid #fbbf24 !important;
  background: linear-gradient(145deg, #1e1b4b, #14532d) !important;
  box-shadow: 0 0 35px rgba(251, 191, 36, 0.8), 0 0 20px rgba(34, 197, 94, 0.6) !important;
  animation: s24PulseWin 2s infinite ease-in-out;
  transform: scale(1.08);
}

@keyframes s24PulseWin {
  0%, 100% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.7), 0 0 15px rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 45px rgba(251, 191, 36, 1), 0 0 25px rgba(34, 197, 94, 0.8); }
}

.s24-win-tag {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.s24-win-sub-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: #86efac;
  margin-top: 8px;
}

.s24-card-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.s24-card-val {
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.s24-card-sub {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 6px;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Operator Buttons Grid (Minimum 52px Touch Target for iPad) */
.s24-ops-grid {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.s24-op-btn {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #111a2e;
  border: 2px solid #334460;
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.s24-op-btn:hover {
  border-color: #60a5fa;
  background: #1e293b;
  transform: translateY(-2px);
}

.s24-op-btn.selected {
  background: #f59e0b;
  border-color: #fbbf24;
  color: #0f172a;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
}

/* Controls & Utility Bar */
.s24-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-bottom: 20px;
}

.s24-action-btn {
  padding: 11px 20px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  border: none;
  min-height: 48px;
  touch-action: manipulation;
}

.s24-action-btn.undo {
  background: #1e293b;
  border: 1px solid #475569;
  color: #f1f5f9;
}

.s24-action-btn.undo:hover {
  background: #334155;
  border-color: #94a3b8;
}

.s24-action-btn.reset {
  background: #1e293b;
  border: 1px solid #475569;
  color: #f1f5f9;
}

.s24-action-btn.reset:hover {
  background: #334155;
  border-color: #94a3b8;
}

.s24-action-btn.hint {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fcd34d;
}

.s24-action-btn.hint:hover {
  background: rgba(245, 158, 11, 0.3);
}

.s24-action-btn.new {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.s24-action-btn.new:hover {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  transform: translateY(-1px);
}

/* Socratic Hint Box */
.s24-hint-card {
  width: 100%;
  max-width: 680px;
  background: #111a2e;
  border: 1px solid #f59e0b;
  border-radius: 16px;
  padding: 14px 20px;
  color: #fef08a;
  font-size: 14px;
  line-height: 1.5;
  animation: popIn 0.25s ease;
  margin-top: 10px;
}

/* Win Modal Overlay */
.s24-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.s24-modal-card {
  background: linear-gradient(145deg, #0f172a, #1e1b4b);
  border: 2px solid #fbbf24;
  border-radius: 28px;
  padding: 32px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(251, 191, 36, 0.3);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.s24-modal-icon {
  font-size: 54px;
  margin-bottom: 12px;
  animation: pulse 1.5s infinite;
}

.s24-modal-title {
  font-size: 24px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 8px;
}

.s24-modal-eq {
  font-size: 19px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid #3b82f6;
  border-radius: 12px;
  padding: 10px;
  margin: 14px 0;
  font-family: 'Fira Code', monospace;
}

.s24-modal-stats {
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.s24-modal-aura {
  font-size: 16px;
  font-weight: 800;
  color: #4ade80;
  margin-bottom: 20px;
}

.s24-modal-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  transition: all 0.15s ease;
  min-height: 52px;
}

.s24-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.6);
}
