.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

/* ========== Overview card (full-width hero at top) ========== */
.stat-overview {
  background: linear-gradient(135deg, var(--accent) 0%, #f59563 100%);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 16px 0 18px;
  box-shadow: var(--shadow-md);
  color: #fff;
}
.stat-overview-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 12px;
}
.stat-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
}
.stat-overview-tile {
  text-align: center;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  backdrop-filter: blur(4px);
}
.stat-overview-value {
  font-size: 26px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
.stat-overview-label {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.85;
  font-weight: 600;
  letter-spacing: 0.4px;
}

/* ========== Export/Import toolbar ========== */
.stats-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}
.stats-tools .btn { font-size: 13px; }
.stats-tools .btn.danger { background: var(--danger); color: #fff; }

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  border: 1px solid var(--border);
}

.stat-game-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-strong);
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-row {
  margin-top: 6px;
}

.sparkline {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 8px;
  overflow: visible;
}

/* ========== Achievement category tabs ========== */
.ach-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.ach-tab-bar .btn {
  font-size: 12px;
  padding: 4px 10px;
  opacity: 0.65;
}

.ach-tab-bar .btn.active {
  opacity: 1;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ========== Achievements section ========== */
.ach-category {
  margin-bottom: 24px;
}

.ach-cat-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.ach-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  transition: box-shadow .15s, border-color .15s;
  position: relative;
  min-height: 90px;
  justify-content: center;
}

.ach-cell.unlocked {
  border-color: rgba(237, 194, 46, 0.45);
  box-shadow: 0 0 0 1px rgba(237, 194, 46, 0.25), var(--shadow-sm);
}

.ach-cell.locked {
  opacity: 0.42;
}

.ach-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.ach-icon.locked-icon {
  font-size: 1.4rem;
  filter: grayscale(1);
}

.ach-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.25;
}

.ach-date {
  font-size: 9px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.ach-hint {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}
