/* League achievements (#/achievements). Prefix: ach-. Rarity colours are tokens, tuned per theme. */
:root {
	--ach-common: #3d4a49; --ach-common-bg: #e4eceb;
	--ach-rare: #17597b; --ach-rare-bg: #d9eaf4;
	--ach-legendary: #6e4d00; --ach-legendary-bg: #fbecb8;
	--ach-impossible: #8b1a3d; --ach-impossible-bg: #fadbe5;
	--ach-line-common: #7a8a88; --ach-line-rare: #247BA0; --ach-line-legendary: #c79a00; --ach-line-impossible: #c42a5a;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ach-common: #cfdad8; --ach-common-bg: #36403f;
		--ach-rare: #9bd2ee; --ach-rare-bg: #1d3b4c;
		--ach-legendary: #ffe066; --ach-legendary-bg: #4a3c08;
		--ach-impossible: #ffa6c0; --ach-impossible-bg: #4d1a2d;
		--ach-line-common: #8c9c9a; --ach-line-rare: #5ab0d8; --ach-line-legendary: #e8c13a; --ach-line-impossible: #f2678f;
	}
}
:root[data-theme="dark"] {
	--ach-common: #cfdad8; --ach-common-bg: #36403f;
	--ach-rare: #9bd2ee; --ach-rare-bg: #1d3b4c;
	--ach-legendary: #ffe066; --ach-legendary-bg: #4a3c08;
	--ach-impossible: #ffa6c0; --ach-impossible-bg: #4d1a2d;
	--ach-line-common: #8c9c9a; --ach-line-rare: #5ab0d8; --ach-line-legendary: #e8c13a; --ach-line-impossible: #f2678f;
}

.ach-rarity { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; line-height: 1.5; }
.ach-r-common { color: var(--ach-common); background: var(--ach-common-bg); }
.ach-r-rare { color: var(--ach-rare); background: var(--ach-rare-bg); }
.ach-r-legendary { color: var(--ach-legendary); background: var(--ach-legendary-bg); }
.ach-r-impossible { color: var(--ach-impossible); background: var(--ach-impossible-bg); }

