/* ═══════════════════════════════════════════
   PANELS — Profile · Leaderboard · History calendar
   ═══════════════════════════════════════════ */

/* ══════════════════
   PROFILE PANEL
══════════════════ */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
#profileAvatarDisplay {
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
}
#profileName {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
/* .profile-section-label uses the shared eyebrow style from base.css */

.profile-avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.avatar-opt {
  width: 48px; height: 48px;
  font-size: 26px;
  border-radius: 12px;
  border: 2px solid var(--paper3);
  background: var(--paper2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--t-std), transform var(--t-fast);
}
.avatar-opt:hover    { border-color: var(--ink2); transform: scale(1.05); }
.avatar-opt.selected { border-color: var(--ink); background: white; }

.profile-name-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--paper3);
  border-radius: 10px;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  background: white;
  color: var(--ink);
  outline: none;
  margin-bottom: 20px;
  transition: border-color var(--t-std);
}
.profile-name-input:focus { border-color: var(--accent); }

.profile-save-btn {
  width: 100%;
  padding: 13px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background var(--t-std);
}
.profile-save-btn:hover    { background: var(--accent); }
.profile-save-btn:disabled { opacity: 0.6; cursor: default; }

/* ══════════════════
   LEADERBOARD PANEL
══════════════════ */

/* Scrollable puzzle-type tabs */
.lb-puzzle-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 12px;
  padding-bottom: 2px;
}
.lb-puzzle-tabs::-webkit-scrollbar { display: none; }

.lb-puzzle-tab {
  flex-shrink: 0;
  padding: 6px 13px;
  border-radius: 20px;
  border: 1.5px solid var(--paper3);
  background: var(--paper2);
  font-size: 12px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink2);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-std), border-color var(--t-std), color var(--t-std);
}
.lb-puzzle-tab:hover  { background: var(--paper3); }
.lb-puzzle-tab.active { background: var(--ink); color: white; border-color: var(--ink); }

/* Period segmented control */
.lb-period-tabs {
  display: flex;
  gap: 2px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 18px;
}
.lb-period-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--ink3);
  transition: background var(--t-std), color var(--t-std);
}
.lb-period-tab.active           { background: var(--ink); color: white; }
.lb-period-tab:hover:not(.active) { background: var(--paper3); color: var(--ink2); }

/* Entries list */
.lb-entries-container { display: flex; flex-direction: column; gap: 6px; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 12px;
}
.lb-row-you {
  background: white;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.lb-row-rank   { font-size: 18px; min-width: 34px; text-align: center; flex-shrink: 0; }
.lb-row-avatar { font-size: 22px; flex-shrink: 0; }
.lb-row-info   { flex: 1; min-width: 0; }
.lb-row-name   {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-row-right  { text-align: right; flex-shrink: 0; }
.lb-row-score  { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 700; color: var(--ink); }
.lb-row-time   { font-size: 11px; color: var(--ink3); }
.lb-you-tag    { font-size: 11px; color: var(--accent); font-weight: 600; margin-left: 4px; }

.lb-loading,
.lb-empty { text-align: center; padding: 40px; color: var(--ink3); font-size: 14px; }
.lb-empty  { line-height: 1.6; }

/* ══════════════════
   HISTORY CALENDAR
══════════════════ */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month-label {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.cal-nav-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--paper3);
  background: var(--paper2);
  font-size: 22px;
  color: var(--ink2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-bottom: 2px;
  transition: background var(--t-std);
}
.cal-nav-btn:hover:not(:disabled) { background: var(--paper3); }
.cal-nav-btn:disabled             { opacity: 0.3; cursor: default; }

.cal-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink3);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cal-legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.cal-legend-dot.solved   { background: var(--green); }
.cal-legend-dot.failed   { background: var(--accent); }
.cal-legend-dot.freeplay { background: var(--blue); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 24px;
}
/* .cal-dow uses the shared eyebrow style from base.css */

.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1.5px solid transparent;
  background: var(--paper2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: transform 0.12s, box-shadow 0.12s;
}
.cal-cell:not(:disabled):hover { transform: scale(1.06); box-shadow: var(--shadow); z-index: 1; }

/* Cell state variants */
.cal-blank      { background: transparent; pointer-events: none; }
.cal-empty-day  { background: var(--paper2); border-color: var(--paper3); opacity: 0.6; }
.cal-future     { opacity: 0.3; cursor: default; }
.cal-solved     { background: #d4edda; border-color: var(--green); }
.cal-failed     { background: #fde8e4; border-color: var(--accent); }
.cal-freeplay   { background: #e8eef8; border-color: var(--blue); }
.cal-today      { box-shadow: 0 0 0 2.5px var(--ink); }

.cal-day-num      { font-family: 'Fraunces', serif; font-size: clamp(11px, 2.5vw, 15px); font-weight: 700; color: var(--ink); line-height: 1; }
.cal-puzzle-emoji { font-size: clamp(10px, 2vw, 13px); line-height: 1; }

/* Monthly stats row */
.cal-stats {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.cal-stat {
  flex: 1;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.cal-stat-val {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.cal-stat-lbl {
  font-size: 10px;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ══════════════════
   HISTORY DAY DETAIL
══════════════════ */
.history-day-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 8px;
  gap: 8px;
}
.history-day-emoji  { font-size: 52px; line-height: 1; margin-bottom: 4px; }
.history-day-title  { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--ink); }
.history-day-sub    { font-size: 14px; color: var(--ink3); margin-bottom: 8px; }

.history-result-chip {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}
.history-result-chip.solved   { background: #d4edda; color: var(--green); }
.history-result-chip.failed   { background: #fde8e4; color: var(--accent); }
.history-result-chip.freeplay { background: #e8eef8; color: var(--blue); }

.history-score {
  font-family: 'Fraunces', serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin: 6px 0;
}
.history-score span {
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  color: var(--ink3);
}

.history-play-btn {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background var(--t-std);
}
.history-play-btn:hover { background: var(--accent); }
