/* Pawn Champ - UI styling. Dark ornate panel under a pixel-art stage. */
/* Pixelify Sans is self-hosted so the game works offline (desktop builds, itch.io). It is a
   variable font: one file per script covers weights 400 to 700. */
@font-face { font-family: "Pixelify Sans"; font-weight: 400 700; font-display: swap;
  src: url(fonts/pixelify-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Pixelify Sans"; font-weight: 400 700; font-display: swap;
  src: url(fonts/pixelify-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Numbers: Pixelify Sans draws 5/8 and 2/8 too alike at small sizes, so digits and "$"
   come from Silkscreen, a blockier pixel face with very distinct numerals. unicode-range
   means only those characters swap; every letter stays Pixelify. Both fonts are OFL. */
@font-face { font-family: "Pawn Digits"; font-weight: 400; font-display: swap;
  src: url(fonts/silkscreen-400.woff2) format("woff2"); unicode-range: U+0024, U+0030-0039; }
@font-face { font-family: "Pawn Digits"; font-weight: 600 900; font-display: swap;
  src: url(fonts/silkscreen-700.woff2) format("woff2"); unicode-range: U+0024, U+0030-0039; }
:root {
  --ink: #e9e4da;
  --dim: #a59e92;
  --panel: #2a2a2e;
  --panel-2: #222226;
  --line: #6d6a66;
  --gold: #e2b04a;
  --red: #d0584a;
  --green: #7cc47a;
  --blue: #7ab0e8;
  --fs: clamp(11px, 1.35vw, 17px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #121214; color: var(--ink);
  font-family: "Pawn Digits", "Pixelify Sans", "Trebuchet MS", system-ui, sans-serif; font-size: var(--fs); }
body { display: flex; justify-content: center; align-items: flex-start; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

#game { position: relative; width: min(100vw, calc((100vh - 4px) * 1.25), 1400px); user-select: none; }
/* the panel and menu buttons belong to a running game: keep their space but hide them on the title screen */
#game:has(> #title:not(.hidden)) > #panel, #game:has(> #title:not(.hidden)) > #menu { visibility: hidden; }

/* ---------------------------------------------------------------- stage */
#stage { position: relative; width: 100%; aspect-ratio: 320 / 180; overflow: hidden; background: #000; }
#scene { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .5s; }
#fade.on { opacity: 1; }

.plaque { position: absolute; left: 1.5%; top: 2.5%; padding: .35em 2.2em .35em 1.6em;
  background: #c9c4bb; color: #2a2a2e; font-size: 1.15em; letter-spacing: .02em;
  clip-path: polygon(0.8em 0, calc(100% - 0.8em) 0, 100% 50%, calc(100% - 0.8em) 100%, 0.8em 100%, 0 50%);
  box-shadow: inset 0 0 0 2px #8a857c; }

#toasts { position: absolute; right: 0; top: 14%; display: flex; flex-direction: column; gap: .4em; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: .5em; background: rgba(24,24,28,.92); padding: .35em 1em .35em .6em;
  border: 1px solid #6d6a66; border-right: none; animation: toastIn .3s ease-out; max-width: 22em;
  clip-path: polygon(0.7em 0, 100% 0, 100% 100%, 0.7em 100%, 0 50%); }
.toast img { width: 1.8em; height: 1.8em; image-rendering: pixelated; }
.toast.out { opacity: 0; transition: opacity .6s; }
#toasts.held { display: none; } /* behind the narration box: wait, then slide in again (js/game.js toast) */
@keyframes toastIn { from { transform: translateX(100%); } to { transform: none; } }

/* speech bubble: cream card with a stepped pixel border and a stepped tail */
.bubble { position: absolute; transform: translate(-50%, -100%); margin-top: -14px; background: #f4efe2; color: #1e1c22;
  padding: .5em .85em .6em; max-width: 34%; min-width: 9em; line-height: 1.3; pointer-events: none; font-size: 1.05em;
  box-shadow: 0 -3px 0 0 #1e1c22, 0 3px 0 0 #1e1c22, -3px 0 0 0 #1e1c22, 3px 0 0 0 #1e1c22, 0 7px 0 0 rgba(0,0,0,.28); }
.bubble::after { content: ""; position: absolute; left: var(--tail, 50%); top: 100%; margin-top: 0; margin-left: -6px; width: 24px; height: 20px; background-size: 100% 100% !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='15' shape-rendering='crispEdges'%3E%3Cpath fill='%231e1c22' d='M0 0h18v3h-3v3h-3v3h-3v3h-3v3H3V0z'/%3E%3Cpath fill='%23f4efe2' d='M3 0h12v3h-3v3h-3v3H6v3H3z'/%3E%3C/svg%3E") no-repeat; }
.bubble .who { position: absolute; left: .5em; top: 0; transform: translateY(-100%); margin-top: -3px; background: #1e1c22; color: var(--gold);
  font-size: .78em; padding: .1em .55em .05em; letter-spacing: .03em; }
.bubble .who:empty { display: none; }
.bubble .more { color: #8a6a2a; }
.more { display: none; position: absolute; right: .45em; bottom: .15em; font-size: .6em; color: var(--gold); animation: blink 1s infinite; }
.done .more { display: block; }
@keyframes blink { 50% { opacity: .2; } }

.narration { position: absolute; left: 50%; top: 6%; transform: translateX(-50%); width: 62%;
  background: #1c1b24; color: #ece6d6; padding: .8em 1.2em 1em; line-height: 1.45;
  box-shadow: 0 -3px 0 0 #c9c4bb, 0 3px 0 0 #c9c4bb, -3px 0 0 0 #c9c4bb, 3px 0 0 0 #c9c4bb, 0 8px 0 0 rgba(0,0,0,.35); }
.narration .txt { white-space: pre-line; }

.choices { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .35em; width: 56%; }
.choices button, .modal-box button { background: #3a3a40; border: 2px solid #8a857c; padding: .45em .8em; text-align: left; }
.choices button:hover:not(:disabled), .modal-box button:hover:not(:disabled) { background: #4c4c54; border-color: var(--gold); }
.choices button:disabled, .card button:disabled, .modal-box button:disabled { opacity: .45; cursor: not-allowed; }
.choices button .key { color: var(--gold); margin-right: .5em; }
/* the shop day's quiet spells (js/day.js) */
.hurry { position: absolute; right: 2%; bottom: 4%; background: rgba(30,30,34,.82); border: 2px solid #8a857c; color: var(--ink); padding: .4em .9em; font-size: .9em; }
.hurry:hover { border-color: var(--gold); background: #3a3a40; }
.hurry.on { color: var(--gold); border-color: var(--gold); }
.choices button .hint { color: var(--dim); font-size: .85em; margin-left: .4em; }

/* --------------------------------------------------------------- item card */
.card { position: absolute; left: 1.5%; top: 13%; width: 33%; max-height: 84%; overflow: auto;
  background: linear-gradient(#ece2c8, #dccfae); color: #2a2018; border: 2px solid #5a3a24; padding: .7em .8em;
  box-shadow: 0 0 0 3px rgba(0,0,0,.35), 4px 4px 0 rgba(0,0,0,.3); font-size: .92em; }
.card h3 { margin: 0 0 .2em; font-size: 1.15em; }
.card .row { display: flex; gap: .7em; align-items: center; }
.card .icon { width: 4.2em; height: 4.2em; image-rendering: pixelated; background: #c9b890; border: 1px solid #8a6a40; padding: .2em; }
.card .meta { font-size: .88em; line-height: 1.35; }
.card .ask { font-size: 1.2em; margin: .35em 0; }
.card .ask b { color: #7a2a10; }
.card .clues { margin: .3em 0; padding-left: 1.1em; font-size: .9em; }
.card .clues li { margin-bottom: .15em; }
.card .clues .bad { color: #9a2010; }
.card .clues .good { color: #1e6a2a; }
.card .tag { display: inline-block; padding: 0 .4em; font-size: .78em; border-radius: 2px; color: #fff; margin-right: .3em; }
.card .tag.fake { background: #9a2010; } .card .tag.hot { background: #a85a10; } .card .tag.ok { background: #3a7a3a; }
.card .btns { display: grid; grid-template-columns: 1fr 1fr; gap: .3em; margin-top: .5em; }
/* Card buttons sit on the cream card, so they get their own light paper style. They used to share
   the dark grey stage-choice style, but inherited the card's dark ink: dark text on dark grey. */
.card button { background: #f7f0dc; border: 2px solid #8a6a40; color: #2a2018; padding: .45em .8em; text-align: left; }
.card button:hover:not(:disabled) { background: #fffaea; border-color: #c08a2a; }
.card button:disabled { background: #d6c9a8; border-style: dashed; color: #6a5a48; opacity: .7; }
.card button .meta { color: #6a5a48; }
.card .btns button { background: #4a3a2a; color: #f2eadb; border-color: #2a1a10; text-align: center; padding: .4em .3em; }
.card .btns button:hover:not(:disabled) { background: #5e4a34; border-color: #c08a2a; }
.card .btns button:disabled { background: #4a3a2a; color: #f2eadb; border-style: dashed; opacity: .45; }
.card .btns button.wide { grid-column: span 2; }
.card .haggle { display: flex; gap: .4em; align-items: center; margin-top: .4em; grid-column: span 2; }
.card .haggle input { flex: 1; accent-color: #7a2a10; }
.card .haggle .val { min-width: 2.4em; text-align: right; font-weight: bold; }
.card .note { font-size: .82em; color: #6a5a48; margin-top: .3em; }
.card .sell-list { display: flex; flex-direction: column; gap: .3em; margin-top: .4em; }
.card .sell-list button { display: flex; align-items: center; gap: .5em; text-align: left; }
.card .sell-list img { width: 1.8em; height: 1.8em; image-rendering: pixelated; }

/* --------------------------------------------------------------- panel */
#panel { display: grid; grid-template-columns: 26% 1fr 22%; gap: 2%; padding: 1.2% 2%;
  background:
    radial-gradient(circle at 92% 50%, rgba(255,255,255,.04) 0 18%, transparent 19%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 6px, transparent 6px 12px),
    var(--panel);
  border-top: 3px solid #4a4a4e; box-shadow: inset 0 2px 0 #1a1a1c; min-height: 9em; }
#stock-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 3px; border: 2px solid #8a857c; background: #1c1c20; align-self: center; }
.slot { aspect-ratio: 1; background: #2e2e33; border: 1px solid #44444a; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; }
.slot img { width: 80%; height: 80%; image-rendering: pixelated; }
.slot.empty::before { content: ""; }
.slot .flag { position: absolute; right: 0; bottom: 0; font-size: .42em; padding: 0 1px; border-radius: 2px; line-height: 1.1; }
.slot .flag.held { background: var(--blue); color: #111; }
.slot .flag.fake { background: var(--red); color: #fff; }
.slot .flag.hot { background: #d08a2a; color: #111; }
.slot .flag.curio { background: #9a5ad0; color: #fff; }

#resources { display: grid; grid-template-columns: repeat(4, 1fr); align-content: center; row-gap: .6em; }
.res { display: flex; align-items: center; justify-content: center; gap: .45em; position: relative; padding: .2em 0; }
.res .ico { font-size: 1.5em; line-height: 1; filter: saturate(.9); }
.res .num { font-size: 1.25em; }
.res .lbl { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-size: .7em; color: var(--dim); white-space: nowrap; }
.res.small .num { font-size: 1em; }
.res.small .ico { font-size: 1.1em; }
.bar { width: 3.2em; height: .45em; background: #1a1a1c; border: 1px solid #555; }
.bar i { display: block; height: 100%; }
.divider { grid-column: 1 / -1; height: 1px; background: linear-gradient(90deg, transparent, #6d6a66, transparent); margin: .2em 0; position: relative; }
.float { position: absolute; left: 50%; top: -0.4em; transform: translateX(-50%); font-weight: bold; animation: floatUp 1.4s ease-out forwards; pointer-events: none; }
.float.up { color: var(--green); } .float.down { color: var(--red); }
@keyframes floatUp { to { transform: translate(-50%, -1.6em); opacity: 0; } }

#panel-right { align-self: center; text-align: center; font-size: .9em; color: var(--dim); line-height: 1.5; }
#panel-right .big { font-size: 1.25em; color: var(--ink); }
#panel-right .clock { color: var(--gold); font-size: 1.1em; letter-spacing: .04em; }
#panel-right button { margin-top: .4em; background: #3a3a40; border: 1px solid #8a857c; padding: .35em .9em; }

#menu { display: flex; justify-content: space-around; padding: 1% 3% 1.5%; background: var(--panel-2); border-top: 1px solid #3a3a3e; }
.plaque-btn { background: #c9c4bb; color: #2a2a2e; border: none; padding: .45em 1.6em; font-size: 1.05em; letter-spacing: .03em; text-transform: uppercase;
  clip-path: polygon(0.9em 0, calc(100% - 0.9em) 0, 100% 50%, calc(100% - 0.9em) 100%, 0.9em 100%, 0 50%);
  box-shadow: inset 0 0 0 2px #8a857c; }
.plaque-btn:hover { background: #e4dfd5; }

/* --------------------------------------------------------------- modal */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal-box { width: min(92vw, 760px); max-height: 88vh; overflow: auto; background: #26262a; border: 2px solid #8a857c;
  box-shadow: 0 0 0 4px #1a1a1c; padding: 1.2em 1.5em; line-height: 1.45; }
.modal-box h2 { margin: 0 0 .5em; font-weight: normal; letter-spacing: .04em; color: #f0ead8; border-bottom: 1px solid #555; padding-bottom: .3em; }
.modal-box h3 { margin: 1em 0 .3em; font-weight: normal; color: var(--gold); }
.modal-box table { width: 100%; border-collapse: collapse; }
.modal-box td, .modal-box th { padding: .3em .4em; border-bottom: 1px solid #3a3a3e; text-align: left; vertical-align: middle; }
.modal-box th { color: var(--dim); font-weight: normal; font-size: .85em; }
.modal-box td img { width: 1.9em; height: 1.9em; image-rendering: pixelated; vertical-align: middle; }
.modal-box .actions { display: flex; gap: .6em; justify-content: flex-end; margin-top: 1em; flex-wrap: wrap; }
.modal-box .muted { color: var(--dim); }
.modal-box .good { color: var(--green); } .modal-box .bad { color: var(--red); }
.modal-box .log { max-height: 16em; overflow: auto; font-size: .9em; }
.modal-box .log div { padding: .15em 0; border-bottom: 1px dotted #3a3a3e; }
.modal-box td button { padding: .25em .6em; font-size: .9em; }
/* the event calendar */
#panel-right .tonight { color: var(--gold); font-size: .85em; line-height: 1.25; margin-top: .2em; }
.modal-box table.calendar { table-layout: fixed; }
.calendar th:first-child { width: 4.6em; }
.calendar td { vertical-align: top; height: 3.6em; border: 1px solid #3a3a3e; padding: .25em; }
.calendar td.today { background: #34322a; box-shadow: inset 0 0 0 2px var(--gold); }
.calendar td.past { background: #1e1e22; }
.cal-ev { font-size: .78em; line-height: 1.2; border-left: 3px solid; padding: .1em .3em; margin-bottom: .25em; background: #2e2e34; }
.cal-ev .where { display: block; color: var(--dim); font-size: .9em; }
.cal-ev.done { opacity: .55; }
.cal-legend { font-size: .8em; color: var(--dim); }
.cal-key { border-left: 3px solid; padding: 0 .4em; margin-right: .5em; white-space: nowrap; }

/* ------------------------------------------------- title, pause, settings (js/menus.js) */
/* Modern look: a neon shop sign over the dusk shop, flat dark cards, plain sans-serif buttons. */
:root { --neon: #ff5fa2; --neon-2: #5fe3ff; --card: rgba(18,18,22,.94); --btn: #f1efe9; --btn-ink: #1c1c20; }
#title { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6em;
  padding: 1.5% 0 3%; box-sizing: border-box;
  background: radial-gradient(ellipse at center, rgba(8,8,14,.45), rgba(8,8,14,.88)); }
/* a menu taller than the space left under the sign scrolls as one piece (Storybook, New game on small windows) */
#title .title-menu { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 4px; }
#title .title-sign, #title .title-sub { flex-shrink: 0; }
#title .book-list { max-height: none; overflow: visible; }
#title .menu-card > .menu-list:last-child { position: sticky; bottom: -1.2em; background: var(--card); padding: .5em 0 1.2em; margin-bottom: -1.2em; } /* Back stays in reach */
.title-sign { display: flex; gap: .45em; font-family: "Arial Rounded MT Bold", "Helvetica Neue", Arial, sans-serif; font-weight: 700;
  font-size: 4em; letter-spacing: .06em; line-height: 1; padding: .18em .4em; border: 2px solid rgba(95,227,255,.35); border-radius: .25em;
  box-shadow: 0 0 18px rgba(95,227,255,.15), inset 0 0 18px rgba(95,227,255,.1); }
.neon { color: #ffe8f2; text-shadow: 0 0 4px #fff, 0 0 10px var(--neon), 0 0 22px var(--neon), 0 0 40px var(--neon); animation: flicker 6s infinite; }
.neon.alt { color: #e8fbff; text-shadow: 0 0 4px #fff, 0 0 10px var(--neon-2), 0 0 22px var(--neon-2), 0 0 40px var(--neon-2); animation: none; }
@keyframes flicker { 0%, 91%, 93%, 96%, 100% { opacity: 1; } 92%, 95% { opacity: .35; } }
.title-sub { color: #d6d2ca; letter-spacing: .08em; font-size: .9em; text-transform: uppercase; margin-bottom: .6em; }
.title-menu { display: flex; flex-direction: column; align-items: center; }
.title-hint { position: absolute; bottom: 3%; font-size: .75em; color: #8d8a84; }
.title-version { position: absolute; bottom: 3%; right: 2.5%; font-size: .65em; color: #6f6c67; }
#title:has(.menu-card) .title-hint { display: none; } /* the taller settings card would cover it */

#pause { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(6,6,10,.62); backdrop-filter: blur(2px) grayscale(.4); }
.menu-card { background: var(--card); border: 1px solid #3c3c44; border-radius: 10px; padding: 1.1em 1.4em 1.2em;
  width: min(90vw, 26em); box-shadow: 0 10px 30px rgba(0,0,0,.5); line-height: 1.45; }
.menu-card h2 { margin: 0 0 .5em; font-weight: 600; font-size: 1.3em; letter-spacing: .02em; }
.menu-card p { margin: .2em 0 .6em; }
.menu-card .muted { color: var(--dim); font-size: .9em; }
.menu-list { display: flex; flex-direction: column; gap: .45em; margin-top: .6em; min-width: 14em; }
.menu-btn { background: var(--btn); color: var(--btn-ink); border: none; border-radius: 6px; padding: .55em 1.2em; font-weight: 600;
  font-size: 1.05em; text-align: center; transition: transform .08s, background .12s; display: flex; flex-direction: column; align-items: center; }
.menu-btn small { font-weight: 400; font-size: .72em; color: #5a5a62; }
.menu-btn:hover:not(:disabled), .menu-btn:focus-visible { background: #fff; transform: translateY(-1px); outline: 2px solid var(--neon-2); outline-offset: 2px; }
.menu-btn.quiet { background: transparent; color: var(--dim); border: 1px solid #44444c; font-weight: 400; }
.menu-btn.quiet:hover:not(:disabled) { background: #2a2a30; color: var(--ink); }
.menu-btn:disabled { opacity: .4; cursor: not-allowed; }
.menu-row { display: grid; grid-template-columns: 6.5em 1fr auto; align-items: center; gap: .8em; margin: .7em 0; }
.menu-row input[type=range] { width: 100%; accent-color: var(--neon-2); }
.menu-row b { min-width: 2em; text-align: right; font-weight: 600; }
.seg { display: flex; grid-column: span 2; border: 1px solid #4a4a52; border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; background: transparent; border: none; padding: .35em .2em; font-size: .9em; color: var(--dim); }
.seg button + button { border-left: 1px solid #4a4a52; }
.seg button[aria-checked=true] { background: var(--btn); color: var(--btn-ink); font-weight: 600; }
.menu-sample { min-height: 2.9em; font-style: italic; color: #cfcac0; background: rgba(0,0,0,.3); border-radius: 4px; padding: .4em .6em; }
.menu-card.credits { width: min(90vw, 36em); } /* wide, so each credit stays on one line and Back fits */
.credits dl { display: grid; grid-template-columns: auto 1fr; gap: .25em 1em; margin: 0 0 .6em; }
.credits dt { color: var(--dim); font-size: .9em; }
.credits dd { margin: 0; }
.menu-help { margin: 0 0 .4em; padding-left: 1.2em; }
.menu-help li { margin-bottom: .25em; }
.card .note.want { color: #2a6a3a; font-weight: bold; }

/* goals (js/goals.js) */
.goal h3 { margin-bottom: .2em; }
.goal p { margin: .2em 0; }
.goal-bar { height: 6px; background: #2e2e33; border: 1px solid #44444a; margin: .3em 0 .6em; }
.goal-bar i { display: block; height: 100%; background: var(--green); }
.goal-steps { list-style: none; padding-left: .4em; margin: .2em 0 .6em; }

/* new game: run code; title: storybook */
.seed-field { display: flex; flex-direction: column; gap: .3em; margin: .4em 0 .2em; font-size: .9em; color: var(--dim); }
.seed-field input { font: inherit; font-size: 1.05em; padding: .4em .6em; border-radius: 6px; border: 1px solid #44444c; background: #18181c; color: #eee; }
.storybook { text-align: left; }
.book-list { max-height: 15.5em; overflow-y: auto; margin-bottom: .6em; padding-right: .3em; }
.book-quest { border-top: 1px solid #33333a; padding: .5em 0 .1em; }
.book-quest p { margin: .2em 0 .3em; }
.book-quest.unmet b { color: var(--dim); }

/* cards (js/cards.js, docs/CARDS.md): index cards from Odile's card file */
.menu-card:has(.card-file) { width: min(94vw, 42em); }
.card-file h3 { margin: .6em 0 .1em; font-size: 1em; }
.card-row { display: flex; gap: .55em; overflow-x: auto; padding: .3em .1em .6em; scroll-snap-type: x proximity; }
.card-row.deal .index-card { animation: deal .45s ease-out backwards; }
.card-row.deal .index-card:nth-child(2) { animation-delay: .25s; }
.card-row.deal .index-card:nth-child(3) { animation-delay: .5s; }
.card-row.deal .index-card:nth-child(n+4) { animation-delay: .75s; }
@keyframes deal { from { transform: translate(-30px, -10px) rotate(-6deg); opacity: 0; } }
.index-card { flex: 0 0 11.5em; scroll-snap-align: start; background: #f2ead8; color: #2a2620; border-radius: 3px;
  border-top: 5px solid var(--quest, #b8332a); padding: .45em .6em .5em; font-size: .78em; line-height: 1.35; text-align: left;
  box-shadow: 0 2px 0 #c8bea6, 0 4px 10px rgba(0,0,0,.35);
  background-image: repeating-linear-gradient(#f2ead8 0 1.32em, #dde5ec 1.32em calc(1.32em + 1px)); background-position: 0 1.9em; }
.index-card[data-card] { cursor: pointer; transition: transform .1s; }
.index-card[data-card]:hover { transform: translateY(-2px); }
.index-card.picked { outline: 3px solid var(--neon-2); outline-offset: 1px; transform: translateY(-3px); }
.index-card.used { opacity: .55; text-decoration: line-through; }
.index-card.blank { background: #2a2a30; background-image: none; color: var(--dim); box-shadow: none; border-top-color: #44444c; }
.index-card p { margin: .25em 0; }
.index-card .muted { color: #8d8a84; font-size: 1em; }
.ic-top { display: flex; flex-direction: column; gap: .05em; }
.ic-top b { font-size: 1.08em; }
.ic-suit { font-size: .85em; color: #7a6a50; text-transform: uppercase; letter-spacing: .06em; }
.index-card.suit-paper .ic-suit::after { content: ' \2605'; color: #b8332a; } /* the stamp */
.ic-price { color: #8a2a1a; font-style: italic; }
.ic-line { color: #4a5a7a; font-style: italic; }
.ic-odile { font-style: italic; color: #cfcac0; }
#choices button.card-choice { border-left: 4px solid var(--neon-2); }
#choices button.card-choice::before { content: '\1F5C2  '; }
#title .menu-card:has(.card-file) { max-height: 62vh; overflow-y: auto; }

/* ---------------------------------------------------------------- controller (js/gamepad.js) */
#pad-cursor { position: fixed; z-index: 30; pointer-events: none; border: 3px solid var(--gold); border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 10px 2px rgba(255,200,80,.55); transition: left .08s, top .08s, width .08s, height .08s;
  animation: pad-pulse 1.1s ease-in-out infinite; }
#pad-cursor.spot { border-style: dashed; border-radius: 6px; }
#pad-cursor.hidden { display: none; }
@keyframes pad-pulse { 50% { box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 16px 4px rgba(255,200,80,.85); } }
.pad-only { display: none; }
body.pad .pad-only { display: inline; }
body.pad .kb-only { display: none; }
body.pad .choices button .key { display: none; }
body.pad button:focus { outline: none; }

/* ---------------------------------------------------------------- the bag (js/bag.js, docs/ITEMS_IN_USE.md) */
#choices button.bag-choice { border-left: 4px solid var(--gold); }
#choices button .ch-ico, .h-ico { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; margin-right: .4em; }
.bag-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35em; max-height: 46vh; overflow-y: auto; margin: .5em 0; }
.modal-box button.bag-item { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: .45em; align-items: center; }
.bag-item img { grid-row: span 2; width: 28px; height: 28px; image-rendering: pixelated; }
.bag-item .tags i { font-style: normal; font-size: .82em; background: #24242a; color: #cfc6b0; border-radius: 3px; padding: 0 .35em; margin-right: .25em; }
.bag-item.match { border-color: #8a7a4a; }
.modal-box button.bag-item.on { border-color: var(--gold); background: #4a4636; box-shadow: inset 0 0 0 1px var(--gold); }
.cal-ev .where.bring { color: #c8a050; }
.diff-pick { display: flex; gap: .4em; margin: .4em 0; }
.diff-pick button { flex: 1; background: #f0eee8; color: #2a2a2e; border: 2px solid transparent; border-radius: 4px; padding: .35em .8em; cursor: pointer; font: inherit; }
.diff-pick button.on { background: #e8c060; color: #1a1a1e; border-color: #8a6a20; }
