/* === Math Runner — page d'accueil ===
   Palette : vert lime + orange électrique sur bleu nuit
   Évite : backdrop-filter sur conteneur permanent, box-shadow animée infinie,
           position fixed décor (perf Firefox).
*/

/* Fond décoratif statique (operateurs flottants) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.45;
  background:
    radial-gradient(2px 2px at 14% 22%, rgba(163, 230, 53, 0.45) 50%, transparent 100%),
    radial-gradient(1px 1px at 32% 78%, rgba(251, 146, 60, 0.55) 50%, transparent 100%),
    radial-gradient(1px 1px at 49% 36%, rgba(34, 211, 238, 0.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 66% 88%, rgba(244, 114, 182, 0.4) 50%, transparent 100%),
    radial-gradient(2px 2px at 81% 47%, rgba(163, 230, 53, 0.35) 50%, transparent 100%),
    radial-gradient(1px 1px at 92% 18%, rgba(255,255,255,0.35) 50%, transparent 100%);
  background-size: 100% 100%;
}

/* === Hero === */
.hero-mathrunner {
  background:
    radial-gradient(ellipse at 28% 25%, rgba(132, 204, 22, 0.20), transparent 65%),
    radial-gradient(ellipse at 78% 75%, rgba(251, 146, 60, 0.16), transparent 60%);
  border: 1px solid rgba(132, 204, 22, 0.22);
  border-radius: 18px;
  padding: 36px 24px 28px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero-mathrunner::before {
  content: '';
  position: absolute;
  top: -50px; left: -50px;
  width: 160px; height: 160px;
  background: radial-gradient(circle at 65% 65%, rgba(132, 204, 22, 0.28), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-mathrunner::after {
  content: '';
  position: absolute;
  bottom: -50px; right: -50px;
  width: 170px; height: 170px;
  background: radial-gradient(circle at 35% 35%, rgba(251, 146, 60, 0.24), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Operateurs flottants dans le hero (×, +, -, ÷) */
.hero-ops {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-op {
  position: absolute;
  font-weight: 800;
  font-size: 1.5rem;
  opacity: 0.4;
  animation: op-float 4.5s ease-in-out infinite;
  will-change: transform, opacity;
}
.hero-op-1 { top: 18%; left: 12%; color: #a3e635; animation-delay: 0s; }
.hero-op-2 { top: 26%; right: 14%; color: #fb923c; animation-delay: -0.9s; }
.hero-op-3 { bottom: 24%; left: 16%; color: #22d3ee; animation-delay: -1.7s; }
.hero-op-4 { bottom: 30%; right: 18%; color: #f472b6; animation-delay: -2.4s; }
.hero-op-5 { top: 56%; left: 36%; font-size: 1.1rem; color: #a3e635; animation-delay: -3s; }
.hero-op-6 { top: 64%; right: 30%; font-size: 1.1rem; color: #fb923c; animation-delay: -3.6s; }

@keyframes op-float {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-12px); opacity: 0.75; }
}

/* === Image hero === */
.hero-mathrunner .hero-visual {
  border-radius: 16px;
  box-shadow: 0 0 22px rgba(132, 204, 22, 0.28), 0 4px 18px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(163, 230, 53, 0.28);
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
/* Placeholder visuel quand l'image n'est pas encore générée — calé sur .hero-visual du shared */
.hero-mathrunner .hero-visual-placeholder {
  grid-area: image;
  align-self: center;
  width: min(200px, 38vw);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 11vw, 4.2rem);
  font-weight: 800;
  color: #a3e635;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(132, 204, 22, 0.4), transparent 65%),
    linear-gradient(135deg, #1e293b, #0f172a);
  box-shadow: 0 0 22px rgba(132, 204, 22, 0.28), 0 4px 18px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(163, 230, 53, 0.28);
  letter-spacing: -2px;
}

/* === Texte hero === */
.hero-text {
  position: relative;
  z-index: 1;
}
.hero-mathrunner .hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 10px;
  line-height: 1.1;
  background: linear-gradient(90deg, #a3e635 0%, #84cc16 30%, #fb923c 70%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-mathrunner .hero-h1 {
  font-size: 1rem;
  font-weight: 400;
  margin: 0 0 10px;
  line-height: 1.4;
}
/* Mobile : placeholder calé sur .hero-visual du shared (140 / 115 / 95) */
@media (max-width: 600px) {
  .hero-mathrunner .hero-visual-placeholder { width: min(140px, 36vw); }
}
@media (max-width: 480px) {
  .hero-mathrunner .hero-visual-placeholder { width: min(115px, 32vw); }
}
@media (max-width: 360px) {
  .hero-mathrunner .hero-visual-placeholder { width: min(95px, 30vw); }
}

/* === CTA === */
.btn-cta-hero {
  position: relative;
  display: inline-block;
  margin-top: 18px;
  padding: 14px 36px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  background: linear-gradient(135deg, #a3e635, #84cc16);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(132, 204, 22, 0.35);
  transition: transform 0.18s, box-shadow 0.18s;
}
.btn-cta-hero::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  border: 2px solid rgba(251, 146, 60, 0.6);
  pointer-events: none;
  animation: cta-ring 2.5s ease-in-out infinite;
  will-change: transform, opacity;
}
.btn-cta-hero:hover {
  transform: scale(1.06);
  box-shadow: 0 0 32px rgba(132, 204, 22, 0.55);
}
@keyframes cta-ring {
  0%, 100% { transform: scale(1); opacity: 0; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* === Indicateur live === */
.hero-live {
  margin-top: 14px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.live-dot {
  position: relative;
  width: 8px; height: 8px;
  background: #a3e635;
  border-radius: 50%;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(163, 230, 53, 0.55);
  animation: live-pulse 2s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(2.4); opacity: 0; }
}

/* === Cards modes === */
.mode-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #84cc16, #fb923c);
  border-radius: 12px 12px 0 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.mode-card:hover::before { opacity: 1; }
.mode-card:hover {
  border-color: rgba(132, 204, 22, 0.4);
  box-shadow: 0 4px 20px rgba(132, 204, 22, 0.18);
}
.mode-card:hover .mode-icon {
  transform: scale(1.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-endless {
  background: rgba(163, 230, 53, 0.2);
  color: #d9f99d;
}
.badge-defi {
  background: rgba(251, 146, 60, 0.2);
  color: #fed7aa;
}

/* === Rules === */
.rules { position: relative; }
.rules::before {
  content: '🧮';
  position: absolute;
  top: 12px; right: 16px;
  font-size: 1.6rem;
  opacity: 0.12;
}

/* === Légende des opérateurs (visuelle pour expliquer le concept) === */
.ops-legende {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.ops-legende-item {
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255,255,255,0.08);
}
.ops-legende-item .symb {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 4px;
}
.ops-mul { color: #a3e635; }
.ops-add { color: #22d3ee; }
.ops-sub { color: #fb923c; }
.ops-div { color: #f472b6; }

/* === Responsive === */
@media (max-width: 480px) {
  .hero-mathrunner { padding: 24px 16px 20px; }
  .btn-cta-hero { padding: 12px 28px; font-size: 1rem; }
}
