/* ==========================================================================
   MARBOTIC / SMART WOODEN LETTERS THEME
   Replicating the tangible wooden toy + iPad phonics aesthetic from reference photos:
   - Clean, serene off-white paper/desk canvas
   - Authentic birch-wood puzzle pieces with 3D metallic silver center knobs
   - The iconic Lil Blue Monster holding illustrated picture cards & sound pipes
   - The Pink Blob mascot companion with stick legs
   - Chunky rounded CVC letter slot cards ([ S ] [ A ] [ P ]) & Onset words ([ R ] obot)
   ========================================================================== */

:root {
  --marbotic-bg: #f8f9fb;
  --marbotic-paper: #ffffff;
  --marbotic-wood-edge: #f5e6cb;
  --marbotic-wood-shadow: #d7be96;
  --marbotic-ink: #2b303a;
  --marbotic-blue-monster: #80d3df;
  --marbotic-monster-belly: #ffffff;
  --marbotic-pipe-teal: #4ea8b6;
  --marbotic-pink-friend: #ff6b9d;
  --marbotic-shelf: #ececec;
}

/* ==========================================================================
   1. AUTHENTIC BIRCH-WOOD KNOBBED LETTER PUZZLE PIECE
   Matches the physical wooden letters with silver knobs in all 5 photos!
   ========================================================================== */
.wooden-letter-piece {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  user-select: none;
  border-radius: 20px;
  background: #ffffff;
  border: 4.5px solid var(--marbotic-wood-edge);
  box-shadow: 
    0 8px 18px rgba(44, 37, 32, 0.14),
    0 3px 0 var(--marbotic-wood-shadow),
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(180, 140, 90, 0.25);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  cursor: pointer;
  line-height: 1;
}

.wooden-letter-piece:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 
    0 12px 24px rgba(44, 37, 32, 0.18),
    0 4px 0 var(--marbotic-wood-shadow),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.wooden-letter-piece:active {
  transform: translateY(2px) scale(0.96);
  box-shadow: 
    0 4px 10px rgba(44, 37, 32, 0.12),
    0 1px 0 var(--marbotic-wood-shadow);
}

/* Authentic Saturated Letter Colors from reference photos */
.wooden-letter-piece.letter-yellow,
.wooden-letter-piece[data-char="R"],
.wooden-letter-piece[data-char="B"] {
  color: #fab005;
}
.wooden-letter-piece.letter-red,
.wooden-letter-piece[data-char="A"],
.wooden-letter-piece[data-char="M"],
.wooden-letter-piece[data-char="Q"] {
  color: #fa5252;
}
.wooden-letter-piece.letter-blue,
.wooden-letter-piece[data-char="S"],
.wooden-letter-piece[data-char="C"],
.wooden-letter-piece[data-char="N"] {
  color: #228be6;
}
.wooden-letter-piece.letter-green,
.wooden-letter-piece[data-char="P"],
.wooden-letter-piece[data-char="I"],
.wooden-letter-piece[data-char="T"] {
  color: #40c057;
}
.wooden-letter-piece.letter-orange,
.wooden-letter-piece[data-char="O"],
.wooden-letter-piece[data-char="G"],
.wooden-letter-piece[data-char="H"] {
  color: #fd7e14;
}
.wooden-letter-piece.letter-purple,
.wooden-letter-piece[data-char="K"],
.wooden-letter-piece[data-char="U"],
.wooden-letter-piece[data-char="V"] {
  color: #7950f2;
}
.wooden-letter-piece.letter-cyan,
.wooden-letter-piece[data-char="D"],
.wooden-letter-piece[data-char="J"],
.wooden-letter-piece[data-char="L"] {
  color: #12b886;
}

/* The Metallic Silver Knob in the Center of Each Piece */
.letter-knob {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #e2e8f0 45%, #94a3b8 75%, #475569 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 
    0 3px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.95),
    inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 3;
}
.letter-knob::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 4px;
  width: 5px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  filter: blur(0.3px);
}

