/* Count & Drop — Faithful Visual Reproduction of Screen Design
   Tactile Meadow Counting with Carved Wooden Toy Tray for Young Children (Ages 2-5)
*/

:root {
  --cd-sky-top: #60A5FA;
  --cd-sky-mid: #93C5FD;
  --cd-sky-bot: #BFDBFE;
  --cd-meadow-crest: #8EE838;
  --cd-meadow-mid: #68C420;
  --cd-meadow-low: #48A316;
  --cd-meadow-bot: #32820F;
  --cd-wood-outer: #FFFDF2;
  --cd-wood-border: #EADBBA;
  --cd-wood-rim-top: #C47F3C;
  --cd-wood-rim-side: #8E4D1D;
  --cd-wood-rim-bot: #572707;
}

/* ==========================================
   MASTER GAME STAGE
   ========================================== */
.count-drop {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: linear-gradient(180deg, var(--cd-sky-top) 0%, var(--cd-sky-mid) 24%, var(--cd-sky-bot) 55%, #DCFCE7 100%);
  overflow: hidden;
  padding-top: var(--header-h, 96px);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.count-drop::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ==========================================
   CARTOON SKY BACKDROP (SUN, CLOUDS, HILLS)
   ========================================== */
.cd-sky-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Smiling Kawaii Sun (Top-Right) */
.cd-sun {
  position: absolute;
  top: 98px;
  right: 4%;
  width: clamp(60px, 8.5vw, 78px);
  height: clamp(60px, 8.5vw, 78px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  z-index: 5;
  filter: drop-shadow(0 6px 14px rgba(245, 158, 11, 0.4));
  animation: cdSunGentlePulse 4s ease-in-out infinite alternate;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cd-sun:hover {
  transform: scale(1.12) rotate(10deg);
}

.cd-sun:active {
  transform: scale(0.94);
}

.cd-sun.sun-spin {
  animation: cdSunSpin 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cdSunGentlePulse {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.05) rotate(4deg); }
  100% { transform: scale(1) rotate(-4deg); }
}

@keyframes cdSunSpin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.25) rotate(360deg); }
  100% { transform: scale(1) rotate(720deg); }
}

/* Sun Rays & Face */
.cd-sun-rays {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, #FDE047 50%, #F59E0B 100%);
  clip-path: polygon(
    50% 0%, 61% 15%, 78% 5%, 82% 23%, 99% 21%, 94% 39%, 100% 50%,
    94% 61%, 99% 79%, 82% 77%, 78% 95%, 61% 85%, 50% 100%,
    39% 85%, 22% 95%, 18% 77%, 1% 79%, 6% 61%, 0% 50%,
    6% 39%, 1% 21%, 18% 23%, 22% 5%, 39% 15%
  );
}

.cd-sun-core {
  position: relative;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FEF08A 0%, #FBBF24 75%, #F59E0B 100%);
  box-shadow: inset 0 -3px 6px rgba(180, 83, 9, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cd-sun-eyes {
  display: flex;
  justify-content: space-between;
  width: 52%;
  margin-top: 18%;
}

.cd-sun-eye {
  width: 6px;
  height: 8px;
  border-radius: 50%;
  background: #78350F;
}

.cd-sun-cheeks {
  display: flex;
  justify-content: space-between;
  width: 74%;
  margin-top: -3px;
}

.cd-sun-cheek {
  width: 9px;
  height: 5px;
  border-radius: 50%;
  background: #FB7185;
  opacity: 0.65;
}

.cd-sun-mouth {
  width: 10px;
  height: 5px;
  border-radius: 0 0 10px 10px;
  border-bottom: 2.5px solid #78350F;
  margin-top: -1px;
}

/* Fluffy Cartoon Clouds */
.cd-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.08);
}

.cd-cloud-1 {
  width: 150px;
  height: 50px;
  top: 105px;
  left: 2%;
  animation: cdFloatCloud 24s ease-in-out infinite alternate;
}

.cd-cloud-2 {
  width: 190px;
  height: 58px;
  top: 135px;
  right: 18%;
  opacity: 0.75;
  animation: cdFloatCloud 28s ease-in-out infinite alternate-reverse;
}

