body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-base);
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Main App Container */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-md) var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: var(--font-2xl);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--accent-primary);
}

.nav-link.active {
  color: var(--accent-primary);
}

/* Main Content */
.main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
}

/* Page Header */
.page-header {
  margin-bottom: var(--spacing-xl);
}

.page-title {
  font-size: var(--font-3xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--spacing-sm);
}

.page-description {
  color: var(--text-secondary);
  font-size: var(--font-lg);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Flex */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Loading State */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .logo img {
    height: 32px !important;
  }

  .logo {
    font-size: var(--font-lg);
  }

  .nav {
    width: 100%;
    justify-content: center;
  }

  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .main {
    padding: var(--spacing-lg) var(--spacing-md);
  }
  .prog-status-header { flex-direction: column; text-align: center; gap: var(--spacing-md); }
  .prog-identity { flex-direction: column; align-items: center; }
  .prog-stats-grid { grid-template-columns: repeat(3, 1fr); gap: var(--spacing-xs); }
  .prog-stat { padding: var(--spacing-sm); }
  .prog-stat-val { font-size: var(--font-lg); }
  .prog-stat-label { font-size: 10px; }
  .prog-badges-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
  .prog-badge { padding: 12px 8px; }
  .prog-badge-name { font-size: 10px; }
  .prog-badge-visual { width: 36px; height: 36px; }
  .prog-badge-icon { width: 22px; height: 22px; }
  .prog-next-grid { grid-template-columns: 1fr; }
  .prog-title-road { gap: 0; }
  .badge-modal-content { padding: 24px 16px; width: 95%; }
}

/* ═══ Progression Page — FF Status Screen ═════════════════ */
#prog-root { overflow: hidden; box-sizing: border-box; }

.prog-status-card {
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  padding: var(--spacing-xl); margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
  position: relative; overflow: hidden;
}
.prog-status-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), #8B5CF6, #EC4899);
}
.prog-status-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--spacing-xl); gap: var(--spacing-lg);
}
.prog-identity { display: flex; align-items: center; gap: var(--spacing-lg); }
.prog-avatar {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 20px rgba(31,111,235,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.prog-avatar:hover { transform: scale(1.05); box-shadow: 0 0 28px rgba(31,111,235,0.35); }
.prog-name-block { display: flex; flex-direction: column; gap: 4px; }
.prog-name { font-size: var(--font-2xl); font-weight: var(--font-bold); color: var(--text-primary); margin: 0; }
.prog-title-badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: var(--font-sm);
  font-weight: var(--font-semibold); color: var(--accent-primary); background: rgba(31,111,235,0.12);
  border: 1px solid rgba(31,111,235,0.2);
}
.prog-level-ring {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid var(--accent-primary); display: flex; align-items: center;
  justify-content: center; background: rgba(31,111,235,0.08);
  box-shadow: 0 0 20px rgba(31,111,235,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: progLevelPulse 4s ease-in-out infinite;
}
.prog-level-ring:hover { transform: scale(1.08); box-shadow: 0 0 32px rgba(31,111,235,0.3); }
@keyframes progLevelPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(31,111,235,0.15); }
  50% { box-shadow: 0 0 28px rgba(31,111,235,0.25); }
}
.prog-level-num { font-size: 28px; font-weight: 800; color: var(--accent-primary); }

/* XP bar */
.prog-xp-section { margin-bottom: var(--spacing-lg); }
.prog-xp-labels { display: flex; justify-content: space-between; font-size: var(--font-sm); color: var(--text-secondary); margin-bottom: 6px; }
.prog-xp-bar {
  height: 12px; background: var(--bg-tertiary); border-radius: 6px; overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.prog-xp-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent-primary), #8B5CF6);
  border-radius: 6px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.prog-xp-fill::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  border-radius: 6px;
}
.prog-xp-detail { font-size: var(--font-xs); color: var(--text-tertiary); margin-top: 4px; text-align: right; }

