/* =======================================================
   El Río nos Llama — estilos cartoon ilustrados
   ======================================================= */

:root {
  --sky: #BAE6FD;
  --sky-2: #7DD3FC;
  --river: #0EA5E9;
  --river-deep: #0C4A6E;
  --green: #34D399;
  --green-deep: #059669;
  --earth: #D97706;
  --earth-deep: #92400E;
  --sun: #FCD34D;
  --coral: #F87171;
  --cream: #FEF3C7;
  --ink: #0F172A;
  --paper: #FFFFFF;

  --shadow-sm: 0 4px 0 rgba(15,23,42,0.08);
  --shadow-md: 0 10px 30px rgba(2,132,199,0.18), 0 4px 0 rgba(15,23,42,0.06);
  --shadow-lg: 0 20px 50px rgba(2,132,199,0.22);

  --radius: 22px;
  --radius-lg: 32px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 700;
  margin: 0 0 .4em;
  line-height: 1.15;
}

p { margin: 0 0 1em; }

a { color: var(--river-deep); text-decoration: none; }

img, svg { max-width: 100%; display: block; }

/* =====================  NAV  ===================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid #BAE6FD;
}
.nav-logo {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem; font-weight: 700;
  color: var(--river-deep);
}
.nav-links {
  display: flex; gap: 6px;
  list-style: none; padding: 0; margin: 0;
  flex-wrap: wrap;
}
.nav-links a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--river-deep);
  transition: background .2s, transform .2s;
}
.nav-links a:hover {
  background: var(--sky);
  transform: translateY(-2px);
}

/* =====================  HERO  ===================== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 100px 20px 200px;
  background: linear-gradient(180deg, #BAE6FD 0%, #7DD3FC 50%, #38BDF8 100%);
  overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}

.hero-content {
  position: relative;
  z-index: 5;
  max-width: 720px;
  animation: heroIn 1s ease both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  margin: 0;
  text-shadow: 0 6px 0 rgba(12,74,110,0.18);
}
.title-line { display: block; color: #FFFFFF; }
.title-line.accent { color: var(--sun); }

.hero-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  color: #0C4A6E;
  background: rgba(255,255,255,0.6);
  padding: 18px 24px;
  border-radius: var(--radius);
  display: inline-block;
  margin: 24px 0 32px;
}

.btn {
  display: inline-block;
  padding: 16px 32px;
  border-radius: 999px;
  border: none;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 0 #B91C1C, 0 12px 24px rgba(248,113,113,0.4);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #B91C1C, 0 16px 30px rgba(248,113,113,0.5);
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #B91C1C;
}

.hero-cta { animation: bounce 2.4s ease-in-out infinite; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Sol con rayos */
.sun {
  position: absolute;
  top: 60px; right: 80px;
  width: 130px; height: 130px;
  z-index: 2;
}
.sun-core {
  position: absolute; inset: 25%;
  background: var(--sun);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(252,211,77,0.7);
}
.sun-rays {
  position: absolute; inset: 0;
  background:
    conic-gradient(from 0deg,
      var(--sun) 0 8deg, transparent 8deg 45deg,
      var(--sun) 45deg 53deg, transparent 53deg 90deg,
      var(--sun) 90deg 98deg, transparent 98deg 135deg,
      var(--sun) 135deg 143deg, transparent 143deg 180deg,
      var(--sun) 180deg 188deg, transparent 188deg 225deg,
      var(--sun) 225deg 233deg, transparent 233deg 270deg,
      var(--sun) 270deg 278deg, transparent 278deg 315deg,
      var(--sun) 315deg 323deg, transparent 323deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 32%, #000 32%, #000 50%, transparent 50%);
          mask: radial-gradient(circle, transparent 32%, #000 32%, #000 50%, transparent 50%);
  animation: spin 18s linear infinite;
  opacity: .85;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Nubes */
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  filter: drop-shadow(0 6px 8px rgba(2,132,199,0.15));
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; background: #fff; border-radius: 50%;
}
.cloud-1 {
  width: 90px; height: 90px; top: 110px; left: -120px;
  animation: drift 38s linear infinite;
}
.cloud-1::before { width: 60px; height: 60px; top: 20px; left: -40px; }
.cloud-1::after  { width: 50px; height: 50px; top: 30px; left: 70px; }

.cloud-2 {
  width: 70px; height: 70px; top: 200px; left: -200px;
  animation: drift 50s linear infinite;
  animation-delay: -15s;
}
.cloud-2::before { width: 45px; height: 45px; top: 18px; left: -32px; }
.cloud-2::after  { width: 40px; height: 40px; top: 24px; left: 55px; }

.cloud-3 {
  width: 100px; height: 100px; top: 60px; left: -300px;
  animation: drift 60s linear infinite;
  animation-delay: -30s;
}
.cloud-3::before { width: 70px; height: 70px; top: 22px; left: -50px; }
.cloud-3::after  { width: 55px; height: 55px; top: 32px; left: 80px; }

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 320px)); }
}

