/* =====================================================
   :root variables
===================================================== */
:root {
  --bg: #ffffff;
  --panel: #f7f7f7;
  --muted: #e7e7e7;
  --text: #222;
  --accent: #2f7d32; /* subtle green */
  --essence: #6aa84f;
}

/* =====================================================
   Basic reset
===================================================== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: var(--bg);
}

/* =====================================================
   Screen & panel layout
===================================================== */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}

.screen.active {
  display: block;
}

.panel {
  width: min(720px, 92%);
  margin: 8vh auto;
  background: var(--panel);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
  text-align: center;
}

/* Titles & subtitles */
.title {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0.4px;
}

.sub {
  color: #666;
  margin-top: 6px;
  margin-bottom: 18px;
}

/* =====================================================
   Buttons
===================================================== */
.buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.06);
}

.btn.small {
  padding: 6px 10px;
  font-size: 14px;
}

.btn.back {
  position: absolute;
  left: 16px;
  top: 16px;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.06);
}

/* =====================================================
   Game canvas
===================================================== */
#game-canvas {
  width: 100%;
  height: 100vh;
  display: block;
  background: var(--bg);
}

/* =====================================================
   HUD (Health & Essence)
===================================================== */
.hud {
  position: absolute;
  right: 18px;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  pointer-events: none;
}

.hud .label {
  font-size: 12px;
  color: #666;
  display: block;
  margin-bottom: 6px;
}

.health, .essence {
  pointer-events: auto;
}

.units {
  display: flex;
  gap: 6px;
}

.health-unit {
  font-size: 16px;
  color: #555;
  filter: grayscale(1);
}

.essence-bar {
  width: 200px;
  height: 12px;
  background: var(--muted);
  border-radius: 12px;
  overflow: hidden;
}

.essence-fill {
  width: 70%;
  height: 100%;
  background: var(--essence);
  transition: width 0.2s ease;
}

/* =====================================================
   Dialogue box
===================================================== */
.dialogue {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 40px;
  background: var(--panel);
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.05);
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
}

.dialogue.hidden {
  display: none;
}

.dialogue #dialogue-text {
  max-width: 60vw;
  color: #333;
}

/* =====================================================
   Controls hint
===================================================== */
.controls-hint {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
  text-align: right;
}

/* =====================================================
   Minimal aesthetic note
===================================================== */
/* Minimal, blank aesthetic — keep shapes simple */
