:root {
  color-scheme: light;
  --ink: oklch(26% .015 55);
  --muted: oklch(49% .017 55);
  --quiet: oklch(56% .012 55);
  --canvas: oklch(96% .009 75);
  --panel: oklch(99% .005 75);
  --line: oklch(86% .016 65);
  --orange: oklch(61% .19 45);
  --orange-soft: oklch(94% .04 65);
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.page-shell { width: min(1380px, calc(100% - 72px)); margin: 0 auto; }
.masthead { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 34px; color: var(--panel); background: var(--orange); font-style: italic; font-size: 23px; font-weight: 950; letter-spacing: -2px; padding-right: 4px; clip-path: polygon(12% 0,100% 0,88% 100%,0 100%); }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .2em; }
.brand-copy strong { font-size: 13px; letter-spacing: .09em; }
.header-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.meta-divider { width: 1px; height: 12px; background: var(--line); margin: 0 9px; }
.hero { display: flex; justify-content: space-between; align-items: end; padding: 62px 0 38px; }
.eyebrow { color: var(--orange); font: 600 10px ui-monospace, Consolas, monospace; letter-spacing: .17em; margin: 0 0 15px; }
h1 { font-size: 50px; letter-spacing: -.05em; line-height: 1.1; margin: 0; font-weight: 900; }
.hero-intro { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 15px 0 0; }
.hero-stamp { display: flex; align-items: center; gap: 12px; color: var(--quiet); font: 11px ui-monospace, Consolas, monospace; letter-spacing: .16em; padding-bottom: 5px; }
.hero-stamp span:first-child { color: var(--orange); font-size: 18px; }
.hero-stamp i { width: 55px; height: 1px; background: var(--line); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.search-box { flex: 1 1 340px; max-width: 480px; height: 48px; position: relative; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); transition: border-color .16s, box-shadow .16s; }
.search-box:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px oklch(61% .19 45 / .1); }
.search-icon { width: 15px; height: 15px; margin-left: 17px; border: 1.7px solid var(--muted); border-radius: 50%; position: relative; flex: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.7px; right: -5px; bottom: -2px; background: var(--muted); transform: rotate(45deg); }
.search-box input { min-width: 0; width: 100%; height: 100%; color: var(--ink); border: 0; outline: 0; background: transparent; padding: 0 42px 0 14px; font-size: 14px; }
.search-box input::placeholder { color: var(--quiet); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
#clear-search { position: absolute; right: 4px; border: 0; background: transparent; color: var(--muted); font-size: 22px; width: 40px; height: 40px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 6px; padding: 0 13px; color: var(--muted); background: transparent; font-size: 13px; transition: color .16s, background .16s; }
.filter-chip b { font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .78; }
.filter-chip:hover { color: var(--orange); background: var(--orange-soft); }
.filter-chip.is-active { color: var(--panel); background: var(--orange); font-weight: 700; }
.results-bar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; }
.results-bar p { margin: 0; color: var(--muted); font-size: 13px; }
.results-bar p strong { color: var(--ink); font-weight: 700; margin: 0 4px; }
.reset-button, .empty-state button { border: 0; color: var(--orange); background: transparent; font-size: 13px; min-height: 40px; padding: 8px 3px; }
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; align-items: start; }
.role-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: border-color .18s, box-shadow .18s; }
.role-card:hover, .role-card:focus-within { border-color: var(--orange); box-shadow: 0 8px 22px oklch(35% .02 55 / .09); }
.card-media { display: block; aspect-ratio: 3 / 4; position: relative; overflow: hidden; color: var(--muted); background-color: oklch(94% .027 65); background-image: linear-gradient(135deg, transparent 68%, oklch(99% .009 65 / .55) 68.2%, oklch(99% .009 65 / .55) 78%, transparent 78.2%); }
.card-media img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 26px 10px 2px; transition: transform .2s ease-out; }
.card-media:hover img { transform: scale(1.025); }
.card-index { position: absolute; z-index: 1; top: 14px; left: 14px; color: var(--muted); font: 10px ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.card-availability { position: absolute; z-index: 1; top: 12px; right: 14px; color: var(--muted); font-size: 10px; }
.view-original { position: absolute; bottom: 11px; right: 11px; padding: 5px 8px; background: var(--panel); color: var(--orange); font-size: 10px; border-radius: 4px; opacity: 0; transition: opacity .18s; }
.card-media:hover .view-original, .card-media:focus .view-original { opacity: 1; }
.card-info { padding: 17px 17px 0; min-height: 67px; }
.card-name { margin: 0; overflow-wrap: anywhere; font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.5; }
.card-type { color: var(--quiet); font-size: 11px; margin-top: 2px; }
.card-controls { display: flex; gap: 6px; padding: 12px 15px 16px; }
.type-button { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 5px; min-height: 35px; padding: 6px 3px; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; transition: color .16s, background .16s; }
.type-button:hover { color: var(--orange); border-color: var(--orange); }
.type-button.is-active { color: var(--orange); border-color: oklch(80% .12 55); background: var(--orange-soft); font-weight: 700; }
.image-error { position: absolute; inset: 45% 10px auto; text-align: center; font-size: 13px; }
.empty-state { text-align: center; padding: 66px 20px 80px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 18px; color: var(--orange); border: 1px solid var(--orange); border-radius: 50%; font: 700 21px Georgia, serif; }
.empty-state h2 { margin: 0; font-size: 21px; }
.empty-state p { color: var(--muted); margin: 9px 0 17px; font-size: 13px; }
.load-more-area { text-align: center; padding: 34px 0 12px; min-height: 61px; }
#load-more { min-height: 44px; padding: 10px 42px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font-size: 13px; }
#load-more.load-more-trigger { display: none; }
#load-progress { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; color: var(--muted); font-size: 12px; letter-spacing: .05em; }
#load-progress i { width: 13px; height: 13px; border: 1px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: load-spin .75s linear infinite; }
.load-more-area.is-loading #load-progress { animation: load-breathe 1.1s ease-in-out infinite; }
#load-more:hover { border-color: var(--orange); color: var(--orange); }
#shown-count { color: var(--quiet); font-size: 12px; margin: 14px 0; }
@keyframes load-spin { to { transform: rotate(360deg); } }
@keyframes load-breathe { 50% { opacity: .58; } }
.footer { display: flex; justify-content: space-between; margin-top: 42px; padding: 22px 0 34px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.footer strong { font-weight: 500; }
@media (min-width: 1680px) { .role-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; } }
@media (max-width: 1040px) {
  .page-shell { width: calc(100% - 40px); }
  .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .search-box { flex: auto; max-width: none; width: 100%; }
  .role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 680px) {
  .page-shell { width: calc(100% - 28px); }
  .masthead { min-height: 67px; }
  .hero { padding: 36px 0 27px; }
  h1 { font-size: 36px; }
  .hero-stamp { display: none; }
  .hero-intro { font-size: 12px; margin-top: 12px; }
  .eyebrow { font-size: 9px; margin-bottom: 12px; }
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .header-meta { font-size: 11px; }
  .header-meta span:nth-child(2), .meta-divider { display: none; }
  .toolbar { padding: 14px 0; }
  .filter-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.2fr; gap: 3px; }
  .filter-chip { justify-content: center; min-width: 0; padding: 0 5px; font-size: 12px; gap: 4px; }
  .filter-chip b { font-size: 10px; }
  .results-bar { min-height: 54px; }
  .card-media img { padding: 23px 4px 0; }
  .card-index { top: 11px; left: 10px; font-size: 9px; }
  .card-availability { right: 9px; top: 9px; font-size: 9px; }
  .card-info { padding: 11px 11px 0; min-height: 62px; }
  .card-name { font-size: 14px; }
  .card-controls { padding: 9px 8px 11px; gap: 3px; }
  .type-button { min-height: 36px; font-size: 10px; padding: 6px 1px; }
  .view-original { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }

/* Rarity is encoded in the frame, badge and ornament as well as its color. */
[data-tier="legendary"] { --tier-color: oklch(53% .205 25); --tier-bright: oklch(73% .14 27); --tier-paper: oklch(97% .017 25); --tier-haze: oklch(90% .062 25); --tier-line: oklch(80% .08 25); --tier-shadow: oklch(43% .13 25 / .21); }
[data-tier="royal"] { --tier-color: oklch(49% .10 76); --tier-bright: oklch(78% .14 81); --tier-paper: oklch(98% .021 85); --tier-haze: oklch(92% .075 86); --tier-line: oklch(79% .095 82); --tier-shadow: oklch(45% .095 77 / .18); }
[data-tier="hero"] { --tier-color: oklch(49% .16 302); --tier-bright: oklch(74% .14 300); --tier-paper: oklch(97% .017 302); --tier-haze: oklch(91% .053 302); --tier-line: oklch(82% .067 302); --tier-shadow: oklch(43% .12 302 / .18); }
[data-tier="other"] { --tier-color: oklch(47% .065 246); --tier-bright: oklch(75% .058 246); --tier-paper: oklch(97% .009 246); --tier-haze: oklch(92% .025 246); --tier-line: oklch(81% .04 246); --tier-shadow: oklch(40% .03 246 / .14); }
.hero { padding: 38px 0 29px; }
.hero-intro { margin-top: 13px; }
.archive-note { margin-top: 10px; color: var(--quiet); font-size: 11px; letter-spacing: .02em; }
.rarity-legend { display: flex; align-items: center; gap: 10px; padding-bottom: 2px; font-size: 11px; }
.rarity-legend span { display: flex; align-items: center; gap: 6px; color: var(--tier-color); }
.rarity-legend i { width: 5px; height: 5px; background: var(--tier-color); transform: rotate(45deg); }
.rarity-legend b { font-weight: 400; color: var(--line); }
.tier-tabs { display: flex; align-items: stretch; gap: 9px; padding: 3px 0 19px; }
.tier-chip { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 49px; padding: 0 21px; border: 1px solid var(--tier-line); border-radius: 5px; background: var(--panel); color: var(--tier-color); font-size: 14px; transition: background .18s, box-shadow .18s, transform .18s; }
.tier-chip[data-tier="all"] { --tier-color: var(--ink); --tier-paper: var(--panel); --tier-line: var(--line); }
.tier-chip[data-tier="legendary"], .tier-chip[data-tier="royal"], .tier-chip[data-tier="hero"], .tier-chip[data-tier="other"] { color: var(--tier-color); }
.tier-chip b { font: 500 11px ui-monospace, Consolas, monospace; opacity: .75; }
.tier-emblem { font-size: 10px; }
.tier-chip:hover { background: var(--tier-paper); box-shadow: 0 3px 10px var(--tier-shadow, oklch(20% 0 0 / .06)); transform: translateY(-2px); }
.tier-chip.is-active { background: var(--tier-color); color: var(--panel); border-color: var(--tier-color); }
.tier-chip.is-active::after { content: ''; position: absolute; height: 5px; width: 5px; left: calc(50% - 3px); bottom: -4px; transform: rotate(45deg); background: var(--tier-color); }
.toolbar { padding: 16px 0; }
.results-actions { display: flex; align-items: center; gap: 18px; }
.sort-label { font-size: 11px; color: var(--muted); }
.sort-label span { font-size: 15px; padding-left: 4px; }
.role-grid { gap: 22px; align-items: stretch; }
.role-card { overflow: visible; border: 0; border-radius: 0; background: transparent; position: relative; min-width: 0; transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .26s cubic-bezier(.16,1,.3,1), filter .26s; filter: drop-shadow(0 4px 5px oklch(25% .01 65 / .07)); }
.role-card:hover, .role-card:focus-within { border: 0; box-shadow: none; filter: drop-shadow(0 12px 13px var(--tier-shadow)); z-index: 2; }
.role-card.is-tilted { transform: perspective(1100px) translateY(-7px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.card-surface { position: relative; isolation: isolate; overflow: hidden; height: 100%; border: 2px solid transparent; border-radius: 8px; background: linear-gradient(var(--tier-paper), var(--tier-paper)) padding-box, linear-gradient(135deg, var(--tier-bright), var(--tier-color) 34%, var(--tier-line) 48%, var(--tier-color) 80%, var(--tier-bright)) border-box; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); animation: deal-in .45s cubic-bezier(.16,1,.3,1) var(--deal-delay, 0ms) backwards; }
.card-surface::after { content: ''; position: absolute; z-index: 5; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--light-x, 50%) var(--light-y, 20%), oklch(99% .007 80 / .48), transparent 47%); opacity: 0; transition: opacity .25s; }
.role-card.is-tilted .card-surface::after { opacity: .75; }
.card-inner-frame { position: absolute; z-index: 3; inset: 5px; border: 1px solid var(--tier-line); pointer-events: none; clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px)); }
.card-inner-frame::before, .card-inner-frame::after { content: ''; position: absolute; width: 20px; height: 20px; background: var(--tier-bright); opacity: .6; }
.card-inner-frame::before { right: -10px; top: -10px; transform: rotate(45deg); }
.card-inner-frame::after { left: -10px; bottom: -10px; transform: rotate(45deg); }
.card-foil { position: absolute; pointer-events: none; z-index: 6; inset: -20% -50%; transform: translateX(-100%); background: linear-gradient(110deg, transparent 37%, oklch(99% .008 80 / .04) 41%, oklch(99% .008 80 / .42) 48%, oklch(99% .008 80 / .05) 53%, transparent 60%); }
.role-card:hover .card-foil, .role-card:focus-within .card-foil { animation: foil-pass .85s cubic-bezier(.16,1,.3,1) both; }
.card-media { aspect-ratio: 3 / 4; background-color: var(--tier-paper); background-image: radial-gradient(ellipse at 50% 40%, var(--tier-haze), transparent 72%), repeating-linear-gradient(120deg, transparent 0 34px, color-mix(in oklch, var(--tier-line) 20%, transparent) 35px, transparent 36px 68px); }
.card-media::after { content: ''; position: absolute; z-index: 2; inset: auto 0 0; height: 18%; pointer-events: none; background: linear-gradient(transparent, var(--tier-paper)); }
.card-media img { position: relative; z-index: 1; padding: 39px 7px 0; filter: drop-shadow(0 6px 7px var(--tier-shadow)); transition: transform .35s cubic-bezier(.16,1,.3,1); }
.card-media:hover img { transform: translateY(-3px) scale(1.025); }
.tier-badge { display: inline-flex; align-items: center; gap: 6px; position: absolute; top: 13px; left: 13px; z-index: 4; height: 27px; padding: 0 12px 0 9px; background: var(--tier-color); color: var(--panel); font-size: 11px; font-weight: 700; letter-spacing: .06em; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); box-shadow: inset 0 1px oklch(99% .005 80 / .35); }
.badge-gem { font-size: 8px; opacity: .86; }
.rarity-pips { position: absolute; right: 17px; top: 24px; display: flex; gap: 5px; z-index: 3; }
.rarity-pips i { display: block; width: 5px; height: 5px; border: 1px solid var(--tier-line); transform: rotate(45deg); }
.rarity-pips .filled { background: var(--tier-color); border-color: var(--tier-color); }
.card-sigil { position: absolute; width: 59%; aspect-ratio: 1; left: 21%; top: 29%; border: 1px solid var(--tier-line); transform: rotate(45deg); opacity: .62; }
.card-sigil::before, .card-sigil::after { content: ''; position: absolute; inset: 7%; border: 1px solid var(--tier-line); }
.card-sigil::after { inset: 18%; transform: rotate(45deg); }
.card-orbit { position: absolute; left: 8%; top: 21%; width: 84%; aspect-ratio: 1; border: 1px solid var(--tier-line); border-radius: 50%; opacity: .52; }
.card-orbit::after { content: ''; position: absolute; inset: 8%; border: 1px dashed var(--tier-line); border-radius: 50%; }
[data-tier="legendary"] .card-orbit { box-shadow: 0 0 0 7px color-mix(in oklch, var(--tier-line) 18%, transparent), inset 0 0 0 7px color-mix(in oklch, var(--tier-line) 18%, transparent); }
[data-tier="royal"] .card-sigil { transform: rotate(0); border-width: 1px; }
[data-tier="hero"] .card-sigil { border-radius: 20% 0; }
[data-tier="other"] .card-sigil { transform: rotate(0); opacity: .35; }
[data-tier="other"] .card-orbit::after { display: none; }
.card-info { position: relative; padding: 0 17px; min-height: 93px; }
.card-edition { display: flex; justify-content: space-between; align-items: center; gap: 5px; border-top: 1px solid var(--tier-line); padding: 11px 0 5px; color: var(--tier-color); font: 9px ui-monospace, Consolas, monospace; letter-spacing: .1em; }
.card-edition span:last-child { color: var(--quiet); letter-spacing: 0; }
.card-name { font-size: 17px; font-weight: 800; line-height: 1.45; }
.card-subline { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10px; color: var(--muted); margin-top: 5px; }
.card-type { margin: 0; color: var(--tier-color); font-size: 10px; }
.card-controls { position: relative; z-index: 4; padding: 10px 16px 21px; gap: 5px; }
.type-button { min-height: 33px; border-color: var(--tier-line); background: color-mix(in oklch, var(--panel) 70%, transparent); color: var(--tier-color); border-radius: 3px; font-size: 10px; }
.type-button.is-active { background: var(--tier-color); border-color: var(--tier-color); color: var(--panel); }
.type-button:hover { border-color: var(--tier-color); color: var(--tier-color); background: var(--tier-haze); }
.type-button.is-active:hover { color: var(--panel); background: var(--tier-color); }
.card-bottom-gem { position: absolute; z-index: 4; bottom: 3px; left: calc(50% - 4px); color: var(--tier-color); background: var(--tier-paper); padding: 0 5px; margin-left: -5px; font-size: 7px; }
.view-original { z-index: 4; color: var(--tier-color); background: var(--tier-paper); bottom: 9px; right: 13px; }
.image-error { z-index: 4; }
@keyframes deal-in { from { opacity: 0; transform: translateY(17px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes foil-pass { from { transform: translateX(-75%); } to { transform: translateX(75%); } }
@media (min-width: 1280px) { .role-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; } }
@media (max-width: 1040px) {
  .tier-chip { flex: 1; padding: 0 12px; gap: 7px; }
  .rarity-legend { gap: 7px; }
  .role-grid { gap: 16px; }
}
@media (max-width: 680px) {
  .hero { padding: 28px 0 24px; }
  .rarity-legend { display: none; }
  .tier-tabs { gap: 5px; padding-bottom: 15px; }
  .tier-chip { flex: 1; flex-wrap: wrap; column-gap: 4px; row-gap: 2px; min-height: 58px; padding: 9px 2px; font-size: 11px; line-height: 1.4; }
  .tier-chip b { width: 100%; font-size: 10px; }
  .tier-emblem { display: none; }
  .role-grid { gap: 14px 10px; }
  .results-actions { gap: 9px; }
  .sort-label { font-size: 10px; }
  .sort-label span { padding-left: 1px; }
  .results-bar p { font-size: 11px; }
  .reset-button { font-size: 11px; }
  .card-surface { border-width: 1.5px; }
  .card-inner-frame { inset: 4px; }
  .tier-badge { height: 23px; top: 10px; left: 10px; font-size: 10px; padding: 0 9px 0 6px; gap: 4px; }
  .badge-gem { font-size: 7px; }
  .rarity-pips { right: 12px; top: 21px; gap: 4px; }
  .rarity-pips i { width: 3px; height: 3px; }
  .card-media img { padding: 33px 3px 0; }
  .card-info { padding: 0 11px; min-height: 86px; }
  .card-edition { font-size: 7px; letter-spacing: .07em; padding: 8px 0 5px; }
  .card-name { font-size: 13px; }
  .card-subline, .card-type { font-size: 9px; }
  .card-controls { padding: 7px 10px 19px; gap: 3px; }
  .type-button { min-height: 34px; font-size: 9px; padding: 4px 0; }
  .card-orbit { top: 30%; }
  .card-sigil { top: 36%; }
}
@media (hover: none) { .role-card:hover { filter: drop-shadow(0 4px 5px oklch(25% .01 65 / .07)); } .card-media:hover img { transform: none; } .card-foil { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .role-card, .role-card.is-tilted, .card-media:hover img, .tier-chip:hover { transform: none !important; }
  .card-foil, .card-surface::after { display: none; }
}
