/* Achievements (#/achievements, #/owner/achievements): Locky medals in six materials, darkest at the top, never a
   metal ladder and never the brand yellow. A medal is a round disc in its material with a ring, the Locky pose in the middle and the tier title under it. New
   badges shine once (not under reduced motion). Nothing here sorts or compares people. */

:root {
  --ac-ink: #4A5578; --ac-steel: #8E97A8; --ac-ice: #BFE3F2; --ac-pearl: #EDE8F3; --ac-plasma: #4B22B8; --ac-obsidian: #0E0D14;
  --ac-ink-sheen: #7C88AE; --ac-steel-sheen: #C9D0DC; --ac-ice-sheen: #F0FAFF; --ac-pearl-sheen: #FFFFFF; --ac-plasma-sheen: #8E6BFF; --ac-obsidian-sheen: #4A4760;
  --ac-outline: transparent;
}
:root[data-theme="dark"] {
  --ac-ink: #4A5578; --ac-steel: #8E97A8; --ac-ice: #BFE3F2; --ac-pearl: #EDE8F3; --ac-plasma: #4B22B8; --ac-obsidian: #0E0D14;
  --ac-ink-sheen: #7C88AE; --ac-steel-sheen: #C9D0DC; --ac-ice-sheen: #F0FAFF; --ac-pearl-sheen: #FFFFFF; --ac-plasma-sheen: #8E6BFF; --ac-obsidian-sheen: #4A4760;
  --ac-outline: var(--line-strong);
}

.view[data-page="achievements"] { --locky: url("/img/brand/locky-okay.svg"); --locky-shows: block; }

.ac-m-ink { --ac-face: var(--ac-ink); --ac-sheen: var(--ac-ink-sheen); }
.ac-m-steel { --ac-face: var(--ac-steel); --ac-sheen: var(--ac-steel-sheen); }
.ac-m-ice { --ac-face: var(--ac-ice); --ac-sheen: var(--ac-ice-sheen); }
.ac-m-pearl { --ac-face: var(--ac-pearl); --ac-sheen: var(--ac-pearl-sheen); }
.ac-m-plasma { --ac-face: var(--ac-plasma); --ac-sheen: var(--ac-plasma-sheen); }
.ac-m-obsidian { --ac-face: var(--ac-obsidian); --ac-sheen: var(--ac-obsidian-sheen); }

/* ---------- the medal */

.ac-medal { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.ac-disc {
  --ac-size: 76px;
  position: relative; display: grid; place-items: center; width: var(--ac-size); height: var(--ac-size); border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--ac-sheen) 0, var(--ac-face) 58%);
  border: 4px solid var(--ac-face); box-shadow: 0 0 0 2px var(--keyline), 0 0 0 3px var(--ac-outline), 0 3px 0 3px var(--keyline);
}
.ac-disc::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 2px solid var(--ac-sheen); opacity: .7; }
.ac-disc .locky { position: relative; width: 62%; height: 62%; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.ac-medal-small .ac-disc { --ac-size: 44px; border-width: 3px; }
.ac-medal-big .ac-disc { --ac-size: 104px; }
.ac-medal-title { margin: 0; font-weight: 700; font-size: 13px; line-height: 1.25; max-width: 14ch; overflow-wrap: anywhere; }
.ac-medal-sub { margin: 0; color: var(--muted); font-size: 12px; }

.ac-shine .ac-disc::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%);
  background-size: 250% 100%; animation: ac-shine 2.4s ease-in-out 1;
}
@keyframes ac-shine { from { background-position: 120% 0; } to { background-position: -60% 0; } }

/* ---------- the page */

.ac-owner-note { margin: -6px 0 14px; font-size: 12.5px; color: var(--muted); }
.ac-note { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-s); background: var(--attn); border: 1.5px solid var(--line-strong); }
.ac-new-list, .ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; margin: 0; padding: 4px 0; list-style: none; }
.ac-new-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; border-radius: var(--radius); background: var(--sunk); }
.ac-family { margin: 14px 0 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.ac-family:first-child { margin-top: 0; }
.ac-earned-item { display: flex; justify-content: center; }
.ac-badge-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 0; border-radius: var(--radius-s);
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.ac-badge-btn:hover { background: var(--sunk); }
.ac-shared { --chip-face: var(--face-sky); }

.ac-switch { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.ac-switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.ac-switch-hint { margin: 0 0 8px 28px; font-size: 12.5px; color: var(--muted); }

.ac-panel { padding: 14px; border-radius: var(--radius); background: var(--sunk); margin-top: 10px; }
.ac-panel[hidden] { display: none; }
.ac-panel-head { display: flex; gap: 14px; align-items: center; }
.ac-panel p { margin: 6px 0; }

.ac-coming { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ac-coming li { display: flex; align-items: center; gap: 10px; }
.ac-ways summary { cursor: pointer; font-weight: 700; }
.ac-ways ul { margin: 8px 0 0; padding-left: 18px; }

.ac-reward { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--line-strong); margin-bottom: 10px; }
.ac-reward p { margin: 0; }
.ac-reward-trait { width: 96px; height: 96px; object-fit: contain; border-radius: var(--radius-s); background: var(--paper); }
.ac-reward-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-reward-form { display: grid; gap: 8px; }
.ac-reward-form[hidden] { display: none; }

/* ---------- cards other pages can show */

.ac-card-list { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ac-card-list li { display: flex; align-items: center; gap: 10px; }

/* ---------- the owner's page */

.ac-family-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ac-family-row:last-child { border-bottom: 0; }
.ac-family-row p { margin: 2px 0; }
.ac-custom-row, .ac-reward-row, .plain-list li.ac-custom-row, .plain-list li.ac-reward-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ac-custom-row:last-child, .ac-reward-row:last-child { border-bottom: 0; }
.ac-row-text { flex: 1; min-width: 0; }
.ac-row-text p { margin: 2px 0; }
.ac-offers { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ac-offers li, .plain-list .ac-offers li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ac-form { display: grid; gap: 10px; max-width: 560px; }
.ac-form[hidden], .ac-form .field[hidden], .ac-form .ac-switch[hidden] { display: none; }
.ac-materials { display: flex; flex-wrap: wrap; gap: 10px; border: 0; margin: 0; padding: 0; }
.ac-materials label { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font-size: 12.5px; }
.ac-materials input { position: absolute; opacity: 0; pointer-events: none; }
.ac-materials input:checked + .ac-medal .ac-disc { box-shadow: 0 0 0 2px var(--keyline), 0 0 0 5px var(--accent); }
.ac-materials input:focus-visible + .ac-medal .ac-disc { outline: 3px solid var(--focus); outline-offset: 4px; }
.ac-standing { font-size: 12.5px; color: var(--muted); }

@media (max-width: 560px) {
  .ac-new-list, .ac-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .ac-disc { --ac-size: 60px; }
  .ac-medal-big .ac-disc { --ac-size: 76px; }
  .ac-custom-row, .ac-reward-row, .ac-family-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .ac-shine .ac-disc::after { animation: none; display: none; }
}
