/* Achievements page (#/achievements) and the achievement showcase on profiles. Classes are prefixed ach-. */

/* ------------------------------------------------------------------ medal */
.ach-medal {
  --tier: #cd7f32; --size: 52px;
  position: relative; display: inline-grid; place-items: center; flex: none; width: var(--size); height: var(--size); border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tier) 70%, #fff) 0%, var(--tier) 38%, color-mix(in srgb, var(--tier) 55%, #000) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25), inset 0 -4px 8px rgba(0, 0, 0, .35), 0 4px 14px -4px color-mix(in srgb, var(--tier) 70%, transparent);
}
.ach-medal svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .55)); }
.ach-medal::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .35); pointer-events: none;
}
.ach-medal.tier-diamond { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), inset 0 -4px 8px rgba(0, 0, 0, .3), 0 0 18px -2px rgba(127, 220, 255, .65); }
.ach-medal.locked { background: radial-gradient(circle at 35% 30%, #4a3c41, #2a2125 70%); color: var(--dim); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06); }
.ach-medal.locked svg { filter: none; opacity: .75; }

/* ------------------------------------------------------------------ note + hero */
.ach-note { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border-color: rgba(228, 174, 57, .35); background: linear-gradient(90deg, rgba(228, 174, 57, .1), var(--panel) 60%); font-size: 14px; }
.ach-note > svg { color: var(--gold); flex: none; }
.ach-note > div { flex: 1; min-width: 0; }

.ach-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 260px); gap: 26px; align-items: center; padding: 22px 26px; margin-bottom: 16px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(380px 220px at 6% 50%, rgba(228, 174, 57, .15), transparent 70%),
    radial-gradient(600px 240px at 100% 0%, rgba(239, 59, 59, .12), transparent 70%),
    var(--panel);
}
.ach-hero:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.ach-hero > * { min-width: 0; }
.ach-ring { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.ach-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ach-ring-track { fill: rgba(0, 0, 0, .35); stroke: var(--panel3); stroke-width: 10; }
.ach-ring-bar {
  fill: none; stroke: url(#achRingG); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 6px rgba(228, 174, 57, .55));
}
.ach-ring-inner { position: relative; text-align: center; line-height: 1; }
.ach-ring-inner b { font-family: var(--display); font-weight: 400; font-size: 36px; color: #fff; text-shadow: 0 0 20px rgba(228, 174, 57, .5); }
.ach-ring-inner small { font-size: 16px; margin-left: 1px; }
.ach-ring-inner span { display: block; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 5px; }
.ach-hero-main h2 { font-size: 24px; }
.ach-hero-main h2 .muted { font-family: var(--font); font-size: 16px; }
.ach-hero-main p { margin: 4px 0 14px; font-size: 14px; }
.ach-hero-main p .price { color: var(--gold); }
.ach-tiers { display: flex; flex-wrap: wrap; gap: 8px; }
.ach-tier {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 9px; font-size: 13px;
  background: var(--bg2); border: 1px solid color-mix(in srgb, var(--tier) 35%, var(--line)); color: var(--muted);
}
.ach-tier i { width: 10px; height: 10px; border-radius: 50%; background: var(--tier); box-shadow: 0 0 8px var(--tier); }
.ach-tier b { color: var(--text); font-variant-numeric: tabular-nums; }
.ach-hero-side { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.ach-hero-side > small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ach-claimable { font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--gold); text-shadow: 0 0 20px rgba(228, 174, 57, .4); }
.ach-claimable .price { font-weight: 400; gap: 8px; }
.ach-claim-all { animation: achGlow 2.2s ease-in-out infinite; }
@keyframes achGlow { 50% { box-shadow: 0 0 0 4px rgba(228, 174, 57, .18), 0 0 22px rgba(228, 174, 57, .5); } }
.ach-next { display: flex; gap: 10px; align-items: center; min-width: 0; }
.ach-next > div { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.ach-next-name { font-size: 14.5px; }

/* ------------------------------------------------------------------ filters + groups */
.ach-filters { margin-bottom: 4px; }
.ach-group .section-head { margin: 22px 0 10px; }
.ach-group .section-head h2 { font-size: 19px; }
.ach-group-count { font-size: 13px; font-weight: 700; color: var(--muted); padding: 2px 9px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ach-group-count.full { color: var(--gold); border-color: rgba(228, 174, 57, .45); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

/* ------------------------------------------------------------------ card */
.ach-card {
  display: flex; align-items: center; gap: 14px; padding: 14px; min-width: 0; position: relative; overflow: hidden;
  transition: transform .15s, border-color .25s, box-shadow .25s; animation: achIn .35s ease-out both; animation-delay: calc(min(var(--i), 20) * 25ms);
}
@keyframes achIn { from { opacity: 0; transform: translateY(6px); } }
.ach-card:hover { transform: translateY(-2px); }
.ach-card.claimable {
  border-color: color-mix(in srgb, var(--tier) 60%, var(--line));
  background: radial-gradient(260px 120px at 0% 50%, color-mix(in srgb, var(--tier) 16%, transparent), transparent 70%), var(--panel);
  box-shadow: 0 0 26px -12px var(--tier);
}
.ach-card.claimed { background: radial-gradient(260px 120px at 0% 50%, color-mix(in srgb, var(--tier) 9%, transparent), transparent 70%), var(--panel); }
.ach-card.locked .ach-title b { color: var(--muted); }
.ach-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ach-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ach-title b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-tier-tag { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tier); }
.ach-text { font-size: 13px; color: var(--muted); }
.ach-bar { height: 6px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line2); overflow: hidden; margin-top: 5px; }
.ach-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--tier) 55%, var(--accent-lo)), var(--tier)); }
.ach-count { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.ach-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.ach-reward { font-size: 13px; color: var(--gold); padding: 3px 8px; border-radius: 8px; background: rgba(228, 174, 57, .1); border: 1px solid rgba(228, 174, 57, .28); white-space: nowrap; }
.ach-card.claimed .ach-reward { opacity: .6; }
.ach-done { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-weight: 700; font-size: 13px; }
.ach-lock { color: var(--dim); display: inline-flex; padding: 4px; }
.ach-claim { animation: achGlow 2.2s ease-in-out infinite; }
.ach-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 18px; text-align: center; margin-top: 14px; }
.ach-empty .btn { margin-top: 8px; }

