* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Comic Sans MS", cursive, sans-serif;
  background: #fdf6f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 10px;
  background: linear-gradient(to right, #fcd8c3, #f9b08c);
  width: 100%;
  box-shadow: 0 2px 4px #00000033;
}

h1 {
  font-size: 1.6em;
  color: #6b2400;
  margin-bottom: 5px;
}

.hud {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 1em;
  color: #5a1a00;
}

.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  flex-grow: 1;
}

canvas {
  background: transparent;
  max-width: 100%;
  height: auto;
  border: 3px solid #ccc;
  border-radius: 10px;
}

.controls {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  width: 90%;
  max-width: 480px;
}

.left-controls,
.right-controls {
  display: flex;
  gap: 10px;
}

button {
  padding: 10px 14px;
  font-size: 1.4em;
  border: none;
  border-radius: 10px;
  background: #fff4e6;
  box-shadow: 0 2px 5px #00000030;
  cursor: pointer;
}

button:active {
  transform: scale(0.95);
  background: #ffdec2;
}

.game-over {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000aa;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup {
  background: #fff8f1;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  box-shadow: 0 0 10px #00000030;
}

.popup h2 {
  color: #702d00;
  margin-bottom: 10px;
}

.popup button {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  font-size: 1em;
}
