.achievements-launch {
  position: relative;
}

.achievements-points {
  position: absolute;
  top: -5px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 17px;
  padding-inline: 3px;
  border: 1px solid #f0cf80;
  border-radius: 10px;
  background: linear-gradient(180deg, #6b4b1e, #442d11);
  color: #fff6dc;
  font: 700 10px/1 var(--sans);
  pointer-events: none;
}

/* ── Directory exploration progress & visited badges ─────────────────────── */
.directory-explore-bar {
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid rgba(235, 198, 117, 0.32);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(64, 47, 22, 0.42), rgba(25, 22, 34, 0.72));
  color: #f4e6c4;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.directory-explore-bar:hover,
.directory-explore-bar:focus-visible {
  border-color: rgba(242, 207, 128, 0.72);
  background: linear-gradient(135deg, rgba(84, 61, 27, 0.52), rgba(31, 26, 42, 0.85));
}

.directory-explore-bar.is-complete {
  border-color: rgba(124, 214, 152, 0.45);
  background: linear-gradient(135deg, rgba(28, 66, 44, 0.42), rgba(22, 26, 36, 0.78));
}

.directory-explore-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.directory-explore-head span:last-child {
  color: #e9c97b;
  font-variant-numeric: tabular-nums;
}

.directory-explore-bar.is-complete .directory-explore-head span:last-child {
  color: #8ee5a9;
}

.index-item-marks {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 4px;
  flex-shrink: 0;
}

.index-mark {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
}

.index-mark--visited {
  border: 1px solid rgba(235, 198, 117, 0.45);
  background: rgba(235, 198, 117, 0.14);
  color: #f1cf7f;
}

.index-mark--lore {
  border: 1px solid rgba(154, 196, 255, 0.45);
  background: rgba(130, 179, 255, 0.14);
  color: #a9d0ff;
}

/* ── Achievements Modal Dialog ───────────────────────────────────────────── */
.achievements-dialog {
  --ach-gold: #e7c270;
  --ach-gold-soft: rgba(231, 194, 112, 0.25);
  --ach-bg: #14121d;
  --ach-surface: #1b1826;
  --ach-surface-earned: #231e2c;
  --ach-border: rgba(212, 182, 120, 0.26);
  --ach-text: #f3ecdc;
  --ach-muted: #b7aec2;
  --ach-green: #72d694;
  box-sizing: border-box;
  width: min(920px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid rgba(224, 188, 114, 0.42);
  border-radius: 16px;
  background: radial-gradient(ellipse at 82% 8%, #2c2338, #16131f 48%, #12101a 100%);
  box-shadow: 0 28px 96px rgba(4, 3, 10, 0.85), 0 0 42px rgba(216, 173, 88, 0.14), inset 0 0 0 1px rgba(255, 228, 166, 0.08);
  color: var(--ach-text);
  scrollbar-color: var(--chrome-scroll) var(--ach-bg);
  scrollbar-width: thin;
}

.achievements-dialog::backdrop {
  background: rgba(7, 6, 14, 0.82);
  backdrop-filter: blur(5px);
}

.ach-hero {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 22px 26px 0;
  border-bottom: 1px solid var(--ach-border);
  background: linear-gradient(180deg, #1d1828 0%, #171321 100%);
}

.ach-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ach-crest {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 1px solid rgba(235, 198, 117, 0.55);
  border-radius: 12px;
  background: linear-gradient(155deg, #523b18, #281d12);
  color: var(--ach-gold);
  box-shadow: inset 0 0 14px rgba(255, 214, 128, 0.18);
}

.ach-crest svg {
  width: 32px;
  height: 32px;
  opacity: 0.35;
}

.ach-crest-points {
  position: absolute;
  font: 700 14px/1 var(--sans);
  color: #fff5d6;
  text-shadow: 0 1px 4px #000;
  font-variant-numeric: tabular-nums;
}

.ach-hero-copy {
  min-width: 0;
  flex: 1;
}

.ach-hero-copy h2 {
  margin: 0;
  font: 600 clamp(20px, 2.4vw, 28px)/1.15 var(--title);
  color: #fbf3e1;
}

.ach-hero-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ach-muted);
}

.ach-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ach-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ach-text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.ach-close:hover,
.ach-close:focus-visible {
  border-color: var(--ach-gold);
  background: rgba(231, 194, 112, 0.14);
}

.ach-overall-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.ach-overall-bar progress {
  flex: 1;
  height: 8px;
  border: 1px solid rgba(231, 194, 112, 0.3);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  appearance: none;
}

.ach-overall-bar progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.07);
}

.ach-overall-bar progress::-webkit-progress-value {
  background: linear-gradient(90deg, #b88a32, #f2cf78);
  border-radius: 99px;
}

.ach-overall-bar progress::-moz-progress-bar {
  background: linear-gradient(90deg, #b88a32, #f2cf78);
  border-radius: 99px;
}

.ach-overall-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ach-gold);
  font-variant-numeric: tabular-nums;
}

/* Single-row scrollable tablist */
.ach-tablist-wrap {
  margin-top: 14px;
  margin-inline: -26px;
  padding-inline: 26px;
}

.ach-tablist {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}

.ach-tablist::-webkit-scrollbar {
  display: none;
}

.ach-tablist [role="tab"] {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  padding: 10px 14px 12px;
  border: 0;
  background: transparent;
  color: var(--ach-muted);
  font: 600 13px/1.2 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}

.ach-tablist [role="tab"]:hover {
  color: var(--ach-text);
}

.ach-tablist [role="tab"][aria-selected="true"] {
  color: var(--ach-gold);
}

.ach-tablist [role="tab"][aria-selected="true"]::after {
  content: '';
  position: absolute;
  inset: auto 8px 0;
  border-block-end: 3px solid var(--ach-gold);
  border-radius: 2px 2px 0 0;
}

.ach-body {
  padding: 20px 26px 24px;
}

.ach-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.ach-filters {
  display: inline-flex;
  gap: 6px;
}

.ach-filters button,
.ach-button {
  padding: 6px 12px;
  border: 1px solid var(--ach-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ach-text);
  font: 600 12px/1.2 var(--sans);
  cursor: pointer;
}

.ach-filters button[aria-pressed="true"] {
  border-color: var(--ach-gold);
  background: rgba(231, 194, 112, 0.16);
  color: #fff4d2;
}

.ach-open-collection {
  border-color: rgba(186, 157, 230, 0.55);
  background: rgba(124, 83, 179, 0.24);
  color: #f3e6ff;
}

.ach-open-collection:hover,
.ach-open-collection:focus-visible {
  background: rgba(124, 83, 179, 0.4);
}

/* ── Summary View ────────────────────────────────────────────────────────── */
.ach-summary {
  display: grid;
  gap: 20px;
}

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

.ach-stat {
  padding: 14px 16px;
  border: 1px solid var(--ach-border);
  border-radius: 12px;
  background: var(--ach-surface);
  display: grid;
  gap: 4px;
}

.ach-stat strong {
  font: 700 22px/1.1 var(--title);
  color: var(--ach-gold);
  font-variant-numeric: tabular-nums;
}

.ach-stat span {
  font-size: 12px;
  color: var(--ach-muted);
}

.ach-section h3 {
  margin: 0 0 10px;
  font: 600 13px/1.2 var(--sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ach-muted);
}

.ach-titles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ach-title-pill {
  padding: 5px 11px;
  border: 1px solid rgba(231, 194, 112, 0.45);
  border-radius: 99px;
  background: rgba(231, 194, 112, 0.12);
  color: #ffe9b0;
  font-size: 12px;
  font-weight: 600;
}

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

.ach-cat-tile {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--ach-border);
  border-radius: 11px;
  background: var(--ach-surface);
  color: var(--ach-text);
  text-align: left;
  cursor: pointer;
}

