/* Korea TCG: the card shop showcase.
   Felt-charcoal showcase, cards in clear toploader sleeves, every price on a white printed sticker.
   Shapes: sleeves 6px, stickers and controls 4px, card art and small tags 3px, nothing else rounded.
   Colour: red/blue only for price movement (Korean convention, always with ▲/▼). The "active" colour is sticker white.

   base.css is what every game's site shares: the tokens, the header and its account menu,
   the search and filters, the shelf of cards, the popup, the footer, profile pictures and
   levels, and the phone layout of all of them. Each game adds its own stylesheet.

   Two cascade layers, declared here, before anything else loads: base (this file) under game
   (riftbound.css, palworld.css, the selector's own block). A game's rule wins over a base rule
   whatever their specificity, so a game restyles a shared part without out-specifying it.
   Unlayered CSS would beat both, so every stylesheet of the site goes in one of the two. */

@layer base, game;

@layer base {

:root {
  --felt: #1b1c1e;
  --shelf: #222427;
  --glass: #2a2c30;
  --line: #36393e;
  --line-2: #4a4d53;
  --text: #ecece8;
  --muted: #a4a6aa;
  --faint: #8b8e93;
  --sleeve: rgb(214 220 226 / .07);
  --sleeve-edge: rgb(214 220 226 / .34);
  --sticker: #f5f5f2;
  --sticker-2: #e4e5e1;
  --ink: #18191b;
  --ink-2: #4b4e53;
  --up: #ff6b60;
  --down: #6aa6ff;
  --up-ink: #d21f26;
  --down-ink: #1a5fd0;
  --r-sleeve: 6px;
  --r: 4px;
  --r-art: 3px;
  /* Riot's rarity colours: the rarity names and the level tiers named after them. */
  --rar-common: #b3b1aa;
  --rar-uncommon: #5fc6c9;
  --rar-rare: #ef8fb0;
  --rar-epic: #eaa955;
  --rar-showcase: #bfa8f5;
  /* Dark glass over card art and the camera (labels, buttons), and the dimming
     behind dialogs and sheets: the colour is fixed, each use sets its alpha. */
  --scrim-rgb: 12 13 14;
  --backdrop-rgb: 8 9 10;
  --placeholder: #6f7277;
  --prose: #d3d3cf;
  --muted-2: #8d9096;
  --header-h: 56px;
  /* The space under a phone's home bar. Always 0: the pages do not ask to draw
     under it (no viewport-fit=cover), and Samsung Internet reports its own
     toolbar's height in env(safe-area-inset-bottom) while that toolbar slides,
     which made the bottom tab bar grow as the page scrolled. */
  --safe-b: 0px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Both languages are in the page; lang.js sets data-lang and the other one is hidden. Korean without script. */
:root[data-lang="en"] [data-l="ko"], :root:not([data-lang="en"]) [data-l="en"] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) var(--felt); }

body {
  margin: 0;
  background: var(--felt);
  color: var(--text);
  font: 15px/1.5 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--sticker);
}
::selection { background: var(--sticker); color: var(--ink); }

a { color: inherit; text-underline-offset: 3px; }
img { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }

.i { width: 18px; height: 18px; flex: none; }
.price { font-variant-numeric: tabular-nums; }

/* ---------- Header and tabs ---------- */

.site-head {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  background: var(--felt);
  border-bottom: 1px solid var(--line);
}
.site-head .bar {
  max-width: 1400px; height: 100%; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap;
}
/* The mark: a hanging price tag, white stock with its punched hole. */
.logo .mark {
  position: relative; width: 14px; height: 19px; border-radius: 2px; background: var(--sticker);
}
.logo .mark::after {
  content: ""; position: absolute; left: 50%; top: 3px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--felt);
}

.tabs { display: flex; gap: 2px; }
.tabs a {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--r);
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}
.tabs a[aria-current="page"] { color: var(--ink); background: var(--sticker); font-weight: 700; }
.tabs .i { width: 17px; height: 17px; }
@media (hover: hover) and (pointer: fine) {
  .tabs a:not([aria-current="page"]):hover { color: var(--text); background: var(--glass); }
}

