/* Portada de entrada. Concepto: el logo de MODO RANDOM es la cara "4" de un dado:
   el dado cae girando, cae en 4 y la app se "tira" a jugar. Fondo nocturno con objetos de juego
   flotando a distintas profundidades. Solo transform/opacity para que vuele en Android. */
.portada { display: none; }
html.con-portada body { overflow: hidden; }
html.con-portada .portada {
  position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: 1fr auto; overflow: hidden;
  padding: calc(20px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background:
    radial-gradient(70% 45% at 50% 30%, rgba(139, 61, 255, .45), transparent 70%),
    radial-gradient(60% 40% at 85% 95%, rgba(255, 122, 26, .28), transparent 70%),
    radial-gradient(55% 40% at 5% 80%, rgba(255, 61, 154, .22), transparent 70%),
    #070a1c;
  color: #f1f3ff;
}
.portada.saliendo { animation: pt-sale .5s cubic-bezier(.6, 0, .4, 1) forwards; pointer-events: none; }
@keyframes pt-sale { to { opacity: 0; transform: scale(1.08); filter: blur(6px); } }

/* Objetos flotando: tres planos de profundidad */
.pt-cielo { position: absolute; inset: 0; pointer-events: none; }
.pt-obj {
  position: absolute; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px;
  font-size: 26px; font-family: "Unbounded", system-ui, sans-serif; font-weight: 800; color: #b79bff;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(183, 155, 255, .22);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .8); opacity: 0;
  animation: pt-aparece .8s ease-out forwards, pt-flota 7s ease-in-out infinite alternate;
}
.pt-obj.o1 { top: 9%; left: 8%; transform: rotate(-14deg); animation-delay: .9s, 0s; }
.pt-obj.o2 { top: 13%; right: 9%; width: 62px; height: 62px; transform: rotate(10deg); animation-delay: 1s, -2s; }
.pt-obj.o3 { top: 44%; left: -10px; width: 44px; height: 44px; font-size: 20px; filter: blur(1.5px); animation-delay: 1.1s, -4s; }
.pt-obj.o4 { top: 40%; right: -8px; width: 46px; height: 46px; font-size: 21px; filter: blur(1px); animation-delay: 1.15s, -1s; }
.pt-obj.o5 { bottom: 24%; left: -8px; width: 40px; height: 40px; font-size: 18px; filter: blur(2px); animation-delay: 1.2s, -3s; }
.pt-obj.o6 { top: 25%; left: 28%; width: 34px; height: 34px; font-size: 18px; color: #ff9a3d; filter: blur(2.5px); animation-delay: 1.25s, -5s; }
.pt-obj.o7 { top: 6%; left: 52%; width: 30px; height: 30px; font-size: 16px; color: #22e1ff; filter: blur(2px); animation-delay: 1.3s, -2.5s; }
.pt-obj.o8 { top: 56%; right: 3%; width: 48px; height: 48px; font-size: 22px; animation-delay: 1.35s, -6s; }
.pt-obj.o9 { top: 30%; right: 27%; width: 28px; height: 28px; font-size: 14px; color: #ff3d9a; filter: blur(3px); animation-delay: 1.4s, -1.5s; }
@keyframes pt-aparece { to { opacity: 1; } }
@keyframes pt-flota { from { translate: 0 0; } to { translate: 0 -16px; } }

/* Centro */
.pt-centro { position: relative; display: grid; justify-items: center; align-content: center; text-align: center; gap: 12px; min-height: 0; }

/* El dado: cae girando y queda en la cara 4 (el logo) */
.pt-dado { position: relative; width: clamp(104px, 30vw, 136px); aspect-ratio: 1; margin-bottom: 10px; animation: pt-cae 1.1s cubic-bezier(.25, 1.25, .45, 1) both, pt-respira 4s ease-in-out 1.6s infinite; }
.pt-cara {
  position: absolute; inset: 0; border-radius: 28%; transform: rotate(-6deg);
  background: linear-gradient(140deg, #9a4dff 0%, #6a3bff 45%, #2a3cff 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .28), inset 0 -10px 22px rgba(10, 10, 60, .45), 0 26px 50px -18px rgba(139, 61, 255, .95);
}
.pt-cara i { position: absolute; width: 22%; height: 22%; border-radius: 50%; background: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); transform: scale(0); animation: pt-punto .35s cubic-bezier(.2, 1.8, .4, 1) forwards; }
.pt-cara .p1 { top: 22%; left: 22%; animation-delay: .95s; }
.pt-cara .p2 { top: 22%; right: 22%; background: #ff7a1a; animation-delay: 1.35s; }
.pt-cara .p3 { bottom: 22%; left: 22%; animation-delay: 1.05s; }
.pt-cara .p4 { bottom: 22%; right: 22%; animation-delay: 1.15s; }
.pt-halo { position: absolute; inset: -22%; border-radius: 50%; background: radial-gradient(circle, rgba(139, 61, 255, .55), transparent 65%); z-index: -1; animation: pt-halo 4s ease-in-out 1.6s infinite; }
@keyframes pt-cae {
  0% { transform: translateY(-60vh) rotate(-540deg) scale(.6); opacity: 0; }
  60% { opacity: 1; }
  78% { transform: translateY(8px) rotate(8deg) scale(1.04); }
  100% { transform: none; opacity: 1; }
}
@keyframes pt-punto { to { transform: scale(1); } }
@keyframes pt-respira { 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes pt-halo { 50% { opacity: .55; transform: scale(1.12); } }

.pt-nombre { display: grid; gap: 0; font-family: "Unbounded", system-ui, sans-serif; font-weight: 800; line-height: .95; letter-spacing: -0.035em; }
.pt-modo { font-size: clamp(30px, 9vw, 44px); color: #fff; opacity: 0; animation: pt-sube .6s cubic-bezier(.2, .9, .2, 1) 1.3s forwards; }
.pt-random {
  font-size: clamp(44px, 14.5vw, 72px); opacity: 0; animation: pt-sube .6s cubic-bezier(.2, .9, .2, 1) 1.42s forwards;
  background: linear-gradient(95deg, #b98cff 0%, #ff3d9a 50%, #ff7a1a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes pt-sube { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.pt-lema { font-family: "Unbounded", system-ui, sans-serif; font-weight: 700; font-size: clamp(15px, 4.6vw, 19px); letter-spacing: -0.01em; margin-top: 6px; }
.pt-lema span { display: inline-block; opacity: 0; animation: pt-sube .5s ease-out forwards; }
.pt-lema span:nth-child(1) { animation-delay: 1.65s; }
.pt-lema span:nth-child(2) { color: #b98cff; animation-delay: 1.8s; }
.pt-lema span:nth-child(3) { color: #ff9a3d; animation-delay: 1.95s; }
.pt-texto { max-width: 30ch; color: #aab1dc; font-size: 15px; line-height: 1.45; opacity: 0; animation: pt-sube .5s ease-out 2.1s forwards; }

/* Lo de hoy */
.pt-hoy { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; min-height: 34px; }
.pt-hoy li {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(183, 155, 255, .25); opacity: 0; animation: pt-sube .45s ease-out forwards;
}
.pt-hoy li:nth-child(1) { animation-delay: 2.2s; } .pt-hoy li:nth-child(2) { animation-delay: 2.3s; } .pt-hoy li:nth-child(3) { animation-delay: 2.4s; }
.pt-hoy li.vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2ee6a0; box-shadow: 0 0 0 3px rgba(46, 230, 160, .25); }

/* Acciones */
.pt-acciones { position: relative; display: grid; justify-items: center; gap: 10px; width: min(420px, 100%); margin: 0 auto; opacity: 0; animation: pt-sube .55s ease-out 1.9s forwards; }
.pt-entrar {
  position: relative; overflow: hidden; width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 22px; cursor: pointer; color: #fff;
  font: 800 15px/1 "Unbounded", system-ui, sans-serif; letter-spacing: .02em;
  background: linear-gradient(100deg, #8b3dff 0%, #c43bd6 38%, #ff3d9a 62%, #ff7a1a 100%);
  box-shadow: 0 18px 40px -14px rgba(255, 61, 154, .85), inset 0 2px 0 rgba(255, 255, 255, .25);
  transition: transform .12s ease, box-shadow .2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pt-entrar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.pt-entrar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); animation: pt-brillo 3.2s ease-in-out 2.6s infinite; }
@keyframes pt-brillo { 0% { left: -60%; } 35%, 100% { left: 130%; } }
.pt-entrar:hover svg { transform: translateX(4px); }
.pt-entrar:active { transform: scale(.96); box-shadow: 0 8px 20px -10px rgba(255, 61, 154, .9); }
.pt-entrar:focus-visible, .pt-instalar:focus-visible, #pt-ios-ok:focus-visible { outline: 3px solid #22e1ff; outline-offset: 3px; }
.pt-instalar {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border-radius: 18px; cursor: pointer;
  font: 700 13px/1 "Unbounded", system-ui, sans-serif; letter-spacing: .03em; color: #f1f3ff;
  background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(183, 155, 255, .45); transition: transform .12s, background .2s;
}
.pt-instalar[hidden] { display: none; }
.pt-instalar svg { width: 20px; height: 20px; fill: none; stroke: #ff9a3d; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pt-instalar:active { transform: scale(.96); background: rgba(255, 255, 255, .12); }
.pt-ios { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 2; box-shadow: 0 -20px 50px -10px rgba(0, 0, 0, .8); width: 100%; text-align: left; padding: 14px 16px; border-radius: 18px; background: rgba(20, 26, 66, .95); border: 1px solid rgba(183, 155, 255, .4); font-size: 14px; line-height: 1.45; animation: pt-sube .3s ease-out; }
.pt-ios ol { margin: 8px 0 12px 20px; display: grid; gap: 4px; color: #d6daf5; }
.pt-ico-comp { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, .12); font-size: 13px; }
#pt-ios-ok { width: 100%; min-height: 44px; border-radius: 14px; border: 0; cursor: pointer; font-weight: 700; color: #070a1c; background: #f1f3ff; }
.pt-confianza { font-size: 12.5px; color: #8f97c6; letter-spacing: .02em; }

@media (max-height: 640px) {
  .pt-dado { width: 88px; margin-bottom: 4px; }
  .pt-texto { display: none; }
  .pt-centro { gap: 8px; }
}
@media (min-width: 760px) { .pt-obj { width: 72px; height: 72px; font-size: 34px; } }
@media (prefers-reduced-motion: reduce) {
  .portada *, .portada:not(.saliendo) { animation: none !important; }
  .pt-obj, .pt-modo, .pt-random, .pt-lema span, .pt-texto, .pt-hoy li, .pt-acciones { opacity: 1 !important; }
  .pt-cara i { transform: none !important; }
  .portada.saliendo { animation: pt-sale .01ms forwards !important; }
  .pt-entrar::after { display: none; }
}
