@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;900&family=Cinzel:wght@700;900&display=swap');

/* ==================== CSS RESET & ROOT ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:    #f0c040;
  --gold2:   #ffd700;
  --amber:   #e88a00;
  --brown:   #2a1a06;
  --dark:    #0e0a04;
  --panel:   rgba(20,12,4,0.92);
  --glass:   rgba(255,200,60,0.06);
  --border:  rgba(240,192,64,0.3);
  --red:     #ff4444;
  --green:   #44ff88;
  --blue:    #44aaff;
  --text:    #f5e8c0;
  --muted:   #a09070;

  --shadow-gold: 0 0 20px rgba(240,192,64,0.4);
  --shadow-deep: 0 8px 40px rgba(0,0,0,0.8);
  --radius: 16px;
  --radius-sm: 10px;
  font-size: 16px;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--dark);
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  user-select: none;
}

/* ==================== BACKGROUND (MADERA) ==================== */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  background-image: url('../assets/images/wood_wall_gemini.png');
  background-size: cover;
  background-position: center center;
}

/* Overlay oscuro sobre la madera para mantener legibilidad */
#bg-canvas::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    160deg,
    rgba(8,4,1,0.88) 0%,
    rgba(14,8,2,0.82) 40%,
    rgba(6,3,0,0.90) 100%
  );
}

/* Viñeta perimetral dorada */
#bg-canvas::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

/* ==================== LAYOUT ==================== */
#app {
  position: relative; z-index: 1;
  width: 100vw; height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ==================== TOP BAR ==================== */
#top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(10,5,1,0.97) 0%, rgba(18,10,2,0.93) 100%);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.8), inset 0 -1px 0 rgba(240,192,64,0.15);
  flex-shrink: 0; gap: 10px; z-index: 10;
}

#score-block { text-align: center; flex: 1; }
#score-label {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 24px var(--amber), 0 0 60px rgba(240,192,64,0.3), 0 2px 4px #000;
  line-height: 1;
  transition: transform 0.1s;
  letter-spacing: 2px;
}
#score-label.pulse { animation: scorePulse 0.15s ease; }
@keyframes scorePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

#stats-row {
  display: flex; gap: 20px; justify-content: center;
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  color: var(--muted); margin-top: 4px;
}
#stats-row span { color: var(--gold2); font-weight: 600; }

/* ==================== POWERUP BAR ==================== */
#powerup-bar {
  display: none; align-items: center; justify-content: center;
  gap: 10px; padding: 6px 16px;
  background: linear-gradient(90deg, rgba(120,20,80,0.5), rgba(40,80,180,0.5));
  border-bottom: 1px solid rgba(200,80,240,0.4);
  font-size: 0.85rem; color: #ee99ff; font-weight: 600;
  flex-shrink: 0;
}
#powerup-bar.active { display: flex; }
#powerup-timer { font-weight: 900; color: #ff88ff; font-size: 1rem; }

/* ==================== MAIN GAME AREA ==================== */
#game-area {
  flex: 1; display: flex;
  overflow: hidden; position: relative;
}

/* Left: click zone */
#click-zone {
  flex: 1.1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; position: relative;
  padding: 10px;
}

/* Inner glow beneath cachopo */
#click-zone::before {
  content: '';
  position: absolute;
  width: 55%; padding-top: 55%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180,80,10,0.25) 0%, transparent 70%);
  pointer-events: none;
}

#cachopo-wrapper {
  position: relative; cursor: pointer;
  width: clamp(260px, 42vw, 500px);
  height: clamp(260px, 42vw, 500px);
}

#cachopo-glow {
  position: absolute; inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,192,64,0.3) 0%, rgba(180,80,0,0.15) 40%, transparent 70%);
  animation: glowPulse 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.92); }
  50%       { opacity: 1;   transform: scale(1.06); }
}

#cachopo-btn {
  width: 100%; height: 100%;
  border: none; background: none; cursor: pointer; padding: 0;
  position: relative; z-index: 2;
  transition: transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