.lang {
  margin-left: auto; flex-shrink: 0; white-space: nowrap;
  font-size: 13px; font-weight: 700;
  background: none; border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 5px 11px; cursor: pointer;
}

/* ---------- Search and filters ---------- */

.toolbar {
  position: sticky; top: var(--header-h); z-index: 15;
  background: var(--shelf);
  border-bottom: 1px solid var(--line);
}
.toolbar .inner {
  max-width: 1400px; margin: 0 auto; padding: 12px 24px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.search { position: relative; flex: 1 1 260px; max-width: 420px; min-width: 0; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--placeholder); pointer-events: none; z-index: 1; }
.search input {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--sticker); border: 0; border-radius: var(--r);
  padding: 10px 14px 10px 38px; caret-color: var(--ink);
}
.search input::placeholder { color: var(--placeholder); }

.filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.field { position: relative; display: block; }
.field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.field select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 8px 32px 8px 12px; cursor: pointer; max-width: 220px;
}
.field select:focus-visible { outline-offset: 1px; }
.field .caret { position: absolute; right: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }

/* A select that opens a list of checkboxes (sellers): looks like the selects beside it. */
.multi {
  font: inherit; font-size: 14px; color: var(--text); text-align: left; white-space: nowrap;
  background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 8px 32px 8px 12px; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.multi-wrap { position: relative; }
.multi.on { border-color: var(--muted); font-weight: 700; }
.multi-menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 240px;
  padding: 6px; border-radius: var(--r); background: var(--shelf); border: 1px solid var(--line-2);
  box-shadow: 0 12px 32px rgb(0 0 0 / .45); transform-origin: top left;
  transition: opacity .15s var(--ease-out), transform .15s var(--ease-out);
  @starting-style { opacity: 0; transform: scale(.97); }
}
.multi-hint { margin: 4px 8px 6px; font-size: 12px; color: var(--faint); }
.multi-opt { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: var(--r); cursor: pointer; font-size: 14px; }
.multi-opt input { position: absolute; opacity: 0; pointer-events: none; }
.multi-opt .box { display: grid; place-items: center; width: 18px; height: 18px; flex: none; border: 1px solid var(--line-2); border-radius: var(--r); }
.multi-opt .box .i { width: 13px; height: 13px; display: none; }
.multi-opt input:checked + .box { background: var(--sticker); border-color: var(--sticker); color: var(--ink); }
.multi-opt input:checked + .box .i { display: block; }
.multi-opt input:focus-visible + .box { outline: 2px solid var(--sticker); outline-offset: 2px; }
.multi-opt .nm { flex: 1; }
.multi-opt .n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .multi-opt:hover { background: var(--glass); } }

.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--muted); white-space: nowrap;
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 12px;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.toggle > span .i { width: 15px; height: 15px; display: none; }
.toggle input:checked + span { color: var(--ink); background: var(--sticker); border-color: var(--sticker); font-weight: 700; }
.toggle input:checked + span .i { display: block; }
.toggle input:focus-visible + span { outline: 2px solid var(--sticker); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .toggle:hover input:not(:checked) + span { color: var(--text); border-color: var(--muted); }
}

