/* ✨ CLAWARTS — Escuela de Mag-IA y Tecnología ✨ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Inter:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
  --purple: #1a0a2e;
  --purple-mid: #2d1b4e;
  --purple-light: #4a2c7a;
  --gold: #fbbf24;
  --green: #22c55e;
  --orange: #f97316;
  --pink: #ec4899;
  --indigo: #6366f1;
  --bg: #0d0618;
  --text: #e8e0f0;
  --text-dim: #9b8fb8;
  --card-bg: rgba(26, 10, 46, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* === PARTICLES === */
.particles {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.particle {
  position: absolute; border-radius: 50%; opacity: 0;
  animation: float-up linear infinite;
}
@keyframes float-up {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* Generate 20 particles via nth-child */
.particle:nth-child(1) { left: 5%; width: 3px; height: 3px; background: var(--gold); animation-duration: 12s; animation-delay: 0s; }
.particle:nth-child(2) { left: 15%; width: 2px; height: 2px; background: var(--pink); animation-duration: 15s; animation-delay: 1s; }
.particle:nth-child(3) { left: 25%; width: 4px; height: 4px; background: var(--green); animation-duration: 10s; animation-delay: 2s; }
.particle:nth-child(4) { left: 35%; width: 2px; height: 2px; background: var(--gold); animation-duration: 14s; animation-delay: 0.5s; }
.particle:nth-child(5) { left: 45%; width: 3px; height: 3px; background: var(--orange); animation-duration: 11s; animation-delay: 3s; }
.particle:nth-child(6) { left: 55%; width: 2px; height: 2px; background: var(--pink); animation-duration: 13s; animation-delay: 1.5s; }
.particle:nth-child(7) { left: 65%; width: 3px; height: 3px; background: var(--gold); animation-duration: 16s; animation-delay: 4s; }
.particle:nth-child(8) { left: 75%; width: 4px; height: 4px; background: var(--green); animation-duration: 9s; animation-delay: 2.5s; }
.particle:nth-child(9) { left: 85%; width: 2px; height: 2px; background: var(--indigo); animation-duration: 12s; animation-delay: 0.8s; }
.particle:nth-child(10) { left: 95%; width: 3px; height: 3px; background: var(--gold); animation-duration: 14s; animation-delay: 5s; }
.particle:nth-child(11) { left: 10%; width: 2px; height: 2px; background: var(--orange); animation-duration: 11s; animation-delay: 6s; }
.particle:nth-child(12) { left: 20%; width: 3px; height: 3px; background: var(--pink); animation-duration: 13s; animation-delay: 3.5s; }
.particle:nth-child(13) { left: 30%; width: 2px; height: 2px; background: var(--gold); animation-duration: 15s; animation-delay: 7s; }
.particle:nth-child(14) { left: 40%; width: 4px; height: 4px; background: var(--green); animation-duration: 10s; animation-delay: 1.2s; }
.particle:nth-child(15) { left: 50%; width: 2px; height: 2px; background: var(--indigo); animation-duration: 12s; animation-delay: 8s; }
.particle:nth-child(16) { left: 60%; width: 3px; height: 3px; background: var(--gold); animation-duration: 14s; animation-delay: 4.5s; }
.particle:nth-child(17) { left: 70%; width: 2px; height: 2px; background: var(--pink); animation-duration: 16s; animation-delay: 2.2s; }
.particle:nth-child(18) { left: 80%; width: 3px; height: 3px; background: var(--orange); animation-duration: 11s; animation-delay: 9s; }
.particle:nth-child(19) { left: 90%; width: 4px; height: 4px; background: var(--gold); animation-duration: 13s; animation-delay: 5.5s; }
.particle:nth-child(20) { left: 3%; width: 2px; height: 2px; background: var(--green); animation-duration: 15s; animation-delay: 10s; }

/* === NAVIGATION === */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 6, 24, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
  padding: 0.8rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
nav .logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}
nav .links { display: flex; gap: 0.3rem; flex-wrap: wrap; }
nav .links a {
  color: var(--text-dim); text-decoration: none;
  padding: 0.3rem 0.6rem; border-radius: 6px;
  font-size: 0.8rem; font-weight: 500;
  transition: all 0.3s;
}
nav .links a:hover, nav .links a.active {
  color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
}

/* === HERO === */
.hero {
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  position: relative; z-index: 1;
}
.hero h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-dim);
  max-width: 650px; margin: 0 auto 2rem;
}

