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

body {
  font-family: 'Patrick Hand', cursive;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

#game-container {
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.8);
  max-width: 540px;
  width: 100%;
  overflow: hidden;
}

#header {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  padding: 15px 20px;
  text-align: center;
  border-bottom: 4px solid #2563eb;
}

#header h1 {
  font-family: 'Bangers', cursive;
  font-size: 2.2rem;
  color: #ffffff;
  text-shadow: 3px 3px 0 #1e40af, -1px -1px 0 #1e40af;
  letter-spacing: 2px;
}

#flag-decoration {
  font-size: 1.2rem;
  margin-top: 5px;
  letter-spacing: 3px;
}

#selection-screen {
  padding: 30px 20px;
  text-align: center;
}

#selection-screen h2 {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  color: #1e40af;
  margin-bottom: 25px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

#country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  max-width: 450px;
  margin: 0 auto;
}

.country-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border: 3px solid #cbd5e1;
  border-radius: 15px;
  padding: 15px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.country-btn:hover {
  transform: translateY(-5px) scale(1.05);
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.country-flag {
  font-size: 2.5rem;
}

.country-name {
  font-size: 0.9rem;
  color: #475569;
  font-weight: bold;
}

#game-screen {
  padding: 15px;
}

#canvas {
  display: block;
  margin: 0 auto;
  border-radius: 15px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.1), 0 4px 15px rgba(0,0,0,0.1);
}

#stats-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 15px 0;
  padding: 15px;
  background: rgba(255,255,255,0.7);
  border-radius: 15px;
  border: 2px solid #e2e8f0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-icon {
  font-size: 1.3rem;
}

.stat-bar-container {
  flex: 1;
  height: 16px;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #cbd5e1;
}

.stat-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: bold;
  color: #475569;
  min-width: 35px;
  text-align: right;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.action-btn {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 3px solid #d97706;
  border-radius: 12px;
  padding: 12px 18px;
  font-family: 'Patrick Hand', cursive;
  font-size: 1.1rem;
  color: #1a1a2e;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 0 #b45309;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #b45309;
}

.action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b45309;
}

#food-menu, #gift-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(5px);
}

.menu-content {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 20px;
  padding: 25px;
  max-width: 350px;
  width: 90%;
  position: relative;
  border: 4px solid #3b82f6;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.menu-content h3 {
  font-family: 'Bangers', cursive;
  font-size: 1.6rem;
  color: #1e40af;
  text-align: center;
  margin-bottom: 20px;
}

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

.menu-btn {
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  font-family: 'Patrick Hand', cursive;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: capitalize;
}

.menu-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
}

.menu-btn.favorite {
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
}

.menu-btn.equipped {
  background: linear-gradient(180deg, #bbf7d0 0%, #86efac 100%);
  border-color: #22c55e;
}

.menu-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ef4444;
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #dc2626;
}

#footer {
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
  padding: 12px 20px;
  text-align: center;
  border-top: 2px solid #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

#day-counter {
  font-size: 1rem;
  color: #475569;
  font-weight: bold;
}

#footer a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
}

#footer a:hover {
  text-decoration: underline;
}

@media (max-width: 400px) {
  #header h1 {
    font-size: 1.6rem;
  }
  
  .action-btn {
    padding: 10px 14px;
    font-size: 1rem;
  }
  
  #stats-panel {
    grid-template-columns: 1fr;
  }
  
  .country-btn {
    padding: 10px 8px;
  }
  
  .country-flag {
    font-size: 2rem;
  }
}