/* Shared card component and table skin (docs/LAYOUT.md "Cards").
   An entity listing (spots, Yo-kai, items, quests, maps ...) is a grid of .ycard, never table rows. Each card sits on a
   tinted panel with the game's blue under-line and a title strip, so it reads as a panel on the white page.
   Tables stay only for numeric grids (build/tools/table_audit.py); they get the same panel skin with zebra rows. */

:root {
  --card-bg: linear-gradient(#4d4e5d, #414251);
  --card-line: #5b5c6d;
  --card-max: 480px; --card-max-thin: 360px; --card-max-wide: 640px;
  /* card widths in the centred card rows (.ycards): every card of a row the same width, a short last row in the middle */
  --card-w: 320px; --card-w-thin: 250px; --card-w-wide: 460px; --card-w-half: calc(50% - 6px); --fus-w: 380px;
  --tile-w: 170px; --tile-w-mid: 210px; --tile-w-small: 128px; --tile-w-big: 220px; --prize-w: 220px; --stat-w: 170px;
  --soul-pic: 170px; --soul-corner: 56px;
  --crank-scale: 2.5;  /* Crank-a-kai prize board (crank.css): the 3DS board at 2.5x, 2x and 1x by width */
  --card-gold-bg: linear-gradient(#5d5940, #4a4732);
  --card-gold-line: #e0a800;
  --card-gold-edge: #b86e00;
  --stack-art: 64px;  /* picture above the title on .stack cards, the size of the plates under it */
}

:root[data-theme="light"] { --card-bg: linear-gradient(#f6faff, #e5effd); --card-line: #bcd4f3; --card-gold-bg: linear-gradient(#fff9dc, #ffe9a0); }

/* centred rows of same-width cards (center audit, Leafy 2026-10-17): a grid leaves a short last row on the left, so
   the cards wrap as flex items, each the width of its variant's token, and every row sits in the middle */
.ycards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 10px 0 18px; align-items: flex-start; }
.ycards > * { flex: 0 1 var(--card-w); min-width: 0; box-sizing: border-box; }
.ycards.wide > * { flex-basis: var(--card-w-wide); }
.cbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; align-items: center; }
.cbar .filter { margin: 0; flex: 1 1 220px; }
.csort { display: inline-flex; align-items: center; gap: 6px; font: 700 var(--fs-md) var(--head); color: var(--link); }
.csort select { flex: none; width: auto; min-width: 9em; font: 500 var(--fs-base) var(--sans); padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--panel); color: var(--ink); }
.ycards.thin > * { flex-basis: var(--card-w-thin); }

/* every card is a game window (Leafy 2026-10-17, docs/LAYOUT.md "Game windows"): the lilac box, without the yellow
   header row (Leafy 2026-10-18), the Whisper window for icon tiles. The windows are
   light in both themes, so they take the light text tokens (shell.css). Legendary (gold) and tone cards keep the CSS box. */
.ycard { background: none; border: 0; border-radius: 0; border-image: var(--g-tile); padding: 6px;
  overflow: hidden; min-width: 0; text-align: left; }
.ycard:not(.gold) { --card-line: var(--mut-on); color: var(--ink); }
.ycard:has(> .yc-h) { border-image: var(--g-tile); border-image-width: 12px; padding: 6px 6px 8px; }
.ycard.gold, .ycard[class*=" t-"] { background: var(--card-bg); border: 2px solid var(--card-line); border-bottom: 4px solid var(--blue); border-radius: var(--r-xl); border-image: none; padding: 0; }
.ycard:target { outline: 3px solid var(--yellow-d); outline-offset: 2px; }
.gwin { border: 0; border-image: var(--g-win); padding: 46px 22px 20px; }
.gwin-card { border: 0; border-image: var(--g-card); padding: 14px 18px 30px; }
.gwin-tile { border: 0; border-image: var(--g-tile); padding: 12px; }

/* header: white title strip on the blue bar (border-bottom), with the game's yellow tab (img/ui/titletab.png) entering
   from the left. The tab is a background sized to the header's padding-box height, so its bottom edge always meets the
   bar; construction in docs/LAYOUT.md "Heading tab". */
.yc-h { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 12px 8px;
  border-bottom: 3px solid var(--blue); background: url("../img/ui/titletab.png") left top / auto 100% no-repeat, var(--panel); min-height: 34px; }
.yc-h h2, .yc-h h3 { margin: 0; font: 800 var(--fs-2xl)/1.2 var(--head); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
body.shell #wrapper.dbpage .yc-h h3 { font: 800 var(--fs-2xl)/1.2 var(--head); margin: 0; }
#wrapper .yc-h a { color: var(--ink); text-decoration: none; }
.ycard:not(.gold):not([class*=" t-"]) > .yc-h { background: none; border-bottom: 0; box-sizing: border-box; padding: 4px 10px; }
#wrapper .yc-h a:hover { color: var(--link); text-decoration: underline; }
.yc-sub { display: block; font: 500 var(--fs-sm)/1.3 var(--sans); color: var(--mut); margin-top: 2px; }
/* small grey text: white with a black outline on the dark panels (--mut-line, shell.css) */
.yc-sub, .yf-tag, .yf-ml, .dbpage .mut, .chat .when, .ro { -webkit-text-stroke: var(--mut-line); paint-order: stroke fill; }
#wrapper .yc-h .yc-sub a:not(:hover) { color: var(--mut); }
.yc-t { min-width: 0; flex: 1 1 auto; }
.yc-no { flex: none; font: 800 var(--fs-md) var(--head); color: var(--link); }

/* art slot: Yo-kai medal ring behind a small picture, or a plain map thumbnail */
.yc-art { flex: none; width: 46px; height: 46px; display: grid; place-items: center; background: url("../img/ui/medal_ring.png") center / contain no-repeat; }
.yc-art img { width: 32px; height: 32px; max-width: none; object-fit: contain; margin: 0; }
.yc-art.plate { background: url("../img/ui/medal_ring.png") center / contain no-repeat, radial-gradient(circle at 50% 53%, var(--panel) 0 20px, transparent 21px); }
.yc-h picture { flex: none; display: contents; }
#wrapper .yc-h .yc-ic { flex: none; width: 32px; height: 32px; margin: 0; object-fit: contain; box-shadow: none; border: 0; background: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
#wrapper .yc-map { flex: none; width: 112px; max-width: 40%; height: auto; border-radius: var(--r-sm); border: 2px solid #fff; background: #1d2633; margin: 0; align-self: stretch; object-fit: cover; }

.yc-b { padding: 8px 12px 10px; }
.yc-b > * + * { margin-top: 8px; }
.yc-lab { display: block; font: 800 var(--fs-xs) var(--head); letter-spacing: .05em; text-transform: uppercase; color: var(--link); margin: 0 0 3px; }
.sc-ch { display: block; }
.yc-foot { padding: 6px 12px 8px; border-top: 2px dashed var(--card-line); font: 700 var(--fs-base) var(--head); }
#wrapper .yc-foot a { color: var(--link); }

/* stat chips (the game's blank lilac pill, as .pill but not clickable) */
.yc-stats { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; }
/* db pages are centred (db.css): the card title, its text and chips sit in the middle; label rows, timelines and the
   map split stay left */
.dbpage .ycard { text-align: center; }
.dbpage .yc-h, .dbpage .yc-stats { justify-content: center; }
.dbpage .yc-t { flex: 0 1 auto; }
.dbpage .yc-row, .dbpage .ycard ol.stops, .dbpage .yc-split { text-align: left; }
.yc-st { display: inline-flex; align-items: baseline; gap: 5px; margin: 0; padding: 3px 12px 4px; color: var(--ink-on);
  font: 700 var(--fs-md) var(--head); border-image: url("../img/ui/pill_lilac.png") 30 47 fill / .6em 1em stretch; }
.yc-st dt { font: 500 var(--fs-xs) var(--sans); color: var(--mut-on); }
.yc-st dd { margin: 0; }
.yc-st.hot { background: var(--yellow); }
.yc-st.mut { background: #e7e3ef; color: var(--mut-on); box-shadow: inset 0 0 0 2px #b9b3c6; }

/* thumbnail on the left, facts on the right (map cards) */
.yc-split { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: start; }
.yc-split > .yc-info > * + * { margin-top: 8px; }
#wrapper .yc-split img.mapthumb { width: 112px; height: auto; max-width: 100%; margin: 0; border: 2px solid #fff; border-radius: var(--r-sm); background: #1d2633; box-shadow: 0 0 0 2px var(--card-line); }
.yc-split:not(:has(img)) { grid-template-columns: 1fr; }
@media (max-width: 420px) { .yc-split { grid-template-columns: 1fr; } }

/* lists inside a card: Yo-kai / item chips, one icon and name per cell (assets/mech.css .chips) */
.ycard .chips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; }
.ycard .meta { margin-top: 0; }

/* rows of label + value inside a card: a chance table in card form */
.yc-rows { display: grid; gap: 4px; }
.yc-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 4px 8px; border-radius: 9px; background: var(--panel-soft); }
.yc-row .chips { grid-template-columns: 1fr; }
.yc-row .val { text-align: right; font-weight: 500; }
.yc-row .val b { font: 800 var(--fs-base) var(--head); color: var(--link); }

/* ol.stops: stations of a line in order, joined by the line (trains) */
.ycard ol.stops { list-style: none; margin: 0; padding: 0 0 0 4px; isolation: isolate; }
.ycard ol.stops li { position: relative; margin: 0; padding: 3px 0 3px 22px; }
.ycard ol.stops li::before { content: ""; position: absolute; left: 3px; top: 50%; width: 10px; height: 10px; margin-top: -6px; border-radius: 50%; background: var(--panel); border: 2px solid var(--blue); }
.ycard ol.stops li::after { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--blue); z-index: -1; }
.ycard ol.stops li:first-child::after { top: 50%; }
.ycard ol.stops li:last-child::after { bottom: 50%; }
.ycard ol.stops li .mut { font-size: var(--fs-md); }
.ycard ol.stops li:has(.mut)::before { width: 6px; height: 6px; margin-top: -4px; left: 5px; border-color: var(--line); }
@media (max-width: 520px) { .yc-row { grid-template-columns: 1fr; } .yc-row .val { text-align: left; } }

