/* DuoDuo & DuoBao Fun Modules - rhymes, ABC, games, dance, cartoons */
.fun-block {
  max-width: 1060px;
  margin: 56px auto 10px;
  padding: 0 20px;
}

.fun-progress {
  height: 10px;
  border-radius: 99px;
  background: rgba(53, 84, 125, .1);
  overflow: hidden;
  margin: 14px 0;
}
.fun-progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--coral), var(--orange), var(--yellow));
  transition: width .35s ease;
}

/* rhymes */
.fun-chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.fun-rhyme-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  background:
    radial-gradient(circle at 92% 8%, var(--rhyme-color), transparent 13rem),
    linear-gradient(150deg, rgba(255, 255, 255, .97), rgba(255, 250, 240, .94));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .75);
}
.fun-rhyme-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fun-rhyme-badge {
  font: 800 16px "Baloo 2", "Noto Sans SC", sans-serif;
  color: var(--navy);
  background: rgba(255, 255, 255, .85);
  border-radius: 99px;
  padding: 8px 14px;
  box-shadow: 0 4px 12px rgba(66, 76, 104, .1);
}
.fun-rhyme-count {
  font: 800 13px "Noto Sans SC", sans-serif;
  color: var(--muted);
}
.fun-rhyme-lyric {
  margin: 22px 0 10px;
  font: 800 30px/1.55 "Baloo 2", "Ma Shan Zheng", "Noto Sans SC", sans-serif;
  color: var(--ink);
}
.fun-rhyme-lyric .fun-rhyme-first {
  color: var(--coral);
  font-size: 36px;
}
.fun-rhyme-zh {
  color: var(--navy);
  font-size: 15px;
  line-height: 1.7;
  background: rgba(255, 255, 255, .72);
  border-radius: 16px;
  padding: 10px 14px;
}
.fun-rhyme-note {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 16px;
}
.fun-rhyme-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* animal ABC */
.fun-abc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}
.fun-abc-tile {
  position: relative;
  border: 2px solid rgba(53, 84, 125, .1);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .96), rgba(255, 247, 232, .92));
  box-shadow: 0 10px 22px rgba(66, 76, 104, .1);
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}
.fun-abc-tile:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 14px 28px rgba(66, 76, 104, .16);
}
.fun-abc-tile.done {
  border-color: rgba(119, 214, 177, .75);
  background: linear-gradient(160deg, #ffffff, #ecfbf4);
}
.fun-abc-tile.bounce {
  animation: funBounce .5s ease;
}
.fun-abc-letter {
  font: 800 26px "Baloo 2", sans-serif;
  color: var(--coral);
  line-height: 1;
}
.fun-abc-emoji {
  font-size: 30px;
  line-height: 1.1;
}
.fun-abc-animal {
  font: 800 11px "Baloo 2", sans-serif;
  color: var(--navy);
  letter-spacing: .03em;
}
.fun-abc-zh {
  font-size: 11px;
  color: var(--muted);
}

/* games */
.fun-game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.fun-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 173, 208, .26), transparent 10rem),
    linear-gradient(150deg, rgba(255, 255, 255, .96), rgba(255, 247, 232, .92));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .72);
}
.fun-card h3 {
  margin: 0 0 6px;
  font: 800 20px "Baloo 2", "Noto Sans SC", sans-serif;
  color: var(--navy);
}
.fun-desc {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.fun-game-start,
.fun-game-end {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13.5px;
}
.fun-game-start b,
.fun-game-end b {
  font: 800 30px "Baloo 2", sans-serif;
  color: var(--coral);
}
.fun-game-question {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 12px;
}
.fun-game-question > span:first-child,
.fun-game-question > div:first-child {
  font-size: 34px;
}
.fun-game-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.fun-game-options .cp-opt {
  font: 800 26px "Baloo 2", sans-serif;
  min-height: 58px;
}
.fun-game-options .cp-opt.correct {
  background: linear-gradient(135deg, var(--mint), #a8e6cd);
  color: #1c5c47;
  border-color: transparent;
}
.fun-game-options .cp-opt.wrong {
  background: #ffe3e8;
  color: #b43a52;
  border-color: transparent;
}
.fun-emoji-options .cp-opt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 700 14px "Noto Sans SC", sans-serif;
}
.fun-emoji-options .cp-opt b {
  font-size: 30px;
  line-height: 1.1;
}
.fun-game-meta {
  color: var(--muted);
  font-size: 12.5px;
}

/* memory match */
.fun-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.fun-memory-card {
  position: relative;
  aspect-ratio: 1 / 1.05;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  background: transparent;
  perspective: 600px;
  padding: 0;
}
.fun-memory-card > span {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 16px;
  backface-visibility: hidden;
  transition: transform .35s ease;
}
.fun-memory-back {
  background: linear-gradient(135deg, var(--coral), var(--orange));
  color: #fff;
  font: 800 24px "Baloo 2", sans-serif;
  box-shadow: 0 8px 18px rgba(255, 114, 133, .3);
}
.fun-memory-front {
  background: #fff;
  border: 2px solid rgba(53, 84, 125, .12);
  transform: rotateY(180deg);
  font-size: 22px;
}
.fun-memory-front b {
  font: 800 16px "Baloo 2", sans-serif;
  color: var(--navy);
}
.fun-memory-card.flip .fun-memory-back {
  transform: rotateY(180deg);
}
.fun-memory-card.flip .fun-memory-front {
  transform: rotateY(0deg);
}
.fun-memory-card.match > span {
  outline: 3px solid rgba(119, 214, 177, .8);
  outline-offset: 2px;
}

/* dance */
.fun-dance-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
}
.fun-dance-stage {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 215, 97, .55), transparent 9rem),
    radial-gradient(circle at 85% 15%, rgba(255, 173, 208, .5), transparent 10rem),
    linear-gradient(165deg, #fff7dc, #e9f7ff 60%, #fff0f6);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .75);
}
.fun-dance-char {
  position: absolute;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  font-size: 92px;
  line-height: 1;
  filter: drop-shadow(0 14px 18px rgba(53, 84, 125, .25));
  transition: transform .2s ease;
}
.fun-dance-stage.dancing .fun-dance-char {
  animation: funDance 1.1s ease-in-out infinite;
}
.fun-dance-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .4), rgba(102, 188, 236, .25));
  border-top: 3px dashed rgba(102, 188, 236, .45);
}
.fun-note {
  position: absolute;
  font-style: normal;
  color: var(--coral);
  opacity: 0;
  font-size: 26px;
}
.fun-dance-stage.dancing .fun-note {
  animation: funNote 1.8s ease-in infinite;
}
.fun-dance-stage.dancing .fn1 { left: 18%; bottom: 120px; animation-delay: .2s; }
.fun-dance-stage.dancing .fn2 { left: 70%; bottom: 140px; animation-delay: .9s; }
.fun-dance-stage.dancing .fn3 { left: 45%; bottom: 190px; animation-delay: 1.4s; }

