/* =============================================
   ES UN 10 PERO… — Estilos
   ============================================= */

:root {
  --bg:        #0f0520;
  --primary:   #FF6B9D;
  --secondary: #9B5DE5;
  --gold:      #FFD93D;
  --text:      #fff;
  --muted:     rgba(255, 255, 255, 0.6);
  --radius:    14px;
  --tap:       54px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 15% 5%,  rgba(155, 93, 229, 0.55) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 8%,  rgba(255, 107, 157, 0.45) 0%, transparent 42%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 217, 61, 0.25) 0%, transparent 50%),
    linear-gradient(160deg, #0f0520 0%, #1a0533 100%);
  overflow-x: hidden;
}

/* =============================================
   APP SHELL
   ============================================= */

.app {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  margin-bottom: 1.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms, background 160ms, border-color 160ms;
}

.back-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.screen     { display: none; }
.screen.active { display: block; }

/* =============================================
   HERO
   ============================================= */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 5rem);
  text-align: center;
  gap: 1.2rem;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(3.2rem, 18vw, 6rem);
  font-weight: 900;
  line-height: 0.88;
}

.highlight {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.3em;
}

.pero-title {
  display: inline-block;
  color: var(--secondary);
  font-style: italic;
  font-size: 0.85em;
  opacity: 0.9;
}

.desc {
  max-width: 26rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* =============================================
   BOTONES
   ============================================= */

.btn-primary {
  min-height: var(--tap);
  padding: 0.9rem 2.8rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(255, 107, 157, 0.45);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn-primary:hover  { transform: translateY(-3px); box-shadow: 0 10px 36px rgba(255, 107, 157, 0.62); filter: brightness(1.06); }
.btn-primary:active { transform: translateY(0);    filter: brightness(0.96); }

.btn-draw {
  min-height: var(--tap);
  padding: 0.85rem 2.2rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn-draw:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.17); border-color: rgba(255, 255, 255, 0.4); }

/* =============================================
   GAME AREA
   ============================================= */

.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 5rem);
  gap: 2.4rem;
}

/* =============================================
   CARTA — flip 3D
   ============================================= */

.card-scene {
  perspective: 900px;
  width: min(75vw, 260px);
  aspect-ratio: 2.5 / 3.5;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.6));
}

.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.72s cubic-bezier(0.4, 0.2, 0.2, 1.2);
}

.card.flipped { transform: rotateY(180deg); }

.card.glowing {
  filter: drop-shadow(0 0 26px rgba(255, 107, 157, 0.75));
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  backface-visibility: hidden;
  overflow: hidden;
  background: #fff;
}

.card-back  { transform: rotateY(0deg); }
.card-front { transform: rotateY(180deg); }

.card-face img {
  z-index: auto;
  width: 100%;
  height: 100%;
  object-fit: none;
  display: block;
}

/* Suspense: la carta "flota" antes de girar */
.card.waiting {
  animation: cardWait 0.55s ease-in-out infinite alternate;
}

@keyframes cardWait {
  from { transform: translateY(0)   rotateZ(0deg) scale(1); }
  to   { transform: translateY(-8px) rotateZ(2deg) scale(1.03); }
}

/* =============================================
   UTILIDADES
   ============================================= */

.hidden { display: none !important; }

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

@media (min-width: 520px) {
  .app { padding: 1.5rem; }
  .card-scene { width: min(65vw, 280px); }
}
