.game-layout {
  display: grid;
  grid-template-columns: 1fr 300px 280px;
  min-height: calc(100vh - 53px);
  gap: 0;
}

/* ===== MAIN PIZZA AREA ===== */
.game-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(239, 68, 68, 0.06), transparent),
    var(--gradient-bg, var(--background));
  background-attachment: fixed;
}

/* ===== COIN STATS ===== */
.coin-stats {
  text-align: center;
  margin-bottom: 1rem;
}

.coin-count {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.2));
}

.coin-cps {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
  font-weight: 500;
}

/* ===== PIZZA SLOTS ===== */
.pizza-slots {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}

.pizza-slot {
  flex-shrink: 0;
  width: 140px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.pizza-slot:hover {
  border-color: var(--border-hover);
  background: var(--secondary);
  transform: translateY(-2px);
}

.pizza-slot.active {
  border-color: #f97316;
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.25), 0 4px 12px rgba(0,0,0,0.2);
  background: rgba(249, 115, 22, 0.08);
  transform: translateY(-2px);
}

.pizza-slot-buy {
  border-style: dashed;
  border-color: var(--border);
  opacity: 0.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pizza-slot-buy:hover:not(.disabled) {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.15);
}

.pizza-slot-buy.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
}

.slot-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pizza-slot.active .slot-header {
  color: #f97316;
}

.slot-pizza-img {
  font-size: 2.8rem;
  line-height: 1;
  margin: 0.4rem 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.slot-upgrades {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  min-height: 1.4rem;
  margin: 0.35rem 0;
}

.slot-upgrade-badge {
  font-size: 0.7rem;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.3;
}

.slot-empty {
  font-size: 0.65rem;
  color: var(--muted-foreground);
  opacity: 0.4;
  font-style: italic;
}

.slot-cps {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 0.2rem;
}

/* ===== ACTIVE PIZZA ===== */
.pizza-area {
  position: relative;
  text-align: center;
}

.active-pizza-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f97316;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.active-pizza-cpc {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: 0.3rem;
}

.pizza-button {
  width: 320px;
  height: 320px;
  object-fit: contain;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 40px rgba(239, 68, 68, 0.25));
  animation: pizzaFloat 3s ease-in-out infinite;
}

@keyframes pizzaFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

.pizza-button:hover {
  animation: none;
  transform: scale(1.08);
  filter: drop-shadow(0 0 60px rgba(239, 68, 68, 0.4));
}

.pizza-button:active {
  transform: scale(0.92) rotate(-5deg);
  filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.5));
}

.click-float {
  position: absolute;
  color: #f97316;
  font-size: 1.4rem;
  font-weight: 800;
  pointer-events: none;
  animation: floatUp 0.8s ease-out forwards;
  text-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
  font-family: var(--font);
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(-40px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* ===== SHOP ===== */
.game-shop {
  background: var(--card);
  border-left: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

.shop-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

/* Event banner */
.event-banner {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(249, 115, 22, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--foreground);
  text-align: center;
}

.event-live {
  background: var(--success);
  color: #000;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-right: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: eventPulse 1.5s ease-in-out infinite;
}

@keyframes eventPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 8px 2px rgba(34, 197, 94, 0.2); }
}

.event-countdown {
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.event-tag {
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 0.3rem;
}

/* Shop section header with pizza selector */
.shop-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.825rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.shop-pizza-target {
  color: #f97316;
  font-weight: 700;
  font-size: 0.85rem;
}

.shop-item-stats {
  font-size: 0.65rem;
  color: var(--accent);
  margin-top: 1px;
}

.shop-item-total {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.shop-item {
  position: relative;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  gap: 0.7rem;
  align-items: center;
  overflow: hidden;
}

.shop-item::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(239, 68, 68, 0.08));
  transition: opacity 0.2s;
}

.shop-item:hover:not(.disabled)::before {
  opacity: 1;
}

.shop-item:hover:not(.disabled) {
  border-color: #f97316;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.12);
  transform: translateX(-2px);
}

.shop-item:active:not(.disabled) {
  transform: scale(0.98);
}

.shop-item.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.shop-item-locked {
  opacity: 0.35;
  cursor: default;
  filter: blur(1px);
  pointer-events: none;
}

.shop-item-locked .shop-item-icon {
  filter: grayscale(1);
}

.shop-item-locked .shop-item-name {
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
}

/* Event items special glow */
.shop-item-event {
  border-color: rgba(168, 85, 247, 0.3);
}

.shop-item-event::before {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(249, 115, 22, 0.1));
}

.shop-item-event:hover:not(.disabled) {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}

