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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  background: white;
  border-radius: 20px;
  padding: 20px;
  width: 700px;
  max-width: 95vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

h1 {
  font-size: 1.3em;
  color: #e67e22;
}

#stats {
  display: flex;
  gap: 15px;
  font-weight: bold;
  font-size: 0.9em;
}

#score {
  color: #27ae60;
}

#lives {
  color: #e74c3c;
}

#level {
  color: #8e44ad;
}

#person-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0;
}

#person {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.person-body {
  font-size: 4em;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

#speech-bubble {
  background: white;
  border: 3px solid #e67e22;
  border-radius: 20px;
  padding: 12px 18px;
  max-width: 280px;
  position: relative;
  font-weight: bold;
  color: #2c3e50;
  font-size: 1em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#speech-bubble::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  border: 10px solid transparent;
  border-right-color: #e67e22;
}

#speech-bubble::after {
  content: '';
  position: absolute;
  left: -13px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: white;
}

#timer-bar {
  width: 100%;
  height: 10px;
  background: #ecf0f1;
  border-radius: 5px;
  margin-top: 10px;
  overflow: hidden;
}

#timer-fill {
  height: 100%;
  width: 100%;
  background: #27ae60;
  border-radius: 5px;
  transition: width 0.3s;
}

#ingredients-area {
  margin: 15px 0;
}

#instruction {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 10px;
  font-size: 0.95em;
}

#ingredients-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.ingredient-btn {
  background: #f8f9fa;
  border: 3px solid #dee2e6;
  border-radius: 15px;
  padding: 8px 14px;
  font-size: 1.5em;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ingredient-btn .ingredient-name {
  font-size: 0.35em;
  color: #555;
  font-weight: 600;
}

.ingredient-btn:hover {
  transform: scale(1.08);
  border-color: #e67e22;
  background: #fff5e6;
}

.ingredient-btn.selected {
  border-color: #27ae60;
  background: #e8f8f0;
  transform: scale(1.05);
}

.ingredient-btn.wrong {
  border-color: #e74c3c;
  background: #fde8e8;
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.ingredient-btn.correct-glow {
  border-color: #27ae60;
  background: #d4edda;
  animation: pop 0.3s;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

#plate-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

#plate {
  background: #f8f9fa;
  border: 3px dashed #ccc;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5em;
  transition: all 0.3s;
}

#plate.has-ingredients {
  border-color: #e67e22;
  background: #fff5e6;
}

#plate-text {
  font-size: 0.3em;
  color: #999;
  text-align: center;
}

#serve-btn {
  background: #e67e22;
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 25px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

#serve-btn:hover:not(:disabled) {
  background: #d35400;
  transform: scale(1.05);
}

#serve-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

#feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 30px 50px;
  border-radius: 20px;
  font-size: 2em;
  font-weight: bold;
  z-index: 10;
  text-align: center;
  animation: fadeIn 0.3s;
}

#feedback.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  color: white;
  z-index: 20;
}

#game-over.hidden {
  display: none;
}

#game-over h2 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

#final-score {
  font-size: 1.5em;
  margin-bottom: 20px;
}

#restart-btn {
  background: #e67e22;
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

#restart-btn:hover {
  background: #d35400;
  transform: scale(1.1);
}
