:root {
  --primary: #E17055;
  --secondary: #FAB1A0;
  --accent: #00CEC9;
  --bg-color: #1A0F0A;
  --border-radius: 12px;
  --font-family: 'Inter', system-ui, sans-serif;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: 1px solid rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: #fff;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1200px; /* Optional max width for desktop */
  aspect-ratio: 16/9; /* Maintain aspect ratio if desired, or fill screen */
  background: var(--bg-color);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* Prevent scrolling on mobile */
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allow clicks to pass through to canvas unless on interactive elements */
}

/* Common UI Styles */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(26, 15, 10, 0.8); /* Semi-transparent background */
  backdrop-filter: blur(8px);
  pointer-events: auto; /* Re-enable pointer events for screens */
  transition: opacity 0.3s ease;
  z-index: 10;
}

.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden; /* Ensure it's not focusable */
}

h1.title {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(225, 112, 85, 0.5);
  letter-spacing: 2px;
}

h2.title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--secondary);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.2rem;
  color: #ccc;
  margin-bottom: 2rem;
  font-weight: 400;
}

.high-score-display {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 2rem;
  font-weight: 600;
  background: var(--glass-bg);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  border: var(--glass-border);
}

.btn {
  padding: 1rem 3rem;
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(225, 112, 85, 0.4);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 112, 85, 0.6);
  background: #FAB1A0; /* Lighter on hover */
  color: #1A0F0A;
}

.btn:active {
  transform: translateY(1px);
}

.controls-hint {
  margin-top: 3rem;
  color: #888;
  text-align: center;
  font-size: 0.9rem;
}

/* HUD */
#hud {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}

.score-container, .multiplier-container {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(5px);
  padding: 10px 20px;
  border-radius: var(--border-radius);
  border: var(--glass-border);
  min-width: 120px;
  align-items: center;
}

.label {
  font-size: 0.8rem;
  color: #aaa;
  font-weight: 600;
  letter-spacing: 1px;
}

#score-display {
  font-size: 2rem;
  font-weight: 800;
  color: var(--secondary);
}

#multiplier-display {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

/* Game Over Stats */
.stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 300px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background: var(--glass-bg);
  border-radius: var(--border-radius);
  border: var(--glass-border);
  font-size: 1.2rem;
  font-weight: 600;
}

.stat-row span:first-child {
  color: #ccc;
}

.stat-row span:last-child {
  color: var(--accent);
}