#cachopo-btn:active { transform: scale(0.91); }
#cachopo-btn img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(200,120,0,0.6)) drop-shadow(0 2px 6px rgba(0,0,0,0.8));
  transition: filter 0.3s;
  pointer-events: none;
}
#cachopo-btn:hover img {
  filter: drop-shadow(0 12px 40px rgba(240,192,64,0.9)) drop-shadow(0 2px 6px rgba(0,0,0,0.8)) brightness(1.08);
}

.click-number {
  position: absolute; pointer-events: none;
  font-family: 'Cinzel', serif; font-size: 1.4rem; font-weight: 900;
  color: var(--gold2);
  text-shadow: 0 0 12px var(--amber), 0 2px 4px #000;
  animation: floatUp 1s ease forwards;
  z-index: 100; white-space: nowrap;
}
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.4); }
}

/* Right: upgrade shop */
#shop-sidebar {
  width: clamp(240px, 32vw, 360px);
  background: linear-gradient(180deg, rgba(8,4,1,0.97) 0%, rgba(12,6,1,0.99) 100%);
  border-left: 2px solid var(--border);
  box-shadow: inset 1px 0 0 rgba(240,192,64,0.1);
  display: flex; flex-direction: column;
  overflow: hidden;
}

#shop-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem; letter-spacing: 3px;
  color: var(--gold); text-align: center;
  background: linear-gradient(180deg, rgba(240,192,64,0.08) 0%, transparent 100%);
  flex-shrink: 0;
}

#shop-list {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 6px 8px; display: flex; flex-direction: column; gap: 4px;
}
#shop-list::-webkit-scrollbar { width: 4px; }
#shop-list::-webkit-scrollbar-track { background: transparent; }
#shop-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.shop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(240,192,64,0.12);
  background: rgba(255,200,60,0.03);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.shop-item::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(240,192,64,0.08) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.2s;
}
.shop-item:hover::before { opacity: 1; }
.shop-item:hover { border-color: rgba(240,192,64,0.5); transform: translateX(-2px); }
.shop-item.affordable { border-color: rgba(240,192,64,0.4); }
.shop-item.affordable:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(240,192,64,0.3); }
.shop-item.locked { opacity: 0.35; cursor: not-allowed; }
.shop-item.locked:hover { transform: none; }

.shop-icon {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: contain; flex-shrink: 0;
  background: rgba(0,0,0,0.5); padding: 4px;
  border: 1px solid rgba(240,192,64,0.2);
}

.shop-info { flex: 1; min-width: 0; }
.shop-name {
  font-size: 0.8rem; font-weight: 700;
  color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.shop-desc { font-size: 0.63rem; color: var(--muted); }
.shop-cost { font-size: 0.72rem; color: var(--gold); font-weight: 600; }

.shop-amount {
  background: rgba(240,192,64,0.12); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 6px;
  font-size: 0.72rem; font-weight: 700;
  color: var(--gold); flex-shrink: 0;
  min-width: 28px; text-align: center;
}

/* ==================== BOTTOM NAV ==================== */
#bottom-nav {
  display: flex; justify-content: space-around;
  padding: 6px 10px 10px;
  background: linear-gradient(0deg, rgba(8,4,1,0.99) 0%, rgba(14,8,2,0.97) 100%);
  border-top: 2px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(240,192,64,0.12);
  flex-shrink: 0; gap: 6px;
}

.nav-btn {
  flex: 1; max-width: 120px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 8px 4px;
  border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--muted); font-family: 'Outfit', sans-serif;
  font-size: 0.62rem; letter-spacing: 1px; text-transform: uppercase;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn .nav-icon {
  width: 28px; height: 28px; object-fit: contain;
  opacity: 0.5; transition: all 0.2s;
  filter: sepia(1) saturate(3) hue-rotate(10deg);
}
.nav-btn:hover { color: var(--gold); background: rgba(240,192,64,0.08); }
.nav-btn:hover .nav-icon { opacity: 1; transform: scale(1.15); filter: none; }
.nav-btn.active { color: var(--gold2); }
.nav-btn.active .nav-icon { opacity: 1; filter: none; }

/* ==================== OVERLAY PANELS ==================== */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(4,2,0,0.88);
  backdrop-filter: blur(8px);
  padding: 16px;
}
.overlay.open { display: flex; }

