.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: 20px; color: var(--gold); }

.sudoku-grid {
  direction: ltr; /* מונע מהכיווניות RTL של האתר לבלבל את סדר התאים/הקווים */
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--gold-dim);
  border-radius: 4px;
  overflow: hidden;
}

.sudoku-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  user-select: none;
}

.sudoku-cell.given {
  background: var(--surface-2);
  color: var(--gold);
  font-weight: 700;
  cursor: default;
}

.sudoku-cell.selected { background: rgba(79, 176, 174, 0.18); }
.sudoku-cell.error { color: #e0897a; background: rgba(180, 67, 47, 0.15); }

/* קווים עבים בין תיבות 3×3 — המחלקות מחושבות ב-JS מתוך שורה/עמודה אמיתיות */
.sudoku-cell.box-right { border-right: 2px solid var(--gold-dim); }
.sudoku-cell.box-bottom { border-bottom: 2px solid var(--gold-dim); }

.number-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 380px;
  margin-top: 14px;
}

.num-btn {
  padding: 10px 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}

.num-btn:hover { border-color: var(--gold-dim); }
.erase-btn { grid-column: span 2; font-size: 12.5px; color: var(--muted); }

.win-msg {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(79, 176, 174, 0.12);
  border: 1px solid rgba(79, 176, 174, 0.4);
  border-radius: 5px;
  color: var(--teal);
  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); }