/* floating "+coins" after a claim */
.ach-float {
  position: fixed; z-index: 250; pointer-events: none; transform: translate(-50%, 0);
  font-family: var(--display); font-size: 20px; color: var(--gold); text-shadow: 0 2px 12px rgba(0, 0, 0, .7), 0 0 18px rgba(228, 174, 57, .6);
  animation: achFloat 1.35s cubic-bezier(.2, .8, .2, 1) forwards;
}
.ach-float .price { font-weight: 400; }
@keyframes achFloat {
  0% { transform: translate(-50%, 0) scale(.6); opacity: 0; }
  15% { transform: translate(-50%, -16px) scale(1.12); opacity: 1; }
  100% { transform: translate(-50%, -70px) scale(1); opacity: 0; }
}

/* ------------------------------------------------------------------ profile showcase */
.ach-show { padding: 18px; }
.ach-show .profile-sec-head { align-items: center; flex-wrap: wrap; row-gap: 8px; }
.ach-show-list { display: flex; flex-wrap: wrap; gap: 10px; }
.ach-show-item { display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--bg2); border: 1px solid color-mix(in srgb, var(--tier) 35%, var(--line)); min-width: 0; max-width: 100%; }
.ach-show-item b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-show-item small { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-show-item > span:last-child { min-width: 0; }
.ach-show-bar { flex: 1; min-width: 120px; max-width: 260px; height: 8px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line2); overflow: hidden; }
.ach-show-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #b8860b, var(--gold)); }
.ach-show-more { font-size: 13px; color: var(--muted); align-self: center; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .ach-hero { grid-template-columns: auto minmax(0, 1fr); }
  .ach-hero-side { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .ach-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 18px 14px; gap: 14px; }
  .ach-hero-main { width: 100%; }
  .ach-tiers { justify-content: center; }
  .ach-hero-side { width: 100%; text-align: left; }
  .ach-ring { width: 116px; height: 116px; }
  .ach-grid { grid-template-columns: minmax(0, 1fr); }
  .ach-card { padding: 12px; gap: 11px; }
  .ach-card .ach-medal { --size: 44px !important; }
  .ach-title { flex-wrap: wrap; row-gap: 0; }
  .ach-show { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .ach-card { animation: none; transition: none; }
  .ach-card:hover { transform: none; }
  .ach-claim-all, .ach-claim { animation: none; }
  .ach-ring-bar { transition: none; }
}
