/* style.css - Critter Coin Tycoon (Proven Casual Mechanics + Preschool Tactile UI) */

:root {
  --sky-top: #bbf2f6;
  --sky-bottom: #e0f7fa;
  --grass-top: #a5d6a7;
  --grass-bottom: #81c784;
  --gold: #ffc107;
  --gold-dark: #c79100;
  --gold-light: #fff350;
  --bubble-bg: rgba(255, 255, 255, 0.96);
  --card-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  --font-family: 'Fredoka', 'Quicksand', 'Nunito', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 55%, var(--grass-top) 55%, var(--grass-bottom) 100%);
}

#app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

/* TOP STATUS & NAVIGATION BAR */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  z-index: 100;
  gap: 10px;
}

/* Universal Coin Purse */
.purse-container {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 50px;
  padding: 6px 16px 6px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  border: 4px solid var(--gold);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.purse-container:active {
  transform: scale(0.92);
}

.purse-icon {
  font-size: 34px;
  margin-right: 8px;
  animation: purse-wobble 4s infinite ease-in-out;
}

.coin-counter-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.coin-number {
  font-size: 28px;
  font-weight: 900;
  color: #b47805;
  line-height: 1;
}

.coin-dots {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  min-height: 8px;
  max-width: 100px;
  flex-wrap: wrap;
  justify-content: center;
}

.coin-dot {
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  border: 1px solid var(--gold-dark);
}

/* Zone Navigation Tabs */
.zone-nav {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  border-radius: 50px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.nav-tab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: white;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-tab:hover {
  transform: translateY(-3px) scale(1.06);
}

.nav-tab.active {
  border-color: #ff9800;
  background: #fff8e1;
  transform: scale(1.15) translateY(-3px);
  box-shadow: 0 8px 18px rgba(255, 152, 0, 0.35);
}

.nav-tab.adult-tab {
  background: #ede7f6;
  border-color: #b39ddb;
}

.controls-right {
  display: flex;
  gap: 6px;
}

.btn-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  border: 3px solid #80deea;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s;
}

.btn-circle:active {
  transform: scale(0.9);
}

/* STAGE CONTAINER */
#stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  margin: 0 14px 14px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.5), 0 10px 25px rgba(0, 0, 0, 0.05);
}

.zone-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  padding: 12px;
}

.zone-screen.active {
  display: flex;
  animation: popFade 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popFade {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* COMMON TOKENS & ACTION BUTTONS */
.coin-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: white;
  padding: 3px 8px;
  border-radius: 16px;
  border: 2px solid var(--gold);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
}

.coin-tag .num {
  font-size: 18px;
  font-weight: 900;
  color: #b47805;
}

.big-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 26px;
  border: 4px solid #ff9800;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.big-action-btn:hover {
  transform: translateY(-2px) scale(1.04);
}

.big-action-btn:active {
  transform: scale(0.93);
}

.critter-avatar {
  font-size: 42px;
  animation: gentle-wobble 3s infinite ease-in-out;
}

/* =======================================================
   1. COIN MERGE (SUIKA / 2048 STYLE)
   ======================================================= */
.merge-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bubble-bg);
  border-radius: 26px;
  padding: 10px;
  box-shadow: var(--card-shadow);
  border: 4px solid #ffffff;
  position: relative;
}

.merge-top-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 12px;
  margin-bottom: 6px;
}

.merge-preview-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f8e9;
  padding: 4px 12px;
  border-radius: 30px;
  border: 2px solid #81c784;
}

.preview-coin {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 18px;
  color: white;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.merge-formula-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff8e1;
  padding: 6px 14px;
  border-radius: 30px;
  border: 2px solid #ffe082;
  font-size: 15px;
  font-weight: 700;
  color: #795548;
}