.panel {
  background: linear-gradient(160deg, rgba(20,10,2,0.98) 0%, rgba(10,5,1,0.99) 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep), var(--shadow-gold), inset 0 1px 0 rgba(240,192,64,0.15);
  width: 100%; max-width: 540px;
  max-height: 88vh; display: flex; flex-direction: column;
  animation: panelIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes panelIn {
  from { opacity: 0; transform: scale(0.86) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(240,192,64,0.06) 0%, transparent 100%);
  flex-shrink: 0;
}
.panel-title {
  font-family: 'Cinzel', serif; font-size: 1rem;
  letter-spacing: 3px; color: var(--gold);
  display: flex; align-items: center; gap: 10px;
}
.panel-title img {
  width: 26px; height: 26px; object-fit: contain;
  filter: drop-shadow(0 0 6px var(--amber));
}
.panel-close {
  background: none; border: 1px solid rgba(240,192,64,0.2); cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 1rem; color: var(--muted); line-height: 1;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.panel-close:hover { color: var(--gold); border-color: var(--gold); transform: rotate(90deg); background: rgba(240,192,64,0.1); }

.panel-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.panel-footer { padding: 12px 22px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-family: 'Outfit', sans-serif;
  font-size: 0.88rem; font-weight: 700; letter-spacing: 0.5px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-gold {
  background: linear-gradient(135deg, #a07008 0%, #f0c040 50%, #a07008 100%);
  color: #1a0a00;
  box-shadow: 0 4px 16px rgba(240,192,64,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-gold:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(240,192,64,0.5); }
.btn-gold:active { transform: translateY(0); filter: brightness(0.95); }
.btn-gold:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border); color: var(--muted);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(240,192,64,0.06); }
.btn-red {
  background: linear-gradient(135deg, #7a0000, #c02020);
  color: #ffc0c0; box-shadow: 0 4px 12px rgba(200,0,0,0.3);
}
.btn-red:hover { filter: brightness(1.15); }
.btn-full { width: 100%; }

/* ==================== MENU GRID ==================== */
#menu-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 4px;
}

.menu-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 18px 8px;
  background: linear-gradient(160deg, rgba(255,200,60,0.06) 0%, rgba(255,160,20,0.02) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.22s;
  -webkit-tap-highlight-color: transparent;
  position: relative; overflow: hidden;
}
.menu-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(240,192,64,0.12) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.2s;
}
.menu-card:hover::after { opacity: 1; }
.menu-card .menu-icon {
  width: 40px; height: 40px; object-fit: contain;
  transition: transform 0.25s;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}
.menu-card:hover .menu-icon { transform: scale(1.18) translateY(-2px); }
.menu-card .label { font-size: 0.6rem; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }
.menu-card:hover { background: rgba(240,192,64,0.1); border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow-gold); }
.menu-card:hover .label { color: var(--gold); }

/* ==================== SHOP PANEL (FULL) ==================== */
.shop-full-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(240,192,64,0.12);
  background: rgba(255,200,60,0.03); margin-bottom: 6px;
  cursor: pointer; transition: all 0.2s;
}
.shop-full-item:hover { border-color: var(--gold); background: rgba(240,192,64,0.08); }
.shop-full-item.affordable { border-color: rgba(80,220,120,0.4); }
.shop-full-item.affordable:hover { box-shadow: 0 0 12px rgba(80,220,120,0.2); }
.shop-full-item.locked { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.shop-full-icon { width: 54px; height: 54px; object-fit: contain; border-radius: 10px; background: rgba(0,0,0,0.5); padding: 5px; flex-shrink: 0; border: 1px solid rgba(240,192,64,0.2); }
.shop-full-info { flex: 1; }
.shop-full-name { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.shop-full-desc { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }
.shop-full-cost { font-size: 0.8rem; color: var(--gold); font-weight: 600; margin-top: 5px; }
.shop-full-amount { background: rgba(240,192,64,0.12); border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; font-size: 0.9rem; font-weight: 700; color: var(--gold); }

/* ==================== SKINS ==================== */
#skins-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.skin-card {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; cursor: pointer;
  background: rgba(255,200,60,0.03);
  transition: all 0.22s;
}
.skin-card.active-skin { border-color: var(--gold); background: rgba(240,192,64,0.1); box-shadow: var(--shadow-gold); }
.skin-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.skin-card.locked-skin { opacity: 0.35; cursor: not-allowed; }
.skin-img { width: 90px; height: 90px; object-fit: contain; margin: 0 auto; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
.skin-name { font-size: 0.8rem; color: var(--text); margin-top: 10px; font-weight: 700; }
.skin-req { font-size: 0.65rem; color: var(--muted); margin-top: 3px; }
.skin-actions { margin-top: 10px; }

/* ==================== STATS ==================== */
.stat-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid rgba(240,192,64,0.08);
  font-size: 0.88rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--muted); }
