.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);
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
}

.puzzle-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s ease;
}

.puzzle-tile:hover { background: var(--line); }

.puzzle-tile.empty {
  background: transparent;
  border: 1px dashed var(--line);
  cursor: default;
}

.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); }
