@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&display=swap');

:root {
  --font-banner: 'comic sans ms';
}

body {
  background-image: url('../assets/images/fondo.png');
  background-size: cover;
  background-attachment: fixed;
}

.numero-especial {
  font-family: "Caveat", cursive !important;
  font-size: larger;
  font-optical-sizing: auto !important;
  font-weight: 700 !important;
  font-style: normal !important;
  margin-left: -10px !important;
  -webkit-text-stroke: 1px ;
  margin-left: 2px !important;
  margin-right: 2px !important;
}
.navbar-custom {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 5px dashed var(--color-primary);
  border-radius: 0 0 2.5rem 2.5rem;
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--color-primary) !important;
}

.btn-back-home {
  background: var(--color-accent);
  border: 3px solid #fff;
  font-family: var(--font-title);
  font-size: 1.1rem;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  color: #fff !important;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-back-home:hover {
  background: var(--color-primary);
  transform: scale(1.06);
}

/* Header animated text */
.font-banner-familias span {
  font-family: var(--font-banner);
  text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
  margin: 0 3px;
  display: inline-block;
  animation: bounce-letters-familias 2s ease-in-out infinite alternate;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  white-space: nowrap;
}

.word{
    display:inline-block;
    white-space:nowrap;
}

.font-banner-familias span:nth-child(1) { animation-delay: 0.1s; color: #ff1744; }
.font-banner-familias span:nth-child(2) { animation-delay: 0.2s; color: #0288d1; }
.font-banner-familias span:nth-child(3) { animation-delay: 0.3s; color: #f57f17; }
.font-banner-familias span:nth-child(4) { animation-delay: 0.4s; color: #2e7d32; }
.font-banner-familias span:nth-child(5) { animation-delay: 0.5s; color: #9c27b0; }
.font-banner-familias span:nth-child(6) { animation-delay: 0.6s; color: #ff1744; }
.font-banner-familias span:nth-child(7) { animation-delay: 0.7s; color: #0288d1; }
.font-banner-familias span:nth-child(8) { animation-delay: 0.8s; color: #f57f17; }
.font-banner-familias span:nth-child(9) { animation-delay: 0.9s; color: #2e7d32; }
.font-banner-familias span:nth-child(10) { animation-delay: 1.0s; color: #9c27b0; }
.font-banner-familias span:nth-child(11) { animation-delay: 1.1s; color: #ff1744; }
.font-banner-familias span:nth-child(12) { animation-delay: 1.2s; color: #0288d1; }
.font-banner-familias span:nth-child(13) { animation-delay: 1.3s; color: #f57f17; }
.font-banner-familias span:nth-child(14) { animation-delay: 1.4s; color: #2e7d32; }
.font-banner-familias span:nth-child(15) { animation-delay: 1.5s; color: #9c27b0; }
.font-banner-familias span:nth-child(16) { animation-delay: 1.6s; color: #ff1744; }
.font-banner-familias span:nth-child(17) { animation-delay: 1.7s; color: #0288d1; }
.font-banner-familias span:nth-child(18) { animation-delay: 1.8s; color: #f57f17; }
.font-banner-familias span:nth-child(19) { animation-delay: 1.9s; color: #2e7d32; }


@keyframes bounce-letters-familias {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(5deg); }
}

.section-title {
  font-family: var(--font-title);
  color: var(--color-primary);
  text-shadow: 2px 2px 0px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  font-weight: 700;
}

/* Experience 1: House sorting game */
.sorting-game-container {
  background: #fff;
  border-radius: 2.5rem;
  border: 5px dashed var(--color-primary);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
}

.number-card-giant {
  width: 150px;
  height: 150px;
  background: #fff;
  border: 5px solid var(--color-primary);
  border-radius: 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-family: var(--font-banner);
  font-size: 5rem;
  font-weight: 900;
  color: var(--color-accent);
  animation: pulse-num-giant 2s infinite;
}

@keyframes pulse-num-giant {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.houses-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.house-item-box {
  background: #fff;
  border: 4px dashed var(--color-border);
  border-radius: 2.5rem;
  width: 160px;
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.house-item-box:hover {
  transform: translateY(-8px) scale(1.06);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.house-item-box.correct {
  background: #e8f5e9;
  border-color: var(--color-success) !important;
  animation: success-pulse 0.5s ease-in-out;
}

.house-item-box.wrong {
  background: #ffebee;
  border-color: var(--color-danger) !important;
  animation: shake 0.5s ease-in-out;
}

.house-graphic {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 8px;
  animation: float-deco 3s ease-in-out infinite;
}

.house-label {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #333;
  margin: 0;
}

/* Experience 2: Floating Balloons Game */
.balloons-area {
  position: relative;
  min-height: 550px;
  background: linear-gradient(180deg, #e3f2fd, #bbdefb);
  border-radius: 2rem;
  border: 5px dashed var(--color-primary);
  overflow: hidden;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.balloon-element {
  position: absolute;
  width: 90px;
  height: 110px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-banner);
  font-size: 2.2rem;
  font-weight: 900;
  color: white;
  cursor: pointer;
  box-shadow: inset -8px -8px 0 rgba(0,0,0,0.15), 0 8px 15px rgba(0,0,0,0.1);
  user-select: none;
  animation: float-balloon 5s ease-in-out infinite alternate;
  transition: transform 0.1s ease;
}

/* Add balloon basket string */
.balloon-element::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 43px;
  width: 4px;
  height: 18px;
  background: rgba(0,0,0,0.15);
}

@keyframes float-balloon {
  0% { transform: translateY(10px) rotate(-3deg); }
  50% { transform: translateY(-15px) rotate(3deg); }
  100% { transform: translateY(10px) rotate(-3deg); }
}

.balloon-element.popped {
  animation: pop-puff 0.25s ease-out forwards;
  pointer-events: none;
}

@keyframes pop-puff {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0); opacity: 0; }
}

/* Experience 3: Puzzle Grid board */
.puzzle-board-container {
  position: relative;
  background: #fff;
  border-radius: 2.5rem;
  border: 5px dashed var(--color-secondary);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.puzzle-matrix-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 2rem;
  border: 8px solid #8d6e63;
  border-radius: 1.5rem;
  background: #fbfbfb;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.puzzle-matrix-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 100%;
  height: 100%;
}

.puzzle-slot {
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-banner);
  font-size: 1.8rem;
  font-weight: 900;
  color: #bbb;
  position: relative;
  background: #fefefe;
  overflow: hidden;
}

.puzzle-slot.revealed {
  border: none;
  background: transparent;
}

/* The cartoon animal picture underneath */
.puzzle-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.puzzle-bg-emoji {
  font-size: 12rem;
  animation: float-deco 3s ease-in-out infinite;
}

/* Cover blocks that hide the background emoji until revealed */
.puzzle-cover-tile {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-banner);
  font-size: 1.6rem;
  font-weight: 900;
  color: white;
  z-index: 2;
  transition: opacity 0.5s ease-out;
}

.puzzle-cover-tile.fade-out {
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.puzzle-scrambled-tray {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 1.5rem auto;
  max-width: 600px;
}

.scrambled-tile-btn {
  background: white;
  border: 4px solid var(--color-border);
  border-radius: 1rem;
  min-width: 60px;
  padding: 0.6rem 0.4rem;
  font-family: var(--font-banner);
  font-size: 1.8rem;
  font-weight: 900;
  color: #333;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.scrambled-tile-btn:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: var(--shadow-md);
}

.scrambled-tile-btn.correct {
  background: #e8f5e9;
  border-color: var(--color-success) !important;
  color: var(--color-success);
  pointer-events: none;
  opacity: 0.5;
}

.scrambled-tile-btn.wrong {
  background: #ffebee;
  border-color: var(--color-danger) !important;
  color: var(--color-danger);
  animation: shake 0.5s ease-in-out;
}

/* Experience 3 Overlay */
.quiz-wrapper {
  position: relative;
  min-height: 500px;
}

.quiz-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .97);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  border-radius: 25px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  border: 10px dashed var(--color-primary);
}

.quiz-overlay-content {
  text-align: center;
  max-width: 380px;
}

.quiz-overlay-content h3 {
  font-family: var(--font-title);
  color: var(--color-primary);
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 15px;
  text-shadow: 2px 2px 0px rgba(0,0,0,0.05);
}

.quiz-overlay-content p {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: #555;
  font-weight: 700;
  margin-bottom: 25px;
}

@keyframes success-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 20px var(--color-success); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Speech Badge Styling */
.speech-badge {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  animation: palpitar 1.2s infinite;
}

@keyframes palpitar {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 214, 0, 0.7); }
  50% { transform: scale(1.08); box-shadow: 0 0 20px rgba(255, 214, 0, 0.9); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 214, 0, 0.7); }
}

.speech-badge:hover {
 background: var(--color-accent);
  transform: scale(1.05);
}

/* Floating Balloons Animation */
@keyframes floatUp {
  0% {
    top: 100%;
    transform: translateX(0) rotate(0deg);
  }
  20% {
    transform: translateX(15px) rotate(4deg);
  }
  40% {
    transform: translateX(-10px) rotate(-3deg);
  }
  60% {
    transform: translateX(10px) rotate(3deg);
  }
  80% {
    transform: translateX(-15px) rotate(-4deg);
  }
  100% {
    top: -130px;
    transform: translateX(0) rotate(0deg);
  }
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  .number-card-giant {
    width: 120px;
    height: 120px;
    font-size: 4rem;
  }

  .house-item-box {
    width: 130px;
    padding: 1.2rem 0.6rem;
    border-radius: 2rem;
  }

  .house-graphic {
    font-size: 3rem;
  }

  .house-label {
    font-size: 1rem;
  }

  .balloon-element {
    width: 75px;
    height: 95px;
    font-size: 1.8rem;
  }

  .balloon-element::after {
    bottom: -13px;
    left: 36px;
    width: 3px;
    height: 14px;
  }

}

@media (max-width: 480px) {

  .number-card-giant {
    width: 100px;
    height: 100px;
    font-size: 3.2rem;
    margin-bottom: 1.5rem;
  }

  .houses-row {
    gap: 10px;
  }

  .house-item-box {
    width: 105px;
    padding: 1rem 0.4rem;
    border-radius: 1.5rem;
  }

  .house-graphic {
    font-size: 2.4rem;
  }

  .house-label {
    font-size: 0.85rem;
  }

  .balloon-element {
    width: 60px;
    height: 75px;
    font-size: 1.4rem;
  }

  .balloon-element::after {
    bottom: -10px;
    left: 28px;
    width: 2px;
    height: 11px;
  }

  .puzzle-matrix-wrapper {
    width: 280px;
    height: 280px;
  }

  .puzzle-bg-emoji {
    font-size: 9rem;
  }

  .puzzle-slot {
    font-size: 1.5rem;
  }

  .scrambled-tile-btn {
    min-width: 48px;
    font-size: 1.4rem;
    padding: 0.5rem 0.3rem;
  }
}