.stat-val { color: var(--gold); font-weight: 700; font-family: 'Cinzel', serif; font-size: 0.82rem; }

/* ==================== PRESTIGE ==================== */
#prestige-info {
  background: rgba(240,192,64,0.05); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px;
  text-align: center; margin-bottom: 18px;
}
#prestige-level { font-family: 'Cinzel', serif; font-size: 2rem; color: var(--gold); letter-spacing: 2px; }
#prestige-mult { font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
#prestige-cost { font-size: 1rem; color: var(--text); margin-top: 10px; font-weight: 600; }
#prestige-cost.can-afford { color: var(--green); }
#prestige-cost.cant-afford { color: var(--red); }

/* ==================== STORY ==================== */
.story-stage {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 14px;
  transition: all 0.2s;
}
.story-stage.completed { border-color: rgba(80,220,120,0.5); }
.story-stage.locked-stage { opacity: 0.35; }
.story-stage-img { width: 100%; height: 90px; object-fit: cover; display: block; }
.story-stage-body { padding: 12px 14px; background: rgba(255,200,60,0.04); }
.story-stage-title { font-family: 'Cinzel', serif; font-size: 0.88rem; color: var(--gold); }
.story-stage-req { font-size: 0.72rem; color: var(--muted); margin-top: 5px; }
.story-stage-reward { font-size: 0.72rem; color: var(--green); margin-top: 5px; font-weight: 600; }
.story-stage-status { font-size: 0.78rem; font-weight: 700; margin-top: 7px; }
.story-stage-status.done { color: var(--green); }
.story-stage-status.next { color: var(--gold); }

/* ==================== WHEEL ==================== */
#wheel-container { position: relative; width: 300px; height: 300px; margin: 0 auto; }
#wheel-canvas { border-radius: 50%; box-shadow: var(--shadow-gold), 0 0 50px rgba(240,192,64,0.35); }
#wheel-pointer {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 26px solid var(--gold);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.8));
  z-index: 5;
}
#wheel-result {
  text-align: center; margin-top: 18px;
  font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--gold); font-weight: 700;
  min-height: 30px; letter-spacing: 1px;
}
#wheel-free-badge {
  text-align: center; margin-bottom: 10px;
  font-size: 0.8rem; color: var(--green); font-weight: 700; letter-spacing: 1px;
}

/* ==================== ACHIEVEMENTS ==================== */
.ach-item {
  display: flex; gap: 14px; align-items: center;
  padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 8px;
  background: rgba(255,200,60,0.03);
  transition: all 0.2s;
}
.ach-item.unlocked { border-color: rgba(240,192,64,0.45); background: rgba(240,192,64,0.07); }
.ach-icon-img {
  width: 48px; height: 48px; object-fit: contain; flex-shrink: 0;
  filter: grayscale(1) brightness(0.4);
  transition: filter 0.3s;
}
.ach-item.unlocked .ach-icon-img { filter: none; }
.ach-text { flex: 1; }
.ach-name { font-size: 0.9rem; font-weight: 700; color: var(--gold); }
.ach-desc { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }

/* ==================== COLLECTIBLES ==================== */
#dex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.col-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; text-align: center;
  background: rgba(255,200,60,0.03); transition: all 0.2s;
}
.col-card.found-col { border-color: rgba(240,192,64,0.45); background: rgba(240,192,64,0.07); }
.col-img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; display: block; }
.col-img.hidden-col { filter: brightness(0) opacity(0.25); }
.col-name { font-size: 0.7rem; color: var(--gold); margin-top: 7px; font-weight: 700; }
.col-desc { font-size: 0.6rem; color: var(--muted); margin-top: 3px; }

/* ==================== SETTINGS ==================== */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid rgba(240,192,64,0.08);
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 0.9rem; color: var(--muted); }
.settings-row .btn { min-width: 100px; }

/* ==================== BOSS BATTLE ==================== */
#boss-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(60,0,0,0.88); backdrop-filter: blur(4px);
  pointer-events: none; gap: 8px;
}
#boss-overlay.active { display: flex; pointer-events: all; }
#boss-img { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 0 20px #ff2200); animation: bossShake 0.3s ease infinite alternate; }
@keyframes bossShake { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
#boss-title {
  font-family: 'Cinzel', serif; font-size: 2rem; letter-spacing: 3px;
  color: #ff4444; text-shadow: 0 0 30px #ff0000, 0 0 60px #ff000088;
  animation: bossFlash 0.5s ease infinite alternate;
}
@keyframes bossFlash { from { opacity: 1; } to { opacity: 0.55; } }
#boss-health-bar-wrap {
  width: 320px; height: 22px;
  background: rgba(255,0,0,0.12); border: 2px solid #ff4444;
  border-radius: 11px; overflow: hidden;
}
#boss-health-bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #cc1111, #ff6666);
  transition: width 0.12s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
#boss-timer { font-family: 'Cinzel', serif; font-size: 1.4rem; color: #ff9999; font-weight: 700; }
#boss-hint { font-size: 0.82rem; color: rgba(255,180,180,0.7); }

/* ==================== NOTIFICATIONS ==================== */
#notif-layer {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  pointer-events: none;
}
.notif {
  position: absolute; left: 50%; transform: translateX(-50%);
  background: rgba(14,7,1,0.96); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 24px;
  font-size: 0.9rem; font-weight: 700;
  text-align: center; white-space: nowrap;
  animation: notifFly 2.5s ease forwards;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.notif.hacienda { color: var(--red); border-color: rgba(255,60,60,0.5); }
.notif.good     { color: var(--green); border-color: rgba(60,255,120,0.4); }
.notif.story    { color: var(--gold);  border-color: var(--border); }
@keyframes notifFly {
  0%   { top: 75px; opacity: 1; }
  70%  { opacity: 1; }
  100% { top: 10px; opacity: 0; }
}

/* ==================== FALLING POWERUPS ==================== */
.falling-powerup {
  position: fixed; z-index: 800;
  background: linear-gradient(160deg, rgba(18,10,2,0.97), rgba(10,5,1,0.99));
  border: 2px solid var(--amber);
  border-radius: 12px; padding: 10px 16px; cursor: pointer;
  font-size: 0.82rem; font-weight: 700; color: var(--gold);
  box-shadow: 0 0 24px rgba(240,192,64,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
  pointer-events: all;
  -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; gap: 8px;
  transition: filter 0.15s;
}
.falling-powerup img { width: 28px; height: 28px; object-fit: contain; }
.falling-powerup:hover { filter: brightness(1.4); }

/* ==================== TUTORIAL OVERLAY (GRANDE) ==================== */
#tutorial-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(3,1,0,0.85); backdrop-filter: blur(6px);
  display: none; align-items: flex-end; justify-content: center;
  padding: 24px;
}
#tutorial-overlay.active { display: flex; }

#tutorial-box {
  background: linear-gradient(160deg, rgba(24,13,3,0.99) 0%, rgba(14,8,2,0.99) 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  max-width: 680px; width: 100%;
  display: flex; gap: 24px; align-items: flex-end;
  box-shadow: var(--shadow-deep), 0 0 50px rgba(240,192,64,0.25);
  animation: panelIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  position: relative;
}

/* Decorative corner accent */
#tutorial-box::before {
  content: '';
  position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(240,192,64,0.3) 0%, transparent 40%, transparent 60%, rgba(240,192,64,0.15) 100%);
  z-index: -1;
  border-radius: var(--radius);
}

