/* Bloom Cafe Merge: Adorable Cozy Chibi Indie Game Theme */
:root {
  --bg-main: #FFFDF7;
  --bg-card: #FFFFFF;
  --accent-pink: #FF6584;
  --accent-rose: #FF8BA7;
  --accent-soft-pink: #FFE5EC;
  --accent-coffee: #5D3A1A;
  --accent-amber: #E28743;
  --accent-gold: #FFB703;
  --accent-green: #52B788;
  --accent-blue: #4EA8DE;
  --text-primary: #4A2E18;
  --text-muted: #8D6E63;
  --border-soft: #F5D6BA;
  --border-chunky: #8D5B2F;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Jua', 'Pretendard', -apple-system, sans-serif;
  letter-spacing: -0.3px;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  background: #2B1810;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-overflow-scrolling: touch;
}

/* Mobile Frame Wrapper */
#app-container {
  width: 100vw;
  max-width: 440px;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: radial-gradient(circle at 50% 10%, #FFFDF5 0%, #FFF3E6 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(74, 46, 24, 0.45);
  border-radius: 32px;
  border: 5px solid var(--border-chunky);
}

@media (max-width: 480px) {
  #app-container {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
}

/* =========================================
   0. GAME TITLE SCREEN (타이틀 화면)
========================================= */
.title-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 35px 20px 25px;
  background: url('cafe_bg.jpg') center/cover no-repeat;
  cursor: pointer;
  transition: opacity 0.5s ease;
}

.title-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.title-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 248, 235, 0.3) 0%, rgba(60, 30, 15, 0.75) 100%);
  pointer-events: none;
}

.title-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.title-logo-container {
  text-align: center;
  margin-top: 15px;
  background: rgba(255, 253, 245, 0.96);
  padding: 14px 24px;
  border-radius: 26px;
  border: 3.5px solid var(--border-chunky);
  box-shadow: 0 6px 0 var(--border-chunky), 0 15px 35px rgba(0, 0, 0, 0.35);
}

.logo-sparkle {
  font-size: 22px;
  animation: pulse 1.5s infinite;
}

.game-logo-title {
  font-size: 26px;
  font-weight: 900;
  color: #5D3A1A;
  text-shadow: 0 2px 0 #FFF, 0 3px 6px rgba(141, 91, 47, 0.3);
  letter-spacing: -0.5px;
}

.game-logo-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: #FF6584;
  margin-top: 3px;
}

.title-barista-hero {
  position: relative;
  margin-top: -10px;
}

.hero-character {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 12%;
  border: 5px solid #FFF;
  box-shadow: 0 6px 0 var(--border-chunky), 0 15px 35px rgba(0, 0, 0, 0.35), 0 0 0 3.5px var(--border-chunky);
  animation: floatHero 3s ease-in-out infinite;
  background-color: #FFF3E6;
}

@keyframes floatHero {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}

.tap-to-start-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tap-text {
  font-size: 16px;
  font-weight: 900;
  color: #FFF;
  background: linear-gradient(180deg, #FF6584 0%, #E11D48 100%);
  padding: 10px 26px;
  border-radius: 25px;
  box-shadow: 0 4px 0 #9F1239, 0 8px 20px rgba(0, 0, 0, 0.35);
  border: 2px solid #FFF;
}

.blink-anim {
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.97); }
}

.version-tag {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: bold;
}

/* =========================================
   0-1. STORY PROLOGUE MODAL (스토리 인트로)
========================================= */
.prologue-card {
  width: 100%;
  max-width: 380px;
  background: #FFFDF9;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  border: 3px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prologue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prologue-badge {
  font-size: 12px;
  font-weight: 800;
  color: #D97706;
  background: #FEF3C7;
  padding: 3px 8px;
  border-radius: 10px;
}

.btn-skip {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: bold;
  color: #9CA3AF;
  cursor: pointer;
}

.prologue-img-box {
  position: relative;
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border-soft);
}

.prologue-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prologue-avatar-box {
  position: absolute;
  bottom: 8px;
  right: 12px;
}

