html, body {
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  background: #fdf6e3;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  max-width: 600px;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
}

h1 {
  margin: 0;
  font-size: 2rem;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 320px;
  margin: 8px 0;
}

/* Speed Button */
#speed-btn {
  font-size: 1rem;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}
.speed-slow {
  background-color: #dcedc8;
  color: #33691e;
}
.speed-medium {
  background-color: #fff59d;
  color: #f57f17;
}
.speed-fast {
  background-color: #ffcdd2;
  color: #b71c1c;
}

/* Timer */
#timer-display {
  font-size: 1.2rem;
  font-weight: bold;
  margin-left: 8px;
  white-space: nowrap;
  color: #3e2723;
}

/* Timer Warning */
.timer-warning {
  color: #b71c1c !important;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

#target-display {
  font-size: 2.2rem;
  font-weight: bold;
  color: #ff5722;
  background: #fff8e1;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 10px 0;
}

#emoji-area {
  flex-grow: 1;
  width: 100%;
  background: #fff3cd;
  border: 2px dashed #ff9800;
  margin: 10px 0;
  position: relative;
  overflow: hidden;
}

.emoji {
  position: absolute;
  font-size: 3.5rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}

.hit {
  animation: explode 0.4s forwards;
}

@keyframes explode {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(2.5) rotate(180deg); opacity: 0.7; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

#score-board {
  font-size: 1.1rem;
  margin: 5px 0;
}

#start-btn {
  font-size: 1.2rem;
  padding: 10px 20px;
  cursor: pointer;
  width: 90%;
  max-width: 300px;
}

.particle {
  position: fixed;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #ff9800 0%, #ff5722 100%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 1;
  transform: scale(1);
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;
  z-index: 1000;
}

@media (max-width: 400px) {
  #target-display {
    font-size: 2rem;
    padding: 8px 12px;
  }

  .emoji {
    font-size: 3rem;
  }

  #start-btn {
    font-size: 1rem;
    padding: 8px 16px;
  }

  #score-board {
    font-size: 1rem;
  }

  #timer-display {
    font-size: 1.1rem;
  }
}