/* ============================================================
   ¿Qué Tanto Me Conoces? · Amor y Amistad
   Candy Romance theme — estilos compartidos
   ============================================================ */

@layer base {
  html, body { margin: 0; padding: 0; }
  body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
  main > :first-child { margin-top: 0 !important; }
  main > :last-child { margin-bottom: 0 !important; }
}

::-webkit-scrollbar { display: none; }
html { scrollbar-width: none; }

#hearts-bg { z-index: 0; }
#hearts-bg ~ * { position: relative; z-index: 1; }

.tnums { font-variant-numeric: tabular-nums; }

/* =========================== Fun animations =========================== */

@keyframes heartFloat {
  0%   { transform: translateY(105vh) scale(.4) rotate(-10deg); opacity: 0; }
  10%  { opacity: .85; }
  90%  { opacity: .6; }
  100% { transform: translateY(-12vh) scale(1.1) rotate(12deg); opacity: 0; }
}
.heart-float {
  position: absolute;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  line-height: 1;
  animation: heartFloat linear infinite;
}

@keyframes popIn {
  0%   { transform: scale(.55); opacity: 0; }
  70%  { transform: scale(1.07); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.pop-in { animation: popIn .55s cubic-bezier(.22, 1.2, .36, 1) both; }

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-14px); }
  40% { transform: translateX(12px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(6px); }
}
.shake { animation: shakeX .55s ease both; }

@keyframes goodPulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.good-pulse { animation: goodPulse .5s ease both; }

@keyframes flipReveal {
  0%   { transform: rotateX(92deg); opacity: 0; }
  100% { transform: rotateX(0); opacity: 1; }
}
.flip-reveal { animation: flipReveal .6s cubic-bezier(.22, 1.2, .36, 1) both; transform-origin: center center; perspective: 800px; }

@keyframes stageZoom {
  from { transform: scale(1.07); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.stage-zoom { animation: stageZoom .5s ease both; }

@keyframes bounceSmooth {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.bounce-smooth { animation: bounceSmooth 2.4s ease-in-out infinite; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  30%      { transform: rotate(-7deg); }
  70%      { transform: rotate(7deg); }
}
.wiggle { animation: wiggle .7s ease infinite; }

@keyframes floatUp {
  0%   { transform: translateY(0); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(-90px); opacity: 0; }
}
.float-up { animation: floatUp 1.4s ease-out forwards; }

@keyframes shine {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.shine-text {
  background: linear-gradient(90deg, #fff, #ffd9dd, #fff, #ffd9dd);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 3.5s linear infinite;
}

/* =========================== Confetti =========================== */

#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -24px;
  will-change: transform, opacity;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translate3d(0, -24px, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--dx, 60px), 106vh, 0) rotate(var(--rot, 720deg)); opacity: .55; }
}

/* =========================== Toast =========================== */

#app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 16px);
  z-index: 90;
  background: #372e31;
  color: #fcedf0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 9999px;
  box-shadow: 0 12px 30px -8px rgba(64, 0, 15, .5);
  opacity: 0;
  pointer-events: none;
  transition: all .3s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
}
#app-toast.show { transform: translate(-50%, 0); opacity: 1; }

/* =========================== Sala en vivo (Kahoot!) =========================== */

#room-panel { animation: popIn .5s cubic-bezier(.22, 1.2, .36, 1) both; }

@keyframes glowPin {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 183, 3, .55); }
  50%      { box-shadow: 0 0 22px 6px rgba(255, 183, 3, .35); }
}
#room-code { animation: glowPin 2.4s ease-in-out infinite; }
#watch-pin  { letter-spacing: .18em; }

/* =========================== Giant fullscreen trivia =========================== */

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background-color .7s ease;
}
.giant-text {
  font-size: clamp(1.9rem, 7.5vw, 6.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.giant-answer {
  font-size: clamp(1.6rem, 6vw, 5.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

/* =========================== tactile buttons (springy candy) =========================== */

.btn-pop {
  box-shadow: 0 5px 0 rgba(0, 0, 0, .18);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-pop:hover { filter: brightness(1.06); }
.btn-pop:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .18); }

.card-hover { transition: transform .18s ease, box-shadow .18s ease; }
.card-hover:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 20px 40px -14px rgba(89, 13, 34, .22); }

/* =========================== Red high-contrast mode (shared) =========================== */

body.dark-red-mode {
  background-color: #590d22 !important;
  color: #fff8f8 !important;
}
body.dark-red-mode .candy-panel {
  background-color: #480616 !important;
  border: 1px solid rgba(255, 178, 184, .25) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .5) !important;
}
body.dark-red-mode .candy-ink { color: #ffffff !important; }
body.dark-red-mode .candy-mut { color: #ffdadb !important; }
body.dark-red-mode .candy-soft { background-color: #38040f !important; border-color: rgba(255, 178, 184, .25) !important; }
body.dark-red-mode input,
body.dark-red-mode textarea,
body.dark-red-mode select {
  background-color: #38040f !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 178, 184, .3) !important;
}
body.dark-red-mode input::placeholder,
body.dark-red-mode textarea::placeholder { color: rgba(255, 218, 219, .6) !important; }
body.dark-red-mode .candy-pill {
  background-color: #38040f !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 178, 184, .2) !important;
}
body.dark-red-mode .candy-pill-on {
  background-color: #da3054 !important;
  color: #ffffff !important;
  border-color: #ffb2b8 !important;
}
body.dark-red-mode .candy-on-primary { background-color: #da3054 !important; color: #ffffff !important; }