.merge-jar-container {
  flex: 1;
  position: relative;
  background: radial-gradient(circle at 50% 30%, #ffffff, #e0f2f1 80%);
  border-radius: 20px 20px 30px 30px;
  border: 6px solid #b2dfdb;
  box-shadow: inset 0 10px 25px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  cursor: crosshair;
}

#merge-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.merge-dropper-guide {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.dropper-coin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 3px solid #ffd54f;
  background: #ffc107;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.dropper-line {
  width: 3px;
  height: 800px;
  background: repeating-linear-gradient(180deg, #80cbc4, #80cbc4 6px, transparent 6px, transparent 12px);
  opacity: 0.7;
}

/* =======================================================
   2. MARKET RUSH (ORDER BOOK & DINER MECHANIC)
   ======================================================= */
.market-rush-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bubble-bg);
  border-radius: 26px;
  padding: 12px;
  box-shadow: var(--card-shadow);
  border: 4px solid #ffffff;
  justify-content: space-between;
}

.rush-wholesale-lane, .rush-customer-lane {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff3e0;
  border: 3px solid #ffb74d;
  border-radius: 24px;
  padding: 8px 16px;
  min-height: 95px;
}

.lane-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 28px;
  min-width: 65px;
}

.bubble-tag {
  font-size: 13px;
  background: white;
  padding: 2px 6px;
  border-radius: 12px;
  border: 1px solid #ffb74d;
  font-weight: bold;
}

.wholesale-cards-row, .customers-queue-row {
  display: flex;
  gap: 12px;
  flex: 1;
  overflow-x: auto;
  padding: 4px 0;
}

.rush-customer-card, .rush-wholesale-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border-radius: 20px;
  padding: 8px 14px;
  border: 3px solid #cfd8dc;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rush-customer-card:hover, .rush-wholesale-card:hover {
  transform: translateY(-4px) scale(1.05);
}

.rush-customer-card.best-bidder {
  border-color: #4caf50;
  background: #f1f8e9;
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
  animation: best-bid-pulse 1.8s infinite;
}

.customer-avatar {
  font-size: 38px;
}

.customer-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f9fbe7;
  padding: 3px 8px;
  border-radius: 14px;
  border: 2px solid #c0ca33;
}

.bid-coins {
  font-size: 18px;
}

.bid-num {
  font-size: 16px;
  font-weight: 900;
  color: #33691e;
}

/* Center Market Counter */
.rush-counter-area {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.stall-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 12px 28px;
  border-radius: 50px;
  border: 4px solid #ff9800;
  box-shadow: 0 8px 20px rgba(255, 152, 0, 0.2);
}

.inventory-crate {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffde7;
  padding: 6px 14px;
  border-radius: 20px;
  border: 3px dashed #fbc02d;
  cursor: pointer;
}

.rush-serve-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #4caf50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 40px;
  font-size: 22px;
  box-shadow: 0 6px 14px rgba(76, 175, 80, 0.4);
  cursor: pointer;
  transition: transform 0.15s;
}

.rush-serve-btn:active {
  transform: scale(0.92);
}

/* =======================================================
   3. PET ROOM (SAVING VS SPENDING)
   ======================================================= */
.pet-room-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bubble-bg);
  border-radius: 26px;
  padding: 14px;
  box-shadow: var(--card-shadow);
  border: 4px solid #ffffff;
  justify-content: space-between;
  align-items: center;
}

.wish-pedestal-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f3e5f5;
  padding: 8px 22px;
  border-radius: 50px;
  border: 3px solid #ba68c8;
  box-shadow: 0 6px 16px rgba(186, 104, 200, 0.25);
  width: 90%;
  justify-content: space-between;
}

.wish-item-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wish-toy-icon {
  font-size: 46px;
  animation: float-toy 2.5s infinite ease-in-out;
}

.wish-progress-container {
  flex: 1;
  max-width: 320px;
}

.wish-slots-grid {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.wish-slot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px dashed #ab47bc;
  background: #ede7f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.wish-slot.filled {
  border-style: solid;
  border-color: #ffd54f;
  background: #ffc107;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.4);
}

.pet-stage-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  margin: 10px 0;
}

.pet-character-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pet-main-avatar {
  font-size: 110px;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
  animation: pet-breath 3.5s infinite ease-in-out;
}

