/* ── Achievements Panel ──────────────────────────────────────────────────── */

.achievements-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: ach-fade-in 0.2s ease;
}

@keyframes ach-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.achievements-panel {
  background: var(--bg-secondary, #1a1a2e);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ach-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes ach-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.ach-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  flex-shrink: 0;
}

.ach-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #fff);
}

.ach-panel-close {
  background: var(--bg-tertiary, #2a2a3e);
  border: none;
  color: var(--text-secondary, #aaa);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ach-panel-close:hover {
  background: var(--bg-hover, #3a3a4e);
  color: var(--text-primary, #fff);
}

/* Stats summary row */
.ach-summary {
  display: flex;
  gap: 16px;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}

.ach-stat {
  background: var(--bg-tertiary, #2a2a3e);
  border-radius: 12px;
  padding: 10px 16px;
  flex: 1;
  text-align: center;
}

.ach-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent, #9b59b6);
}

.ach-stat-label {
  font-size: 11px;
  color: var(--text-secondary, #aaa);
  margin-top: 2px;
}

/* Category tabs */
.ach-category-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ach-category-tabs::-webkit-scrollbar { display: none; }

.ach-cat-tab {
  background: var(--bg-tertiary, #2a2a3e);
  border: 1.5px solid transparent;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary, #aaa);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.ach-cat-tab:hover {
  background: var(--bg-hover, #3a3a4e);
  color: var(--text-primary, #fff);
}

.ach-cat-tab.active {
  background: var(--accent-dim, rgba(155, 89, 182, 0.2));
  border-color: var(--accent, #9b59b6);
  color: var(--accent, #9b59b6);
  font-weight: 600;
}

/* Achievement grid */
.ach-grid {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}

.ach-grid::-webkit-scrollbar { width: 4px; }
.ach-grid::-webkit-scrollbar-track { background: transparent; }
.ach-grid::-webkit-scrollbar-thumb { background: var(--bg-hover, #3a3a4e); border-radius: 2px; }

/* Achievement tile */
.ach-tile {
  background: var(--bg-tertiary, #2a2a3e);
  border-radius: 14px;
  padding: 14px 12px 12px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.ach-tile.unlocked {
  border-color: var(--accent, #9b59b6);
  background: linear-gradient(135deg, var(--bg-tertiary, #2a2a3e), rgba(155, 89, 182, 0.08));
}

.ach-tile.locked {
  opacity: 0.55;
}

.ach-tile.legendary {
  border-color: var(--gold, #f1c40f);
  background: linear-gradient(135deg, var(--bg-tertiary, #2a2a3e), rgba(241, 196, 15, 0.06));
}

.ach-tile.legendary.unlocked {
  border-color: var(--gold, #f1c40f);
  background: linear-gradient(135deg, var(--bg-tertiary, #2a2a3e), rgba(241, 196, 15, 0.12));
}

.ach-tile-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
}

.ach-tile-icon.locked-icon {
  filter: grayscale(1);
}

.ach-tile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  line-height: 1.3;
}

.ach-tile.locked .ach-tile-name {
  color: var(--text-secondary, #aaa);
}

.ach-tile-desc {
  font-size: 10px;
  color: var(--text-secondary, #aaa);
  line-height: 1.4;
}

.ach-tile-xp {
  font-size: 11px;
  color: var(--accent, #9b59b6);
  font-weight: 600;
  margin-top: auto;
}

.ach-tile.locked .ach-tile-xp {
  color: var(--text-tertiary, #666);
}

.ach-tile.legendary .ach-tile-xp {
  color: var(--gold, #f1c40f);
}

.ach-unlocked-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  line-height: 1;
}

.ach-unlock-date {
  font-size: 9px;
  color: var(--text-tertiary, #666);
}

.ach-hidden-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 100px;
}

.ach-hidden-icon {
  font-size: 28px;
  filter: grayscale(1);
  opacity: 0.4;
}

.ach-hidden-label {
  font-size: 11px;
  color: var(--text-tertiary, #555);
}

/* ── Achievement Unlock Banner ───────────────────────────────────────────── */

.ach-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 3100;
  background: linear-gradient(135deg, #1a1a2e, #2d1b4e);
  border: 2px solid var(--accent, #9b59b6);
  border-top: none;
  border-radius: 0 0 18px 18px;
  padding: 10px 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(155, 89, 182, 0.4);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
  white-space: nowrap;
}

.ach-banner.legendary-banner {
  border-color: var(--gold, #f1c40f);
  background: linear-gradient(135deg, #1a1a2e, #2d2a00);
  box-shadow: 0 8px 32px rgba(241, 196, 15, 0.35);
}

.ach-banner.visible {
  transform: translateX(-50%) translateY(0);
}

.ach-banner-icon {
  font-size: 30px;
  flex-shrink: 0;
}

.ach-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.ach-banner-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent, #9b59b6);
}

.ach-banner.legendary-banner .ach-banner-label {
  color: var(--gold, #f1c40f);
}

.ach-banner-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  overflow: hidden;
  text-overflow: ellipsis;
}

.ach-banner-xp {
  font-size: 11px;
  color: var(--text-secondary, #aaa);
}

.ach-banner-xp span {
  color: var(--accent, #9b59b6);
  font-weight: 700;
}

.ach-banner.legendary-banner .ach-banner-xp span {
  color: var(--gold, #f1c40f);
}

.ach-banner.hp-banner {
  border-color: #c0392b;
  background: linear-gradient(135deg, #1a0a0a, #2d1010);
  box-shadow: 0 8px 32px rgba(192, 57, 43, 0.4);
  z-index: 3100; /* Explicit — not inherited, avoids compositing quirks */
}

.ach-banner.hp-banner .ach-banner-label {
  color: #e74c3c;
}

.ach-banner.hp-banner .ach-banner-xp span {
  color: #e74c3c;
}

/* ── Notification Center achievements ────────────────────────────────────── */

.notif-item.notif-achievement {
  border-left: 3px solid var(--accent, #9b59b6);
  cursor: default;
}

.notif-item.notif-achievement.notif-legendary {
  border-left-color: var(--gold, #f1c40f);
}

.notif-ach-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.notif-ach-xp {
  font-size: 11px;
  color: var(--accent, #9b59b6);
  font-weight: 600;
  margin-top: 2px;
}

.notif-achievement.notif-legendary .notif-ach-xp {
  color: var(--gold, #f1c40f);
}

.notif-dismiss-btn {
  background: none;
  border: none;
  color: var(--text-tertiary, #666);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
}

.notif-dismiss-btn:hover {
  color: var(--text-secondary, #aaa);
}