.toolbar .filter-btn, .toolbar .sheet-head, .toolbar .sheet-done, .toolbar .backdrop { display: none; }
/* The Filters button, wherever it shows: one line, and the sticker while its panel is open. */
.filter-btn { white-space: nowrap; }
.filter-btn[aria-expanded="true"] { background: var(--sticker); color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 13px;
  transition: transform .16s var(--ease-out), border-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn .i { width: 15px; height: 15px; color: var(--muted); }
.btn.primary { background: var(--sticker); border-color: var(--sticker); color: var(--ink); font-weight: 800; justify-content: center; }
.btn.primary .i { color: var(--ink); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
@media (hover: hover) and (pointer: fine) { .btn:not(:disabled):hover { border-color: var(--muted); } }
.badge {
  min-width: 19px; height: 19px; padding: 4px 10px 4px 8px; border-radius: var(--r);
  background: var(--sticker); color: var(--ink); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}

/* ---------- The showcase ---------- */

main { max-width: 1400px; margin: 0 auto; padding: 20px 24px 64px; }

.stale {
  margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r); font-size: 14px;
  background: var(--sticker); color: var(--ink); font-weight: 600;
}
.title-row { display: flex; align-items: baseline; gap: 12px; margin: 0 0 18px; }
.title-row h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.count { color: var(--faint); font-size: 14px; margin: 0; font-variant-numeric: tabular-nums; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 30px 18px;
  overflow-x: clip; padding-bottom: 10px;
}

/* A card in its toploader, with the shop's price sticker over the bottom of the sleeve. */
.card {
  position: relative; isolation: isolate; text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer; min-width: 0;
  transition: transform .16s var(--ease-out);
}
.card:active { transform: scale(.98); }
/* The glass shelf the row stands on: each card draws its stretch, half a gap past each side, so a row reads as one shelf. */
.card::before {
  content: ""; position: absolute; z-index: -1; left: -9px; right: -9px; bottom: -10px; height: 34px;
  background: var(--glass); border-top: 1px solid #3a3d42;
}
.card:focus-visible { outline: none; }
.sleeve {
  /* Positioned, so a game can pin a flag on the art. */
  position: relative; padding: 9px 6px 6px; border-radius: var(--r-sleeve);
  background: var(--sleeve);
  box-shadow: inset 0 0 0 1px var(--sleeve-edge), inset 0 5px 0 0 rgb(214 220 226 / .26); /* taste-skill-ignore: the sleeve's plastic edge and lip */
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.sleeve .art { aspect-ratio: 744 / 1039; border-radius: var(--r-art); overflow: hidden; background: var(--shelf); }
.sleeve img { width: 100%; height: 100%; object-fit: cover; }
.card:focus-visible .sleeve { box-shadow: inset 0 0 0 2px var(--sticker); } /* taste-skill-ignore: focus edge */
@media (hover: hover) and (pointer: fine) {
  .card:hover .sleeve { transform: translateY(-3px); /* taste-skill-ignore: lifted off the shelf */ box-shadow: inset 0 0 0 1px rgb(214 220 226 / .6), inset 0 3px 0 0 rgb(214 220 226 / .22), 0 14px 24px -14px rgb(0 0 0 / .8); }
}

.tag-price {
  position: relative; margin: -22px 8px 0; padding: 7px 9px 8px;
  background: var(--sticker); color: var(--ink); border-radius: var(--r);
  box-shadow: 0 2px 3px rgb(0 0 0 / .35); /* taste-skill-ignore: a paper sticker stands off the sleeve */
}
.tag-price .nm {
  font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.3; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag-price .star { color: var(--ink); }
.tag-price .pr { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 1px; }
.tag-price .price { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.price small, .sticker-panel .lead small { font-size: .6em; font-weight: 700; margin: 0 1px; letter-spacing: 0; }
.tag-price .none { font-size: 14px; font-weight: 600; color: #4f5257; line-height: 1.6; }
.tag-price.no-price { background: var(--sticker-2); }
.tag-price .meta {
  font-size: 12px; color: #55585d; margin-top: 1px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* one line, so stickers in a row stay level on the shelf */
}

.star { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; margin-right: 3px; }
.chg { font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.tag-price .chg.up, .sticker-panel .chg.up { color: var(--up-ink); }
.tag-price .chg.down, .sticker-panel .chg.down { color: var(--down-ink); }

.empty { text-align: center; color: var(--muted); padding: 64px 16px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }

/* ---------- Card detail (popup and card pages) ---------- */

dialog {
  border: 1px solid var(--line-2); border-radius: var(--r-sleeve);
  background: var(--shelf); color: var(--text);
  padding: 28px; width: min(1000px, calc(100vw - 48px)); max-height: calc(100dvh - 48px);
  box-shadow: 0 30px 70px -20px rgb(0 0 0 / .85); /* taste-skill-ignore: dialog floats */
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
dialog:focus { outline: none; }
dialog::backdrop { background: rgb(var(--backdrop-rgb) / .74); }
dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog[open] { opacity: 0; transform: translateY(10px); } }
.close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer;
  transition: transform .16s var(--ease-out);
}
.close:active { transform: scale(.95); }

.detail { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
.detail .d-art { position: sticky; top: 0; }
.detail .d-art .sleeve { padding: 12px 8px 8px; }
.detail .d-art img { width: 100%; height: auto; border-radius: var(--r); }
.d-tag { display: none; }
.d-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.d-nav .btn { flex: 1; justify-content: center; font-size: 13px; padding: 7px 8px; font-variant-numeric: tabular-nums; }
.d-nav .btn .i { color: var(--text); }
.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-right: 48px; }
.detail h1, .detail h2 { margin: 0; font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; }
.alt-name { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.chip {
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 2px 8px;
}
.artist { margin: 10px 0 0; color: var(--faint); font-size: 13px; }

.watch { flex: none; }

/* Regular / foil switch in the price section: the chosen finish is a sticker. */
.seg { display: inline-flex; gap: 2px; padding: 2px; margin: 0 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); }
.seg button {
  font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: var(--r-art);
  padding: 5px 14px; cursor: pointer; transition: color .15s ease, background-color .15s ease;
}
.seg button[aria-pressed="true"] { background: var(--sticker); color: var(--ink); font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .seg button[aria-pressed="false"]:hover { color: var(--text); } }
.seg button:active { transform: scale(.97); }
.watch[aria-pressed="true"] { color: var(--ink); background: var(--sticker); border-color: var(--sticker); }
.watch[aria-pressed="true"] .i { color: var(--ink); }

.sec { margin-top: 26px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.sec-head h3, .sec h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.note { color: var(--faint); font-size: 13px; margin: 6px 0; }
.note a { color: var(--muted); }

/* The big sticker: the median as the shop would print it, the rest as figures beside it. */
.sticker-panel {
  display: grid; grid-template-columns: auto 1fr; gap: 0 22px; align-items: center;
  background: var(--sticker); color: var(--ink); border-radius: var(--r); padding: 14px 18px;
}
.sticker-panel .lead b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sticker-panel .lead > span { font-size: 12.5px; color: var(--ink-2); }
.sticker-panel dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: end; gap: 2px 22px; margin: 0; }
.sticker-panel dt { font-size: 12px; color: var(--ink-2); text-align: right; }
.sticker-panel dd { margin: 0; font-size: 16px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; grid-row: 2; }
.sticker-panel .chgline { grid-column: 1 / -1; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sticker-2); font-size: 13px; color: var(--ink-2); }
.sticker-panel + .sticker-panel { margin-top: 8px; }

/* The tooltip: floats above what it explains, so it alone may cast a shadow. */
.tip {
  position: fixed; z-index: 1000; max-width: 240px; padding: 8px 10px; pointer-events: none;
  display: grid; gap: 2px; border-radius: var(--r);
  background: var(--sticker); color: var(--ink); box-shadow: 0 6px 20px rgb(0 0 0 / .4);
  font-size: 12.5px; line-height: 1.4;
  opacity: 0; transform: scale(.97);
  transition: opacity .15s var(--ease-out), transform .15s var(--ease-out);
}
.tip b { font-size: 13px; }
.tip span { color: var(--ink-2); }
.tip.on { opacity: 1; transform: none; }
.tip.instant { transition: none; }

/* The finish switch (regular / foil) over the prices. */
.finish-seg { margin-top: 22px; }
.finish-seg .seg { margin: 0; }

/* ---------- Account (header) ---------- */

.account { position: relative; margin-left: auto; }
.account:not([hidden]) + .lang { margin-left: 0; }
.is-signed-in > .lang { display: none; }
.account > button {
  font-size: 13px; font-weight: 700; background: none; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 5px 11px;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: transform .16s var(--ease-out), border-color .15s ease;
}
.account > button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .account > button:hover { border-color: var(--muted); } }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px;
  display: grid; padding: 4px; border-radius: var(--r);
  background: var(--glass); border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / .7); /* taste-skill-ignore: menu floats */
  transform-origin: top right;
  transition: opacity .15s var(--ease-out), transform .15s var(--ease-out);
}
@starting-style { .account-menu { opacity: 0; transform: scale(.97); } }
.account-menu a, .account-menu button {
  display: block; width: 100%; text-align: left; font-size: 14px; text-decoration: none;
  background: none; border: 0; border-radius: var(--r-art); padding: 8px 10px; cursor: pointer;
}
.account-menu .who { padding: 6px 10px 8px; font-size: 12.5px; color: var(--faint); }
/* The language and sign-out sit apart from the places the menu leads to. */
.account-menu .menu-sep { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-art) var(--r-art); padding-top: 10px; }
@media (hover: hover) and (pointer: fine) { .account-menu a:hover, .account-menu button:hover { background: var(--line); } }