.pet-accessory {
  position: absolute;
  bottom: 0px;
  font-size: 50px;
}

.pet-speech-reaction {
  font-size: 28px;
  background: white;
  padding: 4px 12px;
  border-radius: 20px;
  border: 2px solid #ff80ab;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  margin-top: 4px;
}

.pet-snack-tray {
  display: flex;
  gap: 16px;
  justify-content: center;
  width: 100%;
}

.snack-card {
  background: white;
  border-radius: 20px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 3px solid #e0e0e0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.snack-card:hover {
  transform: translateY(-4px) scale(1.08);
  border-color: #ff9800;
}

/* =======================================================
   4. BANK VAULT (IDLE COMPOUNDING INTEREST)
   ======================================================= */
.bank-vault-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bubble-bg);
  border-radius: 26px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  border: 4px solid #ffffff;
  justify-content: space-between;
  align-items: center;
}

.bank-clock-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #e1f5fe;
  padding: 8px 24px;
  border-radius: 50px;
  border: 3px solid #81d4fa;
}

.sun-dial-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  border: 3px solid #29b6f6;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(41, 182, 246, 0.3);
}

.sun-dial-hand {
  font-size: 26px;
  transition: transform 1s linear;
}

.interest-rate-badge {
  font-size: 22px;
  font-weight: 900;
  color: #0277bd;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bank-vault-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vault-safe-box {
  width: 220px;
  height: 190px;
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  border-radius: 36px;
  border: 6px solid #ff8f00;
  box-shadow: 0 16px 35px rgba(255, 143, 0, 0.35), inset 0 6px 15px rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vault-safe-box:hover {
  transform: scale(1.05);
}

.vault-dial-wheel {
  font-size: 44px;
  animation: gentle-wobble 4s infinite ease-in-out;
}

.bank-actions-row {
  display: flex;
  gap: 20px;
}

/* =======================================================
   5. ADULTS / PARENTS GUIDE
   ======================================================= */
.adult-guide-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 26px;
  padding: 18px 24px;
  box-shadow: var(--card-shadow);
  border: 4px solid #ede7f6;
  overflow: hidden;
}

.guide-header {
  border-bottom: 2px solid #ede7f6;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.guide-header h2 {
  font-size: 26px;
  color: #4a148c;
}

.guide-subtitle {
  font-size: 15px;
  color: #6a1b9a;
  margin-top: 2px;
}

.guide-scroll-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 8px;
}

.guide-card {
  background: #fbf9ff;
  border-radius: 18px;
  padding: 14px 18px;
  border: 2px solid #e1bee7;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.guide-card h3 {
  font-size: 18px;
  color: #4a148c;
}

.guide-card p {
  font-size: 14px;
  color: #424242;
  line-height: 1.5;
  margin-bottom: 6px;
}

.parent-prompt-box {
  background: #ede7f6;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 6px;
  border-left: 4px solid #7e57c2;
}

.parent-prompt-box strong {
  font-size: 13px;
  color: #4a148c;
  display: block;
  margin-bottom: 4px;
}

.parent-prompt-box ul {
  padding-left: 18px;
  font-size: 13px;
  color: #311b92;
}

.parent-prompt-box li {
  margin-bottom: 3px;
}

/* ANIMATIONS & PARTICLES */
#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.flying-coin-sprite {
  position: fixed;
  font-size: 34px;
  pointer-events: none;
  z-index: 2000;
  transition: all 0.65s cubic-bezier(0.25, 1, 0.5, 1);
  filter: drop-shadow(0 6px 12px rgba(212, 155, 16, 0.5));
}

@keyframes gentle-wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

@keyframes purse-wobble {
  0%, 90%, 100% { transform: rotate(0deg); }
  93% { transform: rotate(-8deg); }
  96% { transform: rotate(8deg); }
}

@keyframes pet-breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05) translateY(-4px); }
}

@keyframes float-toy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes best-bid-pulse {
  0%, 100% { transform: scale(1); border-color: #4caf50; }
  50% { transform: scale(1.04); border-color: #2e7d32; box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4); }
}
