/* BULLDER · logros, niveles y medallas (prefijo ac-) */

/* ------------------------------------------------------------------ medalla */
.ac-medal {
  --m-hi: var(--text-2); --m-base: var(--surface-3); --m-lo: var(--surface-2);
  --m-face1: var(--surface-2); --m-face2: var(--surface); --m-icon: var(--text-3); --m-shine: #fff;
  --m-track: var(--line-strong); --m-arc: var(--ac-cat);
  --ac-cat: var(--c1);
  display: inline-grid; place-items: center; width: var(--ac-size, 72px); height: var(--ac-size, 72px); flex: none; position: relative;
}
.ac-medal svg { width: 100%; height: 100%; overflow: visible; }
.ac-medal:not(.is-locked) svg { filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--m-base) 28%, transparent)); }
.ac-c-c1 { --ac-cat: var(--c1); } .ac-c-c2 { --ac-cat: var(--c2); } .ac-c-c3 { --ac-cat: var(--c3); } .ac-c-c4 { --ac-cat: var(--c4); }
.ac-c-c5 { --ac-cat: var(--c5); } .ac-c-c6 { --ac-cat: var(--c6); } .ac-c-c7 { --ac-cat: var(--c7); } .ac-c-c8 { --ac-cat: var(--c8); } .ac-c-pr { --ac-cat: var(--pr); }

