/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  overflow: hidden;
}

/* Screens */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: flex;
}

/* Setup screen */
#setup-screen {
  align-items: center;
  justify-content: center;
}

.setup-container {
  width: 90%;
  max-width: 360px;
  padding: 2rem;
}

.setup-container h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
  color: #4CAF50;
}

.subtitle {
  color: #888;
  margin-bottom: 1.5rem;
}

form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: #aaa;
}

form input, form select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #16213e;
  color: #eee;
  font-size: 1rem;
}

form input:focus, form select:focus {
  outline: none;
  border-color: #4CAF50;
}

button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1.5rem;
  border: none;
  border-radius: 6px;
  background: #4CAF50;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

button:active {
  background: #388E3C;
}

button:disabled {
  background: #555;
  cursor: not-allowed;
}

.status-msg {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #ff9800;
  min-height: 1.2em;
}

/* Game screen */
#game-screen {
  flex-direction: column;
}

#map {
  flex: 1;
  width: 100%;
}

#hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(26, 26, 46, 0.92);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#score-display {
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
}

#cell-status {
  flex: 1;
  font-size: 0.85rem;
  color: #aaa;
  text-align: center;
}

#finish-btn {
  width: auto;
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: #f44336;
}

#finish-btn:active {
  background: #c62828;
}

/* Result screen */
#result-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.result-container {
  padding: 2rem;
}

.result-container h1 {
  font-size: 2rem;
  color: #4CAF50;
  margin-bottom: 1rem;
}

.big-score {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.big-pct {
  font-size: 3rem;
  font-weight: 700;
  color: #4CAF50;
  margin-bottom: 1rem;
}

#new-game-btn {
  max-width: 300px;
}