/* The game switch (home/games.js) sits by the logo, closer than the bar's gap;
   its menu is the account menu's, opening to the right. */
.game-switch { position: relative; margin-left: -12px; flex: none; }
.game-pill {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  padding: 4px 8px 4px 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: none; text-decoration: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--text);
}
.game-pill .i { width: 14px; height: 14px; color: var(--muted); transition: transform .15s var(--ease-out); }
.game-pill[aria-expanded="true"] .i { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .game-pill:hover { border-color: var(--muted); } }
.game-menu { left: 0; right: auto; transform-origin: top left; }
.game-menu a { display: flex; align-items: center; justify-content: space-between; gap: 16px; white-space: nowrap; }
.game-menu a[aria-current="page"] { font-weight: 700; }
.game-menu a .i { width: 15px; height: 15px; }
.game-menu .all { color: var(--muted); }

.hist { margin: 18px 0 6px; }
.hist h2, .hist h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.hist svg { width: 100%; height: auto; display: block; background: var(--felt); border: 1px solid var(--line); border-radius: var(--r); }
.hist polyline { fill: none; stroke: var(--sticker); stroke-width: 2; vector-effect: non-scaling-stroke; }
.hist .area { fill: rgb(245 245 242 / .07); }
.hist circle { fill: var(--sticker); }
.hist .axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 9px 6px; vertical-align: middle; }
tr + tr td { border-top: 1px solid var(--line); }
td.p, th.p { text-align: right; white-space: nowrap; }
td.p { font-weight: 700; font-variant-numeric: tabular-nums; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
td img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-art); }
tr.outlier td { color: var(--faint); font-weight: 400; }
tr.outlier img { opacity: .5; }
tr.outlier td.p { text-decoration: line-through; }

