/* Achievement toasts (every page) and the Achievements page. Colours: theme.css. */

.achievement-toasts {
    position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 1000;
    display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none;
}
.achievement-toast {
    pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 360px;
    padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--text);
    background: var(--panel); border: 1px solid var(--py-yellow); border-left-width: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    transform: translateY(16px); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
.achievement-toast.in { transform: none; opacity: 1; }
.toast-icon { font-size: 30px; line-height: 1; }
.toast-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.toast-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--py-yellow); font-weight: 700; }
.toast-text strong { font-size: 15px; color: #fff; }
.toast-desc { font-size: 12px; color: var(--muted); }
.toast-points {
    font-weight: 800; color: var(--on-yellow); background: var(--py-yellow); border-radius: 999px; padding: 3px 9px; font-size: 13px;
}
@media (prefers-reduced-motion: reduce) { .achievement-toast { transition: none; } }

/* --- Achievements page ----------------------------------------------------------- */
.ach-summary { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.ach-score { font-size: 44px; font-weight: 800; color: var(--py-yellow); line-height: 1; font-variant-numeric: tabular-nums; }
.ach-score small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.ach-overall { flex: 1; min-width: 220px; }
.ach-overall-label { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.meter { height: 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--py-blue); border-radius: 999px; }

.ach-category { margin: 0 0 28px; }
.ach-category h2 { font-size: 18px; color: #fff; margin: 0 0 10px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ach-card {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
    background: var(--panel); border: 1px solid var(--border);
}
.ach-card.unlocked { border-color: var(--py-yellow); box-shadow: inset 4px 0 0 var(--py-yellow); }
.ach-icon { font-size: 32px; line-height: 1.1; width: 40px; text-align: center; flex: none; }
.ach-card.locked .ach-icon { filter: grayscale(1); opacity: .45; }
.ach-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ach-title { font-weight: 700; color: #fff; }
.ach-card.locked .ach-title { color: var(--text); }
.ach-desc { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ach-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.ach-points { font-weight: 700; color: var(--py-yellow-light); }
.ach-card.locked .ach-points { color: var(--muted); }
.ach-progress { margin-top: 4px; }
.ach-progress .meter { height: 6px; }
.score-value { font-size: 30px; font-weight: 800; color: var(--py-yellow); line-height: 1.1; font-variant-numeric: tabular-nums; }
.score-play { font-size: 13px; margin-top: 4px; }
.ach-progress-label { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
