:root {
  --achievement-top: #b9c3a4;
  --achievement-base: #748563;
  --achievement-icon-cutout: #788968;
}
:root[data-theme="dark"] {
  --achievement-top: #80946e;
  --achievement-base: #576b4c;
  --achievement-icon-cutout: #5f744f;
}
.achievement-symbols { position: absolute; pointer-events: none; }
.level-panel .achievements-button { min-height: 44px; margin-top: 16px; background: var(--surface); }
.level-panel .achievements-button:hover { background: var(--soft); }
.profile-help { display: none; }
.dialog:has(.achievements) {
  --achievement-dialog-padding: 28px;
  width: min(830px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
}
.dialog:has(.achievements) #dialog-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: inherit;
}
.dialog:has(.achievements) .dialog-header {
  margin: 0;
  padding: 14px var(--achievement-dialog-padding);
  border-bottom: 1px solid var(--line);
}
.achievements {
  min-height: 0;
  padding: 16px var(--achievement-dialog-padding) var(--achievement-dialog-padding);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.achievements:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.achievement-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.achievement-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.achievement-total { flex: none; border-radius: 50px; padding: 7px 11px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 800; }
.achievement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.achievement-card { display: flex; align-items: center; gap: 17px; min-width: 0; padding: 17px; background: var(--olive-soft); border: 1px solid var(--line); border-radius: 21px; }
.achievement-emblem {
  width: 66px; height: 66px; flex: none; position: relative; display: grid; place-items: center; border-radius: 20px;
  color: #fffdf7; background: linear-gradient(135deg, var(--achievement-top), var(--achievement-base));
  box-shadow: inset 0 1px 0 #ffffff55;
}
.achievement-emblem > svg { width: 36px; height: 36px; }
.achievement-emblem > .achievement-spark { position: absolute; top: 7px; right: 7px; width: 13px; height: 13px; opacity: .9; }
.achievement-emblem > span {
  position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; min-width: 24px; height: 24px;
  padding: 0 4px; border: 2px solid var(--olive-soft); border-radius: 50px; background: var(--accent); color: white;
  font-size: 10px; font-weight: 800; line-height: 1;
}
.achievement-card.locked { background: var(--surface); }
.achievement-card.locked .achievement-emblem { filter: saturate(.22); }
.achievement-card.locked .achievement-emblem > span { border-color: var(--surface); }
.achievement-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.achievement-copy h3 { font-size: 16px; letter-spacing: -.02em; }
.achievements .achievement-copy p { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 3px 0 5px; }
.achievement-copy progress { display: block; width: 100%; height: 5px; margin: 9px 0 5px; border: 0; border-radius: 5px; overflow: hidden; background: var(--soft); color: var(--accent); }
.achievement-copy progress::-webkit-progress-bar { background: var(--soft); }
.achievement-copy progress::-webkit-progress-value { background: var(--accent); }
.achievement-copy progress::-moz-progress-bar { background: var(--accent); }
.achievement-status { display: block; color: var(--muted); font-size: 11px; }
.achievement-card:not(.locked) .achievement-status { color: var(--accent-text); font-weight: 700; }
.public-achievements { margin: 18px 0 23px; }
.public-achievements h3 { margin-bottom: 11px; }
.public-achievement-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 0; list-style: none; }
.public-achievement-list li { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 7px; border-radius: 11px; background: var(--olive-soft); font-size: 11px; overflow-wrap: anywhere; }
.public-achievement-list .achievement-emblem { width: 31px; height: 31px; border-radius: 9px; }
.public-achievement-list .achievement-emblem > svg { width: 19px; height: 19px; }
.public-achievement-list .achievement-emblem > .achievement-spark { display: none; }
.public-achievement-list .achievement-emblem > span { min-width: 15px; height: 15px; font-size: 7px; padding: 0 2px; right: -4px; bottom: -3px; }
@media (max-width: 700px) {
  .profile-help { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 24px; }
  .profile-help button { min-height: 44px; padding: 0; color: var(--muted); font-size: 12px; }
  .profile-help button:hover { text-decoration: underline; }
  .dialog:has(.achievements) { --achievement-dialog-padding: 18px; }
  .dialog:has(.achievements) .dialog-header { gap: 8px; }
  .dialog:has(.achievements) .dialog-header h2 { font-size: 20px; }
  .achievement-heading p { font-size: 12px; }
  .achievement-grid { grid-template-columns: 1fr; gap: 9px; }
  .achievement-card { padding: 13px; gap: 15px; border-radius: 16px; }
  .achievement-emblem { width: 52px; height: 52px; border-radius: 15px; }
  .achievement-emblem > svg { width: 30px; height: 30px; }
  .achievement-emblem > .achievement-spark { width: 11px; height: 11px; top: 5px; right: 5px; }
}
@media (max-width: 350px) {
  .public-achievement-list { grid-template-columns: 1fr; }
}