.ac-medal:not(.is-locked) {
  --m-face1: color-mix(in srgb, var(--ac-cat) 34%, var(--bg-elev)); --m-face2: color-mix(in srgb, var(--ac-cat) 10%, var(--bg));
  --m-icon: color-mix(in srgb, var(--ac-cat) 72%, var(--text));
}
.ac-medal.ac-t-bronze:not(.is-locked) { --m-hi: color-mix(in srgb, var(--c7) 55%, #fff); --m-base: color-mix(in srgb, var(--c7) 70%, var(--navy)); --m-lo: color-mix(in srgb, var(--c7) 38%, var(--navy)); }
.ac-medal.ac-t-silver:not(.is-locked) { --m-hi: color-mix(in srgb, var(--silver) 12%, #fff); --m-base: color-mix(in srgb, var(--silver) 50%, #fff); --m-lo: color-mix(in srgb, var(--silver) 72%, var(--navy)); }
.ac-medal.ac-t-gold:not(.is-locked) { --m-hi: color-mix(in srgb, var(--pr) 45%, #fff); --m-base: var(--pr); --m-lo: color-mix(in srgb, var(--pr) 58%, var(--navy)); }
.ac-medal.ac-t-platinum:not(.is-locked) { --m-hi: #fff; --m-base: color-mix(in srgb, var(--c5) 32%, #fff); --m-lo: color-mix(in srgb, var(--c5) 52%, var(--navy)); }
.ac-medal.is-locked { --m-hi: var(--surface-3); --m-base: var(--surface-2); --m-lo: var(--surface); --m-shine: transparent; }
:root[data-theme="light"] .ac-medal.is-locked { --m-hi: var(--surface-3); --m-base: color-mix(in srgb, var(--surface-3) 70%, var(--surface)); --m-lo: var(--surface-2); --m-face1: var(--surface); --m-face2: var(--surface-2); }
:root[data-theme="light"] .ac-medal:not(.is-locked) { --m-face1: color-mix(in srgb, var(--ac-cat) 14%, #fff); --m-face2: color-mix(in srgb, var(--ac-cat) 26%, #fff); --m-icon: color-mix(in srgb, var(--ac-cat) 80%, var(--text)); --m-shine: #fff; }

/* ------------------------------------------------------------------ cabecera de nivel */
.ac-hero { position: relative; overflow: hidden; padding: var(--sp-5) var(--sp-4); background:
  radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--pr) 14%, transparent) 0%, transparent 55%),
  linear-gradient(160deg, color-mix(in srgb, var(--navy) 55%, var(--surface)) 0%, var(--surface) 70%); }
:root[data-theme="light"] .ac-hero { background:
  radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--pr) 16%, transparent) 0%, transparent 55%),
  linear-gradient(160deg, color-mix(in srgb, var(--navy) 9%, var(--surface)) 0%, var(--surface) 70%); }
.ac-hero-top { display: flex; align-items: center; gap: var(--sp-4); }
.ac-lvl { position: relative; width: 84px; height: 84px; flex: none; display: grid; place-items: center; }
.ac-lvl svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ac-lvl b { position: relative; font: 800 30px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--text); }
.ac-hero-name { font: 700 24px/1.1 var(--font-display); }
.ac-hero-sub { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.ac-xpbar { margin-top: var(--sp-4); }
.ac-xpbar .progress { height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--surface-3) 70%, transparent); }
.ac-xpbar .progress > i { background: linear-gradient(90deg, color-mix(in srgb, var(--pr) 70%, var(--c3)), var(--pr)); border-radius: 5px; }
.ac-xprow { display: flex; justify-content: space-between; gap: var(--sp-3); margin-top: 8px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ac-xprow b { color: var(--text); font-weight: 650; }
.ac-tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: var(--sp-4); }
.ac-tally > span { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 7px; min-width: 0; padding: 9px 10px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--bg) 45%, transparent); border: 1px solid var(--line); }
:root[data-theme="light"] .ac-tally > span { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.ac-tally > span > span { display: contents; }
.ac-tally small { grid-column: 1 / -1; margin-top: 3px; }
.ac-tally b { font: 700 16px/1.1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.ac-tally small { font: 600 11px/1.2 var(--font); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.ac-tally .ac-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--m-hi), var(--m-base) 55%, var(--m-lo)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.ac-dot.ac-t-bronze { --m-hi: color-mix(in srgb, var(--c7) 55%, #fff); --m-base: color-mix(in srgb, var(--c7) 70%, var(--navy)); --m-lo: color-mix(in srgb, var(--c7) 38%, var(--navy)); }
.ac-dot.ac-t-silver { --m-hi: color-mix(in srgb, var(--silver) 12%, #fff); --m-base: color-mix(in srgb, var(--silver) 50%, #fff); --m-lo: color-mix(in srgb, var(--silver) 72%, var(--navy)); }
.ac-dot.ac-t-gold { --m-hi: color-mix(in srgb, var(--pr) 45%, #fff); --m-base: var(--pr); --m-lo: color-mix(in srgb, var(--pr) 58%, var(--navy)); }
.ac-dot.ac-t-platinum { --m-hi: #fff; --m-base: color-mix(in srgb, var(--c5) 32%, #fff); --m-lo: color-mix(in srgb, var(--c5) 52%, var(--navy)); }
.ac-hero-who { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-4); }

/* ------------------------------------------------------------------ cerca de lograrlo */
.ac-next { display: grid; gap: var(--sp-2); }
.ac-next-item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left; padding: 10px var(--sp-3); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .12s var(--ease); min-height: 64px; }
.ac-next-item:hover { border-color: var(--line-strong); }
.ac-next-item:active { transform: scale(.985); }
.ac-next-item .ac-next-title { font-weight: 650; }
.ac-next-item .progress { height: 6px; margin-top: 7px; }
.ac-next-item .progress > i { background: var(--ac-cat); }
.ac-next-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-3); margin-top: 5px; font-variant-numeric: tabular-nums; }
@media (min-width: 960px) { .ac-next { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ rejilla */
.ac-chips { margin-top: var(--sp-5); }
.ac-chips .chip b { font-weight: 650; opacity: .7; font-variant-numeric: tabular-nums; }
.ac-section { margin-top: var(--sp-6); }
.ac-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); }
.ac-section-head h2 { font-size: 18px; flex: 1; min-width: 0; }
.ac-section-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--ac-cat) 16%, transparent); color: var(--ac-cat); flex: none; }
.ac-section-count { font: 650 13px/1 var(--font); color: var(--text-3); font-variant-numeric: tabular-nums; }
.ac-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 560px) { .ac-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) { .ac-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; } }
.ac-cell { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 6px 12px; border-radius: var(--r); transition: background .15s, transform .12s var(--ease); min-width: 0; position: relative; }
.ac-cell:hover { background: var(--surface); }
.ac-cell:active { transform: scale(.96); }
.ac-cell-name { font: 650 12.5px/1.25 var(--font); color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 31px; }
.ac-cell.is-locked .ac-cell-name { color: var(--text-2); }
.ac-cell-meta { font: 600 11.5px/1.2 var(--font); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ac-cell:not(.is-locked) .ac-cell-meta { color: var(--text-2); }
.ac-new { position: absolute; top: 8px; right: 8px; height: 18px; padding: 0 6px; border-radius: 6px; background: color-mix(in srgb, var(--pr) 20%, transparent); color: var(--pr); font: 750 10px/18px var(--font); letter-spacing: .04em; text-transform: uppercase; }
.ac-cell.is-new .ac-medal { animation: ac-pop .6s var(--ease) both; }
@keyframes ac-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }

/* ------------------------------------------------------------------ detalle (hoja) */
.ac-detail { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 4px 4px; }
.ac-detail-medal { position: relative; display: grid; place-items: center; margin: 4px 0 14px; }
.ac-detail-medal::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--ac-glow, transparent) 26%, transparent), transparent); }
.ac-detail-medal.ac-t-gold { --ac-glow: var(--pr); } .ac-detail-medal.ac-t-silver { --ac-glow: var(--silver); } .ac-detail-medal.ac-t-bronze { --ac-glow: var(--c7); } .ac-detail-medal.ac-t-platinum { --ac-glow: var(--c5); }
.ac-detail-medal.is-locked { --ac-glow: transparent; }
.ac-detail h2 { font-size: 24px; }
.ac-detail-desc { color: var(--text-2); margin-top: 8px; max-width: 360px; }
.ac-detail-badges { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.ac-tier { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 5px; border-radius: 8px; background: var(--surface-2); font: 650 12px/1 var(--font); color: var(--text-2); }
.ac-tier .ac-dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--m-hi), var(--m-base) 55%, var(--m-lo)); }
.ac-detail-status { width: 100%; margin-top: var(--sp-5); padding: var(--sp-4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: left; }
.ac-detail-status .progress { height: 10px; border-radius: 5px; margin-top: 10px; }
.ac-detail-status .progress > i { background: var(--ac-cat); border-radius: 5px; }
.ac-detail-big { font: 700 26px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.ac-detail-big small { font: 600 14px/1 var(--font); color: var(--text-2); margin-left: 4px; }
.ac-detail-hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13.5px; color: var(--text-2); }
.ac-detail-hint .ic { color: var(--info); margin-top: 1px; }
.ac-won { display: flex; align-items: center; gap: 12px; }
.ac-won .li-icon { background: color-mix(in srgb, var(--pr) 16%, transparent); color: var(--pr); }
.ac-ladder { width: 100%; margin-top: var(--sp-5); text-align: left; }
.ac-ladder .overline { margin-bottom: 8px; display: block; }
.ac-ladder .list-item { min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
.ac-ladder .list-item.is-current { background: var(--surface-2); }
.ac-ladder .li-end .ac-ok { color: var(--ok); }

/* compartir */
.ac-share-preview { display: block; width: 100%; max-width: 340px; margin: 0 auto; border-radius: var(--r); box-shadow: var(--shadow); aspect-ratio: 4 / 5; background: var(--surface-2); }

/* ------------------------------------------------------------------ aviso dorado (celebración) */
.ac-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; width: min(440px, 100%); padding: 10px 12px 10px 10px; border-radius: 18px; text-align: left;
  background: linear-gradient(135deg, color-mix(in srgb, var(--pr) 22%, var(--surface-2)), var(--surface-2) 62%);
  border: 1px solid color-mix(in srgb, var(--pr) 45%, transparent); box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--pr) 8%, transparent);
  color: var(--text); animation: ac-toast-in .5s var(--ease) both; position: relative; overflow: hidden;
}
:root[data-theme="light"] .ac-toast { background: linear-gradient(135deg, color-mix(in srgb, var(--pr) 18%, #fff), #fff 62%); }
.ac-toast::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60px; left: -80px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-20deg); animation: ac-shine 1.6s .45s var(--ease) both; pointer-events: none; }
.ac-toast .overline { color: var(--pr); }
.ac-toast-title { font: 700 16px/1.2 var(--font-display); margin-top: 4px; }
.ac-toast-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.ac-toast > .ic { color: var(--text-3); }
.ac-toast.is-out { opacity: 0; transform: translateY(-10px) scale(.98); transition: all .3s var(--ease); }
@keyframes ac-toast-in { from { opacity: 0; transform: translateY(-18px) scale(.94); } }
@keyframes ac-shine { to { left: 120%; } }

/* ------------------------------------------------------------------ tira de medallas (widget de perfil) */
.ac-strip { display: flex; align-items: center; gap: var(--sp-3); padding: 12px var(--sp-4); }
.ac-strip-lvl { display: flex; align-items: center; gap: 10px; flex: none; padding-right: var(--sp-3); border-right: 1px solid var(--line); }
.ac-strip-lvl .ac-lvl { width: 52px; height: 52px; }
.ac-strip-lvl .ac-lvl b { font-size: 19px; }
.ac-strip-title { font: 700 15px/1.15 var(--font-display); }
.ac-strip-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ac-strip-medals { display: flex; gap: 2px; flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.ac-strip-empty { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); }
.ac-strip > .ic { color: var(--text-3); }
@media (max-width: 380px) { .ac-strip-lvl > div:last-child { display: none; } }
.ac-strip-card { display: block; color: inherit; }
.ac-strip-medals .ac-medal svg { filter: none; }