.ach-cat-tile:hover,
.ach-cat-tile:focus-visible {
  border-color: var(--ach-gold);
  background: #231e2f;
}

.ach-cat-tile-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}

.ach-cat-tile-head span {
  color: var(--ach-gold);
  font-variant-numeric: tabular-nums;
}

/* ── Achievement Cards ───────────────────────────────────────────────────── */
.ach-list {
  display: grid;
  gap: 10px;
}

.ach-card {
  border: 1px solid rgba(190, 175, 205, 0.2);
  border-radius: 12px;
  background: var(--ach-surface);
  overflow: hidden;
}

.ach-card.is-earned {
  border-color: rgba(231, 194, 112, 0.5);
  background: linear-gradient(135deg, rgba(84, 62, 28, 0.26), var(--ach-surface-earned) 52%);
}

.ach-card.is-meta.is-earned {
  border-color: rgba(247, 211, 120, 0.78);
  box-shadow: 0 0 24px rgba(231, 194, 112, 0.14);
}

.ach-card-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
}

.ach-card-main[role="button"] {
  cursor: pointer;
}

.ach-card-main[role="button"]:hover {
  background: rgba(255, 255, 255, 0.025);
}

.ach-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(190, 175, 205, 0.24);
  background: rgba(15, 13, 22, 0.7);
  color: #9e93ad;
}