#tutorial-chef {
  width: 180px; height: 200px;
  object-fit: contain; object-position: bottom;
  flex-shrink: 0;
  filter: drop-shadow(0 -4px 20px rgba(240,192,64,0.3)) drop-shadow(0 4px 8px rgba(0,0,0,0.8));
  transition: filter 0.3s;
  margin-bottom: -8px; /* Slight overlap at bottom */
}

#tutorial-content { flex: 1; }

#tutorial-name {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem; letter-spacing: 3px;
  color: var(--gold); text-transform: uppercase;
  margin-bottom: 10px; opacity: 0.8;
}

#tutorial-text {
  font-size: 1.05rem; line-height: 1.75; color: var(--text);
  font-weight: 400;
  min-height: 60px;
  animation: textFadeIn 0.4s ease;
}
@keyframes textFadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

#tutorial-continue {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--muted);
  margin-top: 16px; letter-spacing: 1px;
  animation: blink 1.4s ease infinite;
}
#tutorial-continue::after {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); opacity: 0.7;
  animation: blink 1.4s ease infinite;
}
@keyframes blink { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ==================== STORY DIALOGUE (GRANDE) ==================== */
#dialogue-overlay {
  position: fixed; inset: 0; z-index: 950;
  background: rgba(3,1,0,0.92); backdrop-filter: blur(8px);
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
}
#dialogue-overlay.active { display: flex; }
#dialogue-stage-img {
  width: 100%; max-width: 580px; height: 220px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  filter: brightness(0.85) contrast(1.1);
}
#dialogue-box {
  background: linear-gradient(160deg, rgba(20,10,2,0.99) 0%, rgba(10,5,1,0.99) 100%);
  border: 2px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 24px 28px; max-width: 580px; width: 100%;
  box-shadow: var(--shadow-deep);
  cursor: pointer;
}
#dialogue-title {
  font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--gold);
  margin-bottom: 14px; letter-spacing: 2px;
}
#dialogue-text {
  font-size: 1rem; line-height: 1.75; color: var(--text);
  min-height: 60px;
  animation: textFadeIn 0.35s ease;
}
#dialogue-reward {
  font-size: 0.85rem; color: var(--green); margin: 14px 0 0;
  font-weight: 700; letter-spacing: 0.5px;
  padding: 8px 12px; background: rgba(68,255,136,0.07);
  border-radius: 6px; border: 1px solid rgba(68,255,136,0.2);
  display: inline-block;
}
#dialogue-continue {
  font-size: 0.72rem; color: var(--muted); margin-top: 14px;
  letter-spacing: 1px; animation: blink 1.4s ease infinite;
}

/* ==================== DIFFICULTY SELECTOR ==================== */
#difficulty-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(3,1,0,0.97);
  background-image: url('../assets/images/wood_wall_gemini.png');
  background-size: cover; background-position: center;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; gap: 16px;
}
#difficulty-overlay::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(3,1,0,0.88);
}
#difficulty-overlay > * { position: relative; z-index: 1; }
#difficulty-overlay.active { display: flex; }
#diff-logo {
  width: 120px; height: 120px; object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(240,192,64,0.6));
  margin-bottom: 8px;
}
#diff-title {
  font-family: 'Cinzel', serif; font-size: 2.2rem; color: var(--gold);
  text-align: center; text-shadow: 0 0 30px var(--amber);
  letter-spacing: 4px;
}
#diff-subtitle {
  color: var(--muted); font-size: 0.9rem; text-align: center;
  max-width: 360px; line-height: 1.6;
}
.diff-btn {
  width: 100%; max-width: 360px; padding: 18px 28px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: rgba(255,200,60,0.04); cursor: pointer; text-align: left;
  transition: all 0.22s; color: var(--text); font-family: 'Outfit', sans-serif;
}
.diff-btn:hover {
  border-color: var(--gold); background: rgba(240,192,64,0.1);
  transform: translateX(6px);
  box-shadow: -4px 0 20px rgba(240,192,64,0.25);
}
.diff-btn .diff-name { font-size: 1.15rem; font-weight: 700; display: block; letter-spacing: 1px; }
.diff-btn .diff-desc { font-size: 0.8rem; color: var(--muted); display: block; margin-top: 5px; line-height: 1.5; }
.diff-btn.easy-btn .diff-name   { color: var(--green); }
.diff-btn.normal-btn .diff-name { color: var(--gold);  }
.diff-btn.hard-btn .diff-name   { color: var(--red);   }

