/* -- Lobby -- */
.snake-lobby-card {
  background: var(--surface); border-radius: 22px; padding: 26px 22px; text-align: center;
  box-shadow: 0 14px 32px -14px rgba(22,163,74,.25); margin-top: 10px;
}
.snake-lobby-logo { height: 84px; width: auto; margin-bottom: 6px; }
.snake-lobby-title { font-family: 'Baloo 2', sans-serif; font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.snake-lobby-sub { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-bottom: 20px; }
.snake-lobby-btn {
  width: 100%; padding: 15px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  font-weight: 800; font-size: 15px; cursor: pointer; font-family: 'Sora', sans-serif;
  box-shadow: 0 10px 22px -8px rgba(22,163,74,.5);
}
.snake-lobby-btn:disabled { opacity: .6; cursor: default; }
.snake-lobby-status { margin-top: 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; }

.snake-legend { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.snake-legend-title { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 10px; }
.snake-legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); padding: 6px 0; }
.snake-legend-row span:nth-child(2) { flex: 1; }
.snake-legend-row b { color: var(--accent2); font-weight: 800; }
.snake-legend-dot { width: 12px; height: 12px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.snake-legend-icon { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.snake-legend-emoji { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }

.snake-legend-powerups-lbl { font-size: 12px; color: var(--muted); padding: 6px 0 4px; }
.snake-legend-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding-bottom: 6px; }
.snake-legend-chip {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--bg); border-radius: 12px; padding: 6px 2px;
}
.snake-legend-chip img { width: 26px; height: 26px; object-fit: contain; }
.snake-legend-chip b { font-size: 11px; color: var(--accent2); font-weight: 800; }

.snake-howto-list { text-align: left; font-size: 13px; line-height: 1.7; color: var(--ink); margin: 14px 0; }
.snake-howto-list b { color: var(--accent2); }

/* -- Game view: takes over the whole screen, ignores .wrap's max-width -- */
#gameView {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
}
#snakeCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hudTop {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
}
#hudExit {
  pointer-events: auto; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: none; color: var(--ink); font-size: 18px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); cursor: pointer;
}
#hudScoreBox {
  pointer-events: auto; background: rgba(255,255,255,.92); border-radius: 14px; padding: 7px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); text-align: center;
}
#hudScoreLbl { font-size: 9.5px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
#hudScoreVal { font-size: 18px; font-weight: 800; color: var(--accent2); font-family: 'Baloo 2', sans-serif; }
#hudCombo {
  margin-top: 2px; font-size: 11px; font-weight: 800; color: #f59e0b;
  animation: comboPulse .5s ease-in-out infinite alternate;
}
@keyframes comboPulse { from { transform: scale(1); } to { transform: scale(1.08); } }

#hudLeaderboard {
  pointer-events: auto; background: rgba(255,255,255,.92); border-radius: 14px; padding: 8px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); min-width: 118px; max-width: 150px;
}
#hudLeaderboard .lb-hdr { font-size: 9px; font-weight: 800; color: var(--muted); margin-bottom: 4px; letter-spacing: .04em; }
.lb-row { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 1.5px 0; }
.lb-row.me { color: var(--accent2); }
.lb-row .lb-rank { width: 13px; flex-shrink: 0; color: var(--muted); font-weight: 800; }
.lb-row .lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .lb-score { flex-shrink: 0; }
.lb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }

#boostBtn {
  /* The Salesmartly "Dúvidas" chat bubble every page carries sits at
     right:14px, its top edge measured (live, across real viewport widths)
     at ~75-77px from the screen bottom -- bottom:20px here put boostBtn's
     top at 98px, comfortably overlapping it. 104px clears it with margin. */
  position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: calc(104px + env(safe-area-inset-bottom));
  z-index: 2; width: 78px; height: 78px; border-radius: 50%; border: none;
  background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 75%);
  box-shadow: 0 8px 20px -6px rgba(245,158,11,.6); font-size: 30px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .1s;
}
#boostBtn:active, #boostBtn.pressed { transform: scale(.9); }

#deathOverlay {
  position: absolute; inset: 0; z-index: 5; background: rgba(20,41,29,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.death-card {
  background: #fff; border-radius: 22px; padding: 28px 24px; max-width: 320px; width: 100%;
  text-align: center; box-shadow: 0 20px 50px -12px rgba(0,0,0,.4);
}
.death-emoji { font-size: 42px; margin-bottom: 6px; }
.death-title { font-family: 'Baloo 2', sans-serif; font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.death-killer { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.death-score-lbl { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.death-score-val { font-size: 34px; font-weight: 800; color: var(--accent2); font-family: 'Baloo 2', sans-serif; margin-bottom: 18px; }
.death-btn {
  width: 100%; padding: 13px; border-radius: 999px; border: none; font-weight: 800; font-size: 14px;
  cursor: pointer; font-family: 'Sora', sans-serif; margin-bottom: 8px;
}
.death-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.death-btn.ghost { background: none; color: var(--muted); border: 1.5px solid var(--line); }

#connLost {
  position: absolute; inset: 0; z-index: 6; background: rgba(20,41,29,.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700;
  text-align: center; padding: 20px; flex-direction: column; gap: 12px;
}
