/* ABC Learning - Kids Design System */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@700;800;900&display=swap');

:root {
  --A: #FF6B6B; --B: #4ECDC4; --C: #FFE66D; --D: #95E1D3;
  --E: #F38181; --F: #AA96DA; --G: #FCBAD3; --H: #A8D8EA;
  --I: #FF9A8B; --J: #88D8B0; --K: #FF6F61; --L: #6C5B7B;
  --M: #C06C84; --N: #F8B500; --O: #2EC4B6; --P: #E71D36;
  --Q: #9B5DE5; --R: #00BBF9; --S: #F15BB5; --T: #FEE440;
  --U: #00F5D4; --V: #8338EC; --W: #FF006E; --X: #FB5607;
  --Y: #3A86FF; --Z: #FFBE0B;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: #FFF9F0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HOME PAGE ── */
.home-bg {
  background: linear-gradient(135deg, #FFF9F0 0%, #FFF0DB 50%, #FFE8CC 100%);
  min-height: 100vh;
  padding: 40px 20px 60px;
}

.home-title {
  text-align: center;
  margin-bottom: 10px;
}

.home-title h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(3rem, 8vw, 6rem);
  background: linear-gradient(135deg, #FF6B6B, #FF9A8B, #FFE66D, #4ECDC4, #AA96DA, #F15BB5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  animation: rainbow 4s ease infinite;
  filter: drop-shadow(3px 3px 0px rgba(0,0,0,0.1));
}

@keyframes rainbow {
  0%, 100% { filter: hue-rotate(0deg) drop-shadow(3px 3px 0px rgba(0,0,0,0.1)); }
  50% { filter: hue-rotate(20deg) drop-shadow(3px 3px 0px rgba(0,0,0,0.15)); }
}

.home-subtitle {
  text-align: center;
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: #888;
  font-weight: 800;
  margin-bottom: 40px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
}

.letter-card {
  aspect-ratio: 1;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.letter-card:nth-child(1)  { animation-delay: 0.02s; }
.letter-card:nth-child(2)  { animation-delay: 0.04s; }
.letter-card:nth-child(3)  { animation-delay: 0.06s; }
.letter-card:nth-child(4)  { animation-delay: 0.08s; }
.letter-card:nth-child(5)  { animation-delay: 0.10s; }
.letter-card:nth-child(6)  { animation-delay: 0.12s; }
.letter-card:nth-child(7)  { animation-delay: 0.14s; }
.letter-card:nth-child(8)  { animation-delay: 0.16s; }
.letter-card:nth-child(9)  { animation-delay: 0.18s; }
.letter-card:nth-child(10) { animation-delay: 0.20s; }
.letter-card:nth-child(11) { animation-delay: 0.22s; }
.letter-card:nth-child(12) { animation-delay: 0.24s; }
.letter-card:nth-child(13) { animation-delay: 0.26s; }
.letter-card:nth-child(14) { animation-delay: 0.28s; }
.letter-card:nth-child(15) { animation-delay: 0.30s; }
.letter-card:nth-child(16) { animation-delay: 0.32s; }
.letter-card:nth-child(17) { animation-delay: 0.34s; }
.letter-card:nth-child(18) { animation-delay: 0.36s; }
.letter-card:nth-child(19) { animation-delay: 0.38s; }
.letter-card:nth-child(20) { animation-delay: 0.40s; }
.letter-card:nth-child(21) { animation-delay: 0.42s; }
.letter-card:nth-child(22) { animation-delay: 0.44s; }
.letter-card:nth-child(23) { animation-delay: 0.46s; }
.letter-card:nth-child(24) { animation-delay: 0.48s; }
.letter-card:nth-child(25) { animation-delay: 0.50s; }
.letter-card:nth-child(26) { animation-delay: 0.52s; }

@keyframes popIn {
  from { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.letter-card:hover {
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
}

.letter-card:active {
  transform: scale(0.95);
}

.letter-char {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(3rem, 8vw, 4.5rem);
  color: white;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  line-height: 1;
  filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.1));
}

.letter-name {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  text-transform: capitalize;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.letter-card::before {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  top: 12%;
  right: 15%;
}

.letter-card::after {
  content: '';
  position: absolute;
  width: 18%;
  height: 18%;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  bottom: 20%;
  left: 12%;
}

/* ── ANIMAL PAGE ── */
.animal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 40px;
  position: relative;
}

.animal-topbar {
  width: 100%;
  max-width: 800px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  color: #555;
  background: white;
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.back-btn:hover {
  transform: translateX(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.back-arrow {
  font-size: 1.2rem;
}

.animal-letter-badge {
  font-family: 'Fredoka One', cursive;
  font-size: 2.5rem;
  color: white;
  width: 70px;
  height: 70px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.animal-info {
  flex: 1;
}

.animal-info h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: #333;
  line-height: 1.1;
  text-transform: capitalize;
}

.animal-info p {
  font-size: 0.9rem;
  color: #888;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.video-container {
  width: 100%;
  max-width: 720px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  background: #000;
  animation: videoIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes videoIn {
  from { transform: scale(0.8) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.video-container video {
  width: 100%;
  display: block;
}

/* ── A-Z AUTOPLAY BAR ── */
.az-bar {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.az-btn {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: white;
  background: linear-gradient(135deg, #FF6B6B, #FF9A8B);
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,107,107,0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.az-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 30px rgba(255,107,107,0.5);
}

.az-btn:active {
  transform: scale(0.96);
}

.az-btn.active {
  background: linear-gradient(135deg, #4ECDC4, #2EC4B6);
  box-shadow: 0 6px 20px rgba(78,205,196,0.4);
}

.az-progress {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.85rem;
  color: #888;
  background: white;
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.az-skip {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.85rem;
  color: #888;
  background: white;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.az-skip:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.animal-decor {
  position: fixed;
  bottom: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  opacity: 0.06;
  pointer-events: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .alphabet-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
  }
  .home-title h1 { font-size: 3rem; }
  .animal-topbar { flex-wrap: wrap; }
}