/* Stats grid */
.prog-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: var(--spacing-sm);
}
.prog-stat {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--spacing-md) var(--spacing-sm); background: var(--bg-primary);
  border-radius: var(--radius-md); border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative; overflow: hidden;
}
.prog-stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-primary); opacity: 0; transition: opacity 0.2s ease;
}
.prog-stat:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); border-color: var(--accent-primary); }
.prog-stat:hover::before { opacity: 1; }
.prog-stat-icon { color: var(--accent-primary); opacity: 0.8; }
.prog-stat-val { font-size: var(--font-xl); font-weight: 800; color: var(--text-primary); line-height: 1; }
.prog-stat-label { font-size: 11px; color: var(--text-tertiary); text-align: center; line-height: 1.2; overflow-wrap: break-word; word-break: break-word; }
.prog-streak.streak-active {
  border-color: rgba(245,158,11,0.4);
  background: linear-gradient(135deg, var(--bg-primary) 60%, rgba(245,158,11,0.08));
}
.prog-streak.streak-active::before { background: #F59E0B; opacity: 1; }
.prog-streak.streak-active .prog-stat-val { color: #F59E0B; }
.prog-streak.streak-active .prog-streak-flame { color: #F59E0B; animation: progFlameFlicker 1.5s ease-in-out infinite; }
@keyframes progFlameFlicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}
.prog-streak-best { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }

/* Activity chart */
.prog-chart-controls { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--spacing-md); }
.prog-chart-btn {
  background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  color: var(--text-tertiary); padding: 5px 12px; font-size: var(--font-xs); font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.prog-chart-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.prog-chart-btn.active { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.prog-chart-period { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--spacing-sm); }
.prog-period-btn {
  background: transparent; border: 1px solid var(--border-color); border-radius: var(--radius-md);
  color: var(--text-tertiary); padding: 4px 10px; font-size: var(--font-xs); font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.prog-period-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.prog-period-btn.active { background: var(--bg-primary); border-color: var(--text-secondary); color: var(--text-primary); }
.prog-date-range { display: flex; align-items: center; gap: 8px; margin-bottom: var(--spacing-sm); }
.prog-date-input {
  background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  color: var(--text-primary); padding: 4px 8px; font-size: var(--font-xs); font-family: inherit;
}

[data-theme="dark"] .prog-date-input {
  color-scheme: dark;
}
.prog-date-sep { color: var(--text-tertiary); font-size: 14px; }
.prog-chart-wrap { width: 100%; position: relative; }
.prog-chart-wrap canvas { width: 100%; border-radius: var(--radius-md); }
.chart-tooltip {
  display: none; position: absolute; pointer-events: none;
  transform: translate(-50%, -100%); margin-top: -8px;
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: 8px 12px;
  font-size: var(--font-xs); color: var(--text-primary); line-height: 1.5;
  white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 10;
}

/* Sections */
.prog-section {
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  padding: var(--spacing-xl); margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
  overflow: hidden;
}
.prog-section-title {
  font-size: var(--font-lg); font-weight: var(--font-bold); color: var(--text-primary);
  margin: 0 0 var(--spacing-lg); display: flex; align-items: center; gap: var(--spacing-sm);
  padding-bottom: var(--spacing-sm); border-bottom: 2px solid var(--border-color);
}
.prog-badge-count { font-size: var(--font-sm); color: var(--text-tertiary); font-weight: 400; margin-left: auto; }

/* Title road */
.prog-title-road { display: flex; flex-direction: column; gap: 2px; position: relative; margin-bottom: var(--spacing-lg); }
.prog-title-step {
  display: flex; align-items: center; gap: var(--spacing-md);
  padding: 8px 12px; border-radius: var(--radius-sm); position: relative;
  transition: background var(--transition-fast);
}
.prog-title-step.current { background: rgba(31,111,235,0.1); }
.prog-title-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border-color); background: var(--bg-primary);
  transition: all var(--transition-fast);
}
.prog-title-step.unlocked .prog-title-dot { background: var(--accent-primary); border-color: var(--accent-primary); }
.prog-title-step.current .prog-title-dot { background: var(--accent-primary); border-color: var(--accent-primary); box-shadow: 0 0 8px rgba(31,111,235,0.4); width: 18px; height: 18px; }
.prog-title-step.locked .prog-title-dot { opacity: 0.4; }
.prog-title-info { display: flex; flex-direction: column; }
.prog-title-name { font-size: var(--font-sm); font-weight: var(--font-semibold); color: var(--text-primary); }
.prog-title-step.locked .prog-title-name { color: var(--text-tertiary); }
.prog-title-step.current .prog-title-name { color: var(--accent-primary); font-weight: var(--font-bold); }
.prog-title-xp { font-size: var(--font-xs); color: var(--text-tertiary); }
.prog-next-title {
  font-size: var(--font-sm); color: var(--text-secondary); padding: var(--spacing-md);
  background: var(--bg-primary); border-radius: var(--radius-md); border: 1px dashed var(--accent-primary);
}

/* Badge category */
.prog-cat-title {
  font-size: var(--font-xs); font-weight: 700; color: var(--text-tertiary);
  margin: var(--spacing-lg) 0 var(--spacing-sm); text-transform: uppercase;
  letter-spacing: 1px;
}

/* Badge grid — vertical cards like marche-vanilla */
.prog-badges-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px; margin-bottom: var(--spacing-md);
}
.prog-badge {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; border-radius: var(--radius-md);
  background: var(--bg-primary); border: 2px solid var(--border-color);
  position: relative; overflow: hidden; cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.prog-badge::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, color-mix(in srgb, var(--badge-color, #6B7280) 10%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.prog-badge:hover { transform: translateY(-4px); }
.prog-badge-visual {
  width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; border-radius: 50%; overflow: hidden;
  position: relative; z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.prog-badge-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.prog-badge-icon { width: 28px; height: 28px; }
.prog-badge-name {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  text-align: center; color: var(--text-primary); position: relative; z-index: 1;
  word-break: break-word; line-height: 1.3;
}
.prog-badge-rarity {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  position: relative; z-index: 1;
}
.prog-badge-xp {
  font-size: 10px; color: var(--accent-primary); font-weight: 600;
  position: relative; z-index: 1;
}
.prog-badge-date {
  font-size: 10px; color: var(--text-tertiary); position: relative; z-index: 1;
}
/* Badge progress bar (on locked badges in grid) */
.prog-badge-progress {
  width: 100%; padding: 0 4px; position: relative; z-index: 1; margin-top: 2px;
}
.prog-badge-progress-bar {
  width: 100%; height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden;
}
.prog-badge-progress-fill {
  height: 100%; border-radius: 2px; transition: width 0.4s ease;
}
.prog-badge-progress-text {
  font-size: 9px; color: var(--text-tertiary); display: block; text-align: center; margin-top: 2px;
}

/* Rarity-specific borders & glows */
.prog-rarity-common { border-color: var(--border-color); }
.prog-rarity-common:hover { border-color: #94A3B8; box-shadow: 0 4px 16px rgba(148,163,184,0.15); }
.prog-rarity-rare { border-color: rgba(59,130,246,0.3); }
.prog-rarity-rare:hover { border-color: #3B82F6; box-shadow: 0 4px 20px rgba(59,130,246,0.25); }
.prog-rarity-epic { border-color: rgba(139,92,246,0.3); }
.prog-rarity-epic:hover { border-color: #8B5CF6; box-shadow: 0 4px 24px rgba(139,92,246,0.3); }
.prog-rarity-legendary { border-color: rgba(245,158,11,0.3); background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(245,158,11,0.05) 100%); }
.prog-rarity-legendary:hover { border-color: #F59E0B; box-shadow: 0 4px 28px rgba(245,158,11,0.3); }
.prog-rarity-mythic { border-color: rgba(255,107,53,0.4); background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(255,107,53,0.08) 100%); animation: progMythicPulse 3s ease infinite; }
.prog-rarity-mythic:hover { border-color: #FF6B35; box-shadow: 0 4px 36px rgba(255,107,53,0.4); }
@keyframes progMythicPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,107,53,0.1); }
  50% { box-shadow: 0 0 20px rgba(255,107,53,0.2); }
}

/* Locked badges */
.prog-badge.locked { opacity: 0.4; filter: grayscale(0.8); }
.prog-badge.locked:hover { opacity: 0.6; transform: translateY(-2px); filter: grayscale(0.5); }
.prog-badge.locked .prog-badge-icon { color: var(--text-tertiary) !important; }

/* Next objectives */
.prog-next-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md); }
.prog-next-item {
  padding: var(--spacing-md); background: var(--bg-primary); border-radius: var(--radius-md);
  border: 1px solid var(--border-color); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.prog-next-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.prog-next-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.prog-next-name { font-size: var(--font-sm); font-weight: var(--font-semibold); }
.prog-next-pct { font-size: var(--font-sm); font-weight: 700; color: var(--text-secondary); }
.prog-next-bar { height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; }
.prog-next-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.prog-next-detail { font-size: var(--font-xs); color: var(--text-tertiary); margin-top: 4px; }
.prog-next-reward { font-size: 11px; color: var(--accent-primary); font-weight: 600; }

/* Badge detail modal */
.badge-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.badge-modal-overlay.active { display: flex; }
.badge-modal-content {
  position: relative; background: var(--bg-primary); border-radius: var(--radius-lg);
  padding: 32px; max-width: 380px; width: 90%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: badgeModalIn 0.25s ease;
}
@keyframes badgeModalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.badge-modal-close {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  color: var(--text-secondary); font-size: 24px; cursor: pointer; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.badge-modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.badge-modal-badge {
  width: 80px; height: 80px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg-secondary);
  box-shadow: 0 0 14px var(--badge-color, #6B7280);
}
.badge-modal-icon { width: 48px; height: 48px; color: var(--badge-color); }
.badge-modal-icon svg { width: 100%; height: 100%; }
.badge-modal-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.badge-modal-badge.has-image { width: 220px; height: 220px; }
.badge-modal-badge.has-image .badge-modal-icon { width: 200px; height: 200px; }
.badge-modal-name { font-size: 1.3rem; font-weight: 700; margin: 0 0 8px; color: var(--text-primary); }
.badge-modal-xp { font-size: 0.9rem; color: var(--accent-primary); font-weight: 600; margin-bottom: 12px; }
.badge-modal-desc { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; margin: 0 0 16px; }
.badge-modal-status { font-size: 0.85rem; padding: 8px 16px; border-radius: var(--radius-md); margin-bottom: 12px; display: inline-flex; align-items: center; gap: 8px; }
.badge-modal-earned { background: rgba(16,185,129,0.12); color: #10B981; }
.badge-modal-locked { background: var(--bg-tertiary); color: var(--text-tertiary); }
.badge-modal-date { font-size: 0.8rem; opacity: 0.8; }
.badge-modal-category { font-size: 0.8rem; color: var(--text-tertiary); margin-top: 4px; }
.badge-modal-condition { font-size: 0.82rem; color: var(--text-tertiary); margin: 10px 0 0; font-style: italic; }
.badge-modal-locked-visual .badge-modal-icon { opacity: 0.4; filter: grayscale(0.8); }
.badge-modal-locked-visual { opacity: 0.85; }
/* Badge modal progress bar */
.badge-modal-progress {
  margin: 12px 0; padding: 0 16px;
}
.badge-modal-progress-bar {
  width: 100%; height: 8px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden;
}
.badge-modal-progress-fill {
  height: 100%; border-radius: 4px; transition: width 0.4s ease;
}
.badge-modal-progress-text {
  font-size: 0.82rem; color: var(--text-secondary); margin-top: 6px; display: block;
}

/* Photo modal (avatar enlarge) */
.photo-modal-content {
  position: relative; background: var(--bg-primary); border-radius: var(--radius-lg);
  padding: 32px; max-width: 500px; width: 90%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: badgeModalIn 0.25s ease;
}
.photo-modal-img {
  display: block; margin: 0 auto;
  max-width: 100%; max-height: 70vh; border-radius: var(--radius-lg); object-fit: contain;
}

/* ── Achievement Notification ─────────────────────────── */
.achv-overlay {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; pointer-events: none;
  opacity: 0; transition: opacity 0.4s ease;
}
.achv-overlay.active { opacity: 1; }
.achv-overlay.closing { opacity: 0; }
.achv-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px 24px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(30,30,50,0.97) 0%, rgba(40,30,60,0.97) 100%);
  border: 1px solid rgba(245,158,11,0.4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 40px rgba(245,158,11,0.15);
  animation: achvSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes achvSlideIn {
  from { transform: translateY(-40px) scale(0.8); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.achv-glow {
  position: absolute; inset: -2px; border-radius: 14px;
  background: conic-gradient(from 0deg, transparent, rgba(245,158,11,0.4), transparent, rgba(139,92,246,0.3), transparent);
  animation: achvGlow 2s linear infinite;
  z-index: -1;
}
@keyframes achvGlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.achv-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(245,158,11,0.15); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; animation: achvPulse 0.6s ease 0.3s both;
}
@keyframes achvPulse { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.achv-level-icon {
  font-size: 22px; font-weight: 800; color: #F59E0B;
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(139,92,246,0.2));
}
.achv-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: #F59E0B; font-weight: 700; }
.achv-name { font-size: 16px; font-weight: 700; color: #fff; margin: 2px 0; }
.achv-xp { font-size: 13px; color: #10B981; font-weight: 600; }
.achv-particles { position: absolute; inset: 0; pointer-events: none; }
.achv-particle {
  position: absolute; top: 50%; left: 50%; width: 4px; height: 4px;
  border-radius: 50%; background: #F59E0B;
  animation: achvBurst 0.8s ease-out var(--delay, 0s) both;
}
@keyframes achvBurst {
  0% { transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) translateY(0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) translateY(-60px) scale(0); opacity: 0; }
}

/* ── Logo dark mode — inverser l'image si fond clair ───── */
[data-theme="dark"] .logo img {
  filter: brightness(0) invert(1);
}