/* ==================== IMPORT/EXPORT ==================== */
#import-area {
  width: 100%; min-height: 90px; padding: 10px;
  background: rgba(0,0,0,0.5); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: monospace; font-size: 0.72rem; resize: vertical;
}

/* ==================== VISUAL EFFECTS & JUICE ==================== */
/* Click Particles */
.click-particle {
  position: fixed; width: 6px; height: 6px;
  background: var(--gold2); border-radius: 2px;
  box-shadow: 0 0 8px var(--amber);
  pointer-events: none; z-index: 95;
  animation: particleFly 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes particleFly {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.2); }
}

/* Furia Powerup */
body[data-powerup="pu_furia"]::after {
  content: ''; position: fixed; inset: 0;
  box-shadow: inset 0 0 80px rgba(255,30,0,0.4);
  pointer-events: none; z-index: 50;
  animation: furiaPulse 0.4s infinite alternate;
}
@keyframes furiaPulse { 
  from { box-shadow: inset 0 0 40px rgba(255,20,0,0.3); } 
  to   { box-shadow: inset 0 0 120px rgba(255,0,0,0.7); } 
}
body[data-powerup="pu_furia"] #cachopo-img {
  filter: drop-shadow(0 0 40px #ff2200) brightness(1.2);
  animation: bossShake 0.1s infinite alternate;
}
.click-number.furia-text {
  color: #ff4444; font-size: 1.8rem;
  text-shadow: 0 0 20px #ff0000, 0 3px 6px #000;
  animation: floatUpFuria 0.8s ease forwards;
}
@keyframes floatUpFuria {
  0%   { opacity: 1; transform: translateY(0) scale(1) rotate(-5deg); }
  50%  { transform: translateY(-40px) scale(1.3) rotate(5deg); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.5); }
}

/* Dedos Powerup */
body[data-powerup="pu_dedos"]::after {
  content: ''; position: fixed; inset: 0;
  box-shadow: inset 0 0 80px rgba(255,210,60,0.25);
  pointer-events: none; z-index: 50;
}
body[data-powerup="pu_dedos"] #cachopo-img {
  filter: drop-shadow(0 0 50px var(--gold2)) brightness(1.3);
}
body[data-powerup="pu_dedos"], 
body[data-powerup="pu_dedos"] * {
  cursor: url('../assets/images/poder_dedos.png') 16 16, auto !important;
}

/* Lluvia Powerup */
.rain-cachopo {
  position: fixed; width: 42px; height: 42px; object-fit: contain;
  top: -60px; pointer-events: none; z-index: 55;
  animation: rainDrop cubic-bezier(0.3, 0, 0.8, 1) forwards;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6));
}
@keyframes rainDrop {
  0%   { transform: translateY(0) rotate(0deg) scale(0.6); opacity: 0.9; }
  100% { transform: translateY(120vh) rotate(360deg) scale(1.1); opacity: 1; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
  #game-area { flex-direction: column; }
  #shop-sidebar {
    width: 100%; flex: none;
    height: 35vh; border-left: none;
    border-top: 2px solid var(--border);
  }
  #cachopo-wrapper {
    width: clamp(130px, 42vw, 200px);
    height: clamp(130px, 42vw, 200px);
  }
  #menu-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #tutorial-chef { width: 110px; height: 130px; }
  #tutorial-box { padding: 18px; gap: 14px; }
  #tutorial-text { font-size: 0.92rem; }
}

/* ==================== UTILS ==================== */
.hidden { display: none !important; }
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.mt-8        { margin-top: 8px; }
.mt-12       { margin-top: 12px; }
.gap-8       { gap: 8px; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.w-full      { width: 100%; }
