/* Study Brew: Cozy Cafe & SAT Tycoon Styles */

:root {
  --cafe-bg: #fdf8f5;
  --cafe-card: #ffffff;
  --cafe-cream: #f7ede2;
  --cafe-boba: #4a3728;
  --cafe-matcha: #709775;
  --cafe-taro: #9d8189;
  --cafe-peach: #f4a261;
  --cafe-pink: #f7a072;
  --cafe-accent: #e76f51;
  --cafe-gold: #f4a261;
}

body {
  background-color: var(--cafe-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #3d342f;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Cozy Floating Animation */
@keyframes softFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.animate-float {
  animation: softFloat 3s ease-in-out infinite;
}

/* Coin Pop Animation */
@keyframes coinFly {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(1.3);
  }
}

.coin-popup {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  color: #d97706;
  animation: coinFly 1s ease-out forwards;
  z-index: 50;
}

/* Rush Hour Pulsing Aura */
@keyframes rushGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    border-color: #f59e0b;
  }
  50% {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.7);
    border-color: #d97706;
  }
}

.rush-hour-active {
  animation: rushGlow 1.8s infinite;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

/* Touch-friendly buttons */
.btn-press {
  transition: transform 0.1s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-press:active {
  transform: scale(0.97);
}

/* Custom scrollbar for desktop/chromebook */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #fdf8f5;
}
::-webkit-scrollbar-thumb {
  background: #e2d4c9;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #cbb8aa;
}

/* Safe area insets for iOS / modern mobile */
.safe-pb {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Cafe Scene Decor Hotspots */
.decor-hotspot {
  position: absolute;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  z-index: 10;
}

.decor-hotspot:hover {
  transform: scale(1.18);
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.9));
}

.decor-hotspot:active {
  transform: scale(0.95);
}

/* Fairy Lights Sparkle */
@keyframes lightsSparkle {
  0%, 100% {
    filter: drop-shadow(0 0 8px #fef08a) brightness(1.1);
    opacity: 0.9;
  }
  50% {
    filter: drop-shadow(0 0 16px #fde047) brightness(1.3);
    opacity: 1;
  }
}

.lights-glow {
  animation: lightsSparkle 2s ease-in-out infinite;
}

/* Steam Curl Animation for Espresso Machine */
@keyframes steamRise {
  0% {
    opacity: 0.7;
    transform: translateY(0) scale(0.8);
  }
  50% {
    opacity: 0.4;
    transform: translateY(-8px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scale(1.3);
  }
}

.steam-particle {
  animation: steamRise 1.8s ease-out infinite;
}

/* Cat Breathing / Purr */
@keyframes catBreath {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.06, 0.96) translateY(-2px);
  }
}

.cat-purr {
  animation: catBreath 2.4s ease-in-out infinite;
}

/* Vinyl Spinning */
@keyframes vinylSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.vinyl-active {
  animation: vinylSpin 3s linear infinite;
}

/* Pop-in animation for newly bought decor */
@keyframes decorPopIn {
  0% {
    transform: scale(0) rotate(-15deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.25) rotate(5deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.decor-pop-in {
  animation: decorPopIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Cat Animations */
@keyframes catWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg) translateY(-2px); }
  75% { transform: rotate(6deg) translateY(-2px); }
}

.cat-wiggle {
  animation: catWiggle 3.5s ease-in-out infinite;
}

@keyframes catSwish {
  0%, 100% { transform: rotate(0deg) scaleX(1); }
  50% { transform: rotate(4deg) scaleX(1.02); }
}

.cat-swish {
  animation: catSwish 2.8s ease-in-out infinite;
}

@keyframes catBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px) scaleY(1.05); }
  60% { transform: translateY(-2px) scaleY(0.98); }
}

.cat-bounce {
  animation: catBounce 2.2s ease-in-out infinite;
}

/* Floating Love Hearts on Petting */
@keyframes floatHeart {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6);
  }
  50% {
    opacity: 0.9;
    transform: translateY(-25px) scale(1.3) rotate(-10deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.6) rotate(15deg);
  }
}

.heart-pop {
  position: absolute;
  pointer-events: none;
  font-size: 1.4rem;
  z-index: 60;
  animation: floatHeart 1.2s ease-out forwards;
}

/* Cat Speech Bubble */
.cat-bubble {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

/* ============================================================
   MOBILE TYPOGRAPHY & READABILITY ENHANCEMENTS
   Ensures text, options, passages, and dialogue are comfortable
   and legible on mobile screens without eye strain.
   ============================================================ */
@media (max-width: 640px) {
  /* Prevent any unintentional text shrinking on iOS/Android */
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* Reading passages: clear, comfortable line height and 15px+ body */
  #passage-box {
    font-size: 0.95rem !important; /* ~15.2px */
    line-height: 1.65 !important;
    padding: 0.85rem 1rem !important;
  }

  #passage-text {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
  }

  /* Question Prompt */
  #prompt-text {
    font-size: 1.05rem !important; /* ~16.8px */
    line-height: 1.45 !important;
  }

  /* Multiple choice option buttons */
  .option-choice-btn {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    padding: 0.85rem 0.9rem !important;
  }

  .option-badge {
    width: 1.85rem !important;
    height: 1.85rem !important;
    font-size: 0.875rem !important;
  }

  /* Customer dialogue & speech */
  #customer-speech {
    font-size: 0.875rem !important; /* 14px instead of 12px */
    line-height: 1.4 !important;
  }

  #customer-name {
    font-size: 1rem !important;
  }

  #customer-title {
    font-size: 0.8rem !important;
  }

  #customer-order-tag {
    font-size: 0.8rem !important;
  }

  /* Explanation Body & Barista Tips */
  #explanation-body {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }

  #explanation-tip {
    font-size: 0.875rem !important;
    line-height: 1.45 !important;
  }

  #hint-box {
    font-size: 0.875rem !important;
  }

  /* Question badges */
  #question-subject-badge,
  #question-difficulty-badge,
  #question-category {
    font-size: 0.8rem !important;
  }

  /* Mode selection tabs */
  .mode-btn {
    font-size: 0.85rem !important;
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }

  /* Action buttons in header (Stats, Music, Sound, Cats, Shop, etc.) */
  header .text-xs {
    font-size: 0.825rem !important;
  }
}