/* Gotas */
.drops { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.drop {
  position: absolute;
  top: -30px;
  left: var(--x);
  width: 10px; height: 14px;
  background: #38BDF8;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: rotate(180deg);
  opacity: .7;
  animation: fall var(--dur) linear infinite;
  animation-delay: var(--d);
  filter: drop-shadow(0 2px 2px rgba(2,132,199,0.3));
}
@keyframes fall {
  0%   { transform: translateY(0) rotate(180deg); opacity: 0; }
  10%  { opacity: .9; }
  90%  { opacity: .9; }
  100% { transform: translateY(78vh) rotate(180deg); opacity: 0; }
}

/* Olas */
.waves {
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 200px;
  z-index: 3;
}
.waves svg { width: 100%; height: 100%; }
.wave-1 { fill: #38BDF8; opacity: .8; animation: waveX 9s ease-in-out infinite; }
.wave-2 { fill: #0EA5E9; opacity: .85; animation: waveX 12s ease-in-out infinite reverse; }
.wave-3 { fill: #0284C7; }
@keyframes waveX {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-30px); }
}

/* Peces */
.fish {
  position: absolute;
  font-size: 2.4rem;
  bottom: 40px;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.2));
  animation: swim 14s linear infinite;
}
.fish-1 { animation-duration: 16s; bottom: 60px; }
.fish-2 { animation-duration: 22s; animation-delay: -8s; bottom: 30px; font-size: 2rem; }
.fish-3 { animation-duration: 19s; animation-delay: -4s; bottom: 80px; font-size: 2.2rem; }

@keyframes swim {
  0%   { left: -8%;  transform: scaleX(1)  translateY(0); }
  49%  {              transform: scaleX(1)  translateY(-10px); }
  50%  { left: 108%; transform: scaleX(-1) translateY(-10px); }
  99%  {              transform: scaleX(-1) translateY(0); }
  100% { left: -8%;  transform: scaleX(1)  translateY(0); }
}

/* =====================  SECCIONES  ===================== */
.section {
  padding: 90px 20px;
  position: relative;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
}
.section-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  text-align: center;
  margin-bottom: 18px;
}
.section-lead {
  text-align: center;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  max-width: 760px;
  margin: 0 auto 50px;
}

.section-light { background: var(--cream); }
.section-blue {
  background: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 100%);
}
.section-blue-deep {
  background: linear-gradient(180deg, #0EA5E9 0%, #0C4A6E 100%);
  color: #F0F9FF;
}
.section-blue-deep .section-title,
.section-blue-deep .section-lead { color: #fff; }

.section-coral {
  background: linear-gradient(180deg, #FEE2E2 0%, #FECACA 100%);
}
.section-green {
  background: linear-gradient(180deg, #D1FAE5 0%, #A7F3D0 100%);
}
.section-game {
  background: linear-gradient(180deg, #FEF3C7 0%, #FDE68A 100%);
}

/* Ilustración del río */
.river-illustration {
  max-width: 800px;
  margin: 30px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 4px solid #fff;
}

/* =====================  TARJETAS  ===================== */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease;
  border: 3px solid transparent;
}
.card:hover {
  transform: translateY(-8px) rotate(-.5deg);
  box-shadow: var(--shadow-lg);
}
.card h3 { font-size: 1.3rem; }
.card p  { font-size: .98rem; margin: 0; }

/* Río Turbio */
.turbio-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.card-fact { border-color: var(--sky); }
.card-icon {
  font-size: 3.2rem;
  margin-bottom: 8px;
  display: inline-block;
  animation: tilt 4s ease-in-out infinite;
}
@keyframes tilt {
  0%, 100% { transform: rotate(-6deg); }
  50%      { transform: rotate(6deg); }
}

/* Causas */
.cause-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card-cause { border-color: #FCA5A5; }
.cause-emoji {
  font-size: 3.8rem;
  margin-bottom: 8px;
  display: inline-block;
  transition: transform .3s;
}
.card-cause:hover .cause-emoji {
  transform: scale(1.2) rotate(-8deg);
}

/* Consecuencias */
.consec-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card-consec { border-color: var(--coral); }
.consec-icon {
  font-size: 3.5rem;
  margin-bottom: 6px;
  animation: pulse 2.4s ease-in-out infinite;
  display: inline-block;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* Reciclar — preview de bins */
.bins-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  margin-top: 30px;
}
.bin-mini {
  background: var(--bin);
  color: #fff;
  width: 120px;
  border-radius: var(--radius);
  padding: 18px 8px;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,0.15);
  transition: transform .2s;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
}
.bin-mini span { font-size: 2.4rem; display: block; margin-bottom: 4px; }
.bin-mini p    { margin: 0; font-size: 1.1rem; }
.bin-mini:hover { transform: translateY(-6px) rotate(-2deg); }

/* =====================  JUEGO  ===================== */
.game-board {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: var(--shadow-lg);
  border: 4px solid #FBBF24;
}
.game-hud {
  display: flex; justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
}
.hud-item {
  background: var(--cream);
  padding: 8px 18px;
  border-radius: 999px;
  border: 3px solid var(--sun);
}

.game-stage {
  display: flex; flex-direction: column;
  align-items: center; gap: 30px;
}

.trash-zone {
  width: 100%;
  min-height: 140px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #E0F2FE, #BAE6FD);
  border-radius: var(--radius);
  border: 3px dashed #0EA5E9;
  position: relative;
}

.trash-item {
  font-size: 4rem;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
  transition: transform .2s;
  display: inline-block;
  padding: 8px;
}
.trash-item:hover { transform: scale(1.1) rotate(-4deg); }
.trash-item.dragging {
  cursor: grabbing;
  transform: scale(1.2);
  position: fixed;
  z-index: 1000;
  pointer-events: none;
}

.bins {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
}
.bin {
  background: var(--bin);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 8px 24px;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,0.18);
  transition: transform .2s, box-shadow .2s;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  min-height: 140px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.bin-emoji { font-size: 2.6rem; margin-bottom: 6px; }
.bin-label { font-size: 1.1rem; }
.bin.drag-over {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 14px 0 rgba(0,0,0,0.18), 0 20px 30px rgba(0,0,0,.15);
}
.bin.shake { animation: shake .4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-10px) rotate(-3deg); }
  40%     { transform: translateX(10px) rotate(3deg); }
  60%     { transform: translateX(-8px) rotate(-2deg); }
  80%     { transform: translateX(8px) rotate(2deg); }
}
.bin.success { animation: pop .5s ease; }
@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); box-shadow: 0 14px 0 rgba(16,185,129,0.5); }
  100% { transform: scale(1); }
}

