:root {
  --primary: #00ff88;
  --secondary: #0ff;
  --dark: #0a0e27;
  --dark-light: #1a1a2e;
  --gold: #ffd700;
  --error: #ff4444;
  --warning: #ffaa00;
  --success: #00ff88;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Courier New', monospace; background: linear-gradient(135deg, var(--dark) 0%, #0f1929 50%, var(--dark-light) 100%); color: var(--primary); min-height: 100vh; }

.main-container { display: flex; flex-direction: column; min-height: 100vh; }

.game-header {
  background: rgba(0, 255, 136, 0.08);
  border-bottom: 2px solid var(--primary);
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
  flex-wrap: wrap;
}

.header-left h1 { font-size: 1.8em; text-shadow: 0 0 20px var(--primary); margin-bottom: 5px; }
.dimension-counter { font-size: 0.85em; color: var(--secondary); }

.header-stats {
  display: flex;
  gap: 20px;
}

.stat {
  background: rgba(0, 255, 136, 0.1);
  padding: 8px 15px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  font-size: 1.1em;
}

.stat span { font-weight: bold; color: var(--gold); }

.header-buttons { display: flex; gap: 10px; }
.btn-header { background: rgba(0, 255, 255, 0.1); border: 2px solid var(--secondary); color: var(--secondary); width: 45px; height: 45px; font-size: 1.2em; border-radius: 8px; cursor: pointer; transition: all 0.3s; }
.btn-header:hover { background: rgba(0, 255, 255, 0.3); transform: scale(1.1); box-shadow: 0 0 20px rgba(0, 255, 255, 0.5); }

.stats-row {
  background: rgba(0, 255, 136, 0.08);
  border-bottom: 1px solid var(--primary);
  padding: 12px 25px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(0, 255, 136, 0.05);
  border-radius: 4px;
  font-size: 0.9em;
}

.game-wrapper {
  display: flex;
  flex: 1;
  gap: 0;
  padding: 0;
  width: 100%;
}

.garden-section {
  flex: 1;
  background: rgba(26, 26, 46, 0.5);
  border-right: 2px solid var(--primary);
  padding: 20px;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
  overflow-y: auto;
}

.garden-header { margin-bottom: 20px; }
.garden-header h2 { color: var(--secondary); margin-bottom: 10px; }

.garden-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.plot {
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
  border: 2px solid var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
  position: relative;
  overflow: hidden;
}

.plot:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(0, 255, 136, 0.5); border-color: var(--secondary); }
.plot.drag-over { transform: scale(1.1); border-color: var(--secondary); background: rgba(0, 255, 255, 0.2); }
.plot.growing { border-color: var(--warning); }
.plot.ready { border-color: var(--gold); background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%); animation: pulse 2s ease-in-out infinite; }

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

.plot-content { text-align: center; font-size: 2.5em; text-shadow: 0 0 10px rgba(0, 255, 136, 0.5); }
.plot.empty .plot-content { opacity: 0.6; font-size: 1.5em; }
.progress-pct { font-size: 0.5em; color: var(--warning); }

.sidebar {
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  background: rgba(26, 26, 46, 0.6);
  border-left: 2px solid var(--primary);
  overflow-y: auto;
}

.sidebar-section {
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.15);
}

.sidebar-section h3 {
  color: var(--secondary);
  margin-bottom: 12px;
  font-size: 1.1em;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 8px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.inventory-item {
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  cursor: grab;
  transition: all 0.3s;
}

.inventory-item:hover { transform: scale(1.05); background: rgba(0, 255, 136, 0.2); }
.inventory-item:active { cursor: grabbing; opacity: 0.7; }

.item-emoji { font-size: 2em; margin-bottom: 4px; }
.item-qty { background: rgba(0, 0, 0, 0.5); border-radius: 4px; padding: 2px 6px; font-size: 0.8em; font-weight: bold; margin-bottom: 2px; }
.item-name { font-size: 0.7em; opacity: 0.8; }

.inventory-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border-top: 1px solid var(--primary);
  gap: 10px;
}