/* summary */
.ach-sum { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 20px; align-items: center; }
.ach-big { font-family: var(--display, inherit); font-size: 44px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.ach-big-l { margin: 6px 0 10px; }
.ach-prog { height: 6px; border-radius: 999px; background: var(--chip, rgba(0, 0, 0, .08)); overflow: hidden; }
.ach-prog-lg { height: 10px; }
.ach-prog-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); min-width: 2px; }
.ach-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ach-tile { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; border-top: 3px solid var(--ach-line-common); }
.ach-tile.ach-b-rare { border-top-color: var(--ach-line-rare); }
.ach-tile.ach-b-legendary { border-top-color: var(--ach-line-legendary); }
.ach-tile.ach-b-impossible { border-top-color: var(--ach-line-impossible); }
.ach-tile-n { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ach-tile-of { font-size: 13px; font-weight: 500; color: var(--dim); }
.ach-tile-l { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.ach-tile.ach-b-common .ach-prog-fill { background: var(--ach-line-common); }
.ach-tile.ach-b-rare .ach-prog-fill { background: var(--ach-line-rare); }
.ach-tile.ach-b-legendary .ach-prog-fill { background: var(--ach-line-legendary); }
.ach-tile.ach-b-impossible .ach-prog-fill { background: var(--ach-line-impossible); }

/* newest unlocks */
.ach-newest { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ach-newest li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ach-newest li:last-child { border-bottom: 0; }
.ach-newest-name { font-weight: 600; }
.ach-newest-who { color: var(--dim); display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }

/* filters */
.ach-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 8px; }
.ach-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ach-search { min-width: 180px; flex: 1 1 180px; max-width: 280px; }
.ach-topic-select { max-width: 100%; }
.ach-bar .ui-seg { max-width: 100%; overflow-x: auto; }

/* groups and cards */
.ach-group { margin-top: 20px; }
.ach-group-title { font-size: 20px; margin: 0 0 10px; }
.ach-group-n { font-size: 14px; font-weight: 500; font-family: var(--font, inherit); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ach-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--ach-line-common); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); min-width: 0; }
.ach-card.ach-b-rare { border-left-color: var(--ach-line-rare); }
.ach-card.ach-b-legendary { border-left-color: var(--ach-line-legendary); }
.ach-card.ach-b-impossible { border-left-color: var(--ach-line-impossible); background-image: linear-gradient(135deg, transparent 70%, var(--ach-impossible-bg)); }
.ach-card.ach-locked { box-shadow: none; }
.ach-card.ach-locked .ach-name, .ach-card.ach-locked .ach-desc { opacity: .82; }
.ach-card.ach-unavailable { border-style: dashed; border-left-style: solid; box-shadow: none; opacity: .75; }
.ach-card:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.ach-flash { animation: ach-flash 2.2s ease-out 1; }
@keyframes ach-flash { 0% { box-shadow: 0 0 0 4px var(--accent); } 100% { box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .ach-flash { animation: none; outline: 2px solid var(--accent); } }
.ach-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ach-topic { flex: 1; min-width: 0; }
.ach-state { font-size: 12px; font-weight: 700; margin-left: auto; white-space: nowrap; }
.ach-s-unlocked { color: var(--good); }
.ach-s-locked, .ach-s-unavailable { color: var(--dim); font-weight: 600; }
.ach-name { margin: 2px 0 0; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.ach-desc { margin: 0; color: var(--dim); font-size: 14px; }
.ach-first { display: flex; gap: 10px; align-items: center; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.ach-face { flex: 0 0 34px; width: 34px; height: 51px; border-radius: 6px; overflow: hidden; background: var(--panel-2); }
.ach-face > * { width: 34px !important; height: 51px !important; }
.ach-first-text { min-width: 0; }
.ach-who { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; overflow-wrap: anywhere; }
.ach-prog + .ach-closest { margin-top: 2px; }
.ach-card .ach-prog { margin-top: 6px; }
.ach-closest { color: var(--dim); overflow-wrap: anywhere; }
.ach-card.ach-b-common .ach-prog-fill { background: var(--ach-line-common); }
.ach-card.ach-b-rare .ach-prog-fill { background: var(--ach-line-rare); }
.ach-card.ach-b-legendary .ach-prog-fill { background: var(--ach-line-legendary); }
.ach-card.ach-b-impossible .ach-prog-fill { background: var(--ach-line-impossible); }

/* loading skeleton */
.ach-loading { display: grid; gap: 14px; }
.ach-skel { border-radius: 10px; background: var(--panel-2); }
.ach-skel-sum { height: 120px; }
.ach-skel-card { height: 120px; }
@media (prefers-reduced-motion: no-preference) { .ach-skel { animation: ach-pulse 1.4s ease-in-out infinite; } }
@keyframes ach-pulse { 50% { opacity: .55; } }

/* new since the last export */
.ach-new { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); letter-spacing: .02em; }
.ach-card.ach-is-new { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.ach-new-line { margin-top: 8px; color: var(--dim); }
.ach-new-line:empty { display: none; }
.ach-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; }
.ach-linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* sort, flat list, times row */
.ach-sort-select { max-width: 100%; }
.ach-more { margin-top: 12px; text-align: center; }
.ach-times { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ach-times .btn { margin-left: auto; }

/* closest (Home card) */
.ach-cl { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ach-cl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ach-cl-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ach-cl-pct { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.ach-cl .ach-prog { margin: 4px 0 2px; }
.ach-prog.ach-b-common .ach-prog-fill { background: var(--ach-line-common); }
.ach-prog.ach-b-rare .ach-prog-fill { background: var(--ach-line-rare); }
.ach-prog.ach-b-legendary .ach-prog-fill { background: var(--ach-line-legendary); }
.ach-prog.ach-b-impossible .ach-prog-fill { background: var(--ach-line-impossible); }

/* unlock timeline */
.ach-tl-wrap { margin-top: 6px; }
.ach-tl-chart { width: 100%; height: 170px; display: block; overflow: visible; }
.ach-tl-chart:focus { outline: none; }
.ach-tl-chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ach-tl-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ach-tl-axis { font-size: 11px; fill: var(--dim); }
.ach-tl-seg { stroke: var(--panel); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ach-tl-common { fill: var(--ach-line-common); }
.ach-tl-rare { fill: var(--ach-line-rare); }
.ach-tl-legendary { fill: var(--ach-line-legendary); }
.ach-tl-impossible { fill: var(--ach-line-impossible); }
.ach-tl-hit { fill: transparent; cursor: pointer; }
.ach-tl-bar:hover .ach-tl-hit, .ach-tl-bar.on .ach-tl-hit { fill: var(--text); fill-opacity: .06; }
.ach-tl-sw-common { background: var(--ach-line-common); }
.ach-tl-sw-rare { background: var(--ach-line-rare); }
.ach-tl-sw-legendary { background: var(--ach-line-legendary); }
.ach-tl-sw-impossible { background: var(--ach-line-impossible); }
.ach-tl-season { margin-top: 16px; scroll-margin-top: 70px; }
.ach-tl-h { font-size: 18px; margin: 0 0 6px; }
.ach-tl-h:focus { outline: none; }
.ach-tl-items { list-style: none; margin: 0; padding: 0; }
.ach-tl-items li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0 6px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid var(--ach-line-common); }
.ach-tl-items li.ach-b-rare { border-left-color: var(--ach-line-rare); }
.ach-tl-items li.ach-b-legendary { border-left-color: var(--ach-line-legendary); }
.ach-tl-items li.ach-b-impossible { border-left-color: var(--ach-line-impossible); }
.ach-tl-name { font-weight: 600; overflow-wrap: anywhere; }
.ach-tl-who { color: var(--dim); display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }

/* share card (rendered off screen, saved as a PNG) */
.ach-offscreen { position: fixed; left: -10000px; top: 0; pointer-events: none; }
.ach-share { width: 520px; box-sizing: border-box; padding: 26px 28px 20px; border-radius: 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-top: 8px solid var(--ach-line-common); display: grid; gap: 10px; }
.ach-share.ach-b-legendary { border-top-color: var(--ach-line-legendary); background-image: linear-gradient(160deg, var(--ach-legendary-bg), transparent 55%); }
.ach-share.ach-b-impossible { border-top-color: var(--ach-line-impossible); background-image: linear-gradient(160deg, var(--ach-impossible-bg), transparent 55%); }
.ach-sh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ach-sh-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.ach-sh-name { font-family: var(--display, inherit); font-size: 32px; font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; }
.ach-sh-desc { font-size: 16px; color: var(--dim); }
.ach-sh-who { display: flex; align-items: center; gap: 14px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.ach-sh-face { flex: 0 0 84px; width: 84px; height: 126px; border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.ach-sh-label { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.ach-sh-person { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.ach-sh-where { color: var(--dim); }
.ach-sh-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--dim); margin-top: 6px; }

/* "Since your last export" (lastexport.js). Prefix: lx-. */
.lx-span { margin-bottom: 6px; }
.lx-head { font-weight: 700; margin: 4px 0 8px; }
.lx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lx-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.lx-list:empty { display: none; }
.lx-k { flex: 0 0 74px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.lx-more { margin-top: 10px; }
.lx-count { margin-left: 8px; font-size: 13px; font-weight: 600; color: var(--dim); }
.lx-stats { margin: 12px 0 16px; }
.lx-sec { margin-bottom: 16px; }
.lx-people, .lx-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lx-people li, .lx-events li { overflow-wrap: anywhere; }
.lx-h4 { margin: 12px 0 6px; font-size: 14px; }
.lx-up { color: var(--good); font-weight: 700; }
.lx-down { color: var(--bad); font-weight: 700; }

@media (max-width: 720px) {
	.lx-k { flex-basis: 64px; }
	.ach-times .btn { margin-left: 0; }
	.ach-sum { grid-template-columns: 1fr; }
	.ach-tiles { grid-template-columns: repeat(2, 1fr); }
	.ach-big { font-size: 38px; }
	.ach-grid { grid-template-columns: 1fr; }
	.ach-search { max-width: none; flex-basis: 100%; }
	.ach-filters { width: 100%; }
	.ach-bar { position: static; }
}
.lx-ms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 4px 20px; }
.lx-ms .lx-h4 { margin-top: 4px; }

/* sweep 14: rarity legend, rarity badge focus, per-season view */
.ach-rarity[tabindex] { cursor: help; }
.ach-rarity:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.ach-legend { margin-top: 10px; }
.ach-legend summary { cursor: pointer; color: var(--muted, inherit); }
.ach-legend ul { list-style: none; padding: 0; margin: 8px 0 4px; display: grid; gap: 6px; }
.ach-legend li { display: flex; gap: 8px; align-items: baseline; }
.ach-legend li .ach-rarity { flex: 0 0 auto; min-width: 74px; text-align: center; }
.ach-rtip { max-width: 260px; }
.ach-season-bar { align-items: center; }
.ach-season-bar select { min-width: 110px; }
.ach-season-rarest { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ach-season-n { font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .ach-legend li { flex-direction: column; gap: 2px; } }