/* Glow text helper */
.glow-gold { color: var(--gold); text-shadow: 0 0 30px rgba(251, 191, 36, 0.4), 0 0 60px rgba(251, 191, 36, 0.2); }
.glow-green { color: var(--green); text-shadow: 0 0 30px rgba(34, 197, 94, 0.4), 0 0 60px rgba(34, 197, 94, 0.2); }
.glow-pink { color: var(--pink); text-shadow: 0 0 30px rgba(236, 72, 153, 0.4), 0 0 60px rgba(236, 72, 153, 0.2); }
.glow-orange { color: var(--orange); text-shadow: 0 0 30px rgba(249, 115, 22, 0.4), 0 0 60px rgba(249, 115, 22, 0.2); }
.glow-indigo { color: var(--indigo); text-shadow: 0 0 30px rgba(99, 102, 241, 0.4), 0 0 60px rgba(99, 102, 241, 0.2); }

/* === SECTIONS === */
.container {
  max-width: 1100px; margin: 0 auto;
  padding: 0 1.5rem;
  position: relative; z-index: 1;
}
section { padding: 4rem 0; }
section h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* === CARDS === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 1.8rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent, var(--gold)), transparent);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.2);
  box-shadow: 0 8px 40px rgba(251, 191, 36, 0.1);
}
.card h3 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem; margin-bottom: 0.6rem;
}
.card p { color: var(--text-dim); font-size: 0.9rem; }
.card a { text-decoration: none; color: inherit; display: block; }

/* Round scroll cards */
.scroll-card { cursor: pointer; }
.scroll-card .round-num {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem; color: var(--text-dim);
  margin-bottom: 0.5rem; letter-spacing: 2px;
}
.scroll-card .winner-name {
  font-size: 1.3rem; margin-bottom: 0.3rem;
}

/* Color accents per round */
.accent-indigo { --accent: var(--indigo); }
.accent-gold { --accent: var(--gold); }
.accent-green { --accent: var(--green); }
.accent-pink { --accent: var(--pink); }
.accent-orange { --accent: var(--orange); }

.accent-indigo .winner-name { color: var(--indigo); }
.accent-gold .winner-name { color: var(--gold); }
.accent-green .winner-name { color: var(--green); }
.accent-pink .winner-name { color: var(--pink); }
.accent-orange .winner-name { color: var(--orange); }

/* === STATS === */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem; margin: 2rem 0;
}
.stat-item {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}
.stat-num {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2rem; font-weight: 700;
  display: block;
}
.stat-label {
  font-size: 0.8rem; color: var(--text-dim);
  margin-top: 0.3rem; display: block;
}

/* === CAULDRON SECTION === */
.cauldron-section {
  background: linear-gradient(135deg, rgba(26,10,46,0.8), rgba(45,27,78,0.4));
  border: 1px solid rgba(251,191,36,0.15);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  margin: 2rem 0;
  position: relative;
}
.cauldron-section .formula {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 1.5rem 0;
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(251,191,36,0.3); }
  50% { text-shadow: 0 0 40px rgba(251,191,36,0.6), 0 0 80px rgba(251,191,36,0.3); }
}

/* === LEADERBOARD === */
.leaderboard {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.leaderboard-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 1rem; align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.3s;
}
.leaderboard-row:hover { background: rgba(251,191,36,0.05); }
.leaderboard-row .rank {
  font-family: 'Cinzel Decorative', serif;
  font-weight: 700; font-size: 1.1rem;
  color: var(--gold);
}
.leaderboard-row .name { font-weight: 600; }
.leaderboard-row .score {
  font-family: 'Fira Code', monospace;
  color: var(--gold); font-size: 0.9rem;
}