.fun-beat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}
.fun-beat-ball {
  font-size: 44px;
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease;
}
.fun-beat-ball.hit {
  transform: scale(1.35);
}
.fun-beat-ball.bouncing {
  animation: funBall 1.28s linear infinite;
}
.fun-beat-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fun-beat-score {
  font: 800 20px "Baloo 2", sans-serif;
  color: var(--navy);
}
.fun-beat-result {
  color: var(--muted);
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .8);
}
.fun-beat-result.win {
  color: #1c5c47;
  background: linear-gradient(135deg, var(--mint), #a8e6cd);
}

/* cartoons */
.fun-cartoon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.fun-cartoon-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  background:
    radial-gradient(circle at 90% 8%, rgba(102, 188, 236, .22), transparent 9rem),
    linear-gradient(150deg, rgba(255, 255, 255, .97), rgba(255, 247, 232, .92));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .75);
  transition: transform .16s ease, box-shadow .16s ease;
}
.fun-cartoon-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(66, 76, 104, .16);
}
.fun-cartoon-emoji {
  font-size: 40px;
  line-height: 1;
}
.fun-cartoon-card h3 {
  margin: 0;
  font: 800 19px "Baloo 2", "Noto Sans SC", sans-serif;
  color: var(--navy);
}
.fun-cartoon-who {
  font-size: 12.5px;
  color: var(--coral);
  font-weight: 700;
}
.fun-cartoon-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}
.fun-cartoon-go {
  margin-top: 6px;
  font: 800 13px "Noto Sans SC", sans-serif;
  color: var(--navy);
}
.fun-cartoon-hot {
  width: fit-content;
  margin-top: 4px;
  padding: 5px 10px;
  border-radius: 99px;
  font: 800 11px "Noto Sans SC", sans-serif;
  color: #b74b16;
  background: linear-gradient(135deg, #ffe3b8, #ffd2a0);
}

/* memory badge + confetti */
.memory-badge {
  min-width: 0;
  white-space: nowrap;
  font-size: 12px;
}
.duoduo-birthday {
  display: inline-block;
  margin: 14px 0 4px;
  padding: 8px 14px;
  border-radius: 99px;
  font: 800 14px "Noto Sans SC", sans-serif;
  color: #1c5c47;
  background: linear-gradient(135deg, #e8fff3, #d8f7ec);
  border: 1.5px solid rgba(119, 214, 177, .55);
  box-shadow: 0 8px 18px rgba(119, 214, 177, .22);
}
.fun-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}
.fun-confetti i {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  animation: funFall linear forwards;
}

@keyframes funBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px) scale(1.08); }
}
@keyframes funFall {
  to { transform: translateY(110vh) rotate(720deg); }
}
@keyframes funDance {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-6deg); }
  25% { transform: translateX(-42%) translateY(-18px) rotate(8deg); }
  50% { transform: translateX(-50%) translateY(-34px) rotate(-10deg); }
  75% { transform: translateX(-58%) translateY(-12px) rotate(9deg); }
}
@keyframes funNote {
  0% { opacity: 0; transform: translateY(0) scale(.7); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-150px) scale(1.25) rotate(14deg); }
}
@keyframes funBall {
  0% { transform: translateY(0); }
  50% { transform: translateY(-120px); }
  100% { transform: translateY(0); }
}

@media (max-width: 900px) {
  .fun-game-grid,
  .fun-dance-wrap {
    grid-template-columns: 1fr;
  }
  .fun-rhyme-lyric {
    font-size: 25px;
  }
  .fun-rhyme-lyric .fun-rhyme-first {
    font-size: 30px;
  }
  .memory-badge {
    display: none;
  }
}

@media (max-width: 560px) {
  .fun-rhyme-card {
    padding: 20px 16px;
  }
  .fun-abc-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .fun-abc-letter {
    font-size: 22px;
  }
  .fun-abc-emoji {
    font-size: 24px;
  }
  .fun-abc-animal {
    font-size: 9.5px;
  }
  .fun-memory-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .fun-game-options {
    grid-template-columns: repeat(3, 1fr);
  }
}