.ach-card.is-earned .ach-card-icon {
  border-color: rgba(235, 198, 117, 0.65);
  background: linear-gradient(145deg, #4b3618, #241910);
  color: #f6d584;
}

.ach-card-copy {
  min-width: 0;
}

.ach-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ach-card-head h3 {
  margin: 0;
  font: 600 15px/1.25 var(--title);
  color: #f4eee1;
}

.ach-card.is-earned .ach-card-head h3 {
  color: #ffe8ad;
}

.ach-title-tag {
  padding: 2px 7px;
  border: 1px solid rgba(231, 194, 112, 0.4);
  border-radius: 99px;
  background: rgba(231, 194, 112, 0.12);
  color: #f0cf80;
  font-size: 11px;
  font-weight: 600;
}

.ach-card-desc {
  margin: 3px 0 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ach-muted);
}

.ach-card-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ach-mini-bar {
  flex: 1;
  max-width: 240px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.ach-mini-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #4a9d68, var(--ach-green));
}

.ach-count {
  font-size: 12px;
  color: var(--ach-muted);
  font-variant-numeric: tabular-nums;
}

.ach-earned-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--ach-green);
}

.ach-expand-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--ach-muted);
}

.ach-shield {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  clip-path: polygon(50% 0%, 100% 18%, 92% 76%, 50% 100%, 8% 76%, 0% 18%);
  background: linear-gradient(180deg, #3a3444, #221e2a);
  color: #a99eb8;
  font: 700 13px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}

.ach-card.is-earned .ach-shield {
  background: linear-gradient(180deg, #d7a645, #845919);
  color: #fff8e2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

/* Criteria checklist */
.ach-criteria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px 14px;
  list-style: none;
  margin: 0;
  padding: 12px 16px 14px 72px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(10, 9, 16, 0.45);
  font-size: 12.5px;
}

.ach-criteria li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--ach-muted);
}

.ach-criteria li.is-done {
  color: #a8ecc0;
}

.ach-check {
  flex-shrink: 0;
  font-weight: 700;
}

.ach-criterion-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(231, 194, 112, 0.35);
  text-underline-offset: 2px;
}

.ach-criterion-link:hover,
.ach-criterion-link:focus-visible {
  color: #ffe8ad;
  text-decoration-color: #ffe8ad;
}

.ach-empty {
  margin: 12px 0;
  color: var(--ach-muted);
  font-size: 14px;
}

/* Footer */
.ach-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 26px 18px;
  border-top: 1px solid var(--ach-border);
  background: rgba(12, 10, 18, 0.65);
}

.ach-reset-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(235, 130, 120, 0.35);
  border-radius: 10px;
  background: rgba(90, 26, 26, 0.25);
}

.ach-reset-confirm p {
  margin: 0;
  flex: 1 1 260px;
  font-size: 12.5px;
  color: #f5d8d5;
}

.ach-confirm-reset {
  border-color: rgba(235, 120, 110, 0.6);
  background: rgba(160, 42, 38, 0.45);
}

/* ── WoW Achievement Earned Toast (popover="manual") ────────────────────── */
.ach-toast-region {
  position: fixed;
  inset: auto 0 24px;
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding-inline: 16px;
}

.ach-toast {
  pointer-events: auto;
  position: fixed;
  inset: auto auto 24px 50%;
  transform: translateX(-50%);
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  width: min(440px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1.5px solid #e6be6a;
  border-radius: 13px;
  background: linear-gradient(135deg, #2d2214 0%, #1c1724 55%, #16121e 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.78), 0 0 28px rgba(230, 190, 106, 0.24);
  color: #fdf4df;
  opacity: 1;
  transition: opacity 0.26s ease, transform 0.26s ease;
  transition-behavior: allow-discrete;
}

.ach-toast--meta {
  border-color: #f7d983;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.82), 0 0 38px rgba(247, 217, 131, 0.35);
}

@starting-style {
  .ach-toast {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

.ach-toast-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid rgba(242, 207, 128, 0.65);
  background: linear-gradient(145deg, #543d1a, #261b10);
  color: #f7d887;
}

.ach-toast-body {
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.ach-toast-kicker {
  font: 700 10px/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e9c571;
}

.ach-toast-title {
  font: 600 15px/1.2 var(--title);
  color: #fff6df;
}

.ach-toast-reward {
  font-size: 11.5px;
  color: #9be8b5;
}

.ach-toast-points {
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  clip-path: polygon(50% 0%, 100% 18%, 92% 76%, 50% 100%, 8% 76%, 0% 18%);
  background: linear-gradient(180deg, #deb04f, #8b5e1a);
  color: #fff8e4;
  font: 700 12px/1 var(--sans);
}

.ach-toast-dismiss {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #cbbda2;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ach-toast-dismiss:hover,
.ach-toast-dismiss:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ach-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .ach-hero {
    padding: 16px 16px 0;
  }
  .ach-tablist-wrap {
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .ach-body,
  .ach-footer {
    padding-inline: 16px;
  }
  .ach-criteria {
    padding-left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ach-toast {
    transition: none;
  }
}