/* === ROUND PAGE SPECIFIC === */
.round-hero {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
}
.round-badge {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  border: 1px solid;
  margin-bottom: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.round-hero h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.8rem;
}
.round-hero .narrative {
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 600px; margin: 0 auto;
}

/* Potion cards */
.potion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.potion {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  transition: all 0.3s;
}
.potion.winner {
  border-color: var(--accent, var(--gold));
  box-shadow: 0 0 20px rgba(251,191,36,0.15);
}
.potion .emoji { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.potion h4 { font-family: 'Cinzel Decorative', serif; font-size: 0.95rem; margin-bottom: 0.3rem; }
.potion p { font-size: 0.8rem; color: var(--text-dim); }

/* Funding battle */
.battle {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem; align-items: center;
  margin: 2rem 0;
}
.battle-side { text-align: center; }
.battle-side .count {
  font-family: 'Cinzel Decorative', serif;
  font-size: 3rem; font-weight: 700;
}
.battle .vs {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.5rem; color: var(--text-dim);
}
.believers .count { color: var(--green); }
.challengers .count { color: var(--orange); }

/* Council */
.council-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.council-member {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.3rem;
  border: 1px solid rgba(255,255,255,0.06);
}
.council-member .avatar { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.council-member .member-name { font-weight: 700; margin-bottom: 0.3rem; }
.council-member .vote {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem; padding: 0.2rem 0.5rem;
  border-radius: 4px; display: inline-block; margin-bottom: 0.5rem;
}
.vote-believe { background: rgba(34,197,94,0.15); color: var(--green); }
.vote-challenge { background: rgba(249,115,22,0.15); color: var(--orange); }
.council-member .reasoning { font-size: 0.85rem; color: var(--text-dim); font-style: italic; }

/* Winner announcement */
.winner-announce {
  text-align: center;
  padding: 3rem 2rem;
  margin: 2rem 0;
  border-radius: 20px;
  border: 1px solid;
  position: relative;
  overflow: hidden;
}
.winner-announce::before {
  content: '✨'; position: absolute; font-size: 4rem; opacity: 0.1;
  top: -10px; left: 20px;
}
.winner-announce::after {
  content: '🪄'; position: absolute; font-size: 3rem; opacity: 0.1;
  bottom: -5px; right: 20px;
}
.winner-announce h2 {
  font-family: 'Cinzel Decorative', serif;
}
.winner-announce .winner-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700; margin: 0.5rem 0;
}
.winner-announce .winner-desc {
  color: var(--text-dim);
  font-size: 1rem; max-width: 500px;
  margin: 0 auto;
}

/* Builder log */
.builder-log {
  background: rgba(13,6,24,0.9);
  border-radius: 12px;
  padding: 1.5rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
}
.builder-log .log-line { padding: 0.3rem 0; }
.builder-log .log-line .time { color: var(--text-dim); }
.builder-log .log-line .action { color: var(--green); }

/* Round nav */
.round-nav {
  display: flex; justify-content: space-between;
  padding: 2rem 0; margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.round-nav a {
  color: var(--text-dim); text-decoration: none;
  font-weight: 600; transition: color 0.3s;
  display: flex; align-items: center; gap: 0.5rem;
}
.round-nav a:hover { color: var(--gold); }

/* === FOOTER === */
footer {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  position: relative; z-index: 1;
}
footer .headmistress {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--gold);
}

/* === FADE IN === */
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1; transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero { padding: 4rem 1rem 2rem; }
  .round-hero { padding: 3rem 1rem 2rem; }
  .cauldron-section { padding: 2rem 1rem; }
  .battle { grid-template-columns: 1fr; gap: 1rem; }
  .battle .vs { order: -1; }
  nav .links a { font-size: 0.7rem; padding: 0.2rem 0.4rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* === SPARKLE CURSOR TRAIL (subtle) === */
@keyframes sparkle {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(180deg); opacity: 0; }
}