.prologue-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 12%;
  border: 3.5px solid #FFF;
  box-shadow: 0 4px 0 var(--border-chunky), 0 8px 16px rgba(0, 0, 0, 0.35);
  background-color: #FFF3E6;
}

.prologue-dialogue {
  background: #FFFDF8;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--border-soft);
  box-shadow: 0 3px 0 var(--border-soft);
}

.prologue-dialogue h3 {
  font-size: 14px;
  font-weight: 800;
  color: #BE185D;
  margin-bottom: 4px;
}

.prologue-dialogue p {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--accent-coffee);
}

.prologue-footer {
  display: flex;
  justify-content: flex-end;
}

/* =========================================
   0-2. INTERACTIVE TUTORIAL OVERLAY
========================================= */
.tutorial-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  pointer-events: none; /* Allows click through to target */
}

.tutorial-overlay.hidden {
  display: none;
}

.tutorial-banner {
  position: absolute;
  top: 48px; /* Docks right below header, cleanly replacing the story banner during guide */
  left: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: 14px;
  border: 2px solid #F59E0B;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
  pointer-events: auto;
  z-index: 310;
}

.tutorial-claire-icon {
  font-size: 26px;
}

.tutorial-speech h4 {
  font-size: 12px;
  font-weight: 800;
  color: #D97706;
}

.tutorial-speech p {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-coffee);
  margin-top: 1px;
}

.btn-skip-tutorial {
  background: #F3F4F6;
  border: 1.5px solid #D1D5DB;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 11px;
  font-weight: 900;
  color: #6B7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  transition: all 0.1s;
}

.btn-skip-tutorial:active {
  transform: scale(0.92);
  background: #E5E7EB;
}

.tutorial-hand {
  position: absolute;
  font-size: 38px;
  z-index: 350;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  animation: bouncePointer 1s ease-in-out infinite;
}

@keyframes bouncePointer {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-16px) scale(1.15); }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* =========================================
   TOP HUD BAR
========================================= */
#game-header {
  height: 48px;
  flex-shrink: 0;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border-soft);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(120, 53, 15, 0.05);
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 2.5px;
  background: #FFF;
  padding: 3px 6px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 10.5px;
  border: 1.5px solid var(--border-soft);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s;
  white-space: nowrap;
}

/* Player Level & XP HUD Pill */
.level-pill {
  background: #FEF3C7;
  border-color: #FCD34D;
  padding: 3px 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.level-badge {
  font-size: 10px;
  font-weight: 900;
  color: #B45309;
}

.xp-bar-bg {
  width: 22px;
  height: 6px;
  background: #FDE68A;
  border-radius: 3px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #EF4444);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.vip-badge {
  font-size: 9px;
  font-weight: 900;
  color: #FFF;
  background: linear-gradient(135deg, #EC4899, #8B5CF6);
  padding: 2px 6px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.4);
}

.pulse-jump {
  animation: hudJump 0.25s ease;
}

@keyframes hudJump {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); color: #F59E0B; }
  100% { transform: scale(1); }
}

.energy-pill {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
  cursor: pointer;
}

.btn-pill-add {
  background: #3B82F6;
  color: #fff;
  border: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.4);
}

.hud-currencies {
  display: flex;
  gap: 4px;
}

.coin-pill { color: #B45309; }
.gem-pill { color: #7C3AED; }
.star-pill { color: #D97706; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFFDF8;
  border: 2px solid var(--border-chunky);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 var(--border-chunky);
  transition: transform 0.1s ease;
}

.icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border-chunky);
}

/* =========================================
   MAIN VIEW CONTAINER
========================================= */
#main-view {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view-section {
  display: none;
  flex: 1 1 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden; /* Merge board section must NEVER scroll */
}

.view-section.active {
  display: flex;
}

/* LIVE STORY CAFE SCENE BANNER (Compact & Elegant) */
.story-scene-banner {
  height: 42px;
  flex-shrink: 0;
  position: relative;
  background: url('cafe_bg.jpg') center 30% / cover no-repeat;
  border-bottom: 1.5px solid var(--border-soft);
  display: flex;
  align-items: center;
  padding: 2px 8px;
  overflow: hidden;
}

.story-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 248, 240, 0.3) 0%, rgba(255, 248, 240, 0.82) 100%);
  pointer-events: none;
}