.cd-cloud-3 {
  width: 110px;
  height: 40px;
  top: 210px;
  left: 36%;
  opacity: 0.55;
  animation: cdFloatCloud 20s ease-in-out infinite alternate;
}

@keyframes cdFloatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(45px); }
}

/* Distant Horizon Rolling Tree Hills & Forest Canopy */
.cd-horizon-treeline {
  position: absolute;
  bottom: clamp(40%, 45vh, 52%);
  left: -2%;
  right: -2%;
  height: clamp(65px, 11vh, 95px);
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.cd-horizon-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(34, 84, 61, 0.22));
}

/* ==========================================
   TOP BAR: TITLE & CHUNKY TOY BUTTONS
   ========================================== */
.cd-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px;
  max-width: 1050px;
  width: 100%;
  margin: 0 auto;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

/* Mobile Back Button (shown on mobile when desktop header is hidden) */
.cd-mobile-back {
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #BAE6FD;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0284C7;
  text-decoration: none;
  touch-action: manipulation;
}

.cd-mobile-back:active {
  transform: scale(0.94);
}

/* Mascot + Game Title (Matches Screenshot Typography) */
.cd-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cd-title-mascot {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15));
  animation: cdGentleBounce 2.4s ease-in-out infinite;
}

.cd-title-mascot svg {
  width: 100%;
  height: 100%;
}

.cd-game-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 900;
  color: #38BDF8;
  letter-spacing: -0.01em;
  margin: 0;
  text-shadow:
    -2px -2px 0 #FFFFFF,
     2px -2px 0 #FFFFFF,
    -2px  2px 0 #FFFFFF,
     2px  2px 0 #FFFFFF,
     0px  4px 8px rgba(2, 132, 199, 0.28);
}

/* Action Controls (Quest, 1-5, Sound, Voice, Reset) */
.cd-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cd-btn-quest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #A855F7 0%, #7E22CE 100%);
  color: #FFFFFF;
  border: 2px solid #C084FC;
  box-shadow: 0 4px 10px rgba(126, 34, 206, 0.35);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
  touch-action: manipulation;
  white-space: nowrap;
}

.cd-btn-quest:active {
  transform: scale(0.95);
}

.cd-btn-range {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #06B6D4 0%, #0E7490 100%);
  color: #FFFFFF;
  border: 2px solid #67E8F9;
  box-shadow: 0 4px 10px rgba(14, 116, 144, 0.35);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
  touch-action: manipulation;
  white-space: nowrap;
}

.cd-btn-range:active {
  transform: scale(0.95);
}

.cd-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease;
  touch-action: manipulation;
}

.cd-icon-btn:active {
  transform: scale(0.92);
}

.cd-btn-reset {
  background: #EFF6FF;
  border-color: #BAE6FD;
  color: #0284C7;
}

.cd-icon-btn.muted {
  opacity: 0.55;
  background: #F1F5F9;
  border-color: #CBD5E1;
}

/* ==========================================
   MISSION / GOAL FLOATING CAPSULE CARD
   ========================================== */
.cd-mission-banner {
  max-width: 960px;
  width: calc(100% - 24px);
  margin: 2px auto 6px auto;
  padding: 6px 14px;
  background: #FFFFFF;
  border-radius: 999px;
  border: 3px solid #38BDF8;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

/* Left Mascot + Multiplier Pill (Orange) */
.cd-target-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FEF08A 0%, #F59E0B 100%);
  border: 2.5px solid #D97706;
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
}

.cd-target-avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.cd-target-avatar svg {
  width: 100%;
  height: 100%;
}

.cd-target-multiplier {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  color: #78350F;
}

/* Middle Spoken Audio Prompt Bubble (Green) */
.cd-prompt-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #F0FDF4;
  border: 2px solid #86EFAC;
  border-radius: 999px;
  padding: 6px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
  min-width: 0;
}

.cd-prompt-bubble:hover {
  background: #DCFCE7;
  transform: translateY(-1px);
}

.cd-prompt-bubble:active {
  transform: scale(0.98);
}