/* A row of links or buttons, and the text of a plain page: its about and its lede. */
.links { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.about { color: var(--muted); font-size: 15px; max-width: 70ch; margin: 0 0 18px; }
.detail .about { margin-top: 18px; }
.about a { color: var(--text); }
.lede { color: var(--muted); font-size: 14px; margin: 0 0 24px; font-variant-numeric: tabular-nums; word-break: keep-all; }

/* ---------- Footer ---------- */

.site-foot { border-top: 1px solid var(--line); background: var(--shelf); }
.site-foot .inner { max-width: 1400px; margin: 0 auto; padding: 32px 24px 40px; color: var(--faint); font-size: 13px; }
.site-foot p { margin: 0 0 10px; max-width: 90ch; }
.site-foot .meta { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

.ad { display: none; }
.ad.on { display: flex; justify-content: center; margin: 0 0 22px; min-height: 90px; }

/* ---------- Phone ---------- */

@media (max-width: 768px) {
  :root { --header-h: 52px; }
  body { padding-bottom: calc(64px + var(--safe-b)); }
  .site-head .bar { padding: 0 16px; gap: 10px; }
  /* Signed in, the account button shares the bar: the brand gives way before the buttons do. */
  .logo { min-width: 0; }
  .logo > span:last-child { overflow: hidden; text-overflow: ellipsis; }

  /* Tabs become the bottom bar, one column per tab (--tab-n: a game with another
     number of tabs sets it; Riftbound has six); the active tab carries a sticker strip. */
  .tabs {
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(var(--tab-n, 6), 1fr); gap: 0;
    padding: 4px 12px calc(4px + var(--safe-b));
    background: var(--shelf); border-top: 1px solid var(--line);
  }
  .tabs a { flex-direction: column; gap: 3px; padding: 6px 2px 5px; margin: 2px; font-size: 11px; }
  .tabs a[aria-current="page"] { background: var(--sticker); color: var(--ink); border-radius: var(--r); }
  .tabs .i { width: 22px; height: 22px; }
  /* A site with one section (body.no-tabbar) has no tab bar: nothing to switch between. */
  body.no-tabbar { padding-bottom: var(--safe-b); }
  body.no-tabbar .tabs { display: none; }
  .game-switch { margin-left: -2px; }

  .toolbar .inner { padding: 10px 16px; flex-wrap: nowrap; }
  .search { flex: 1 1 auto; max-width: none; }
  .toolbar .filter-btn { display: inline-flex; padding: 9px 12px; }
  .filter-btn > span { display: none; }

  /* Filters live in a bottom sheet. */
  .filters {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding: 8px 16px calc(16px + var(--safe-b));
    background: var(--shelf); border-top: 1px solid var(--line-2); border-radius: var(--r-sleeve) var(--r-sleeve) 0 0;
    transform: translateY(105%); transition: transform .32s var(--ease-drawer);
    max-height: 85dvh; overflow-y: auto;
  }
  .sheet-open .filters { transform: none; }
  .sheet-open .toolbar { z-index: 30; }
  .toolbar .backdrop {
    display: block; position: fixed; inset: 0; z-index: 35; background: rgb(var(--backdrop-rgb) / .66);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .sheet-open .backdrop { opacity: 1; pointer-events: auto; }
  .sheet-open { overflow: hidden; }
  .toolbar .sheet-head {
    grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0 2px; font-size: 17px; font-weight: 800;
  }
  .toolbar .sheet-head::before {
    content: ""; position: absolute; left: 50%; top: 7px; width: 36px; height: 4px; margin-left: -18px;
    border-radius: 2px; background: var(--line-2);
  }
  .toolbar .sheet-head .close { position: static; }
  .field > span { position: static; width: auto; height: auto; clip-path: none; display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
  .field select { width: 100%; max-width: none; padding: 11px 32px 11px 12px; }
  .multi { width: 100%; max-width: none; padding: 11px 32px 11px 12px; }
  .multi-wrap .caret { top: 50%; bottom: auto; transform: translateY(-50%); }
  .multi-menu { position: static; margin-top: 6px; box-shadow: none; }
  .field .caret { top: auto; bottom: 14px; transform: none; }
  .toggle > span { justify-content: center; padding: 11px 12px; }
  .toolbar .sheet-done { display: flex; grid-column: 1 / -1; padding: 13px; margin-top: 6px; font-size: 15px; }

  main { padding: 16px 16px 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 12px; }
  .card::before { left: -6px; right: -6px; }
  .tag-price { margin: -20px 6px 0; padding: 6px 8px 7px; }
  .tag-price .price { font-size: 17px; }
  .tag-price .nm { font-size: 14px; }
  .tag-price .src { display: none; } /* the source count stays in the card's popup */

  dialog {
    width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 20px 16px calc(24px + var(--safe-b));
    border-radius: var(--r-sleeve) var(--r-sleeve) 0 0; border-bottom: 0;
    transition: opacity .3s var(--ease-drawer), transform .3s var(--ease-drawer);
  }
  @starting-style { dialog[open] { opacity: 0; transform: translateY(48px); } }
  .detail { grid-template-columns: 1fr; gap: 20px; }
  .detail .d-art { position: static; max-width: 250px; margin: 0 auto; width: 100%; }
  .d-head { padding-right: 44px; flex-direction: column; gap: 12px; }
  /* In the sheet the art stays the hero and carries its price sticker, as on the shelf, so the number sits in the top half. */
  dialog .detail .d-art { max-width: 60%; }
  dialog .d-tag { display: block; margin: -26px 10px 0; }
  dialog .d-nav .nav-code { display: none; }
  .detail h1, .detail h2 { font-size: 22px; }
  .sticker-panel { grid-template-columns: 1fr; gap: 10px; }
  .sticker-panel dl { justify-content: start; }
  .sticker-panel dt, .sticker-panel dd { text-align: left; }
  .lang { padding: 4px 9px; }
  .site-foot .inner { padding: 26px 16px 28px; }
  td img { width: 38px; height: 38px; }
  table { font-size: 13.5px; }
  .ad.on { min-height: 100px; }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- profile pictures ---------- */
/* A circle cropped from a card: the card sits under a round window (account.js
   places it), so the picture is sharp at every size. Without one, the initial. */
.avatar {
  position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: var(--av, 32px); height: var(--av, 32px); border-radius: 50%;
  background: var(--glass); color: var(--text); font-weight: 800; font-size: calc(var(--av, 32px) * .44); line-height: 1;
  box-shadow: inset 0 0 0 1px rgb(214 220 226 / .22); /* taste-skill-ignore: the coin's edge */
}
.avatar img { position: absolute; max-width: none; height: auto; pointer-events: none; }
.avatar:not(.is-initial)::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(214 220 226 / .3); } /* taste-skill-ignore: edge over the picture */
.av-head { --av: 22px; }
.av-xl { --av: 88px; }
/* Signed in, the ring frames the picture already: no box around it, only a soft
   background on hover. Signed out, "Sign in" keeps its outline: it is an action. */
.account > button.has-avatar {
  display: inline-flex; align-items: center; gap: 12px; padding: 3px 10px 3px 4px; max-width: 240px;
  border-color: transparent; transition: transform .16s var(--ease-out), background-color .15s ease;
}
@media (hover: hover) and (pointer: fine) { .account > button.has-avatar:hover { border-color: transparent; background: var(--glass); } }
.account > button.has-avatar[aria-expanded="true"] { background: var(--glass); }
.account > button.has-avatar:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.account > button.has-avatar .acct-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.account > button .pfp { margin: 2px 1px 7px 2px; }
/* ---------- Levels: a ring around the member's picture, as in the League client ----------
   The ring fills with the XP towards the next level; the level sits on a plaque
   over the ring's foot. Its colour climbs the rarities (account.js levelTier):
   common 1-4, uncommon 5-9, rare 10-19, epic 20-34, showcase 35+. */

/* --glow grows with the tier: a regular's ring visibly burns brighter. */
.lv-common { --tier: var(--rar-common); --glow: 2px; }
.lv-uncommon { --tier: var(--rar-uncommon); --glow: 3.5px; }
.lv-rare { --tier: var(--rar-rare); --glow: 5px; }
.lv-epic { --tier: var(--rar-epic); --glow: 6.5px; }
.lv-showcase { --tier: var(--rar-showcase); --glow: 8px; }

.pfp {
  position: relative; display: inline-grid; flex: none; vertical-align: middle;
  width: var(--av); height: var(--av);
  /* Room for the ring around the picture and the plaque under it. */
  margin: 3px 3px calc(3px + var(--av) * .12 + 3px);
}
.pfp .avatar { width: var(--av); height: var(--av); font-size: calc(var(--av) * .44); }
.pfp-ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); rotate: -90deg; overflow: visible; pointer-events: none; }
.pfp-ring circle { fill: none; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.pfp-track { stroke: rgb(214 220 226 / .16); }
.pfp-fill { stroke: var(--tier, var(--rar-common)); stroke-linecap: round; }
/* The earned arc glows in the tier's colour; the plaque catches a little of it. */
.pfp-arc { filter: drop-shadow(0 0 1px var(--tier, var(--rar-common))) drop-shadow(0 0 var(--glow, 2px) var(--tier, var(--rar-common))); } /* taste-skill-ignore: the ring's glow is the reward */
.pfp-lv {
  position: absolute; left: 50%; bottom: 0; translate: -50% 62%;
  min-width: 2.1em; padding: 0 .4em; border-radius: var(--r-art);
  font-size: max(9px, calc(var(--av) * .2)); font-weight: 800; line-height: 1.45; text-align: center;
  font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--text);
  background: var(--felt);
  box-shadow: inset 0 0 0 1px var(--tier, var(--rar-common)), 0 0 var(--glow, 2px) color-mix(in srgb, var(--tier, var(--rar-common)) 70%, transparent); /* taste-skill-ignore: the plaque's edge and glow */
}
/* Large rings (profile, My activity): a thicker ring and a plaque that reads at arm's length. */
.pfp-xl .pfp-ring { inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); }
.pfp-xl .pfp-ring circle { stroke-width: 3px; }
.pfp-xl .pfp-lv { font-size: max(11px, calc(var(--av) * .16)); }
.pfp-xl { margin: 5px 5px calc(5px + var(--av) * .12); }

/* A name with its ring, inline in a line of text. */
.who { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.who .pfp { margin-right: 8px; }
.who-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: inherit; }
.who-link .pfp { margin-right: 8px; }
@media (hover: hover) and (pointer: fine) { .who-link:hover > span { text-decoration: underline; } }

/* "Level up!": shown once, at the bottom, after the level rose since the last visit. */
.lv-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; translate: -50% 0;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 12px; border-radius: var(--r);
  background: var(--glass); border: 1px solid var(--line-2); color: var(--text); text-decoration: none;
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / .7); /* taste-skill-ignore: floats over the page */
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
@starting-style { .lv-toast { opacity: 0; transform: translateY(12px); } }
.lv-toast.is-out { opacity: 0; transform: translateY(8px); transition-duration: .2s; }
.lv-toast > span:not(.pfp) { display: grid; min-width: 0; font-size: 14px; }
.lv-toast small { font-size: 12.5px; color: var(--muted); }
.lv-toast .lv-toast-go { font-size: 13px; font-weight: 700; color: var(--muted); padding-left: 4px; }
/* Phones: above the bottom tab bar. */
@media (max-width: 768px) { .lv-toast { bottom: calc(76px + var(--safe-b)); } }