.story-character-group {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.character-portrait-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.character-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 12%;
  border: 2px solid #FFF;
  box-shadow: 0 2px 0 var(--border-chunky), 0 3px 8px rgba(120, 53, 15, 0.2);
  background-color: #FFF3E6;
}

.bounce-idle {
  animation: gentleBounce 3s ease-in-out infinite;
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.character-nametag {
  display: none; /* Keep story banner slim and clean */
}

.story-speech-bubble {
  flex: 1;
  min-width: 0;
  background: #FFFDF8;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border-soft);
  box-shadow: 0 1.5px 0 var(--border-soft);
  position: relative;
}

.story-speech-bubble p {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent-coffee);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.speech-arrow {
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 5px solid #FFF;
}

/* Customer Orders Area (Slim & Non-Intrusive) */
.orders-section {
  flex-shrink: 0;
  padding: 2px 8px 3px;
  background: #FFFDF9;
  border-bottom: 1.5px solid var(--border-soft);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.title-main {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent-coffee);
}

.sub-hint {
  font-size: 9px;
  color: var(--text-muted);
}

.orders-list {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 1px 0;
  scrollbar-width: none;
}

.orders-list::-webkit-scrollbar {
  display: none;
}

.order-card {
  flex: 1 1 0;
  min-width: 94px;
  background: #FFFDF8;
  border: 1.5px solid #DDB892;
  border-radius: 12px;
  padding: 3px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 0 #DDB892, 0 3px 8px rgba(120, 53, 15, 0.05);
  position: relative;
  transition: transform 0.15s ease;
}

.order-header-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  justify-content: center;
  margin-bottom: 1px;
}

.order-avatar-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #FF8BA7;
  box-shadow: 0 1px 3px rgba(120, 53, 15, 0.15);
  background-color: #FFF3E6;
  overflow: hidden;
  flex-shrink: 0;
}

.order-avatar-badge.customer-minji {
  background: url('customers_sheet.jpg') 18% 22% / 330% no-repeat;
}

.order-avatar-badge.customer-junho {
  background: url('customers_sheet.jpg') 50% 25% / 330% no-repeat;
}

.order-avatar-badge.customer-lucy {
  background: url('customers_sheet.jpg') 81% 25% / 330% no-repeat;
}

.order-customer {
  font-size: 10px;
  font-weight: 800;
  color: #5D3A1A;
}

.order-target {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #FFF5EB;
  padding: 1px 5px;
  border-radius: 6px;
  margin: 1px 0;
  border: 1px solid #FCD5B5;
}

.target-name {
  font-size: 9px;
  font-weight: 700;
  color: #5D3A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-tier {
  font-size: 8.5px;
  font-weight: 800;
  color: #EA580C;
  flex-shrink: 0;
}

.order-reward {
  display: flex;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  color: #B45309;
  margin-bottom: 2px;
}

.btn-serve {
  width: 100%;
  padding: 3px 0;
  border-radius: 7px;
  font-size: 10px;
  font-family: 'Jua', sans-serif;
  border: 1.5px solid #5D3A1A;
  cursor: pointer;
  transition: all 0.1s;
}

.btn-serve.ready {
  background: linear-gradient(180deg, #FF6584 0%, #E11D48 100%);
  color: #FFF;
  box-shadow: 0 2px 0 #9F1239;
  animation: pulse 1.6s infinite;
}

.btn-serve.ready:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #9F1239;
}

.btn-serve.disabled {
  background: #F3F4F6;
  color: #9CA3AF;
  border: 1.5px solid #D1D5DB;
  box-shadow: 0 1.5px 0 #D1D5DB;
}

/* 60FPS Canvas Merge Board Area (Auto Dynamic Fit) */
.canvas-board-wrapper {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 6px;
  background: #FAF2E9;
  overflow: hidden;
  box-sizing: border-box;
}

#board-canvas {
  width: 320px;
  height: 320px;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: #FCECE0;
  box-shadow: 0 4px 14px rgba(120, 53, 15, 0.15), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  border: 2.5px solid #DDB892;
  cursor: grab;
  touch-action: none;
  display: block;
}

