:root {
  --bg: #1a2f1a;
  --panel: #243824;
  --accent: #4caf50;
  --accent-hover: #66bb6a;
  --trunk: #5d4037;
  --branch: #6d4c41;
  --leaf: #2e7d32;
  --leaf-hover: #43a047;
  --text: #e8f5e9;
  --muted: #a5d6a7;
  --danger: #ef5350;
  --border: #3e5c3e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(160deg, #0d1f0d 0%, var(--bg) 50%, #1b3a1b 100%);
  color: var(--text);
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
}

header h1 {
  font-size: 2rem;
  color: var(--accent);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.subtitle {
  color: var(--muted);
  margin-top: 0.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.panel input {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #1a2a1a;
  color: var(--text);
  font-size: 1rem;
  min-width: 180px;
}

button {
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hud-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.hud-item .label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hud-item .value {
  font-size: 1.2rem;
  font-weight: 600;
}

.status {
  text-align: center;
  padding: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  min-height: 1.5rem;
}

.status.danger {
  color: var(--danger);
  font-weight: 600;
}

#board-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

#game-board {
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #0f1a0f;
  cursor: crosshair;
  max-width: 100%;
}

#game-board.spectator {
  cursor: default;
}

.controls {
  text-align: center;
}

.spectator-banner {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid #ffc107;
  color: #ffe082;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  text-align: center;
  margin-top: 1rem;
}

#role.player {
  color: var(--accent);
}

#role.spectator {
  color: #ffc107;
}

.btn-danger {
  background: #c62828;
}

.btn-danger:hover {
  background: #e53935;
}
