/* ========================================
   PROFILE TAB - PC-OPTIMIZED DASHBOARD
   ======================================== */
.profile-container {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

/* ===== Left Column (Sidebar) ===== */
.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* User Card */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-wrapper {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}

.avatar-svg {
  width: 100%;
  height: 100%;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-actions-tactile {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.total-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ===== Inline Name Edit ===== */
.name-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.name-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.name-input:focus {
  border-color: var(--primary);
}

.name-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.name-edit-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ===== Player Rank & Level Badge Card ===== */
.profile-rank-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}

.rank-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.rank-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rank-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.rank-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.rank-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}

.rank-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 50px;
  transition: width 0.4s ease;
}

.rank-progress-fill.rank-max {
  background: linear-gradient(90deg, #F59E0B, #EF4444);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.profile-rank-card.rank-max .rank-icon-wrapper {
  background: rgba(245, 158, 11, 0.15);
  border-color: #F59E0B;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.rank-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Right Column (Main Dashboard) ===== */
.profile-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Difficulty Selector Pills */
.difficulty-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.diff-tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: none;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: center;
}

.diff-tab:hover {
  color: var(--text);
}

.diff-tab.active {
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.25);
}

/* Overview Summary Card (Donut + Played/Won) */
.stats-charts {
  margin: 0;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.overview-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.donut-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart {
  width: 96px;
  height: 96px;
  transition: all 0.6s ease;
}

#donut-win {
  transition: stroke-dashoffset 0.8s ease;
}

.overview-details {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 12px;
  min-width: 0;
}

.overview-stat-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.overview-stat-row:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.overview-stat-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.overview-stat-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.overview-stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.overview-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Stat Cards Grid (3 Columns x 2 Rows) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-light);
}

.stat-card .stat-icon {
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-card .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card.highlight {
  border-color: var(--primary-light);
  background: var(--primary-bg);
}

.stat-card.highlight .stat-value {
  color: var(--primary);
}