/* Large Wooden Stamp for Monster Belly & CVC Slots */
.wooden-letter-piece.lg {
  width: clamp(90px, 14vw, 120px);
  height: clamp(100px, 16vw, 140px);
  font-size: clamp(64px, 10vw, 88px);
  border-width: 6px;
  border-radius: 28px;
}
.wooden-letter-piece.lg .letter-knob {
  width: 24px;
  height: 24px;
}

/* Medium Wooden Stamp for Word Slots */
.wooden-letter-piece.md {
  width: clamp(70px, 10vw, 92px);
  height: clamp(84px, 12vw, 110px);
  font-size: clamp(48px, 7vw, 68px);
  border-width: 4.5px;
  border-radius: 22px;
}

/* ==========================================================================
   2. CLEAN MINIMALIST MARBOTIC TOP BAR
   ========================================================================== */
.marbotic-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  height: 60px;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  z-index: 20;
}

/* Dedicated Soft Rounded Home Button (House Icon) */
.marbotic-home-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid #e5eaf0;
  box-shadow: 0 4px 12px rgba(40, 60, 80, 0.07), 0 2px 0 #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
  color: #5c7cfa;
}
.marbotic-home-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 18px rgba(40, 60, 80, 0.12), 0 3px 0 #cbd5e1;
}
.marbotic-home-btn:active {
  transform: scale(0.94) translateY(1px);
}

.marbotic-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Soft Navigation Chevrons (« and ») seen in Image 1 */
.marbotic-nav-chevron {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e1e9f4;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #74c0fc;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, color 0.2s ease;
  user-select: none;
}
.marbotic-nav-chevron:hover {
  transform: scale(1.12);
  background: #e7f5ff;
  color: #1c7ed6;
}
.marbotic-nav-chevron:active {
  transform: scale(0.92);
}

/* ==========================================================================
   3. THE LIL BLUE MONSTER COMPONENT (Images 3 & 4)
   ========================================================================== */
.monster-stage-wrap {
  width: 100%;
  max-width: 960px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto;
}

.monster-character-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  width: 100%;
  min-height: 420px;
}

/* The Monster Body */
.monster-body-svg {
  width: min(85vw, 440px);
  height: auto;
  filter: drop-shadow(0 14px 28px rgba(44, 90, 110, 0.12));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Monster Eye Blinking & Pupil Tracking */
.monster-eye-white {
  fill: #ffffff;
  transition: transform 0.2s ease;
}
.monster-pupil {
  fill: #1a2730;
  transition: transform 0.15s ease;
  animation: monsterPupilWiggle 5s ease-in-out infinite;
}
@keyframes monsterPupilWiggle {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(2px, 1px); }
  75% { transform: translate(-2px, -1px); }
}

.monster-eyelid {
  fill: #6dc6d3;
  transform-origin: center;
  transform: scaleY(0);
  transition: transform 0.1s ease;
}
.monster-blink .monster-eyelid {
  transform: scaleY(1);
}

/* Monster Smiling / Talking Mouth */
.monster-mouth {
  fill: #243b4a;
  transition: d 0.2s ease;
}

/* Monster Picture Frame Card held in Hand (Image 3: Robot, Image 4: Apple) */
.monster-picture-frame {
  position: absolute;
  top: 15%;
  left: 2%;
  width: clamp(120px, 18vw, 175px);
  height: clamp(130px, 20vw, 185px);
  background: #ffffff;
  border: 5px solid #a5e8f0;
  border-radius: 26px;
  box-shadow: 0 10px 24px rgba(40, 80, 100, 0.14), 0 3px 0 #7ed3dd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
  transform: rotate(-5deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  z-index: 5;
}
.monster-picture-frame:hover {
  transform: rotate(-2deg) scale(1.06);
}
.monster-picture-frame.frame-flip {
  animation: frameCardFlip 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes frameCardFlip {
  0% { transform: rotate(-5deg) scale(0.85); opacity: 0.5; }
  50% { transform: rotate(4deg) scale(1.1); }
  100% { transform: rotate(-5deg) scale(1); opacity: 1; }
}

.frame-illustration {
  font-size: clamp(52px, 9vw, 84px);
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.1));
}
.frame-word-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(13px, 2vw, 17px);
  color: #2b303a;
  margin-top: 6px;
}

