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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Lilita One', 'Arial Rounded MT Bold', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#escena {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* =============== TEMA ACUARIO =============== */
body.mar {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.35), transparent 55%),
    linear-gradient(180deg, #4fc3f7 0%, #0288d1 45%, #01579b 80%, #002f5f 100%);
}

/* Rayos de luz que entran desde la superficie */
body.mar #escena::before {
  content: '';
  position: absolute;
  inset: -20% -10% 0;
  background: repeating-linear-gradient(
    100deg,
    transparent 0 60px,
    rgba(255, 255, 255, 0.07) 60px 110px,
    transparent 110px 200px
  );
  animation: rayos 9s ease-in-out infinite alternate;
}

@keyframes rayos {
  from { transform: translateX(-40px) skewX(-4deg); opacity: 0.6; }
  to   { transform: translateX(40px) skewX(4deg);   opacity: 1; }
}

.pez {
  position: absolute;
  left: 0;
  animation: nadar linear infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

.pez span {
  display: inline-block;
  scale: -1 1; /* los emojis miran a la izquierda: los giramos para ir a la derecha */
  animation: menear 1.2s ease-in-out infinite alternate;
}

.pez.izq {
  animation-direction: reverse;
}

.pez.izq span {
  scale: 1 1;
}

@keyframes nadar {
  from { transform: translateX(-15vw); }
  to   { transform: translateX(110vw); }
}

@keyframes menear {
  from { translate: 0 -10px; rotate: -4deg; }
  to   { translate: 0 10px;  rotate: 4deg; }
}

.burbuja {
  position: absolute;
  bottom: -30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.05) 60%);
  animation: subir linear infinite;
}

@keyframes subir {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(20px, -55vh); }
  100% { transform: translate(-10px, -115vh); opacity: 0.2; }
}

.alga {
  position: absolute;
  bottom: 30px;
  width: 16px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(90deg, #1b5e20, #43a047, #1b5e20);
  transform-origin: bottom center;
  animation: mecer 4s ease-in-out infinite alternate;
}

@keyframes mecer {
  from { transform: rotate(-8deg); }
  to   { transform: rotate(8deg); }
}

.arena {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50px;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.12) 2px, transparent 3px) 0 0 / 22px 18px,
    linear-gradient(180deg, #e8c98a, #c9a25c);
  border-radius: 50% 50% 0 0 / 30px 30px 0 0;
}

/* =============== TEMA PASAS =============== */
body.pasas {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 240, 200, 0.6), transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(140, 60, 90, 0.35), transparent 45%),
    linear-gradient(160deg, #f7e1b5 0%, #e0a96d 55%, #a0522d 100%);
}

/* Patrón de "caja de pasas" */
body.pasas #escena::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(110, 40, 60, 0.06) 0 20px,
    transparent 20px 40px
  );
}

.pasa {
  position: absolute;
  top: -80px;
  border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
  background: radial-gradient(circle at 30% 30%, #9a5b4a, #5a2a22 55%, #2e120d);
  box-shadow: inset -3px -4px 6px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(60, 20, 10, 0.35);
  animation: caer linear infinite;
}

/* Arrugas de la pasa */
.pasa::before {
  content: '';
  position: absolute;
  inset: 15%;
  border-radius: inherit;
  background: repeating-linear-gradient(
    115deg,
    transparent 0 4px,
    rgba(0, 0, 0, 0.28) 4px 6px
  );
}

/* Brillito */
.pasa::after {
  content: '';
  position: absolute;
  top: 18%;
  left: 22%;
  width: 22%;
  height: 16%;
  border-radius: 50%;
  background: rgba(255, 220, 200, 0.45);
}

@keyframes caer {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(calc(100vh + 160px)) rotate(540deg); }
}

.uva {
  position: absolute;
  font-size: 46px;
  opacity: 0.5;
  animation: flotar 5s ease-in-out infinite alternate;
}

@keyframes flotar {
  from { transform: translateY(-15px) rotate(-10deg); }
  to   { transform: translateY(15px) rotate(10deg); }
}

/* =============== TEXTO CENTRAL =============== */
#titulo {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35em;
  font-size: clamp(64px, 16vw, 220px);
  font-weight: 400;
  line-height: 1;
  padding: 0 16px;
}

.palabra {
  cursor: pointer;
  transition: transform 0.2s;
}

.palabra:hover {
  transform: scale(1.08) rotate(-2deg);
}

.letra {
  display: inline-block;
  animation: ondular 1.6s ease-in-out infinite;
}

@keyframes ondular {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.12em); }
}

body.mar .letra {
  color: #e1f5fe;
  text-shadow:
    0 0.04em 0 #0277bd,
    0 0.08em 0 #01579b,
    0 0.12em 0.2em rgba(0, 0, 0, 0.4);
}

body.pasas .letra {
  color: #6d2b3d;
  text-shadow:
    0 0.04em 0 #fff3d6,
    0 0.08em 0 #3e1420,
    0 0.12em 0.2em rgba(60, 20, 10, 0.4);
}

#pista {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  font-size: 18px;
  letter-spacing: 1px;
  opacity: 0.8;
}

body.mar #pista   { color: #e1f5fe; }
body.pasas #pista { color: #5a2a22; }

/* =============== BOTÓN =============== */
.boton {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-top: 28px;
  padding: 14px 40px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 28px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.boton:hover {
  transform: translateY(-3px) scale(1.05);
}

.boton:active {
  transform: translateY(2px);
}

body.mar .boton {
  color: #01579b;
  background: #e1f5fe;
  box-shadow: 0 6px 0 #0277bd, 0 10px 20px rgba(0, 0, 0, 0.3);
}

body.pasas .boton {
  color: #fff3d6;
  background: #6d2b3d;
  box-shadow: 0 6px 0 #3e1420, 0 10px 20px rgba(60, 20, 10, 0.3);
}

/* Onda expansiva del click */
.onda {
  position: fixed;
  z-index: 3;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  pointer-events: none;
  animation: expandir 0.9s ease-out forwards;
}

@keyframes expandir {
  to { transform: scale(18); opacity: 0; }
}

/* =============== OLA DE TRANSICIÓN =============== */
#ola {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 100vh;
  z-index: 10;
  background: linear-gradient(180deg, #29b6f6, #0277bd);
  transform: translateY(130%);
  pointer-events: none;
}

#ola .cresta {
  position: absolute;
  left: 0;
  width: 100%;
  height: 120px;
  fill: #29b6f6;
}

#ola .cresta.arriba {
  top: -118px;
}

#ola .cresta.abajo {
  bottom: -118px;
  fill: #0277bd;
  transform: scaleY(-1);
}

#ola.activa {
  animation: barrer 1.7s cubic-bezier(0.6, 0, 0.4, 1) forwards;
}

@keyframes barrer {
  0%   { transform: translateY(130%); }
  45%  { transform: translateY(0); }
  55%  { transform: translateY(0); }
  100% { transform: translateY(-130%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01s !important;
  }
}