#board-canvas:active {
  cursor: grabbing;
}

/* =========================================
   RECIPE BOOK MODAL (디저트 도감)
========================================= */
.recipe-card {
  max-width: 390px;
}

.recipe-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.recipe-item-card {
  background: #FFF;
  border: 1.5px solid var(--border-soft);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.recipe-item-card.locked {
  background: #F3F4F6;
  opacity: 0.6;
}

.recipe-icon {
  font-size: 26px;
  margin-bottom: 4px;
}

.recipe-name {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-coffee);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95%;
}

.btn-claim-recipe {
  margin-top: 5px;
  background: #10B981;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 6px;
  cursor: pointer;
}

.claimed-tag {
  margin-top: 5px;
  font-size: 9px;
  font-weight: bold;
  color: #9CA3AF;
}

/* Cafe Decor View with Illustrated Background */
.decor-header {
  padding: 12px;
  text-align: center;
}

.decor-header h2 {
  font-size: 17px;
  color: var(--accent-coffee);
}

.decor-header p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.cafe-full-illustration {
  margin: 0 12px 14px;
  height: 180px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  border: 3px solid #FBCFE8;
  box-shadow: 0 8px 20px rgba(120, 53, 15, 0.2);
}

.decor-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.decor-overlay-spots {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.decor-pin {
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent-coffee);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #F59E0B;
  animation: pulse 2s infinite;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.decor-pin:active {
  transform: scale(0.92);
}

.highlight-pulse {
  animation: highlightCard 1.2s ease;
}

@keyframes highlightCard {
  0%, 100% { border-color: var(--border-soft); box-shadow: 0 2px 6px rgba(0,0,0,0.03); }
  30%, 70% { border-color: #F43F5E; box-shadow: 0 0 16px rgba(244, 63, 94, 0.5); transform: scale(1.02); }
}

.decor-list {
  padding: 0 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.decor-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFF;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--border-soft);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.decor-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-coffee);
}

