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

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #87CEEB 0%, #228B22 100%);
  min-height: 100vh;
  overflow: hidden;
}

.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none !important;
}

/* JOIN SCREEN */
#join-screen {
  background: rgba(34, 139, 34, 0.95);
}

.title {
  font-size: 4rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  margin-bottom: 1rem;
  letter-spacing: 0.3rem;
}

.subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

#code-input {
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  width: 280px;
  padding: 1rem;
  border: 4px solid #fff;
  border-radius: 16px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  letter-spacing: 1rem;
  margin-bottom: 1.5rem;
}

#code-input::placeholder {
  color: rgba(255,255,255,0.4);
}

#code-input:focus {
  outline: none;
  background: rgba(255,255,255,0.3);
}

.btn {
  font-size: 1.5rem;
  font-weight: 900;
  padding: 1rem 3rem;
  border: 4px solid #fff;
  border-radius: 50px;
  background: #FF8C00;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn:hover {
  transform: scale(1.05);
  background: #ff7700;
}

.error {
  color: #ff4444;
  font-weight: 600;
  margin-top: 1rem;
  min-height: 1.5rem;
}

/* WAITING SCREEN */
#waiting-screen {
  background: rgba(34, 139, 34, 0.95);
  color: #fff;
}

#waiting-screen h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.loader {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255,255,255,0.3);
  border-top-color: #FF8C00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-top: 2rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* GAME SCREEN */
#game-screen {
  background: #000;
}

#game-canvas {
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 16px;
  z-index: 100;
}

.score-box, .carrot-box {
  background: rgba(0,0,0,0.6);
  padding: 12px 20px;
  border-radius: 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-box .label {
  font-size: 0.8rem;
  opacity: 0.7;
}

.score-box #score {
  font-size: 2rem;
  font-weight: 900;
}

.carrot-box {
  flex-direction: row;
  font-size: 1.5rem;
  font-weight: 900;
  gap: 8px;
}

#action-badge {
  background: #FF8C00;
  padding: 8px 20px;
  border-radius: 20px;
  color: #fff;
  font-weight: 900;
  font-size: 1.2rem;
}

/* GAME OVER SCREEN */
#gameover-screen {
  background: rgba(34, 139, 34, 0.95);
  color: #fff;
}

.gameover-title {
  font-size: 3rem;
  color: #ff4444;
  margin-bottom: 1rem;
}

.final-score {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.final-carrots {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.waiting-text {
  opacity: 0.7;
}
