/* Onion Clicker - Identidade Visual Idêntica ao Cookie Clicker */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Outfit:wght@400;500;600;700;800;900&family=Merriweather:ital,wght@0,700;1,400&display=swap');

:root {
  --cookie-dark: #090d16;
  --cookie-panel: rgba(12, 18, 32, 0.92);
  --cookie-gold: #fbbf24;
  --cookie-amber: #f59e0b;
  --cookie-wood: #29180e;
  --cookie-border: rgba(245, 158, 11, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--cookie-dark);
  font-family: 'Outfit', sans-serif;
  color: #f8fafc;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* 3-Column Layout (320px | 1fr | 330px) */
.cookie-grid {
  display: grid;
  grid-template-columns: 330px 1fr 340px;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 15% 50%, #1e1b4b 0%, #090d16 100%);
}

@media (max-width: 1024px) {
  .cookie-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
    height: auto;
  }
}

/* Panels System */
.game-panel {
  background: var(--cookie-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 2px solid var(--cookie-border);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.game-panel-right {
  border-right: none;
  border-left: 2px solid var(--cookie-border);
}

/* Left Column: Big Onion & Stats Header */
.onion-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  height: 100%;
  z-index: 10;
}

.bakery-header {
  text-align: center;
  z-index: 10;
  width: 100%;
}

.bakery-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.35rem;
  color: var(--cookie-gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 15px rgba(245, 158, 11, 0.6);
  cursor: pointer;
  transition: transform 0.2s ease;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--cookie-border);
  display: inline-block;
}

.bakery-title:hover {
  transform: scale(1.04);
  border-color: var(--cookie-gold);
}

.count-display {
  font-family: 'Fredoka One', cursive;
  font-size: 2.15rem;
  color: #ffffff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9), 0 0 25px rgba(234, 179, 8, 0.7);
  margin-top: 0.5rem;
  line-height: 1.1;
}

.cps-display {
  font-size: 0.9rem;
  color: #fbbf24;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 0.2rem;
}

/* Big Interactive Onion */
.onion-container {
  position: relative;
  width: 230px;
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
}

.onion-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.45) 0%, rgba(234, 179, 8, 0) 70%);
  border-radius: 50%;
  animation: pulseGlow 2.5s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes pulseGlow {
  0% { transform: scale(0.92); opacity: 0.4; }
  100% { transform: scale(1.18); opacity: 0.95; }
}

.onion-svg {
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
  transition: transform 0.08s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.onion-container:hover .onion-svg {
  transform: scale(1.07);
}

.onion-container:active .onion-svg {
  transform: scale(0.91) rotate(-4deg);
}

/* Floating Numbers on Click */
.floating-number {
  position: absolute;
  font-family: 'Fredoka One', cursive;
  font-size: 1.7rem;
  color: #fef08a;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.9), 0 0 15px rgba(234, 179, 8, 0.9);
  pointer-events: none;
  animation: floatUpFade 0.85s ease-out forwards;
  z-index: 60;
}

@keyframes floatUpFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.8) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.25) translateY(-45px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1) translateY(-90px);
  }
}

/* Center Column: News Ticker & Navigation Tabs */
.center-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-ticker {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 2px solid var(--cookie-border);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.ticker-tag {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.ticker-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #fef08a;
  font-family: 'Merriweather', serif;
  font-style: italic;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 2px solid var(--cookie-border);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
}

.tab-btn.active {
  color: #fbbf24;
  border-bottom: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.tab-content {
  display: none;
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.tab-content.active {
  display: block;
}

/* Right Column: Upgrades Shelf & Store List */
.upgrades-container {
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--cookie-border);
  background: rgba(15, 23, 42, 0.8);
}

.upgrades-title {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  color: #fbbf24;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upgrades-grid {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.upgrade-card {
  width: 46px;
  height: 46px;
  background: #1e293b;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  position: relative;
}

.upgrade-card:hover {
  transform: scale(1.1);
  border-color: #fef08a;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

/* Store Header */
.store-header {
  padding: 0.85rem 1rem;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 2px solid var(--cookie-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.15rem;
  color: #fbbf24;
}

.amount-selector {
  display: flex;
  gap: 0.25rem;
  background: #0f172a;
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid #334155;
}

.amount-btn {
  padding: 0.2rem 0.5rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.75rem;
  border-radius: 5px;
  cursor: pointer;
}

.amount-btn.active {
  background: #f59e0b;
  color: #0f172a;
}

/* Store Items Cards (Cookie Clicker Style List) */
.store-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.building-card {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #334155;
  border-radius: 14px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.building-card:hover {
  border-color: #f59e0b;
  transform: translateX(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.building-card.unaffordable {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.building-card.unaffordable .building-cost {
  color: #f87171 !important;
}

.building-icon {
  font-size: 2.2rem;
  margin-right: 0.75rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.building-name {
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  color: #f8fafc;
}

.building-cost {
  font-size: 0.85rem;
  color: #fbbf24;
  font-weight: 700;
}

.building-count {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  color: rgba(245, 158, 11, 0.35);
  font-weight: 900;
}

.building-card:hover .building-count {
  color: #f59e0b;
}

/* Golden Onion Event Floating Object */
.golden-onion {
  position: absolute;
  width: 50px;
  height: 50px;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 100;
  animation: goldenPulse 0.8s infinite alternate ease-in-out;
  filter: drop-shadow(0 0 15px #f59e0b);
}

@keyframes goldenPulse {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.15) rotate(10deg); }
}
