/* The public card pages: the game's dark theme, its card frames and pixel fonts, and no JavaScript. */
@font-face { font-family: "VT323"; font-display: swap; src: url(/fonts/vt323-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Press Start 2P"; font-display: swap; src: url(/fonts/press-start-2p-latin-400-normal.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --ink: #0a0e17; --panel: #121928; --panel-2: #1a2336; --line: #2a3650;
  --text: #e8edf7; --muted: #a9b5cc; --phosphor: #5eead4; --link: #8cc2ff; --visited: #d0a8ff; --gold: #f5b83d;
  --common: #94a3b8; --rare: #4f9dff; --epic: #b77dff; --legendary: #f5b83d;
  --pixel: "VT323", ui-monospace, monospace;
  --pixel-title: "Press Start 2P", "VT323", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--ink); font: 16px/1.55 var(--sans);
  background-image: radial-gradient(60% 40% at 15% 0%, rgb(29 111 134 / 0.28), transparent 70%), radial-gradient(50% 40% at 90% 10%, rgb(91 42 140 / 0.3), transparent 70%),
    linear-gradient(rgb(255 255 255 / 0.025) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 0.025) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
}
a { color: var(--link); text-underline-offset: 2px; }
a:visited { color: var(--visited); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.35; text-wrap: balance; }
h1 { font: 22px/1.5 var(--pixel-title); margin: 6px 0 14px; color: #fff; text-shadow: 3px 3px 0 #3b1d6e; overflow-wrap: anywhere; }
h1 .year { color: var(--gold); white-space: nowrap; }
h2 { font: 14px/1.6 var(--pixel-title); margin: 0 0 12px; color: var(--phosphor); }
h3 { font: 600 15px/1.4 var(--sans); margin: 18px 0 6px; color: var(--text); }
p { margin: 0 0 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; padding: 8px 12px; border-radius: 6px; background: var(--phosphor); color: #06211d; text-decoration: none; }
.skip:focus { left: 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Shell */
.top { border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgb(94 234 212 / 0.5), rgb(183 125 255 / 0.5), transparent) 1; background: rgb(10 14 23 / 0.86); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding-block: 12px; }
.brand { font: 15px var(--pixel-title); text-decoration: none; color: var(--phosphor); }
.brand:visited { color: var(--phosphor); }
.brand sup, .dub3 sup { font-size: 0.6em; line-height: 0; vertical-align: 0.6em; margin-left: 0.05em; }
.brand sup { color: #ff4fd8; }
.dub3 { white-space: nowrap; }
.top nav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-left: auto; }
.top nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 15px; }
.top nav a:hover, .top nav a[aria-current] { color: var(--text); background: rgb(255 255 255 / 0.06); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 0; padding: 0; list-style: none; font: 19px/1.3 var(--pixel); color: var(--muted); }
.crumbs li + li::before { content: "»"; margin-right: 6px; color: var(--line); }
main { padding-block: 8px 48px; }
footer { border-top: 1px solid var(--line); padding-block: 22px 40px; color: var(--muted); font-size: 14px; }
footer p { margin: 0 0 8px; }

/* Buttons, bevelled like a 1997 form and glossy like the game */
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid rgb(255 255 255 / 0.16);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0.03)); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1), 0 4px 12px rgb(0 0 0 / 0.25); }
.btn:visited { color: var(--text); }
.btn:hover { border-color: rgb(255 255 255 / 0.3); color: #fff; }
.btn.primary, .btn.primary:visited { color: #052520; border-color: rgb(94 234 212 / 0.9); background: linear-gradient(180deg, #a5fbec 0%, #4fe3cb 48%, #22bfa8 52%, #1fae99 100%); }
.btn.primary:hover { color: #052520; filter: brightness(1.06); }

/* The card page */
.card-page { display: grid; grid-template-columns: 336px minmax(0, 1fr); gap: 20px 40px; align-items: start; margin-top: 14px; }
.showcase { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.facts .eyebrow { margin: 0; font: 20px var(--pixel); color: var(--phosphor); letter-spacing: 0.04em; }
.lede { font-size: 18px; color: var(--muted); font-style: italic; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 0 0 22px; }
.stats div { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, rgb(28 38 60 / 0.8), rgb(15 21 35 / 0.8)); }
.stats dt { font: 18px/1.1 var(--pixel); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stats dd { margin: 2px 0 0; font-weight: 600; }
.stats dd a { color: var(--text); }
.stats .rarity-common { color: var(--common); } .stats .rarity-rare { color: var(--rare); } .stats .rarity-epic { color: var(--epic); } .stats .rarity-legendary { color: var(--legendary); }
.panel { margin: 0 0 18px; padding: 16px 18px; border: 1px solid rgb(140 170 230 / 0.18); border-radius: 14px; background: linear-gradient(180deg, rgb(28 38 60 / 0.72), rgb(15 21 35 / 0.78)); }
.panel p:last-child { margin-bottom: 0; }
.ability-text { font-size: 18px; font-weight: 600; color: #fff; }
.source { color: var(--muted); font-size: 14px; }
.small { font-size: 14px; color: var(--muted); }
section.more { margin-top: 36px; }

/* 88 by 31 badges, as every homepage had */
.badge88 { display: inline-grid; place-items: center; width: 176px; height: 62px; padding: 4px; margin: 0; border: 2px solid; border-color: #fff #555 #555 #fff;
  background: linear-gradient(180deg, #2c4fb0, #10226a); color: #fff; font: 20px/1 var(--pixel); text-align: center; letter-spacing: 0.03em; text-shadow: 1px 1px 0 #000; }
.badge88 b { display: block; font: 9px/1.4 var(--pixel-title); color: var(--gold); }

/* The card itself, framed like the game's (src/index.css), at a size where its pixels stay square: the art box is
   exactly twice the page's 160 by 120. */
.card { position: relative; width: 336px; display: flex; flex-direction: column; margin: 0; font-size: 17px; line-height: 1.25; color: #111;
  background: var(--frame, #c0c0c0); box-shadow: 0 10px 24px rgb(0 0 0 / 0.45); isolation: isolate; }
.card-titlebar { display: flex; align-items: center; gap: 0.4em; padding: 0.3em 0.45em; font-weight: 700; white-space: nowrap; overflow: hidden; }
.card-titlebar .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-controls { display: flex; gap: 0.2em; flex: none; }
.card-controls i { display: block; width: 0.75em; height: 0.75em; }
.card-address { margin: 0 8px; padding: 0.14em 0.4em; font: 0.72em ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fff; color: #333; }
.card-view { position: relative; width: 320px; height: 240px; margin: 6px 8px 0; overflow: hidden; background: #fff; flex: none; }
.card-view img { display: block; width: 320px; height: 240px; image-rendering: pixelated; }
.card-view .text-art { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; font: 18px/1.5 var(--pixel-title); color: #fff;
  background: repeating-linear-gradient(0deg, rgb(255 255 255 / 0.06) 0 2px, transparent 2px 4px), var(--art-bg, #1d4f9e); overflow-wrap: anywhere; }
.card-body { margin: 6px 8px; padding: 0.4em 0.5em; background: #fff; color: #161616; display: flex; flex-direction: column; gap: 0.25em; min-height: 6.4em; }
.card-ability { margin: 0; font-size: 0.86em; font-weight: 600; }
.card-flavour { margin: 0; font-size: 0.76em; font-style: italic; color: #555; }
.card-meta { margin-top: auto; display: flex; justify-content: space-between; gap: 0.5em; font-size: 0.66em; color: #555; }
.card-credit { padding: 0 4em 0.6em 3.6em; font-size: 0.6em; line-height: 1.25; min-height: 3.2em; color: var(--credit, #333); }
.chip { position: absolute; z-index: 3; display: grid; place-items: center; width: 2em; height: 2em; font: 0.85em var(--pixel-title); color: #fff; text-shadow: 0 1px 0 rgb(0 0 0 / 0.5); }
.chip-cost { bottom: 0.4em; left: 0.4em; background: linear-gradient(160deg, #1f6fe0, #0b4fc4); border-radius: 50%; box-shadow: 0 0 0 0.14em #fff, 0 2px 6px rgb(0 0 0 / 0.5); }
.chip-power { bottom: 0.4em; right: 0.4em; width: 2.4em; background: linear-gradient(160deg, #c2410c, #9a3412); border-radius: 0.45em; box-shadow: 0 0 0 0.14em #fff, 0 2px 6px rgb(0 0 0 / 0.5); }
.badge-beta { position: absolute; top: 6px; right: -26px; z-index: 2; padding: 2px 28px; transform: rotate(35deg); background: #ff6a00; color: #fff; font: 700 11px var(--sans); text-transform: uppercase; }

.era-pioneer { --frame: #cfcfcf; --credit: #333; font-family: "Times New Roman", Times, serif; border: 1px solid #555; }
.era-pioneer .card-titlebar { background: #cfcfcf; color: #000; border-bottom: 1px solid #777; font-weight: 400; font-style: italic; }
.era-pioneer .card-controls { display: none; }
.era-pioneer .card-address { background: #e8e8e8; border: 1px solid #888; }
.era-pioneer .card-body { background: #dcdcdc; border: 1px solid #999; }
.era-boom { --frame: #c0c0c0; --credit: #222; font-family: Tahoma, "Segoe UI", Geneva, sans-serif; border: 2px outset #efefef; }
.era-boom .card-titlebar { background: linear-gradient(90deg, #000080, #0e78bf); color: #fff; margin: 0.14em; }
.era-boom .card-controls i { background: #c0c0c0; border: 1px outset #fff; }
.era-boom .card-address { border: 1px inset #bbb; }
.era-boom .card-body { border: 2px inset #ddd; }
.era-dotcom { --frame: linear-gradient(170deg, #cfe3ff, #5f93d8 45%, #1d4f9e); --credit: #e6f0ff; font-family: Verdana, Geneva, sans-serif; border-radius: 0.9em; border: 1px solid #0d3a7d; }
.era-dotcom .card-titlebar { background: linear-gradient(180deg, rgb(255 255 255 / 0.75), rgb(255 255 255 / 0.1) 55%, rgb(0 30 90 / 0.25)); color: #06275e; border-radius: 0.8em 0.8em 0 0; }
.era-dotcom .card-controls i { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #7fb1ef 60%, #285ba8); }
.era-dotcom .card-address { border-radius: 1em; }
.era-dotcom .card-view { border-radius: 0.4em; box-shadow: 0 0 0 1px #0d3a7d; }
.era-dotcom .card-body { background: rgb(255 255 255 / 0.92); border-radius: 0.4em; }
.era-web2 { --frame: linear-gradient(180deg, #f6f8fb, #d9e1ea); --credit: #4a5563; font-family: "Lucida Grande", "Segoe UI", Helvetica, sans-serif; border-radius: 0.7em; border: 1px solid #aab4c1; }
.era-web2 .card-titlebar { background: linear-gradient(180deg, #e8f4ff 0%, #bcdcff 49%, #8cc1ff 50%, #b7dcff 100%); color: #123a63; border-radius: 0.62em 0.62em 0 0; }
.era-web2 .card-controls i { border-radius: 50%; background: linear-gradient(180deg, #ffb3b3, #e63b3b); }
.era-web2 .card-controls i:nth-child(2) { background: linear-gradient(180deg, #ffe8a8, #e6b13b); }
.era-web2 .card-controls i:nth-child(3) { background: linear-gradient(180deg, #c8f0a8, #5ab33b); }
.era-web2 .card-address { border-radius: 0.3em; border: 1px solid #b6c2d0; }
.era-web2 .card-view { border-radius: 0.3em; box-shadow: 0 0.2em 0.5em rgb(0 0 0 / 0.2); }
.era-web2 .card-body { border-radius: 0.3em; }
.era-modern { --frame: #fff; --credit: #5b6473; font-family: var(--sans); border-radius: 0.8em; overflow: hidden; }
.era-modern .card-titlebar { background: #fff; color: #111827; font-weight: 600; }
.era-modern .card-controls i { border-radius: 50%; background: #e5e7eb; }
.era-modern .card-address { background: #f3f4f6; border-radius: 1em; color: #4b5563; }
.era-modern .card-view { border-radius: 0.3em; }
.finish-rare { box-shadow: 0 0 0 2px var(--rare), 0 10px 24px rgb(0 0 0 / 0.45); }
.finish-epic { box-shadow: 0 0 0 2px var(--epic), 0 0 18px rgb(183 125 255 / 0.5), 0 10px 24px rgb(0 0 0 / 0.45); }
.finish-legendary { box-shadow: 0 0 0 2px var(--legendary), 0 0 26px rgb(245 184 61 / 0.5), 0 10px 24px rgb(0 0 0 / 0.5); }
.finish-legendary .card-view::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.85) 48%, transparent 66%); background-size: 280% 100%; background-position: 120% 0; }
@media (prefers-reduced-motion: no-preference) {
  .finish-legendary .card-view::after { animation: shine 4.5s linear 1s 3; }
  @keyframes shine { from { background-position: 120% 0; } to { background-position: -60% 0; } }
}

/* Tiles of other cards */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.tiles a { display: block; height: 100%; padding: 4px 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-decoration: none; color: var(--text); }
.tiles a:hover { border-color: var(--phosphor); }
.tiles a:visited .tile-name { color: var(--visited); }
.tiles img, .tiles .text-art { display: block; width: 160px; height: 120px; margin: 0 auto 6px; border-radius: 6px; image-rendering: pixelated; }
.tiles .text-art { display: grid; place-items: center; padding: 8px; text-align: center; font: 10px/1.5 var(--pixel-title); color: #fff; background: var(--art-bg, #1d4f9e); overflow-wrap: anywhere; }
.tile-name { display: block; padding: 0 6px; font-weight: 600; color: var(--link); }
.tile-meta { display: block; padding: 0 6px; font-size: 13px; color: var(--muted); }

/* A webring, of course */
.webring { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin: 40px auto 0; padding: 12px; max-width: 640px;
  border: 3px ridge #8f94a8; background: #1a2336; font: 20px/1.2 var(--pixel); text-align: center; }
.webring a { padding: 4px 10px; border: 2px solid; border-color: #fff #3a3a3a #3a3a3a #fff; background: #c0c0c0; color: #000080; text-decoration: none; }
.webring a:visited { color: #551a8b; }
.webring a:hover { background: #dcdcdc; color: #000; }
.webring span { color: var(--gold); }

/* The directory, after the web directories of 1996 */
.counter { display: inline-flex; gap: 2px; margin: 0 0 16px; padding: 4px; background: #000; border: 2px inset #666; }
.counter span { min-width: 22px; padding: 2px 3px; background: linear-gradient(180deg, #222 0 50%, #111 50%); color: #7CFF6B; font: 26px/1 var(--pixel); text-align: center; }
.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.collections > li { padding: 16px 18px; border: 1px solid rgb(140 170 230 / 0.18); border-radius: 14px; background: linear-gradient(180deg, rgb(28 38 60 / 0.72), rgb(15 21 35 / 0.78)); }
.collections h2 { margin-bottom: 6px; font-size: 13px; }
.collections h2 a { color: var(--phosphor); }
.count { color: var(--muted); font: 19px var(--pixel); }
.eras { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; padding: 0; list-style: none; font: 19px/1.3 var(--pixel); }
.dir { columns: 3 220px; column-gap: 28px; margin: 0 0 8px; padding: 0; list-style: none; }
.dir li { break-inside: avoid; padding: 3px 0; }
.dir .meta { color: var(--muted); font-size: 13px; }
.cool { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 3px; background: var(--gold); color: #2a1a00; font: 700 10px/1.6 var(--sans); vertical-align: 2px; text-decoration: none; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 26px 0 0; padding: 0; list-style: none; font: 20px var(--pixel); }
.pager a, .pager span { display: inline-block; min-width: 40px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-align: center; text-decoration: none; }
.pager span[aria-current] { background: var(--phosphor); color: #052520; border-color: var(--phosphor); }
.construction { height: 18px; margin: 8px 0 22px; background: repeating-linear-gradient(-45deg, #f5b83d 0 14px, #111 14px 28px); border-block: 2px solid #000; }

.art-pioneer { --art-bg: #6b6b6b; } .art-boom { --art-bg: #000080; } .art-dotcom { --art-bg: #1d4f9e; } .art-web2 { --art-bg: #2f6fb8; } .art-modern { --art-bg: #334155; }

@media (max-width: 820px) {
  .card-page { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 18px; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .top nav { margin-left: -6px; width: calc(100% + 12px); gap: 0; }
  .top nav a { padding: 8px 6px; font-size: 14px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tiles img, .tiles .text-art { width: 100%; max-width: 160px; height: auto; aspect-ratio: 4 / 3; }
}
