/* ==========================================================
   Educollage · página "vuelve pronto"
   Colores tomados del logo. Cambia aquí la paleta completa.
   ========================================================== */
:root {
  --coral: #e8502f;
  --teal:  #17afc7;
  --green: #3aa24a;
  --sun:   #ffc72c;
  --navy:  #24485c;
  --paper: #f3fafb;
}

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

html, body { height: 100%; }

body {
  font-family: "Fredoka", "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
  color: var(--navy);
  background:
    radial-gradient(60vmax 60vmax at 0% 0%,     rgba(23, 175, 199, .16), transparent 60%),
    radial-gradient(50vmax 50vmax at 100% 100%, rgba(232, 80, 47, .13),  transparent 60%),
    radial-gradient(40vmax 40vmax at 100% 0%,   rgba(255, 199, 44, .18), transparent 60%),
    var(--paper);
  overflow: hidden;
  touch-action: none;           /* permite "pintar" con el dedo sin que la página se mueva */
  -webkit-font-smoothing: antialiased;
}

/* Si el navegador no puede quitar el fondo blanco del logo (p. ej. abriendo
   el archivo con file://), usamos fondo blanco para que no se note el recuadro. */
html.solid-bg body { background: #fff; }

/* ---------- Formas flotantes ---------- */
.shapes {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.shape-wrap {
  position: absolute;
  transition: transform .5s ease-out;
  will-change: transform;
}

.shape {
  width: var(--s);
  height: var(--s);
  color: var(--c);
  opacity: .9;
  transform: rotate(var(--r));
  animation: drift var(--d) ease-in-out var(--delay) infinite;
}

.shape svg { display: block; width: 100%; height: 100%; fill: currentColor; }

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--r)); }
  50%      { transform: translate3d(var(--dx), var(--dy), 0) rotate(calc(var(--r) + var(--spin))); }
}

/* ---------- Escenario central ---------- */
.stage {
  --logo: clamp(170px, min(46vh, 84vw), 440px);
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1.25rem;
}

.logo-float {
  width: var(--logo);
  /* el PNG trae mucho aire alrededor: lo recortamos visualmente */
  margin-top: calc(var(--logo) * -.1);
  margin-bottom: calc(var(--logo) * -.2);
  animation: float 5.5s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-14px); }
}

.logo-btn {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  border-radius: 28px;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .18s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.logo-btn:focus-visible { outline: 3px dashed var(--teal); outline-offset: 6px; }

.logo-btn img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;                    /* se muestra cuando main.js termina de preparar el logo */
  transition: opacity .4s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.logo-btn img.is-ready { opacity: 1; }

.logo-btn img.pop { animation: pop .55s cubic-bezier(.3, 1.6, .5, 1); }

@keyframes pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.09, .91) rotate(-2deg); }
  60%  { transform: scale(.96, 1.05) rotate(1.5deg); }
  100% { transform: scale(1); }
}

/* ---------- Titular: tira de papel recortado ---------- */
.title {
  font-size: clamp(1.4rem, 1rem + 2.6vw, 2.7rem);
  font-weight: 600;
  line-height: 1.2;
  max-width: 94vw;
  filter: drop-shadow(0 6px 0 rgba(36, 72, 92, .14));
  transform: rotate(-1.6deg);
}

.strip {
  display: inline-block;
  padding: .4em 1em .45em;
  color: #fff;
  background: var(--coral);
  clip-path: polygon(0 8%, 3% 0, 28% 5%, 61% 0, 100% 6%, 99% 90%, 71% 100%, 38% 94%, 9% 100%, 0 91%);
  letter-spacing: .01em;
}

/* ---------- Subtítulo y palabra que cambia ---------- */
.subtitle {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, .9rem + .8vw, 1.5rem);
  font-weight: 500;
}

.word {
  display: block;
  min-height: 1.3em;
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1.25;
  color: var(--wc, var(--teal));
  transition: opacity .25s ease, transform .25s ease;
}

.word.out { opacity: 0; transform: translateY(.35em) rotate(-3deg); }

/* ---------- Pista de interacción ---------- */
.hint {
  margin-top: 1.1rem;
  font-size: .95rem;
  color: rgba(36, 72, 92, .72);
  animation: nudge 2.4s ease-in-out infinite;
  transition: opacity .4s ease;
}

body.has-played .hint { opacity: 0; animation: none; }

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

/* ---------- Lienzo de confeti ---------- */
#paint {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* ---------- Accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  .logo-float, .shape, .hint { animation: none; }
  .logo-btn, .shape-wrap, .word { transition: none; }
}
