:root {
  --primary-color: #8d6e63;
  --accent-color: #ffccbc;
  --text-color: #3e2723;
  --bg-sky: #87CEEB;
  --bg-sunset: #FF7F50;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1280px;
  max-height: 720px;
  background: #000;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks pass through to game */
}

#score-container {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  font-family: monospace;
}

#score-container .small {
  font-size: 16px;
  opacity: 0.8;
  margin-top: 5px;
}

#story-text {
  position: absolute;
  bottom: 20%;
  width: 100%;
  text-align: center;
  font-size: 28px;
  font-style: italic;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 1s ease-in-out;
  padding: 0 20px;
}

#story-text.visible {
  opacity: 1;
}

/* Screens */
#start-screen, #game-over-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(62, 39, 35, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  pointer-events: auto;
  transition: opacity 0.3s;
}

#start-screen.hidden, #game-over-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

h1, h2 {
  font-size: 48px;
  margin-bottom: 10px;
  color: var(--accent-color);
  text-align: center;
}

p {
  font-size: 18px;
  margin-bottom: 20px;
  opacity: 0.9;
  text-align: center;
}

.stats-box {
  background: rgba(0,0,0,0.2);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  min-width: 200px;
}

.stats-box p {
  margin: 5px 0;
  font-size: 20px;
  font-weight: bold;
}

.controls-hint {
  background: rgba(255,255,255,0.1);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 30px;
  text-align: center;
  line-height: 1.6;
}

.controls-hint span {
  background: white;
  color: var(--text-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
}

button {
  padding: 15px 40px;
  font-size: 24px;
  background-color: var(--accent-color);
  color: var(--text-color);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  font-weight: bold;
}

button:hover {
  transform: scale(1.05);
  background-color: white;
}

button:active {
  transform: scale(0.95);
}