.shop-item-icon {
  font-size: 1.6rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.shop-item-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.shop-item-name {
  font-weight: 600;
  color: var(--foreground);
  font-size: 0.85rem;
}

.shop-item-desc {
  color: var(--muted-foreground);
  font-size: 0.7rem;
  margin-top: 1px;
}

.shop-item-price {
  color: #f97316;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 3px;
}

.shop-item-owned {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  min-width: 1.5rem;
  text-align: center;
}

/* ===== OFFLINE TOAST ===== */
.offline-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  text-align: center;
  z-index: 20;
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.2), 0 20px 40px rgba(0,0,0,0.4);
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.offline-toast-exit {
  animation: toastOut 0.6s ease-in forwards !important;
}

.offline-toast-title {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.offline-toast-amount {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.offline-toast-time {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.3rem;
}

@keyframes toastIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes toastOut {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* ===== SIDEBAR ===== */
.game-sidebar {
  background: var(--card);
  border-left: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

/* ===== ACHIEVEMENT POPUPS ===== */
#achievement-container {
  position: fixed;
  top: 70px;
  left: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.achievement-popup {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: achieveSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 280px;
}

.achievement-popup.achievement-exit {
  animation: achieveSlideOut 0.6s ease-in forwards;
}

.achievement-glow {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
}

.achievement-common .achievement-glow {
  background: linear-gradient(135deg, #a1a1aa, transparent);
}
.achievement-rare .achievement-glow {
  background: linear-gradient(135deg, #3b82f6, transparent);
}
.achievement-rare { border-color: rgba(59, 130, 246, 0.4); }

.achievement-epic .achievement-glow {
  background: linear-gradient(135deg, #a855f7, transparent);
}
.achievement-epic { border-color: rgba(168, 85, 247, 0.4); }
.achievement-epic .achievement-name { color: #c084fc; }

.achievement-legendary .achievement-glow {
  background: linear-gradient(135deg, #fbbf24, #f97316, transparent);
  opacity: 0.2;
  animation: legendaryPulse 1s ease-in-out infinite;
}
.achievement-legendary {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.15), 0 8px 24px rgba(0,0,0,0.4);
}
.achievement-legendary .achievement-name {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes legendaryPulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.3; }
}

.achievement-icon {
  font-size: 2rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.achievement-info {
  position: relative;
  z-index: 1;
}

.achievement-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

.achievement-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
}

.achievement-desc {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 1px;
}

@keyframes achieveSlideIn {
  0% { transform: translateX(-120%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes achieveSlideOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-120%); opacity: 0; }
}

/* ===== CONFETTI ===== */
.confetti {
  position: absolute;
  top: -10px;
  pointer-events: none;
  animation: confettiFall linear forwards;
  z-index: 5;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  80% { opacity: 1; }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}

/* ===== SCREEN SHAKE ===== */
.screen-shake {
  animation: shake 0.5s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-6px) rotate(-0.5deg); }
  20% { transform: translateX(6px) rotate(0.5deg); }
  30% { transform: translateX(-4px) rotate(-0.3deg); }
  40% { transform: translateX(4px) rotate(0.3deg); }
  50% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
}

/* ===== BONUS TOPPINGS ===== */
.bonus-topping {
  position: absolute;
  font-size: 2rem;
  cursor: pointer;
  z-index: 8;
  animation: toppingSpawn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  filter: drop-shadow(0 0 12px var(--topping-color, #fbbf24));
  transition: transform 0.15s;
  pointer-events: auto;
}

.bonus-topping:hover {
  transform: scale(1.3);
  filter: drop-shadow(0 0 20px var(--topping-color, #fbbf24));
}

.bonus-topping:active {
  transform: scale(0.9);
}

.topping-fade {
  animation: toppingFade 0.5s ease-out forwards !important;
}

@keyframes toppingSpawn {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes toppingFade {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.3) translateY(20px); }
}

.topping-float {
  position: absolute;
  font-size: 1.2rem;
  font-weight: 800;
  pointer-events: none;
  z-index: 9;
  animation: toppingFloatUp 1.2s ease-out forwards;
  font-family: var(--font);
  white-space: nowrap;
}

@keyframes toppingFloatUp {
  0% { opacity: 1; transform: translateY(0) scale(1.3); }
  30% { opacity: 1; transform: translateY(-30px) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.7); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .game-layout {
    grid-template-columns: 1fr 260px;
  }
  .game-sidebar { display: none; }
}

@media (max-width: 700px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .game-main {
    min-height: 55vh;
  }
  .pizza-button { width: 180px; height: 180px; }
  .coin-count { font-size: 1.8rem; }
  .pizza-slot { width: 110px; }
  .slot-pizza-img { font-size: 2.2rem; }
  .game-shop {
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 45vh;
  }
  .game-sidebar { display: none; }
}
