/* ── Snake game overlay ───────────────────────────────────────────────────── */

#snake-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #050a05;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

#snake-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.snake-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 1rem;
  background: #0d140d;
  border-bottom: 1px solid #1a3a1a;
  flex-shrink: 0;
}

.snake-title {
  color: #00e533;
  font-size: 0.82rem;
  font-weight: bold;
  letter-spacing: 0.18em;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.snake-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 1rem;
  gap: 0.8rem;
  width: 100%;
}

/* ── Stats row ───────────────────────────────────────────────────────────── */
.snake-stats {
  display: flex;
  gap: 2.5rem;
  font-size: 0.72rem;
  color: #267326;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.snake-stat-val {
  color: #00ff41;
  font-size: 1.1rem;
  margin-left: 0.35rem;
  text-shadow: 0 0 8px rgba(0,255,65,.6);
}

/* ── Canvas wrapper ──────────────────────────────────────────────────────── */
.snake-canvas-wrap {
  position: relative;
  border: 1px solid #1a3a1a;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,229,51,.12), inset 0 0 40px rgba(0,0,0,.4);
  flex-shrink: 0;
}

#snake-canvas { display: block; }

/* ── Game over overlay ───────────────────────────────────────────────────── */
.snake-msg {
  position: absolute;
  inset: 0;
  background: rgba(5,10,5,.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.snake-msg.visible { display: flex; }

.snake-msg-title {
  color: #ff4444;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.2em;
  text-shadow: 0 0 12px rgba(255,68,68,.8);
}

.snake-msg-score {
  color: #00e533;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.snake-restart-btn {
  margin-top: 0.6rem;
  background: none;
  border: 1px solid #00e533;
  color: #00e533;
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: background 0.15s, box-shadow 0.15s;
}

.snake-restart-btn:hover {
  background: rgba(0,229,51,.1);
  box-shadow: 0 0 10px rgba(0,229,51,.3);
}

/* ── Hint bar ────────────────────────────────────────────────────────────── */
.snake-hint {
  color: #1a3a1a;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-align: center;
}
