:root {
  --bg: #0c1018;
  --panel: #131822;
  --line: #1f2433;
  --text: #e8ecf3;
  --muted: rgba(232, 236, 243, 0.6);
}

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

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
               Arial, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

#hud {
  flex: 0 0 auto;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#hud-line {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

#score { font-size: 22px; font-weight: 700; color: #74e0d4; }
#best  { font-size: 14px; color: var(--muted); }
#status { font-size: 14px; font-weight: 600; }
#status.dead { color: #ff6477; }
#status.alive { color: #74e0d4; }

button {
  font: inherit;
  background: #1c2230;
  color: var(--text);
  border: 1px solid #2a3142;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover { background: #232a3a; }

#board-wrap {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 10px;
}

canvas#board {
  background: #0a0d14;
  border-radius: 8px;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}

#hint {
  flex: 0 0 auto;
  background: var(--panel);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 8px;
}