/* Monster Belly Card: Displays the chunky wooden stamped letter */
.monster-belly-card {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(100px, 15vw, 135px);
  height: clamp(115px, 17vw, 155px);
  background: #ffffff;
  border-radius: 28px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06), 0 6px 14px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}
.monster-belly-card .wooden-letter-piece {
  transform: scale(1);
}

/* Monster Phonics Pipes & Bubbles on the Right (Image 3 & 4) */
.monster-pipes-wrap {
  position: absolute;
  top: 38%;
  right: 6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

.monster-pipe-svg {
  width: clamp(70px, 11vw, 100px);
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(30, 80, 90, 0.15));
}

/* Animated Phonics Letter Bubbles rising from the pipe */
.pipe-bubble-stream {
  position: absolute;
  bottom: 85%;
  right: 25%;
  width: 80px;
  height: 140px;
  pointer-events: none;
  overflow: visible;
}

.pipe-bubble-char {
  position: absolute;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: #ffd43b;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  animation: pipeBubbleFloat 2.2s ease-out infinite;
}
.pipe-bubble-char:nth-child(1) { left: 10px; animation-delay: 0s; font-size: 20px; }
.pipe-bubble-char:nth-child(2) { left: 35px; animation-delay: 0.6s; font-size: 26px; }
.pipe-bubble-char:nth-child(3) { left: 20px; animation-delay: 1.2s; font-size: 32px; }

@keyframes pipeBubbleFloat {
  0% { transform: translateY(0) scale(0.6) rotate(0deg); opacity: 0; }
  25% { opacity: 1; transform: translateY(-30px) scale(1) rotate(10deg); }
  75% { opacity: 0.8; transform: translateY(-90px) scale(1.15) rotate(-8deg); }
  100% { transform: translateY(-130px) scale(1.3) rotate(15deg); opacity: 0; }
}

/* ==========================================================================
   4. THE PINK BLOB MASCOT COMPANION (Image 3)
   A cute bright pink oval with stick legs waving to the child
   ========================================================================== */
.pink-blob-friend {
  position: absolute;
  bottom: 12px;
  left: 6%;
  width: clamp(64px, 10vw, 84px);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 6;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pink-blob-friend:hover {
  transform: scale(1.12) translateY(-4px);
}
.pink-blob-friend.hop {
  animation: pinkBlobHop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
@keyframes pinkBlobHop {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-24px) scale(1.15, 0.88) rotate(-8deg); }
  70% { transform: translateY(-12px) scale(0.92, 1.08) rotate(6deg); }
}

.pink-blob-body {
  width: 100%;
  height: clamp(68px, 10vw, 90px);
  background: var(--marbotic-pink-friend);
  border-radius: 50% 50% 48% 48% / 60% 60% 40% 40%;
  border: 3px solid #f74d82;
  box-shadow: 0 8px 18px rgba(247, 77, 130, 0.25), inset 0 2px 4px rgba(255,255,255,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pink-blob-eyes {
  display: flex;
  gap: 12px;
  margin-top: -6px;
}
.pink-blob-eye {
  width: 14px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  position: relative;
  border: 1.5px solid #1a2730;
}
.pink-blob-pupil {
  width: 6px;
  height: 8px;
  background: #1a2730;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 3px;
}

.pink-blob-smile {
  width: 12px;
  height: 6px;
  border-bottom: 2px solid #1a2730;
  border-radius: 0 0 10px 10px;
  margin-top: 4px;
}

.pink-blob-arm-wave {
  position: absolute;
  top: 28px;
  right: -8px;
  width: 18px;
  height: 4px;
  background: #1a2730;
  border-radius: 4px;
  transform-origin: left center;
  animation: blobArmWaving 2s infinite ease-in-out;
}
@keyframes blobArmWaving {
  0%, 100% { transform: rotate(10deg); }
  50% { transform: rotate(-50deg); }
}

.pink-blob-legs {
  display: flex;
  gap: 18px;
  margin-top: -2px;
}
.pink-blob-leg {
  width: 3px;
  height: 24px;
  background: #1a2730;
  border-radius: 2px;
}

/* ==========================================================================
   5. CVC & ONSET WORD BUILDING STAGE (Images 1 & 2)
   ========================================================================== */
.marbotic-build-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 880px;
  flex: 1;
  margin: 0 auto;
  position: relative;
}

/* Centerpiece Illustration (e.g. Tree Branch dripping Sap, Robot, Parachute) */
.marbotic-word-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(16px, 3vh, 32px);
  position: relative;
}
.marbotic-hero-illustration {
  font-size: clamp(90px, 18vh, 140px);
  line-height: 1;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.12));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.marbotic-hero-illustration:hover {
  transform: scale(1.08) rotate(3deg);
}