.game-msg {
  text-align: center;
  margin-top: 22px;
  font-size: 1.1rem;
  font-weight: 700;
  min-height: 1.6em;
  transition: color .2s;
}
.game-msg.ok    { color: var(--green-deep); }
.game-msg.fail  { color: #B91C1C; }

/* Pantalla de victoria */
.win-screen {
  position: fixed; inset: 0;
  background: rgba(12,74,110,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn .3s ease;
}
.win-screen[hidden] { display: none; }
.win-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 5px solid var(--sun);
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
  position: relative;
  z-index: 2;
}
.win-emoji { font-size: 5rem; animation: bounce 1.2s infinite; }
.win-card h3 { font-size: 2rem; color: var(--river-deep); }
.win-card p  { font-size: 1.2rem; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn  {
  from { transform: scale(.5) rotate(-10deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* Confetti */
.confetti-piece {
  position: fixed;
  width: 10px; height: 16px;
  top: -20px;
  z-index: 999;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* =====================  TIPS  ===================== */
.tips-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card-tip {
  border-color: var(--sun);
  position: relative;
  padding-top: 38px;
}
.tip-num {
  position: absolute;
  top: -22px; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 48px;
  background: var(--sun);
  color: var(--river-deep);
  border-radius: 50%;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 #B45309;
}

/* =====================  EQUIPO  ===================== */
.team-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 40px;
}
.team-card {
  background: rgba(255,255,255,0.12);
  border: 3px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  padding: 28px 14px;
  text-align: center;
  transition: transform .3s, background .3s;
  backdrop-filter: blur(6px);
}
.team-card:hover {
  transform: translateY(-8px) rotate(1deg);
  background: rgba(255,255,255,0.22);
}
.team-avatar { font-size: 4rem; margin-bottom: 6px; }
.team-card h3 { color: #fff; font-size: 1.2rem; margin: 0; }

.team-meta {
  text-align: center;
  background: rgba(255,255,255,0.12);
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: var(--radius);
  padding: 20px;
}
.team-meta p { margin: 4px 0; }

/* =====================  FOOTER  ===================== */
.footer {
  background: #082F49;
  color: #BAE6FD;
  text-align: center;
  padding: 24px 16px;
  font-size: .95rem;
}

/* =====================  REVEAL  ===================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* =====================  RESPONSIVE  ===================== */
@media (max-width: 760px) {
  .nav { padding: 10px 16px; flex-direction: column; gap: 6px; }
  .nav-links { gap: 2px; justify-content: center; }
  .nav-links a { padding: 4px 10px; font-size: .9rem; }
  .nav-logo { font-size: 1.2rem; }

  .hero { padding-top: 130px; padding-bottom: 160px; }
  .sun  { width: 90px; height: 90px; top: 100px; right: 20px; }

  .bins {
    grid-template-columns: repeat(2, 1fr);
  }
  .trash-item { font-size: 3.2rem; }
  .section { padding: 70px 16px; }
}

@media (max-width: 420px) {
  .nav-links a { padding: 3px 8px; font-size: .82rem; }
  .hero-subtitle { font-size: 1rem; padding: 14px 16px; }
}

/* =====================  ACCESIBILIDAD  ===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