/* legendary variant: gold panel, big art on the game's burst */
.ycard.gold { background: var(--card-gold-bg); border-color: var(--card-gold-line); border-bottom: 5px solid var(--card-gold-edge); }
/* gold strip: cream fading to white where the strip art starts (its left end is white between the dots) */
.ycard.gold .yc-h { background: url("../img/ui/titletab.png") left top / auto 100% no-repeat, linear-gradient(90deg, #ffe68a, var(--panel) 70%); border-bottom-color: var(--card-gold-edge); }
.ycard.gold .yc-lab { color: var(--ink-gold); }
.ycard.gold .yc-foot { border-top-color: #e8c660; }
.ycard.gold .yc-row { background: var(--panel-soft); }

/* legend card layout: stage (art) on the left, facts on the right; stacked on narrow cards */
.ylegend { display: grid; grid-template-columns: minmax(150px, 38%) minmax(0, 1fr); }
.ylegend .stage { position: relative; display: grid; place-items: center; padding: 10px 6px 6px; min-height: 190px; border-right: 2px solid var(--card-gold-line);
  background: radial-gradient(circle at 50% 46%, var(--hilite) 0, #ffe9a0 55%, #f6cb55 100%); overflow: hidden; }
.ylegend .stage::before { content: ""; position: absolute; left: 50%; top: 46%; width: 118%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: url("../img/ui/medal_burst.png") center / contain no-repeat; opacity: .8; }
/* the 2D art is an opaque square on white: shown as a framed plate */
#wrapper .ylegend .art { position: relative; width: 100%; max-width: 190px; height: auto; margin: 0; background: var(--panel); border: 3px solid var(--card-gold-line); border-radius: var(--r-xl); box-shadow: 0 0 0 2px #fff; }
#wrapper .ylegend .art.small { width: 104px; padding: 8px; box-sizing: content-box; max-width: none; image-rendering: auto; }
.ylegend .facts { padding: 8px 12px 10px; }
.ylegend .facts > * + * { margin-top: 8px; }
@media (max-width: 560px) { .ylegend { grid-template-columns: 1fr; } .ylegend .stage { border-right: 0; border-bottom: 2px solid var(--card-gold-line); } }

/* ---- card view of data tables (site.js adds .cv): same panel instead of white-on-white ---- */
#wrapper table.dbt.cv tbody tr { background: var(--card-bg); border: 2px solid var(--card-line); border-bottom: 4px solid var(--blue); border-radius: var(--r-lg); padding: 8px 12px 10px; }
#wrapper table.dbt.cv tbody tr:hover { border-color: var(--blue); }
#wrapper table.dbt.cv tbody tr:hover td { background: none; }
#wrapper table.dbt.cv td.ct, #wrapper table.dbt.cv tbody th, #wrapper table.dbt.cv td.cno { font-family: var(--head); font-weight: 800; border-bottom: 2px solid var(--card-line); }
#wrapper table.dbt.cv td.cno { color: var(--link); }
#wrapper table.dbt.cv td[data-l]::before { font-family: var(--head); font-weight: 700; color: var(--link); }
#wrapper table.dbt.cv th { background: var(--lav); color: var(--ink-on); font-family: var(--head); font-weight: 700; box-shadow: inset 0 0 0 2px #2a2238; }
#wrapper table.dbt.cv tbody tr.sel { background: var(--hilite); border-color: var(--yellow-d); }
.vsw button { font-family: var(--head); font-weight: 700; }
.vsw button.on { background: var(--blue); }

/* ---- the other card-like boxes of db.css, same tint ---- */
.card, .hubcard, .seccard, .echip { background: var(--card-bg); border-color: var(--card-line); }
.card, .hubcard, .seccard { border-width: 2px; border-bottom: 4px solid var(--blue); border-radius: var(--r-lg); }
.hubcard:hover, .seccard:hover { border-color: var(--blue); box-shadow: none; }
.hubcard b, .seccard b, .card b { font-family: var(--head); }

/* ---- tables that stay tables: numeric grids ---- */
#wrapper table.dbt:not(.cv) { border-collapse: separate; border-spacing: 0; border: 2px solid var(--card-line); border-bottom: 4px solid var(--blue); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
#wrapper table.dbt:not(.cv) th { background: var(--blue-d); font-family: var(--head); font-weight: 700; border-bottom: 3px solid var(--yellow); }
#wrapper table.dbt:not(.cv) tbody tr:nth-child(even) td { background: var(--panel-2); }
#wrapper table.dbt:not(.cv) tbody tr:nth-child(odd) td { background: var(--panel); }
#wrapper table.dbt:not(.cv) tbody tr:hover td { background: var(--blue-l); }
#wrapper table.dbt:not(.cv) tbody tr.sel td { background: var(--hilite); }
#wrapper table.dbt:not(.cv) tbody tr:last-child td { border-bottom: 0; }

/* ---- forms strip (inc/variants.php yv_strip): one tile per form, Puni Puni sprite or game art on a plate ---- */
.yforms ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 110px)); justify-content: center; gap: 6px; }
.yforms li { margin: 0; min-width: 0; }
.yforms li > a, .yforms li > span { display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; padding: 5px 4px 6px; border-radius: var(--r-lg);
  background: var(--panel-soft); border: 2px solid var(--card-line); text-decoration: none; color: var(--ink); box-sizing: border-box; }
#wrapper .yforms li > a { color: var(--ink); text-decoration: none; }
.yforms li > a:hover, .yforms li > a:focus { border-color: var(--blue); background: var(--panel); }
.yf-art { display: grid; place-items: center; width: 66px; height: 58px; border-radius: var(--r-xl); background: radial-gradient(circle at 50% 55%, var(--panel) 0, var(--panel-2) 100%); }
#wrapper .yf-art img { width: 60px; height: 54px; max-width: none; object-fit: contain; margin: 0; }
.yf-n { font: 700 11.5px/1.2 var(--head); text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.yf-tag { font: 500 var(--fs-2xs) var(--sans); color: var(--mut); }
.yf-more { margin: 6px 0 0; font-size: var(--fs-md); line-height: 1.7; }
.yf-more > a, .yf-more > span:not(.yf-ml) { display: inline-block; padding: 0 8px; margin: 0 2px 2px 0; border-radius: var(--r-md); background: var(--panel-soft); border: 1px solid var(--card-line); font: 700 var(--fs-sm) var(--head); }
.yf-ml { font: 500 var(--fs-xs) var(--sans); color: var(--mut); }
.ycard.gold .yforms li > a, .ycard.gold .yforms li > span, .ycard.gold .yf-more > a, .ycard.gold .yf-more > span:not(.yf-ml) { border-color: var(--card-gold-line); }
.ycard.gold .yforms li > a:hover { border-color: var(--card-gold-edge); }
.ycard.gold .yf-art { background: radial-gradient(circle at 50% 55%, var(--panel) 0, var(--hilite) 100%); }
.yl-forms { padding: 8px 12px 10px; border-top: 2px solid var(--card-gold-line); }
.yko-forms { margin: 18px 0 8px; }
.yko-forms h2 { margin: 0 0 6px; }
.yko-forms .yforms ul { grid-template-columns: repeat(auto-fit, minmax(96px, 120px)); }
@media (max-width: 560px) { .yko-forms .yforms ul { grid-template-columns: repeat(auto-fit, minmax(78px, 100px)); } }
/* item.php: chests and found spots per area (rows: kind + count, chance on the right) */
#chests .yc-row, #found .yc-row { grid-template-columns: minmax(0, 1fr) auto; }
#chests .yc-row .val, #found .yc-row .val { text-align: right; font: 800 var(--fs-base) var(--head); color: var(--link); }
.yc-cond { display: block; font-size: var(--fs-sm); color: var(--mut); }
.yc-say { font-size: var(--fs-sm); color: var(--mut); margin: 2px 0 6px; }
.ycards.kv .yc-row { grid-template-columns: minmax(0, 1fr) auto; }
.ycards.kv .yc-row .val { white-space: nowrap; }
#tpw .yc-b p { margin: 0; }
#wrapper .yc-art ~ .yc-t h3 img.medal, #wrapper .yc-art ~ .yc-t h3 img.iicon { display: none; }  /* the art slot already shows it */
.yc-b > * + .yc-stats { margin-top: 8px; }
#tpools .ycard { flex-basis: 100%; }
#tpools .yc-rows { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* icon tiles (inc/cards.php ytile): lists that are only a name and an icon, as on the DSTS site. Game icon 88 px
   (120 px in .mid), name under it, a grey line and a small meta line. */
.ycards.tiles { gap: 10px; align-items: stretch; }
.ycards.tiles > * { flex-basis: var(--tile-w); }
.ycards.tiles.mid > * { flex-basis: var(--tile-w-mid); }
.ytile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 9px; text-align: center; }
#wrapper .ytile .yt-a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; min-width: 0; max-width: 100%; }
#wrapper .ytile a.yt-a:hover .yt-n { color: var(--link); text-decoration: underline; }
#wrapper .ytile .yt-img { width: 88px; height: 88px; object-fit: contain; margin: 0; max-width: none; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--card-line); }
#wrapper .tiles.mid .ytile .yt-img { width: 120px; height: 120px; }
#wrapper .tiles.ukcards .ytile .yt-img { height: 175px; border: 0; background: none; border-radius: var(--r-xs); }
/* .small: 64 px source icons at their own size (hub topic grids) */
.ycards.tiles.small { gap: 8px; }
.ycards.tiles.small > * { flex-basis: var(--tile-w-small); }
#wrapper .tiles.small .ytile .yt-img { width: 64px; height: 64px; }
.ycards.tiles.small .ytile { padding: 8px 4px 7px; }
.ycards.tiles.small .yt-n { font-size: var(--fs-md); }
.ycards.tiles.sims > * { flex-basis: 120px; }
.ytile .yt-n { font: 800 var(--fs-lg)/1.2 var(--head); overflow-wrap: anywhere; }
.ytile .yc-sub { margin-top: 0; }
.yt-m { font: 500 var(--fs-sm)/1.35 var(--sans); color: var(--ink); }
.yt-m span { white-space: nowrap; }
.ytile .yt-p { position: relative; display: block; line-height: 0; }
.yt-q { position: absolute; right: -6px; bottom: -4px; padding: 1px 8px; border-radius: var(--r-lg); background: var(--yellow); color: var(--ink-on);
  font: 800 var(--fs-md)/1.4 var(--head); box-shadow: inset 0 0 0 2px #2a2238; }
/* prize cards (rewards, prizes, used-by): the icon large and centered on a white plate, name and lines under it */
.ycards.prizes { gap: 12px; align-items: stretch; }
.ycards.prizes > * { flex-basis: var(--prize-w); }
.ycards.prizes .ytile { padding: 14px 10px 12px; gap: 4px; }
#wrapper .ycards.prizes .yt-img { width: 128px; height: 128px; padding: 8px; box-sizing: border-box; border-radius: var(--r-pill); border: 2px solid var(--card-line);
  background: radial-gradient(circle at 50% 45%, var(--panel) 0, var(--panel) 55%, var(--panel-2) 100%); }
.ycards.prizes .yt-n { font-size: var(--fs-xl); }
.ycards.prizes .yt-q { font-size: var(--fs-lg); padding: 2px 10px; }

/* stat cards (ystat()): label on a small strip with the tab, one big value under it */
.ycards.stats { gap: 10px; align-items: stretch; }
.ycards.stats > * { flex-basis: var(--stat-w); }
.ystat { display: flex; flex-direction: column; text-align: center; }
.ystat .ys-l { display: block; padding: 4px 10px 5px; font: 800 var(--fs-sm) var(--head); letter-spacing: .04em; text-transform: uppercase; color: var(--link);
  background: url("../img/ui/titletab.png") left top / auto 100% no-repeat, var(--panel); border-bottom: 3px solid var(--blue); }
.ystat .ys-v { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 10px 10px 12px;
  font: 800 var(--fs-6xl)/1.2 var(--head); color: var(--ink); }
#wrapper .ystat .ys-v img { margin: 0; }

/* tones: the game's coloured text boxes. Any .ycard (and .ystat, .ytile) takes one; the strip stays white. */
.ycard.t-yellow { --card-bg: linear-gradient(#fffbe0, #ffef9a); --card-line: #e8c94a; color: var(--ink); }
.ycard.t-cyan { --card-bg: linear-gradient(#efffff, #b8f4fb); --card-line: #63cfe0; color: var(--ink); }
.ycard.t-green { --card-bg: linear-gradient(#f0fff3, #bff2cb); --card-line: #6fcf8a; color: var(--ink); }
.ycard.t-pink { --card-bg: linear-gradient(#fff1fd, #f6c6f1); --card-line: #e08ad8; color: var(--ink); }
.ycard.t-purple { --card-bg: linear-gradient(#f6f0ff, #dccbff); --card-line: #a98be8; color: var(--ink); }
.ycard.t-red { --card-bg: linear-gradient(#fff3f1, #ffd0c8); --card-line: #ef8f80; color: var(--ink); }
/* fusion cards (fusions.php): A + B = result, three 56 px icons in one row */
.ycards.fus { gap: 10px; align-items: stretch; }
.ycards.fus > * { flex-basis: var(--fus-w); }
.yfus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 4px; padding: 10px 6px 9px; text-align: center; }
#wrapper .yfus .yf { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--ink); text-decoration: none; min-width: 0; }
#wrapper .yfus a.yf:hover .yt-n { color: var(--link); text-decoration: underline; }
#wrapper .yfus .yt-img { width: 56px; height: 56px; object-fit: contain; margin: 0; max-width: none; border-radius: var(--r-sm); background: var(--panel); border: 1px solid var(--card-line); }
#wrapper .yfus .yf-r .yt-img { border: 2px solid var(--blue-d); }
.yfus .yt-n { font: 700 var(--fs-md)/1.2 var(--head); overflow-wrap: anywhere; }
.yfus .yf-r .yt-n { font-weight: 800; }
.yfus .yf-op { font: 800 var(--fs-3xl)/56px var(--head); color: var(--link); }
/* shops.php: item icon strip on the index cards, and a heading per shop above its item tiles */
.yshop-strip { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
#wrapper .yshop-strip img { width: 32px; height: 32px; margin: 0; object-fit: contain; }
.yshop { scroll-margin-top: 70px; margin-top: 22px; }
.yshop > p { margin: 2px 0 0; }
.ycard.cat-off, .ycard.mk-off { display: none !important; }
.mk-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 4px 4px 6px; }
.mk-row .pill { padding: 3px 10px 4px; font-size: var(--fs-sm); }
.mc-top { margin: 0 0 14px; }
.mc-set { margin: 0 0 6px; }
.mc-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; font: 700 var(--fs-lg) var(--head); background: var(--panel-soft); border: 1px solid rgba(0,0,0,.2); text-align: left; cursor: pointer; }
.mc-head .mc-sn { flex: 1; min-width: 0; }
.mc-head .mc-fam { color: var(--mut); font-weight: 400; font-size: var(--fs-md); }
.mc-head .mc-num { width: 70px; text-align: right; font-weight: 400; font-size: var(--fs-md); }
.mc-head .bar { flex: none; width: 120px; }
.mc-list { list-style: none; margin: 4px 0 8px; padding: 0; }
.mc-m { display: flex; align-items: center; gap: 10px; padding: 3px 8px; border-bottom: 1px solid rgba(0,0,0,.1); }
.mc-m img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.mc-m .mc-n { flex: 1; min-width: 0; }
.mc-m.mc-drag { opacity: .4; }
.mk-page { padding: 0 0 6px; }
.mk-page .pill { font-size: var(--fs-base); padding: 5px 14px 6px; }
.mk-bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; margin: 6px 0; }
.mk-bar .flab { font: 700 var(--fs-md)/30px var(--head); color: var(--mut); margin-right: 2px; }
.mk-n { display: inline-flex; align-items: center; gap: 2px; font: 700 var(--fs-md) var(--head); }
.mk-n .pill { min-width: 28px; padding: 3px 6px 4px; }
.mk-prog { display: flex; align-items: center; gap: 10px; margin: 6px 0; font: 700 var(--fs-base) var(--head); }
.ytile .mk-prog { justify-content: center; margin: 2px 8px 8px; font-size: var(--fs-md); }
.ytile .mk-prog .bar { flex: none; width: 70px; }
.filters.cats { margin: 10px 0 0; }
#wrapper .filters.cats img { width: 22px; height: 22px; margin: 0; }
.yt-m b { font-weight: 700; color: var(--link); }

/* phones: thin card grids (boss moves, item sources, Puni item lists) go two to a row, with a smaller header and no strip art */
@media (max-width: 600px) {
  :root { --card-w: 100%; --card-w-wide: 100%; --card-w-half: 100%; --card-w-thin: calc(50% - 4px); --tile-w: calc(50% - 4px); --tile-w-mid: calc(50% - 4px);
    --tile-w-small: calc((100% - 16px) / 3); --tile-w-big: calc(50% - 4px); --prize-w: calc(50% - 4px); --stat-w: calc(50% - 4px); --fus-w: 100%;
    --soul-pic: 132px; --soul-corner: 44px; }
  .ycards.thin { gap: 8px; }
  .ycards.thin .yc-h { padding: 6px 8px; gap: 6px; min-height: 0; }
  .ycards.thin .yc-h h3, body.shell #wrapper.dbpage .ycards.thin .yc-h h3 { font-size: var(--fs-base); }
  .ycards.thin .yc-art { width: 36px; height: 36px; }
  .ycards.thin .yc-art img { width: 26px; height: 26px; }
  .ycards.thin .yc-b { padding: 6px 8px 8px; font-size: var(--fs-md); }
  .ycards.thin .yc-st { padding: 2px 8px; font-size: var(--fs-sm); }
  .ycards.tiles { gap: 8px; }
  .ycards.tiles .ytile { padding: 8px 4px 7px; }
  .ycards.tiles .yt-n { font-size: var(--fs-md); }
  #wrapper .tiles.small .ytile .yt-img { width: 56px; height: 56px; }
  .ycards.prizes, .ycards.stats { gap: 8px; }
  #wrapper .ycards.prizes .yt-img { width: 96px; height: 96px; }
  .ycards.prizes .yt-n { font-size: var(--fs-base); }
  .ystat .ys-v { font-size: var(--fs-4xl); }
}
/* chest renders (img/chests/): card art slot and heading/key icons (yc_chest()) */
.yc-chest { flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
#wrapper .yc-chest img, #wrapper .h-chest img { box-shadow: none; background: none; border: 0; padding: 0; border-radius: 0; }
#wrapper .yc-chest img { max-width: 46px; max-height: 46px; width: auto; height: auto; object-fit: contain; margin: 0; }
/* Blasters role banner (img/ui/blasters-role-*.png, game art) at the top of a role card */
#wrapper .yc-role { display: block; width: 100%; max-width: 434px; height: auto; margin: 0 auto; box-shadow: none; background: none; border: 0; padding: 0; border-radius: 0; }
.h-chest { display: inline-block; vertical-align: middle; margin-right: 8px; }
#wrapper .h-chest img { width: auto; height: 34px; margin: 0; vertical-align: middle; }
.chest-key .card h3 { display: flex; align-items: center; gap: 4px; }
#wrapper .chest-key .h-chest img { height: 48px; }

/* big tiles (ytile 'fields' / 'badge', ycards_open('tiles big')): prize and "Used by" cards. 110 px picture on top, name and
   labelled fields centered under it; a Yo-kai's medal sits in the medal ring on the picture's corner. */
.ycards.tiles.big { gap: 12px; }
.ycards.tiles.big > * { flex-basis: var(--tile-w-big); }
#wrapper .tiles.big .ytile .yt-img { width: 110px; height: 110px; padding: 6px; box-sizing: border-box; object-fit: contain;
  background: radial-gradient(circle at 50% 45%, var(--panel) 0, var(--panel) 55%, var(--panel-2) 100%); }
/* .face: a Yo-kai with no 2D art shows its 64 px face icon, small in the middle of the plate instead of filling it */
#wrapper .tiles.big .ytile.face .yt-img { padding: 22px; }
/* trophies.php: the 60 px cup on the plate above the trophy name */
#wrapper .tiles.big.trophy .ytile .yt-img { padding: 16px; }
.tiles.big .ytile { padding: 12px 8px 10px; }
.tiles.big .ytile .yt-n { font-size: var(--fs-xl); }
.yt-pic { position: relative; display: block; }
.yt-badge { position: absolute; right: -10px; bottom: -6px; width: 38px; height: 38px; display: grid; place-items: center; background: url("../img/ui/medal_ring.png") center / contain no-repeat; }
#wrapper .yt-badge img { width: 36px; height: 36px; max-width: none; margin: 0; object-fit: contain; }
/* Soul Gem tiles (ytile 'corner', soul_tile_pic): the Yo-kai big, its Soul Gem icon small in the top right corner like the
   rank on a Yo-kai page (Leafy 2026-10-18) */
#wrapper .tiles.big .ytile .yt-pic.soulpic .yt-img { width: var(--soul-pic); height: var(--soul-pic); }
.yt-corner { position: absolute; top: -10px; right: -10px; }
#wrapper .yt-corner img { display: block; width: var(--soul-corner); height: var(--soul-corner); max-width: none; margin: 0; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.yt-f { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; width: 100%; margin: 6px 0 0; padding: 6px 0 0; border-top: 2px solid var(--card-line); }
.yt-f > div { min-width: 0; text-align: center; }
.yt-f dt { font: 700 var(--fs-xs)/1.3 var(--head); color: var(--link); }
.yt-f dd { margin: 0; font: 500 var(--fs-base)/1.35 var(--sans); color: var(--ink); }
.yt-f dd .cchip { margin: 0 3px; }
@media (max-width: 600px) {
  .ycards.tiles.big { gap: 8px; }
  #wrapper .tiles.big .ytile .yt-img { width: 96px; height: 96px; }
  #wrapper .tiles.big .ytile.face .yt-img { padding: 18px; }
  .yt-f { gap: 4px 10px; }
}

/* ---- game windows on the other cards (docs/LAYOUT.md "Game windows") ---- */
/* icon tiles in the Whisper window; small hub tiles keep the lilac box */
.ycard.ytile:not(.gold):not([class*=" t-"]) { border-image: var(--g-card); }
#wrapper .ycard.ytile:not(.gold):not([class*=" t-"]) { padding-left: 16px; padding-right: 16px; padding-bottom: 28px; }
#wrapper .ycards.tiles.small .ytile { border-image: var(--g-tile); padding: 10px 6px 9px; }
/* stat cards on the lilac box, no yellow header row (Leafy 2026-10-18) */
.ycard.ystat:not(.gold):not([class*=" t-"]) { border-image: var(--g-tile); border-image-width: 12px; padding: 4px; }
.ycard.ystat:not(.gold):not([class*=" t-"]) .ys-l { background: none; border-bottom: 0; box-sizing: border-box; }
/* db.css boxes and the card view of tables */
.card, .hubcard, .seccard { background: none; border: 0; border-radius: 0; border-image: var(--g-tile); --card-line: var(--mut-on); }
#wrapper table.dbt.cv tbody tr:not(.sel) { background: none; border: 12px solid transparent; border-radius: 0; border-image: var(--g-tile); padding: 0 2px; }
/* page title on the game's title bar */
body.shell #wrapper.dbpage h1:not(.yko-h1):not(.k-title), body.shell #wrapper .gintro ~ h2 { display: inline-block; border-image: var(--g-plate); padding: 4px 48px 6px 18px; }

/* .stack: the picture above the title, everything centred, on the lilac box (chests, sparkles, and trophies; Leafy 2026-10-18) */
.ycards.stack .ycard:has(> .yc-h) { border-image: var(--g-tile); border-image-width: 12px; padding: 8px 8px 10px; }
#wrapper .ycards.stack .yc-h { flex-direction: column; justify-content: center; gap: 4px; min-height: 0; padding: 4px 6px; text-align: center; }
#wrapper .ycards.stack .yc-h > .yc-t { margin-left: 0; align-items: center; }
#wrapper .ycards.stack .yc-art, #wrapper .ycards.stack .pt-art { width: var(--stack-art); height: var(--stack-art); background: none; }
#wrapper .ycards.stack :is(.yc-art, .pt-art) img { width: var(--stack-art); height: var(--stack-art); max-width: none; max-height: none; object-fit: contain; }
.ycards.stack .yc-b { text-align: center; }
.ycards.stack .places { justify-content: center; }
/* name cards: one line, cut with an ellipsis past about "Springdale Flower Road" (Leafy 2026-10-18); the full name is the h3 title */
#wrapper .ycards.thin .yc-h h3, #wrapper .ycards.thin .yc-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
#wrapper .ycards.thin .yc-t { flex: 1 1 0; }
#wrapper .ycards.thin.shopc > * { flex-basis: var(--card-w); }
