.puzzle-layout {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 640px) {
  .puzzle-layout { grid-template-columns: 1fr; }
}

.puzzle-panel h2 { margin: 0 0 4px; font-family: var(--font-head); font-size: 20px; }

.puzzle-stats { display: flex; gap: 24px; margin: 16px 0; }
.puzzle-stats > div { display: flex; flex-direction: column; }
.stat-label { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.puzzle-stats span:last-child { font-family: monospace; font-size: 22px; color: var(--gold); }

#snakeCanvas {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 100%;
  display: block;
}

.dpad {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.dpad-row { display: flex; gap: 6px; }

.dpad-btn {
  width: 48px;
  height: 48px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.dpad-btn:active { background: var(--line); }

/* מציגים את הכפתורים רק במסכים צרים (מובייל) */
@media (max-width: 640px) {
  .dpad { display: flex; }
}

.win-msg {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(180, 67, 47, 0.12);
  border: 1px solid rgba(180, 67, 47, 0.4);
  border-radius: 5px;
  color: #e0897a;
  font-size: 14px;
}

.leaderboard-panel h3 { margin: 0 0 12px; font-size: 15px; }
.leaderboard-list { display: flex; flex-direction: column; gap: 6px; }

.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 5px;
  font-size: 13px;
}

.leader-rank { width: 20px; text-align: center; color: var(--gold); font-weight: 700; }
.leader-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-time { font-family: monospace; color: var(--teal); }
.leader-row.is-me { border: 1px solid var(--gold-dim); }