.cd-prompt-speak-icon {
  font-size: 1.35rem;
  color: #166534;
  flex-shrink: 0;
  animation: cdPulseIcon 2.4s infinite ease-in-out;
}

.cd-prompt-text {
  font-size: clamp(0.9rem, 2.2vw, 1.25rem);
  font-weight: 800;
  color: #166534;
  line-height: 1.2;
}

/* Right Montessori Star Stepping Stone Pods */
.cd-counting-pods {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cd-pod {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #CBD5E1;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cd-pod.filled {
  border: 2px solid #D97706;
  background: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
  color: #78350F;
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.45);
}

/* ==========================================
   MAIN PLAYGROUND (MEADOW + WOODEN TRAY)
   ========================================== */
.cd-play-arena {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 0 14px 4px 14px;
  gap: 8px;
  min-height: 0;
  z-index: 10;
}

/* ==========================================
   ROLLING MEADOW HILL (THE DROP STAGE)
   ========================================== */
.cd-meadow-zone {
  flex: 1.4;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 110% 75% at 50% 16%, var(--cd-meadow-crest, #8EE838) 0%, var(--cd-meadow-mid, #68C420) 36%, var(--cd-meadow-low, #48A316) 72%, var(--cd-meadow-bot, #32820F) 100%);
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 8px 18px rgba(255, 255, 255, 0.4), 0 8px 24px rgba(22, 163, 74, 0.22);
  min-height: 160px;
}

/* Framing Foliage Side Bushes (Left & Right Flanks) */
.cd-side-bushes {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(45px, 8vw, 90px);
  pointer-events: none;
  z-index: 4;
}

.cd-side-bushes-left {
  left: -12px;
}

.cd-side-bushes-right {
  right: -12px;
}

.bush-b {
  position: absolute;
  border-radius: 50%;
  box-shadow: inset -3px -3px 8px rgba(20, 60, 20, 0.35), 0 4px 10px rgba(0, 0, 0, 0.12);
}

.cd-side-bushes-left .b1 {
  width: 75px; height: 75px; top: 12%; left: -20px;
  background: radial-gradient(circle at 35% 35%, #52B72A 0%, #388E3C 75%, #276749 100%);
}
.cd-side-bushes-left .b2 {
  width: 95px; height: 95px; top: 35%; left: -28px;
  background: radial-gradient(circle at 35% 35%, #4CAF50 0%, #2E7D32 75%, #1B5E20 100%);
}
.cd-side-bushes-left .b3 {
  width: 78px; height: 78px; top: 62%; left: -16px;
  background: radial-gradient(circle at 35% 35%, #52B72A 0%, #388E3C 75%, #276749 100%);
}
.cd-side-bushes-left .b4 {
  width: 65px; height: 65px; top: 82%; left: -12px;
  background: radial-gradient(circle at 35% 35%, #48BB78 0%, #2F855A 75%, #22543D 100%);
}

.cd-side-bushes-right .b1 {
  width: 75px; height: 75px; top: 12%; right: -20px;
  background: radial-gradient(circle at 35% 35%, #52B72A 0%, #388E3C 75%, #276749 100%);
}
.cd-side-bushes-right .b2 {
  width: 95px; height: 95px; top: 35%; right: -28px;
  background: radial-gradient(circle at 35% 35%, #4CAF50 0%, #2E7D32 75%, #1B5E20 100%);
}
.cd-side-bushes-right .b3 {
  width: 78px; height: 78px; top: 62%; right: -16px;
  background: radial-gradient(circle at 35% 35%, #52B72A 0%, #388E3C 75%, #276749 100%);
}
.cd-side-bushes-right .b4 {
  width: 65px; height: 65px; top: 82%; right: -12px;
  background: radial-gradient(circle at 35% 35%, #48BB78 0%, #2F855A 75%, #22543D 100%);
}

/* Wildflowers, Shamrocks & Bees Accents */
.cd-meadow-nature {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.cd-bee-item {
  position: absolute;
  display: flex;
  align-items: center;
}

.cd-bee-trail {
  width: 42px;
  height: 24px;
}

.cd-bee-body {
  font-size: 1.15rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.cd-bee-1 {
  top: 36%;
  left: 12%;
  animation: cdBeeBuzz 6s ease-in-out infinite alternate;
}

.cd-bee-2 {
  top: 34%;
  right: 14%;
  animation: cdBeeBuzz 7s ease-in-out infinite alternate-reverse;
}

.cd-bee-3 {
  top: 55%;
  right: 32%;
  animation: cdBeeBuzz 8s ease-in-out infinite alternate;
}

@keyframes cdBeeBuzz {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(12px, -7px) rotate(8deg); }
  100% { transform: translate(-8px, 5px) rotate(-6deg); }
}

.cd-wildflower {
  position: absolute;
  opacity: 0.92;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.fl-pink-1 { top: 32%; left: 30%; font-size: 1.1rem; }
.fl-purple-top { top: 36%; left: 50%; transform: translateX(-50%); }
.fl-yellow-left { top: 48%; left: 9%; font-size: 1.25rem; }
.fl-pink-bottom { top: 58%; left: 49%; font-size: 0.95rem; }
.fl-white-right { top: 53%; right: 16%; }
.fl-shamrock-1 { top: 33%; right: 35%; font-size: 1.2rem; }
.fl-shamrock-2 { top: 54%; left: 30%; font-size: 1.15rem; }
.fl-shamrock-3 { top: 49%; right: 11%; font-size: 1.2rem; }

/* Meadow Drop Area */
.cd-meadow-drop-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  overflow: hidden;
  touch-action: none;
  z-index: 5;
}

/* Meadow Guidance Prompt in Center */
.cd-meadow-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #FFFFFF;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(20, 83, 45, 0.5);
  z-index: 6;
}

.cd-meadow-empty-icon {
  font-size: clamp(2rem, 5vw, 2.7rem);
  animation: cdGentleBounce 2.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.cd-meadow-empty-text {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: clamp(1.1rem, 2.7vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.cd-meadow-empty-hint {
  font-size: clamp(0.82rem, 2vw, 0.98rem);
  font-weight: 700;
  color: #FEF9C3;
  text-shadow: 0 1px 3px rgba(20, 83, 45, 0.45);
}

/* Placed Animals Container inside the Meadow Grass */
.cd-placed-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 95%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px;
  z-index: 7;
}

.cd-placed-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Placed Animal Card Playing on Grass */
.cd-placed-animal {
  position: relative;
  width: clamp(62px, 13vw, 84px);
  height: clamp(62px, 13vw, 84px);
  background: #FFFFFF;
  border-radius: 20px;
  border: 3px solid #86EFAC;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  animation: cdAnimalHopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease;
}

.cd-placed-animal svg {
  width: 82%;
  height: 82%;
}

.cd-placed-animal:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.cd-placed-animal:active {
  transform: scale(0.92);
}

/* Shiny Golden Star Number Coin on Placed Animal */
.cd-placed-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
  border: 2px solid #FFFFFF;
  color: #78350F;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.45);
  pointer-events: none;
}

/* ==========================================
   INTEGRATED CELEBRATION TOAST
   ========================================== */
.cd-feedback-banner {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  border: 2.5px solid #FCD34D;
  border-bottom: 4px solid #F59E0B;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  z-index: 10;
  transition: all 0.25s ease;
  pointer-events: none;
}

.cd-feedback-banner:empty {
  display: none;
}

.cd-feedback-msg {
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  font-weight: 800;
  color: #1E293B;
  white-space: nowrap;
  text-align: center;
}

.cd-feedback-msg.success {
  color: #15803D;
  animation: cdGentleBounce 0.5s ease infinite alternate;
}

.cd-feedback-msg.warning {
  color: #B45309;
}

/* ==========================================
   CARVED WOODEN TOY TRAY / CRATE
   ========================================== */
.cd-tray-wrapper {
  position: relative;
  width: 100%;
}

.cd-tray-card {
  position: relative;
  background: var(--cd-wood-outer, #FFFDF2);
  border: 2.5px solid var(--cd-wood-border, #EADBBA);
  border-radius: 28px;
  padding: 8px 16px 12px 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.cd-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-shrink: 0;
  padding: 0 4px;
}

.cd-tray-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 0.86rem;
  font-weight: 800;
  color: #78350F;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cd-tray-instruction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2D581A;
}

/* Inset 3D Carved Wooden Trough (Outer Beveled Rim & Recessed Cavity) */
.cd-wood-trough {
  flex: 1;
  position: relative;
  border-top: 6px solid var(--cd-wood-rim-top, #C47F3C);
  border-left: 7px solid var(--cd-wood-rim-side, #8E4D1D);
  border-right: 7px solid var(--cd-wood-rim-side, #824417);
  border-bottom: 8px solid var(--cd-wood-rim-bot, #572707);
  border-radius: 24px;
  background:
    repeating-linear-gradient(180deg, transparent, transparent 16px, rgba(0, 0, 0, 0.06) 17px, transparent 18px),
    linear-gradient(180deg, #6C3611 0%, #7E4318 20%, #945220 52%, #7B3F15 82%, #5F2C08 100%);
  box-shadow:
    0 8px 22px rgba(40, 16, 4, 0.42),
    0 2px 4px rgba(0, 0, 0, 0.22),
    inset 0 18px 30px rgba(25, 9, 2, 0.76),
    inset 0 4px 8px rgba(0, 0, 0, 0.5),
    inset 0 -6px 14px rgba(255, 190, 120, 0.2);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grass Tufts Peeking along Bottom Rim */
.cd-tray-grass-tufts {
  position: absolute;
  bottom: -9px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
  z-index: 12;
  font-size: 1.15rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.cd-tray-grass-tufts .tuft {
  display: inline-block;
}

.cd-tray-grass-tufts .tuft-left { transform: rotate(-10deg); }
.cd-tray-grass-tufts .tuft-right { transform: rotate(10deg); }

/* Animal Stickers Grid inside Wooden Trough */
.cd-tray-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.8vw, 16px);
  width: 100%;
}

/* 3D Tactile Animal Sticker Tile (Matching Screenshot) */
.cd-animal {
  position: relative;
  width: clamp(52px, 11vw, 72px);
  height: clamp(52px, 11vw, 72px);
  background: #FFFFFF;
  border-radius: 20px;
  border: 2px solid #F1F5F9;
  border-bottom: 4px solid #CBD5E1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.cd-animal svg {
  width: 82%;
  height: 82%;
  pointer-events: none;
}

.cd-animal:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 0 0 4px #FBBF24, 0 8px 18px rgba(245, 158, 11, 0.45), 0 8px 16px rgba(0, 0, 0, 0.25);
}

.cd-animal:active {
  cursor: grabbing;
  transform: translateY(2px) scale(0.96);
  border-bottom-width: 2px;
}

/* Active Highlight Tile (Matching Golden Aura & Pointer in Screenshot) */
.cd-animal.cd-animal-active {
  box-shadow: 0 0 0 4.5px #FBBF24, 0 10px 22px rgba(245, 158, 11, 0.5);
  transform: translateY(-3px) scale(1.04);
}

.cd-pointer-hand {
  position: absolute;
  bottom: -10px;
  right: -8px;
  font-size: 1.45rem;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  animation: cdPointerTap 1.2s ease-in-out infinite alternate;
  z-index: 10;
}

@keyframes cdPointerTap {
  0% { transform: translate(0, 0) rotate(15deg); }
  100% { transform: translate(-3px, -4px) rotate(22deg) scale(1.1); }
}

.cd-animal.dragging {
  position: fixed;
  z-index: 1000;
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0.95;
  transition: none;
}

.cd-animal.slot-disabled {
  opacity: 0.22;
  filter: grayscale(0.85);
  pointer-events: none;
  border-style: dashed;
}

/* ==========================================
   BOTTOM MILESTONE STARS TRACK & CLEAN FOOTER
   ========================================== */
.cd-bottom-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px 2px 16px;
  max-width: 950px;
  width: 100%;
  margin: 0 auto;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

.cd-sandy-trail-glow {
  position: absolute;
  inset: -12px -20px;
  background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(229, 184, 118, 0.55) 0%, rgba(200, 143, 79, 0.25) 55%, transparent 85%);
  pointer-events: none;
  z-index: -1;
}

.cd-stars-track {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cd-star-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #F59E0B;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cd-star-badge.completed {
  background: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
  border-color: #D97706;
  color: #78350F;
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.45);
}

.cd-star-badge.current {
  border: 3.5px solid #22C55E;
  background: #DCFCE7;
  color: #15803D;
  transform: scale(1.22);
  box-shadow: 0 0 18px #4ADE80;
}


/* Clean Footer flow beneath stars */
.count-drop .game-footer {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  margin: 0 auto;
  padding: 2px 16px 8px 16px;
  text-align: center;
  z-index: 10;
  flex-shrink: 0;
  pointer-events: none;
}

.count-drop .game-footer span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  opacity: 0.45;
  color: #1E293B;
  letter-spacing: 0.3px;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes cdGentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes cdPulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes cdAnimalHopIn {
  0% { transform: translateY(-14px) scale(0.8); opacity: 0; }
  60% { transform: translateY(2px) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ==========================================
   MOBILE-FRIENDLY & HEADER HIDING OVERRIDES
   ========================================== */
@media (max-width: 768px) {
  /* On mobile: HIDE the top Cadence-X header per user instruction */
  .cx-game-nav-container {
    display: none !important;
  }

  .count-drop {
    padding-top: 6px !important;
  }

  /* Show compact mobile return button */
  .cd-mobile-back {
    display: inline-flex !important;
  }

  .cd-top-bar {
    padding: 2px 10px;
    gap: 6px;
  }

  .cd-title-box {
    gap: 6px;
  }

  .cd-title-mascot {
    width: 30px;
    height: 30px;
  }

  .cd-game-title {
    font-size: 1.35rem;
  }

  .cd-controls-group {
    gap: 5px;
  }

  .cd-btn-quest, .cd-btn-range {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .cd-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .cd-sun {
    width: 52px;
    height: 52px;
    top: 50px;
  }

  .cd-mission-banner {
    padding: 4px 10px;
    margin-bottom: 4px;
    gap: 8px;
  }

  .cd-target-badge {
    padding: 3px 10px;
    gap: 6px;
  }

  .cd-target-avatar {
    width: 26px;
    height: 26px;
  }

  .cd-target-multiplier {
    font-size: 1.15rem;
  }

  .cd-prompt-bubble {
    padding: 4px 12px;
  }

  .cd-prompt-text {
    font-size: 0.85rem;
  }

  .cd-play-arena {
    padding: 0 8px 4px 8px;
    gap: 6px;
  }

  .cd-meadow-zone {
    border-radius: 50% 50% 0 0 / 14% 14% 0 0;
    min-height: 130px;
  }

  .cd-side-bushes {
    width: 35px;
  }

  .cd-tray-card {
    padding: 6px 8px 10px 8px;
    border-radius: 20px;
    min-height: 100px;
  }

  .cd-tray-title {
    font-size: 0.78rem;
  }

  .cd-tray-instruction {
    font-size: 0.72rem;
  }

  .cd-wood-trough {
    border-top-width: 4px;
    border-left-width: 5px;
    border-right-width: 5px;
    border-bottom-width: 6px;
    padding: 6px 8px;
    border-radius: 16px;
  }

  .cd-tray-grid {
    gap: 6px;
  }

  .cd-animal {
    width: clamp(44px, 14vw, 56px);
    height: clamp(44px, 14vw, 56px);
    border-radius: 14px;
  }

  .cd-pointer-hand {
    font-size: 1.15rem;
    bottom: -6px;
    right: -4px;
  }

  .cd-star-badge {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .cd-top-bar {
    padding: 2px 12px;
  }
  .cd-mission-banner {
    padding: 3px 10px;
    margin: 2px auto;
  }
  .cd-play-arena {
    flex-direction: row;
    gap: 10px;
  }
  .cd-meadow-zone {
    flex: 1.3;
  }
  .cd-tray-card {
    flex: 1;
  }
  .cd-sun {
    display: none;
  }
}
