* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Noto Sans', sans-serif;
  background: #f5f1e8;
  overflow: hidden;
  touch-action: none;
}

#game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

#stats {
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
}

.stat {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 16px;
}

.label {
  color: #666;
}

#money {
  font-weight: bold;
  color: #d4af37;
}

#forest {
  flex: 1;
  position: relative;
  background: linear-gradient(to bottom, #e8dcc4 0%, #d4c4a8 100%);
  overflow: hidden;
}

.leaf {
  position: absolute;
  width: 80px;
  height: 80px;
  cursor: pointer;
  transition: transform 0.2s;
  animation: fall 5s ease-in forwards, sway 3s ease-in-out infinite;
}

.leaf:active {
  transform: scale(1.2);
}

@keyframes fall {
  from {
    top: -50px;
  }
  to {
    top: calc(100% - 50px);
  }
}

@keyframes sway {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(10px);
  }
}

#inventory {
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 16px;
  max-height: 120px;
  overflow-y: auto;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.inventory-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

#leaf-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leaf-count {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f0f0;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 14px;
}

.leaf-icon {
  width: 24px;
  height: 24px;
}

#craft-btn {
  position: fixed;
  bottom: 140px;
  right: 16px;
  background: #4a7c59;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 20;
}

#craft-btn:active {
  transform: scale(0.95);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s;
}

.modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  border-radius: 16px;
  overflow: hidden;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
}

#close-modal {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#recipes {
  padding: 16px;
  max-height: calc(80vh - 64px);
  overflow-y: auto;
}

.recipe {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.recipe-name {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 16px;
}

.recipe-ingredients {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.recipe-value {
  font-size: 14px;
  color: #d4af37;
  margin-bottom: 8px;
}

.craft-recipe-btn {
  width: 100%;
  background: #4a7c59;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.craft-recipe-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.craft-recipe-btn:active:not(:disabled) {
  transform: scale(0.98);
}

#notification {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(74, 124, 89, 0.95);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-weight: bold;
  z-index: 200;
  animation: slideDown 0.3s;
}

#notification.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

