/* SLITHER3D dark arcade UI. Tight, not chunky. No em or en dashes anywhere. */

:root {
  --bg: #04050a;
  --panel: rgba(13, 17, 28, 0.92);
  --line: rgba(120, 140, 200, 0.22);
  --ink: #e8ecf7;
  --ink-soft: #9aa6c4;
  --accent: #43e06c;
  --accent-hot: #6dff95;
  --danger: #ff4f5e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* Subtle screen-space vignette */
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 2;
}

.hidden { display: none !important; }

/* ---------- overlays ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 3, 8, 0.72);
  backdrop-filter: blur(4px);
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  max-width: 420px;
  width: calc(100% - 32px);
}

#logo {
  max-width: 320px;
  width: 100%;
  height: auto;
}

#logo-text {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--ink);
  text-shadow: 0 0 22px rgba(67, 224, 108, 0.55);
}

#logo-text span { color: var(--accent); }

.tagline {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 2px;
  text-transform: uppercase;
}

#name-input {
  width: 220px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: var(--ink);
  background: rgba(6, 9, 16, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

#name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67, 224, 108, 0.18);
}

/* ---------- skin picker ---------- */

#skin-picker {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 2px solid transparent;
  background-size: cover, cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  transition: transform 160ms ease, border-color 160ms ease;
}

.swatch:hover { transform: scale(1.12); }

.swatch.selected {
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
}

/* ---------- buttons ---------- */

.btn {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink);
  background: rgba(28, 34, 52, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn:hover { background: rgba(44, 52, 78, 0.95); }

.btn-primary {
  min-width: 160px;
  color: #04130a;
  background: var(--accent);
  border-color: var(--accent);
  text-transform: uppercase;
}

.btn-primary:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 320px;
}

/* ---------- HUD ---------- */

#hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

#hud .btn { pointer-events: auto; }

#stats {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

#stats #rank {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

#leaderboard {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 190px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

#leaderboard h3 {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

#lb-list {
  margin: 0;
  padding-left: 22px;
  font-size: 12px;
  line-height: 1.65;
}

#lb-list li.me {
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

#minimap {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 150px;
  height: 150px;
}

#kill-feed {
  position: absolute;
  left: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 300px;
}

.feed-msg {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(13, 17, 28, 0.75);
  border-radius: 8px;
  transition: opacity 600ms ease;
}

.feed-msg.fade { opacity: 0; }

#mute-btn {
  position: absolute;
  left: 16px;
  bottom: 76px;
}

/* ---------- death screen ---------- */

#death-screen h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--danger);
  text-shadow: 0 0 18px rgba(255, 79, 94, 0.5);
}

.death-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin: 0;
  width: 100%;
}

.death-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.death-stats dt {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.death-stats dd {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

@media (max-width: 520px) {
  #leaderboard { width: 150px; }
  #minimap { width: 110px; height: 110px; }
  .panel { padding: 20px; }
}