.inventory-nav button {
  background: rgba(0, 255, 136, 0.2);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.inventory-nav button:hover { background: rgba(0, 255, 136, 0.4); transform: scale(1.1); }
.page-label { font-size: 0.9em; color: var(--secondary); font-weight: bold; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tool-btn {
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid var(--secondary);
  color: var(--secondary);
  padding: 10px;
  border-radius: 8px;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.3s;
}

.tool-btn:hover { background: rgba(0, 255, 255, 0.3); transform: scale(1.1); }
.tool-btn.active { background: rgba(0, 255, 255, 0.5); box-shadow: 0 0 20px rgba(0, 255, 255, 0.7); }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 1000; align-items: center; justify-content: center; }

.modal-content {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 25px;
  max-height: 80vh;
  overflow-y: auto;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 0 50px rgba(0, 255, 136, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 15px;
}

.modal-header h2 { color: var(--secondary); }
.btn-close { background: transparent; border: none; color: var(--secondary); font-size: 1.5em; cursor: pointer; transition: all 0.3s; }
.btn-close:hover { transform: scale(1.3); color: var(--error); }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.shop-card {
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.shop-card:hover { transform: translateY(-5px); background: rgba(0, 255, 136, 0.2); box-shadow: 0 0 25px rgba(0, 255, 136, 0.4); }

.card-emoji { font-size: 2.5em; margin-bottom: 10px; }
.card-name { font-size: 0.9em; margin-bottom: 8px; color: var(--secondary); }
.card-cost { color: var(--gold); font-weight: bold; margin-bottom: 10px; }
.card-controls { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; justify-content: center; }
.card-controls input { border: 1px solid var(--primary); background: rgba(0, 0, 0, 0.3); color: var(--primary); padding: 5px; border-radius: 4px; }
.card-total { color: var(--gold); font-weight: bold; min-width: 80px; }

.btn-buy {
  background: rgba(0, 255, 136, 0.2);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  font-family: 'Courier New', monospace;
}

.btn-buy:hover { background: rgba(0, 255, 136, 0.4); }

.upgrades-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  overflow-x: auto;
}

.tab-btn {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.tab-btn:hover, .tab-btn.active {
  background: rgba(0, 255, 136, 0.3);
  border-color: var(--secondary);
  color: var(--secondary);
}

.upgrades-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.upgrade-btn {
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.upgrade-btn:hover:not(:disabled) {
  background: rgba(0, 255, 136, 0.3);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.upgrade-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0, 255, 136, 0.02);
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 15px;
  transition: all 0.3s;
}

.achievement-item.unlocked { background: rgba(255, 215, 0, 0.1); border-color: var(--gold); }
.achievement-item:not(.unlocked) { opacity: 0.6; border-color: #555; }
.achievement-item:not(.unlocked) h4 { color: #888; }
.achievement-item:not(.unlocked) p { color: #666; }

.achievement-icon { font-size: 1.5em; transition: all 0.3s; }

.achievement-info h4 { color: var(--secondary); margin-bottom: 5px; }
.achievement-info p { font-size: 0.85em; color: var(--primary); }
.achievement-info .reward { color: var(--gold); font-weight: bold; margin-top: 5px; }

#notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 900;
  max-width: 350px;
}

.notification {
  background: rgba(0, 255, 136, 0.9);
  color: var(--dark);
  padding: 15px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 2px solid var(--primary);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
  font-weight: bold;
  animation: slideIn 0.3s ease;
}

.notification.error { background: rgba(255, 68, 68, 0.9); border-color: var(--error); }
.notification.warning { background: rgba(255, 170, 0, 0.9); border-color: var(--warning); }
.notification.golden { background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.95)); border-color: var(--gold); box-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }

@keyframes slideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.notification.fade-out { animation: fadeOut 0.3s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateX(400px); } }

.gold-reward {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4em;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  animation: rewardPop 2s ease-out forwards;
  pointer-events: none;
  z-index: 1000;
  font-weight: bold;
}

.gold-reward.golden { font-size: 5em; animation: goldenRewardPop 3s ease-out forwards; }

@keyframes rewardPop { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; } 100% { transform: translate(-50%, -120%) scale(1); opacity: 0; } }
@keyframes goldenRewardPop { 0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.5) rotate(360deg); opacity: 1; } 70% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; } 100% { transform: translate(-50%, -150%) scale(0.8); opacity: 0; } }

@media (max-width: 1024px) {
  .game-wrapper { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; border-left: none; border-top: 2px solid var(--primary); }
  .sidebar-section { flex: 1; }
  .garden-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .game-header { padding: 10px 15px; flex-direction: column; }
  .header-left h1 { font-size: 1.3em; }
  .header-stats { font-size: 0.9em; gap: 10px; flex-wrap: wrap; }
  .header-buttons { flex-wrap: wrap; }
  .game-wrapper { padding: 0; }
  .garden-section { padding: 15px; border-right: none; border-bottom: 2px solid var(--primary); }
  .garden-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sidebar { width: 100%; padding: 15px; }
  .modal-content { width: 95%; max-height: 90vh; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px 15px; }
}

@media (max-width: 480px) {
  .game-header { flex-direction: column; align-items: flex-start; padding: 10px; }
  .header-left h1 { font-size: 1em; }
  .header-buttons { width: 100%; }
  .garden-grid { grid-template-columns: 1fr; }
  .sidebar-section { width: 100%; }
  .stats-row { grid-template-columns: 1fr; gap: 8px; }
  .inventory-grid { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: 1fr; }
}