/* ---------- Condition badges (tips.js): how solid the badge is says how good the copy is ---------- */

.cond {
  display: inline-grid; place-items: center; min-width: 30px; height: 20px; padding: 0 6px; margin-right: 6px;
  border: 1px solid transparent; border-radius: var(--r);
  font-size: 11.5px; font-weight: 800; line-height: 1; letter-spacing: .02em; vertical-align: 1px;
  cursor: help; transition: transform .16s var(--ease-out);
}
.cond[data-c="NM"] { background: var(--sticker); color: var(--ink); }
.cond[data-c="EX"] { background: var(--muted); color: var(--ink); }
.cond[data-c="VG"] { border-color: var(--line-2); color: var(--text); }
.cond[data-c="G"] { border-color: var(--line-2); border-style: dashed; color: var(--muted); }
.cond:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }
.cond:active { transform: scale(.96); }
tr.out .cond { opacity: .5; }

/* ---------- Asking to sign in, and a short note that something was done ---------- */

/* The sign-in prompt in a panel or a page: what signing in is for, and the providers. */
.kf-signin { display: grid; gap: 10px; margin: 12px 0 0; padding: 14px; border-radius: var(--r); background: var(--shelf); }
.kf-signin p { margin: 0; font-size: 14px; }
.kf-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* A toast at the bottom ("Copied", "Saved"), shown for a moment. */
.flash {
  position: fixed; z-index: 60; left: 50%; bottom: 28px;
  margin: 0; padding: 10px 16px; border-radius: var(--r);
  background: var(--sticker); color: var(--ink); font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transform: translate(-50%, 8px);
  box-shadow: 0 14px 30px -14px rgb(0 0 0 / .8); /* taste-skill-ignore: a toast floats */
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
.flash.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Table columns and bits of text a phone has no room for. */
@media (max-width: 768px) { .m-hide { display: none; } }

}