/* Prompt speech bubble at top of word stage (seen in Image 2) */
.marbotic-speech-bubble {
  background: #ffffff;
  border: 2px solid #e0ebf5;
  border-radius: 20px;
  padding: 6px 18px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #495057;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* CVC Letter Slots Row: [ S ] [ A ] [ P ] (Image 2) */
.marbotic-cvc-slots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.5vw, 24px);
  width: 100%;
}

.marbotic-slot-card {
  width: clamp(84px, 13vw, 115px);
  height: clamp(100px, 16vw, 140px);
  border-radius: 24px;
  background: #ffffff;
  border: 3px dashed #d0dbe5;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.marbotic-slot-card:hover {
  transform: translateY(-2px);
  border-color: #74c0fc;
}

.marbotic-slot-card.active-target {
  border-color: #339af0;
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(51, 154, 240, 0.25), 0 8px 20px rgba(51, 154, 240, 0.15);
  animation: slotTargetPulse 1.8s ease-in-out infinite;
}
@keyframes slotTargetPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.marbotic-slot-card.filled {
  border: none;
  background: transparent;
  box-shadow: none;
  transform: none !important;
}

.marbotic-slot-card.filled .wooden-letter-piece {
  animation: slotSnapBounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.marbotic-slot-card.blending-active {
  transform: scale(1.15) translateY(-8px) !important;
  box-shadow: 0 12px 28px rgba(255, 212, 59, 0.4) !important;
}
.marbotic-slot-card.blending-active .wooden-letter-piece {
  filter: drop-shadow(0 8px 16px rgba(255, 200, 0, 0.5));
}

.marbotic-slot-card.word-bounce {
  animation: slotWordBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Onset Word Display: [ R ] obot (Image 1) */
.marbotic-onset-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.marbotic-onset-rest {
  font-family: 'Outfit', 'Nunito', sans-serif;
  font-size: clamp(48px, 9vw, 84px);
  font-weight: 900;
  color: #1a2730;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Responsive adjustments for iPad Landscape */
.marbotic-build-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #eef2f6;
  border-radius: 36px;
  box-shadow: 0 16px 36px rgba(44, 60, 80, 0.08);
  padding: clamp(14px, 2.5vh, 28px) clamp(18px, 3.5vw, 42px);
  width: 100%;
  max-width: 840px;
}

.slot-placeholder {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 800;
  color: #cbd5e1;
  opacity: 0.6;
  user-select: none;
  pointer-events: none;
  transition: all 0.2s ease;
}

.marbotic-slot-card.active-target .slot-placeholder {
  color: #339af0;
  opacity: 0.85;
  transform: scale(1.08);
}

.marbotic-discover-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   Build Words 4-Level Indicator & Star Tracker
   ========================================================================== */
.build-level-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 247, 255, 0.95));
  border: 2px solid #e1ecf8;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(40, 60, 90, 0.05);
  margin-bottom: 12px;
}

.level-indicator-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-tag-icon {
  font-size: 20px;
  animation: pulseStar 2s infinite ease-in-out;
}
@keyframes pulseStar {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(10deg); }
}

.level-number-badge {
  background: linear-gradient(135deg, #4c6ef5, #364fc7);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.8px;
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(76, 110, 245, 0.35);
}

.level-title-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #1c2b3a;
}

.level-stars-tracker {
  display: flex;
  align-items: center;
  gap: 4px;
}

.level-star-pill {
  font-size: 18px;
  color: #cbd5e1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
  user-select: none;
}

.level-star-pill.filled {
  color: #fcc419;
  filter: drop-shadow(0 2px 4px rgba(252, 196, 25, 0.45));
  animation: starPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes starPop {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