.decor-current {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.btn-upgrade-decor {
  background: linear-gradient(180deg, #FBBF24 0%, #D97706 100%);
  color: #FFF;
  border: none;
  border-bottom: 3px solid #B45309;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.35);
}

.btn-upgrade-decor:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.decor-complete {
  font-size: 11px;
  font-weight: 800;
  color: #10B981;
}

/* Bottom Navigation Bar (Chunky Jelly Cookie Style) */
#bottom-nav {
  height: 54px;
  flex-shrink: 0;
  display: flex;
  background: #FFFDF8;
  border-top: 2.5px solid var(--border-chunky);
  z-index: 10;
  box-shadow: 0 -4px 16px rgba(93, 58, 26, 0.08);
  padding: 2px 4px;
}

.nav-item {
  flex: 1;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8D6E63;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  font-family: 'Jua', sans-serif;
}

.nav-item.active {
  background: #FFF0F5;
  border-color: #FF8BA7;
  color: #FF6584;
  box-shadow: 0 3px 0 #FF8BA7;
  transform: translateY(-2px);
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-icon {
  font-size: 20px;
}

.nav-text {
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.nav-item.highlight {
  color: #2563EB;
}

.nav-badge, .ad-free-badge {
  position: absolute;
  top: 6px;
  right: 18px;
  background: #EF4444;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 6px;
}

.ad-free-badge {
  background: #10B981;
}

/* 3D Chunky Biscuit/Jelly Buttons for Modals & Actions */
.btn-jelly {
  border: 2px solid var(--border-chunky);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  font-family: 'Jua', sans-serif;
  color: #FFF;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  box-shadow: 0 4px 0 var(--border-chunky), 0 6px 12px rgba(93, 58, 26, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
}

.btn-jelly:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--border-chunky);
}

.btn-pink {
  background: linear-gradient(180deg, #FF6584 0%, #E11D48 100%);
}

.btn-gold {
  background: linear-gradient(180deg, #FBBF24 0%, #D97706 100%);
}

.btn-blue {
  background: linear-gradient(180deg, #60A5FA 0%, #2563EB 100%);
}

.btn-purple {
  background: linear-gradient(180deg, #C084FC 0%, #7C3AED 100%);
}

/* Modals */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(40, 20, 10, 0.65);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 450;
  padding: 20px;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  background: #FFFDF9;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  border: 3px solid var(--border-soft);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header h2 {
  font-size: 17px;
  color: var(--accent-coffee);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #9CA3AF;
}

.modal-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.energy-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.energy-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFF;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  padding: 12px;
}

.energy-amt {
  font-size: 14px;
  font-weight: 800;
  color: #1D4ED8;
  display: block;
}

.energy-cost {
  font-size: 10px;
  color: var(--text-muted);
}

/* Shop List */
.shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFF;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid var(--border-soft);
}

.shop-item.vip-item {
  background: #FEF3C7;
  border-color: #F59E0B;
}

.item-badge {
  font-size: 9px;
  font-weight: 800;
  color: #D97706;
  margin-bottom: 2px;
}

.item-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.item-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* Ad Simulator Video Card */
.ad-video-card {
  width: 100%;
  max-width: 360px;
  height: 440px;
  background: #111827;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #3B82F6;
}

.ad-video-header {
  padding: 10px 14px;
  background: #1F2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ad-sponsor-badge {
  font-size: 10px;
  font-weight: bold;
  color: #60A5FA;
}

.ad-timer-text {
  font-size: 11px;
  font-weight: bold;
  color: #F59E0B;
}

.ad-video-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #38BDF8;
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 14px;
}

.ad-headline {
  font-size: 15px;
  font-weight: 800;
  color: #FFF;
}

.ad-reward-desc {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 4px;
}

.ad-video-footer {
  padding: 12px;
  background: #1F2937;
}

.btn-ad-close {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: #10B981;
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.btn-ad-close.disabled {
  background: #374151;
  color: #6B7280;
  cursor: not-allowed;
}

/* Toast */
.toast {
  position: absolute;
  top: 65px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1F2937;
  color: #FFF;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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


/* =========================================
   V2.0 DIRECTOR'S CUT STYLES
   (Action Bar, Storage Bag, Flash Shop, Set/VIP Orders, Visual Decor)
========================================= */

.speech-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  gap: 6px;
}

.tip-bonus-tag {
  font-size: 9.5px;
  font-weight: 800;
  color: #B45309;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  padding: 1px 6px;
  border-radius: 8px;
}

.combo-badge {
  font-size: 9.5px;
  font-weight: 900;
  color: #FFF;
  background: linear-gradient(90deg, #F97316, #EF4444);
  padding: 1px 7px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
  animation: pulse 0.8s infinite;
}

.combo-badge.hidden {
  display: none;
}

.banner-decor-layer {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.banner-decor-chip {
  font-size: 9px;
  background: rgba(255, 253, 248, 0.92);
  color: #5D3A1A;
  border: 1.5px solid #F59E0B;
  padding: 1px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Set & VIP Order Cards */
.order-card.vip-order {
  background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
  border-color: #F59E0B;
  box-shadow: 0 4px 0 #D97706, 0 6px 14px rgba(217, 119, 6, 0.18);
}

.order-card.set-order {
  background: linear-gradient(180deg, #FFFDF9 0%, #FFF0F5 100%);
  border-color: #FF8BA7;
  box-shadow: 0 4px 0 #E29578, 0 6px 14px rgba(255, 101, 132, 0.15);
}

.order-badge-top {
  position: absolute;
  top: -6px;
  right: 6px;
  font-size: 8.5px;
  font-weight: 900;
  color: #FFF;
  background: #E11D48;
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid #FFF;
}

.order-badge-top.vip {
  background: linear-gradient(90deg, #D97706, #B45309);
}

.order-targets-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin: 3px 0;
}

.order-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 5px;
  border-radius: 7px;
  border: 1px solid #FCD5B5;
  font-size: 9.5px;
}

.order-target-row.fulfilled {
  background: #DCFCE7;
  border-color: #86EFAC;
  color: #166534;
}

.order-btn-group {
  display: flex;
  gap: 3px;
  width: 100%;
}

.btn-serve-2x {
  flex: 0 0 auto;
  padding: 5px 5px;
  border-radius: 10px;
  font-size: 9.5px;
  font-family: 'Jua', sans-serif;
  background: linear-gradient(180deg, #60A5FA 0%, #2563EB 100%);
  color: #FFF;
  border: 1.5px solid #1E3A8A;
  box-shadow: 0 2px 0 #1E3A8A;
  cursor: pointer;
}

.btn-serve-2x:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* Bottom Item Selection & Bag Bar */
.board-action-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px;
  background: #FFF9F0;
  border-top: 1.5px solid #F3DFC9;
}

.btn-storage-bag {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #FDE68A 0%, #F59E0B 100%);
  border: 2px solid var(--border-chunky);
  border-radius: 14px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border-chunky);
  flex-shrink: 0;
  color: #5D3A1A;
  transition: transform 0.1s;
}

.btn-storage-bag:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border-chunky);
}

.bag-icon {
  font-size: 18px;
}

.bag-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.bag-label {
  font-size: 10px;
  font-weight: 800;
}

.bag-count {
  font-size: 11px;
  font-weight: 900;
  color: #78350F;
}

.selected-item-panel {
  flex: 1;
  min-width: 0;
  background: #FFFFFF;
  border: 2px solid #E6BA95;
  border-radius: 14px;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.sel-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sel-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #5D3A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sel-desc {
  font-size: 9.5px;
  color: #8D6E63;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-mini-action {
  border: 1.5px solid var(--border-chunky);
  border-radius: 10px;
  padding: 5px 8px;
  font-size: 10.5px;
  font-family: 'Jua', sans-serif;
  color: #FFF;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border-chunky);
  white-space: nowrap;
  transition: transform 0.08s;
}

.btn-mini-action:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn-mini-green {
  background: linear-gradient(180deg, #34D399 0%, #059669 100%);
}

.btn-mini-gray {
  background: linear-gradient(180deg, #9CA3AF 0%, #4B5563 100%);
}

/* Storage Bag Modal */
.storage-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.storage-slot {
  aspect-ratio: 1 / 1;
  background: #FFF9F0;
  border: 2px solid #DDB892;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s;
}

.storage-slot.filled {
  background: #FFF;
  border-color: #F59E0B;
  box-shadow: 0 3px 0 #DDB892;
}

.storage-slot.filled:active {
  transform: translateY(2px);
}

.storage-slot.locked {
  background: #F3F4F6;
  border-style: dashed;
  border-color: #D1D5DB;
  color: #9CA3AF;
  cursor: default;
}

.storage-slot-icon {
  font-size: 20px;
}

.storage-slot-name {
  font-size: 9px;
  color: #5D3A1A;
  text-align: center;
  margin-top: 2px;
  line-height: 1.1;
}

/* Gold Flash Shop in Shop Modal */
.shop-modal-card {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.shop-list {
  overflow-y: auto;
  max-height: 70vh;
  padding-right: 2px;
}

.flash-shop-section {
  background: #FFF9EB;
  border: 2px solid #FCD34D;
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 10px;
}

.flash-shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #92400E;
}

.flash-refresh-btns {
  display: flex;
  gap: 4px;
}

.flash-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.flash-item-card {
  background: #FFFFFF;
  border: 1.5px solid #FDE68A;
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.flash-item-icon {
  font-size: 20px;
}

.flash-item-name {
  font-size: 10px;
  color: #5D3A1A;
  text-align: center;
  line-height: 1.15;
  height: 23px;
  display: flex;
  align-items: center;
}

/* Visual Cafe Renovation Overlays */
.decor-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.decor-bonus-pill {
  font-size: 11px;
  font-weight: 800;
  color: #FFF;
  background: linear-gradient(90deg, #F59E0B, #D97706);
  padding: 3px 9px;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(217, 119, 6, 0.3);
}

.decor-visual-items {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.visual-upgrade-badge {
  position: absolute;
  background: rgba(255, 253, 248, 0.94);
  border: 2px solid #FF6584;
  border-radius: 14px;
  padding: 4px 8px;
  font-size: 10.5px;
  color: #5D3A1A;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 4px;
  animation: floatHero 2.8s ease-in-out infinite;
}
