/* guildle's styles, part 10 of 10 (stash.css). Hero chatter, the stash, the Quartermaster (shop), using items and bringing heroes back.
   The parts load in order (index.html) and later rules build on earlier ones. */

/* ================================================================ the heroes' chatter (chatter.js)
   A little speech bubble over a hero's card now and then. It sits above the card's top edge, its
   tail pointing down at the card; two bonded heroes talking lean their bubbles apart. */
.hand-card.talking { z-index: 95 !important; }
.chat-bubble { position: absolute; left: calc(50% + var(--lean, 0%) + var(--shift, 0px)); bottom: calc(100% + 16px); z-index: 20; pointer-events: none;
  transform: translate(-50%, 0); width: max-content; max-width: max(150px, min(240px, calc(var(--fw, 120px) * 1.7)));
  padding: 7px 11px 8px; border-radius: 12px; background: #fffaf0; color: #2b2118; border: 1px solid rgba(107, 79, 42, .55);
  box-shadow: 0 6px 16px rgba(43, 33, 24, .28); font: italic 500 .86rem/1.25 var(--serif); text-align: center; text-wrap: balance; white-space: normal; }
.chat-bubble::after { content: ""; position: absolute; left: calc(50% - var(--lean, 0%) - var(--shift, 0px)); bottom: -7px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg);
  background: #fffaf0; border-right: 1px solid rgba(107, 79, 42, .55); border-bottom: 1px solid rgba(107, 79, 42, .55); }
.adv-party .chat-bubble { bottom: calc(100% + 38px); } /* above the activity badge and health */
.adventure.result .adv-party .chat-bubble { bottom: calc(100% + 34px); }
@media (max-width: 560px) { .chat-bubble { font-size: .74rem; padding: 5px 8px 6px; max-width: 150px; } .adv-party .chat-bubble { bottom: calc(100% + 30px); } }

/* ================================================================ the stash (stash.js)
   A plain list inside a stitched border: one line per stack, with its picture, name, what it does,
   how many and Use. Lines can be dragged into any order. The gold is a line too; after the last, the next empty space; under it, how full it is and Upgrade Stash. */
#tab-stash { --stitch: rgba(240, 207, 142, .5); --stitch-soft: rgba(240, 207, 142, .22); position: relative; min-width: 0; grid-template-columns: minmax(0, 1fr); }
:root[data-theme="light"] #tab-stash { --stitch: rgba(143, 108, 52, .6); --stitch-soft: rgba(143, 108, 52, .3); }
.stash-waiting { margin: 0 0 12px; padding: 8px 12px; border: 1px dashed var(--brass-dim); border-radius: 5px; color: var(--gold); font-size: .88rem; }
:root[data-theme="light"] .stash-waiting { color: #8a6414; }
/* Each item's 32×32 pixel-art picture, drawn crisply. */
.inv-ic { display: block; width: 36px; height: 36px; background-image: var(--img, none); background-position: center; background-size: contain; background-repeat: no-repeat; image-rendering: pixelated; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .5)); pointer-events: none; }
.inv-ic.i-gold { --img: url(../img/items/gold.png?v=530); }
.inv-ic.i-coin { --img: url(../img/items/coin.png?v=530); }
.inv-ic.i-ticket { --img: url(../img/items/ticket.png?v=530); }
.inv-ic.i-letter_uncommon { --img: url(../img/items/letter_uncommon.png?v=530); }
.inv-ic.i-letter_rare { --img: url(../img/items/letter_rare.png?v=530); }
.inv-ic.i-letter_epic { --img: url(../img/items/letter_epic.png?v=530); }
.inv-ic.i-letter_legendary { --img: url(../img/items/letter_legendary.png?v=530); }
.inv-ic.i-draught { --img: url(../img/items/draught.png?v=530); }
.inv-ic.i-hourglass { --img: url(../img/items/hourglass.png?v=530); }
.inv-ic.i-elixir { --img: url(../img/items/elixir.png?v=530); }
.inv-ic.i-campfire { --img: url(../img/items/campfire.png?v=530); }
.inv-ic.i-tome { --img: url(../img/items/tome.png?v=530); }
.inv-ic.i-prism { --img: url(../img/items/prism.png?v=530); }
.inv-ic.i-revivify { --img: url(../img/items/revivify.png?v=530); }
.inv-ic.i-potential { --img: url(../img/items/potential.png?v=530); }
.inv-ic.i-honour_kingbreaker { --img: url(../img/items/honour_kingbreaker.png?v=530); }
.inv-ic.i-honour_deepsworn { --img: url(../img/items/honour_deepsworn.png?v=530); }
/* An item's rarity: a small squared label in the rarity's colour. */
.rar-tag { display: inline-block; margin-left: 8px; padding: 2px 5px; border-radius: 5px; vertical-align: 2px; font: 800 .66rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: #686c64; }
.rar-tag.r-uncommon { background: #2f7a45; }
.rar-tag.r-rare { background: var(--r-rare); }
.rar-tag.r-epic { background: var(--r-epic); }
.rar-tag.r-legendary { background: var(--r-legendary); color: #2b1f05; }
.inv-more-who select { font: 600 .82rem var(--sans); padding: 5px 8px; border-radius: 5px; border: 1px solid #6b4f2a; background: #1b120a; color: var(--gold-hi); }
/* Under the list: how full the stash is, and Upgrade Stash. */
.cap { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 12px 4px 0; font: 600 .86rem var(--sans); color: var(--text-dim); }
.cap-bar { width: 120px; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); overflow: hidden; }
.cap-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b8862a, #f0cf6e); transition: width .4s; }
.cap-grow { font: 600 .82rem var(--sans); color: var(--gold-hi); background: #1b120a; border: 1px solid #6b4f2a; border-radius: 5px; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.cap-grow b { font-weight: 800; color: var(--gold); margin-left: 4px; }
.cap-grow:hover { background: #2a1d10; }
.cap-grow.armed { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.cap-grow.short { opacity: .55; }
/* The stitched border, and one line per stack. */
.inv { position: relative; border-radius: 16px; padding: 14px 10px; min-height: 60px; }
.inv::before { content: ""; position: absolute; inset: 7px; border: 2px dashed var(--stitch); border-radius: 11px; pointer-events: none; }
.inv-row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 10px 14px; border-radius: 5px;
  cursor: grab; color: var(--text); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: pan-y; -webkit-touch-callout: none; }
.inv-row + .inv-row::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; border-top: 1px dashed var(--stitch-soft); }
.inv-row:hover { background: rgba(255, 255, 255, .03); }
:root[data-theme="light"] .inv-row:hover { background: rgba(43, 33, 24, .04); }
.inv-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.inv-nm { min-width: 0; }
.inv-nm b { display: block; font: 400 1.15rem/1.15 var(--serif); }
.inv-nm small { display: block; margin-top: 2px; font: italic .92rem/1.35 var(--serif); color: var(--text-dim); }
.inv-qty { font: 800 1rem var(--sans); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.inv-qty::before { content: "×"; opacity: .7; font-weight: 600; margin-right: 1px; }
.inv-act { min-height: var(--btn-h); font: var(--btn-font); color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-line); border-radius: var(--btn-r); padding: 7px 14px; min-width: 64px; cursor: pointer; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.inv-act:hover:not(:disabled) { background: #2a1d10; }
.inv-act:disabled { opacity: .45; cursor: default; }
.inv-who { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font: 600 .84rem var(--sans); color: var(--text-dim); }
.inv-who button { font: 700 .82rem var(--sans); border: 1px solid #6b4f2a; background: #1b120a; color: var(--gold-hi); border-radius: 5px; padding: 6px 10px; cursor: pointer; }
.inv-who button small { opacity: .75; font-weight: 600; }
.inv-qty.gold::before { content: none; }
.inv-qty.gold::after { content: " gold"; font-weight: 600; opacity: .7; }
.inv-act-none { min-width: 64px; }
/* After the last line: the next empty space, and how many are left. */
.inv-slot { position: relative; display: flex; align-items: center; gap: 14px; margin: 6px 4px 2px; padding: 10px; border: 1px dashed var(--stitch-soft); border-radius: 5px;
  font: italic .95rem var(--serif); color: var(--text-dim); }
.inv-slot-ic { width: 36px; height: 36px; border-radius: 5px; background: rgba(0, 0, 0, .18); box-shadow: inset 0 1px 4px rgba(0, 0, 0, .35); }
:root[data-theme="light"] .inv-slot-ic { background: rgba(43, 33, 24, .07); box-shadow: inset 0 1px 3px rgba(43, 33, 24, .2); }
.inv-slot.full { color: #e0a080; border-color: rgba(224, 160, 128, .45); }
/* Carrying a line: it fades where it was, a copy follows the pointer, a gold line shows where it will go. */
.inv-row.lifted { opacity: .3; }
.inv-row.gap-before::after, .inv-row.gap-after::after { content: ""; position: absolute; left: 10px; right: 10px; height: 3px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 8px rgba(240, 207, 142, .7); pointer-events: none; }
.inv-row.gap-before::after { top: -2px; }
.inv-row.gap-after::after { bottom: -2px; }
.inv-ghost { position: fixed; z-index: 60; margin: 0; box-sizing: border-box; pointer-events: none; background: var(--felt, #151c30); border: 1px solid var(--brass-dim); box-shadow: 0 12px 28px rgba(0, 0, 0, .5); opacity: .96; }
:root[data-theme="light"] .inv-ghost { background: #f4ecda; }
.inv-ghost::before { display: none; }
html.inv-dragging, html.inv-dragging * { cursor: grabbing !important; }
@media (max-width: 600px) {
  .inv { padding: 12px 6px; }
  .inv-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px; }
  .inv-ic { width: 32px; height: 32px; }
  .inv-act-none { display: none; }
  .inv-slot { gap: 10px; padding: 8px 12px; }
  .inv-slot-ic { width: 32px; height: 32px; }
  .inv-act { grid-column: 2 / -1; justify-self: start; margin-top: 4px; }
  .cap { width: 100%; flex-wrap: wrap; row-gap: 8px; }
  .cap > span:first-child { white-space: nowrap; }
  .cap-bar { flex: 1; width: auto; min-width: 40px; }
  .cap-grow { margin-left: auto; padding: 6px 8px; }
}
/* "Keep the letter for later": back out of a Recruitment Letter's recruit scene. */
.letter-back-wrap { text-align: center; margin-top: 14px; }
.draw.mode-party .letter-back-wrap { display: none; }

/* Dragging an item that's used on a hero: the party rises out of the hand, each card dimmed with
   "Use on <name>" (or why not) over it; the one under the item lights up. */
.party-row.hand.dock.all-up > .hand-card { transition: transform .38s cubic-bezier(.3, 1.3, .55, 1); }
.party-row.hand.dock.all-up .hand-sway { animation-play-state: paused; }
.use-dim { position: absolute; inset: 0; z-index: 5; border-radius: 4.5%; background: rgba(10, 7, 4, .6); pointer-events: none; transition: background .2s; animation: use-dim .2s ease-out; }
@keyframes use-dim { from { background: rgba(10, 7, 4, 0); } }
.use-no .use-dim { background: rgba(10, 7, 4, .74); }
.use-over .use-dim { background: rgba(10, 7, 4, .3); }
.hand-card.use-target.use-over .card { box-shadow: 0 0 0 3px var(--brass), 0 0 30px rgba(240, 207, 142, .55); }
.use-on { position: absolute; left: 50%; top: 42%; z-index: 6; transform: translate(-50%, -50%); width: max-content; max-width: 88%; pointer-events: none;
  padding: 6px 10px; border-radius: 5px; background: rgba(27, 18, 10, .92); border: 1px solid #6b4f2a; color: var(--gold-hi);
  font: 700 .82rem/1.2 var(--sans); text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.use-on b { color: #fff; }
.use-no .use-on { color: #c9c1b0; border-color: #4a3d2c; font-weight: 600; }
.use-over .use-on { background: #2f5a3a; border-color: #6fcf8f; color: #e8ffe9; transform: translate(-50%, -50%) scale(1.08); transition: transform .15s; }
@media (max-width: 560px) { .use-on { font-size: .66rem; padding: 4px 6px; } }
/* A Healing Draught carried to the party: a small tag instead of the whole line. */
.inv-ghost.compact { display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 6px 14px 6px 8px; border-radius: 5px; border-color: var(--brass); color: var(--text); white-space: nowrap; }
.inv-ghost.compact b { font: 400 1.05rem/1 var(--serif); }

/* ================================================================ the Quartermaster (shop.js)
   Above the stash: the weekly offer as a wide card tinted in its rarity's colour, then the day's
   three offers as tiles (rows on a phone). Bought offers are stamped Sold out. */
.shop-sec { margin-bottom: 26px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin: 0 4px 10px; }
.sec-head h2 { margin: 0; font: 400 1.5rem/1.1 var(--display); color: var(--text); }
.sec-head h2 small { display: block; margin-top: 2px; font: italic .95rem var(--serif); color: var(--text-dim); }
.shop-timer, .shop-left { font: 600 .82rem var(--sans); color: var(--text-dim); white-space: nowrap; }
.shop-timer b, .shop-left b { color: var(--gold); font-variant-numeric: tabular-nums; }
:root[data-theme="light"] .shop-timer b, :root[data-theme="light"] .shop-left b { color: #8a6414; }
.shop { position: relative; border-radius: 16px; padding: 16px 12px; }
.shop::before { content: ""; position: absolute; inset: 7px; border: 2px dashed var(--stitch); border-radius: 11px; pointer-events: none; }
.shop .r-common { --rc: var(--r-common); } .shop .r-uncommon { --rc: var(--r-uncommon); } .shop .r-rare { --rc: var(--r-rare); }
.shop .r-epic { --rc: var(--r-epic); } .shop .r-legendary { --rc: var(--r-legendary); }
.shop-tag { display: inline-block; padding: 4px 6px; border-radius: 5px; background: #c9994a; color: #1b120a; font: 800 .66rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.shop-name { font: 400 1.12rem/1.15 var(--serif); color: var(--text); }
.shop-name .rar-tag { vertical-align: 3px; }
.shop-n { font: 800 .8rem var(--sans); color: var(--text-dim); margin-left: 3px; }
.shop-flav { font: italic .9rem/1.35 var(--serif); color: var(--text-dim); }
.shop-flav .rar-tag { margin: 0 4px 0 0; vertical-align: 1px; }
.shop-price { display: inline-flex; align-items: center; gap: 5px; font: 800 1rem var(--sans); color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
:root[data-theme="light"] .shop-price { color: #8a6414; }
.shop-price .inv-ic { width: 22px; height: 22px; }
.shop-buy { min-height: var(--btn-h); font: var(--btn-font); color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-line); border-radius: var(--btn-r); padding: 7px 14px; min-width: 74px; cursor: pointer; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); white-space: nowrap; }
.shop-buy:hover:not(:disabled) { background: #2a1d10; }
.shop-buy.armed { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.shop-buy:disabled { opacity: .45; cursor: default; }
.shop-stamp { display: none; }
.shop .sold > :not(.shop-stamp) { opacity: .35; }
.shop .sold .shop-stamp { display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); padding: 4px 12px; border: 2px solid #c2523f; border-radius: 5px;
  color: #e07a66; font: 400 1.3rem/1 var(--display); letter-spacing: .08em; background: rgba(14, 20, 36, .6); pointer-events: none; white-space: nowrap; }
:root[data-theme="light"] .shop .sold .shop-stamp { background: rgba(250, 244, 230, .8); color: #b0402e; }
/* The weekly offer. */
.shop-week { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 6px 18px; align-items: center; margin: 4px 6px 14px; padding: 16px 18px; border-radius: 10px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--rc) 22%, transparent), rgba(255, 255, 255, .02) 60%); border: 1px solid color-mix(in srgb, var(--rc) 60%, transparent); }
.shop-week > .inv-ic { width: 80px; height: 80px; justify-self: center; }
.shop-week .shop-name { display: block; font-size: 1.4rem; margin: 6px 0 2px; }
.shop-week .shop-flav { display: block; }
.shop-buyw { display: grid; justify-items: end; gap: 8px; }
/* The day's three. */
.shop-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 6px; }
.shop-rar { display: block; line-height: 1; }
.shop-rar .rar-tag { margin: 0; }
.shop-week .shop-rar { margin: 2px 0 6px; }
.shop-tile { position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; justify-items: center; text-align: center; gap: 6px; padding: 16px 12px 14px; border-radius: 8px;
  background: rgba(255, 255, 255, .025); border: 1px dashed var(--stitch-soft); }
.shop-tile.r-epic, .shop-tile.r-legendary, .shop-tile.r-rare { border-style: solid; border-color: color-mix(in srgb, var(--rc) 55%, transparent); background: color-mix(in srgb, var(--rc) 10%, transparent); }
.shop-tile > .inv-ic { width: 56px; height: 56px; }
.shop-foot { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.shop-fly { position: fixed; z-index: 90; pointer-events: none; }
.inv-head { margin-top: 4px; }
@media (max-width: 700px) {
  .shop-week { grid-template-columns: 64px minmax(0, 1fr); padding: 14px; }
  .shop-week > .inv-ic { width: 60px; height: 60px; }
  .shop-buyw { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; justify-items: start; }
  .shop-days { grid-template-columns: 1fr; gap: 8px; }
  .shop-tile { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto; justify-items: start; text-align: left; align-items: center; padding: 10px 12px; column-gap: 12px; }
  .shop-tile > .inv-ic { width: 40px; height: 40px; grid-row: 1 / 4; }
  .shop-tile .shop-name, .shop-tile .shop-rar, .shop-tile .shop-flav { grid-column: 2; }
  .shop-tile .shop-flav { grid-row: 3; }
  .shop-tile .shop-foot { grid-column: 3; grid-row: 1 / 4; flex-direction: column; gap: 6px; margin: 0; }
  .shop { padding: 12px 6px; }
}
/* A Trapped Potential on a card's ability bars and its working. */
.bar .iboon, .pg-ab .bar .iboon { background: #8a48c2 !important; }
.rolls .ib { font-style: normal; font-weight: 800; color: #c49be8; }
/* A Prism of Splendour being used: the recruit's finish reveal on a stage of its own, in a spotlight (finish.js playFinishFor). */
.prism-focus { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; align-content: center; gap: 14px; padding: 24px 16px;
  background: radial-gradient(ellipse 45% 55% at 50% 45%, rgba(var(--shade-rgb), .15), rgba(var(--shade-rgb), .82)); opacity: 0; transition: opacity .5s; }
.prism-focus.on { opacity: 1; }
.prism-focus.out { opacity: 0; transition-duration: .3s; }
.pf-stage { width: min(340px, 78vw, calc((100svh - 200px) * .714)); }
.pf-caption { margin: 0; font: italic 1.1rem var(--serif); color: #f4ecda; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { .prism-focus { transition: none; } }
/* "Use the Gem of Revivify?": the confirmation before a Rare or rarer item is used (stash.js confirmUse). */
.confirm-sheet { width: min(440px, 100%); }
.uc-head { display: flex; align-items: center; gap: 12px; }
.uc-head h2 { margin: 0; font: 400 1.35rem/1.15 var(--display); }
.uc-head .inv-ic { width: 48px; height: 48px; }
#uc-text { margin: 0; color: var(--text-dim); }
#uc-text b { color: var(--text); }
.prism-focus .chat-bubble { bottom: calc(100% + 12px); font-size: .95rem; max-width: 260px; }
/* The collection's search box. */
.roster-q { width: 180px; min-height: 38px; padding: 6px 10px; border-radius: var(--btn-r); border: 1px solid var(--felt-line); background: rgba(var(--panel-rgb), .7); color: var(--text); font: 500 .9rem var(--sans); }
.roster-q:focus-visible { outline: none; border-color: var(--brass); }
.roster-q::placeholder { color: var(--text-dim); opacity: .8; }
@media (max-width: 560px) { .roster-q { width: 100%; flex: 1 1 100%; } .controls { flex-wrap: wrap; } }
/* Choosing who an item is for (roster.js pickHero): heroes it can be used on stand out, the rest dim with why not,
   the item follows the mouse, and a bar at the bottom says what's going on. */
#view-roster.picking { padding-bottom: 90px; }
#view-roster.picking .slot.pick-ok { cursor: pointer; }
#view-roster.picking .slot.pick-ok:hover .card { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(240, 207, 142, .55); }
#view-roster.picking .slot.pick-no .card { filter: grayscale(.6) brightness(.55); }
#view-roster.picking .slot.pick-no { cursor: not-allowed; }
.slot { position: relative; }
.pick-label { position: absolute; left: 50%; top: 46%; z-index: 6; transform: translate(-50%, -50%); width: max-content; max-width: 88%; pointer-events: none;
  padding: 5px 9px; border-radius: 5px; background: rgba(27, 18, 10, .92); border: 1px solid #6b4f2a; color: var(--gold-hi); font: 700 .78rem/1.2 var(--sans); text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.pick-label.no { color: #c9c1b0; border-color: #4a3d2c; font-weight: 600; }
.slot.pick-ok:hover .pick-label { background: #2f5a3a; border-color: #6fcf8f; color: #e8ffe9; }
.pick-bar { position: fixed; left: 50%; bottom: 16px; z-index: 30; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 24px);
  padding: 10px 16px; border-radius: 10px; background: #1b120a; border: 1px solid #6b4f2a; color: var(--gold-hi); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font: 600 .92rem var(--sans); }
.pick-bar .inv-ic { width: 32px; height: 32px; }
.pick-bar .link { color: var(--gold); font-weight: 700; margin-left: 6px; }
.pick-cursor { position: fixed; left: 0; top: 0; z-index: 90; width: 40px; height: 40px; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55)); }
/* Dragging a hero from the collection into the party (roster.js): a small copy follows the pointer. */
.hero-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .5)); }
.hero-ghost .card { width: 100%; }
.slot.lifted { opacity: .35; }
html.hero-dragging, html.hero-dragging * { cursor: grabbing !important; }
html.hero-dragging .grid .slot { touch-action: none; }

/* ================================================================ tabs and search (stash.js) */
.st-bar { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.st-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.st-tabs button { all: unset; box-sizing: border-box; min-height: var(--btn-h); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--btn-r); font: var(--btn-font); color: var(--text-dim);
  background: var(--btn2-bg); border: 1px solid var(--felt-line); }
.st-tabs button:hover, .st-tabs button:focus-visible { color: var(--text); border-color: var(--brass-dim); }
/* chosen, as every chosen option in the game: the dark chip */
.st-tabs button[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--brass); }
.st-tabs button i { font-style: normal; font-size: .76rem; opacity: .85; color: inherit; }
.st-search { display: flex; align-items: center; gap: 6px; flex: 0 1 300px; min-width: 180px; min-height: 38px; padding: 0 10px; border-radius: var(--btn-r); background: rgba(var(--panel-rgb), .7); border: 1px solid var(--felt-line); color: var(--text-dim); }
.st-search:focus-within { border-color: var(--brass); }
.st-sort { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 38px; padding: 0 12px; border-radius: var(--btn-r); background: rgba(var(--panel-rgb), .7); border: 1px solid var(--felt-line); color: var(--text, #f1e7d2); font: 600 .9rem var(--sans); cursor: pointer; }
.st-sort svg { width: 16px; height: 16px; flex: none; }
.st-sort:hover:not(:disabled) { border-color: var(--brass); }
.st-sort:disabled { opacity: .5; cursor: default; }
.st-search svg { width: 16px; height: 16px; flex: none; }
.st-search input { all: unset; flex: 1; min-width: 0; padding: 8px 0; font: .9rem var(--sans); color: var(--text, #f1e7d2); }
.st-search input::placeholder { color: var(--text-dim, #b9ad96); opacity: .7; }
.st-none { margin: 10px 4px; color: var(--text-dim); font: italic 1rem/1.4 var(--serif); }
@media (max-width: 560px) { .st-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; } .st-tabs button { flex: none; } .st-search { flex: 1 1 0; min-width: 0; max-width: none; } }
/* Loot in the stash (gear, potions, scrolls, reagents): no Use button; heroes carry gear from their Equipment page. */
.inv-row.loot .inv-act-none { width: 1px; }
.inv-row:not(.drag) { cursor: default; }

/* An item's line of flavour, and on hover (or a tap) what it does, fading in where it was (stash and shop). */
.flip { display: grid; }
.flip > span { grid-area: 1 / 1; transition: opacity .35s ease; }
.flip .fl-a { font-style: italic; }
.flip .fl-b { opacity: 0; font-style: normal; font-family: var(--sans); font-size: .92em; }
.flip-host:hover .fl-a, .flip-host:focus-within .fl-a, .flip-host.show .fl-a { opacity: 0; }
.flip-host:hover .fl-b, .flip-host:focus-within .fl-b, .flip-host.show .fl-b { opacity: 1; }
.shop-week.flip-host, .shop-tile.flip-host { outline: none; }
.shop-week.flip-host:focus-visible, .shop-tile.flip-host:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
@media (prefers-reduced-motion: reduce) { .flip > span { transition: none; } }

/* A legendary's picture: a golden glow, and a sheen that sweeps across it now and then (card.js lootPic). */
/* A legendary's glow and glint, moved and faded by the graphics chip: animating a filter or a background repaints it every frame. */
.inv-ic.lg-ic { position: relative; filter: drop-shadow(0 0 3px rgba(255, 205, 80, .95)) drop-shadow(0 0 8px rgba(230, 160, 30, .55)); }
.inv-ic.lg-ic::before { content: ""; position: absolute; inset: 0; background: inherit; filter: drop-shadow(0 0 4px rgba(255, 220, 110, .9)) drop-shadow(0 0 13px rgba(240, 175, 40, .7)); opacity: 0; animation: lg-glow 2.6s ease-in-out infinite; }
.lg-ic .lg-sheen { position: absolute; inset: 0; display: block; pointer-events: none; overflow: hidden;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  mix-blend-mode: screen; }
.lg-ic .lg-sheen::after { content: ""; position: absolute; left: 0; top: 0; width: 260%; height: 100%; transform: translateX(98.46%);
  background: linear-gradient(115deg, transparent 30%, rgba(255, 250, 220, .95) 48%, rgba(255, 220, 120, .6) 54%, transparent 70%);
  animation: lg-sheen 3.2s ease-in-out infinite; }
@keyframes lg-sheen { 0%, 45% { transform: translateX(98.46%); } 100% { transform: translateX(-98.46%); } }
@keyframes lg-glow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .inv-ic.lg-ic::before, .lg-ic .lg-sheen::after { animation: none; } }
/* Selling gear to the Quartermaster (stash.js): the price on the button, a second tap to be sure. */
.inv-sell b { color: var(--btn-fg); font-weight: 800; margin-left: 3px; }
.inv-sell.armed { background: #6e2a2a; border-color: #b0442f; color: #fff; }
.inv-sell.armed b { color: #ffe08a; }
.inv-sell { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.inv-sell .inv-ic { width: 16px; height: 16px; margin-left: 3px; }
.inv-sell b { margin-left: 0; }
/* The Quartermaster's Equipment tab (shop.js equipHTML): healing potions, the day's brews for reagents, armour. */
.shop-tabs { margin: 0 4px 10px; }
.eq-h { margin: 6px 8px 10px; font: 400 1.15rem/1.1 var(--display); color: var(--text); }
.eq-h small { display: block; margin-top: 3px; font: italic .9rem var(--serif); color: var(--text-dim); }
.eq-h:not(:first-child) { margin-top: 20px; }
.shop-days.eq-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shop-tile.locked > :not(.shop-foot) { opacity: .4; filter: grayscale(.7); }
.eq-lock { font: 700 .74rem/1.25 var(--sans); color: var(--text-dim); padding: 6px 8px; border: 1px dashed var(--stitch-soft); border-radius: 5px; text-align: center; }
.eq-left { font: 700 .72rem var(--sans); color: var(--text-dim); margin-left: 4px; vertical-align: 1px; }
.eq-costs { display: inline-flex; gap: 8px; align-items: center; }
.eq-cost { display: inline-flex; align-items: center; gap: 3px; font: 800 .9rem var(--sans); color: var(--gold); font-variant-numeric: tabular-nums; }
.eq-cost .inv-ic { width: 24px; height: 24px; }
.eq-cost.short { color: #e07a66; }
:root[data-theme="light"] .eq-cost { color: #8a6414; }
:root[data-theme="light"] .eq-cost.short { color: #b0402e; }
.eq-arms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0 6px; }
.eq-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; background: rgba(255, 255, 255, .025); border: 1px dashed var(--stitch-soft); }
.eq-row > .inv-ic { width: 34px; height: 34px; }
.eq-nm { display: grid; min-width: 0; }
.eq-nm b { font: 400 1.02rem/1.15 var(--serif); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-nm small { font: 600 .74rem var(--sans); color: var(--text-dim); text-transform: capitalize; }
.eq-row .shop-buy { min-width: 64px; padding: 6px 10px; }
@media (max-width: 900px) { .shop-days.eq-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .eq-arms { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .shop-days.eq-four { grid-template-columns: 1fr; }
  .eq-costs { flex-direction: column; gap: 2px; }
  .eq-lock { max-width: 120px; }
  .eq-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .eq-row .shop-price { grid-column: 2; grid-row: 2; }
  .eq-row .shop-buy { grid-column: 3; grid-row: 1 / 3; }
  .eq-row > .inv-ic { grid-row: 1 / 3; }
}

/* how many healing potions to buy at once */
.eq-qty { display: inline-flex; align-items: center; border: 1px solid rgba(107, 79, 42, .35); border-radius: 5px; overflow: hidden; }
.eq-qty button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; background: rgba(43, 33, 24, .08); color: inherit; font: 800 1rem/1 var(--sans); cursor: pointer; }
.eq-qty button:disabled { opacity: .35; cursor: default; }
.eq-qty b { min-width: 26px; text-align: center; font: 800 .9rem/1 var(--sans); font-variant-numeric: tabular-nums; }

/* ---- selling: a stack's choice (one, or all of it), and Sell several */
.inv-sell-pick { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st-pick { position: sticky; top: 0; z-index: 4; display: grid; gap: 10px; margin: -2px 0 12px; padding: 10px 12px; border: 1px solid var(--brass-dim); border-radius: var(--btn-r); background: rgb(var(--panel-rgb)); box-shadow: 0 8px 18px rgba(0, 0, 0, .3); } /* (stays in view while you scroll down the list choosing) */
.st-pick[hidden] { display: none; }
.stp-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font: 700 .8rem/1 var(--sans); color: var(--text-dim); }
.stp-quick em { font: italic 400 .95rem var(--serif); }
.stp-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border-radius: var(--btn-r); border: 1px solid var(--felt-line); background: var(--btn2-bg); color: var(--text); font: var(--btn-font); font-size: .8rem; cursor: pointer; }
.stp-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rc, var(--r-common)); }
.stp-chip i { font-style: normal; opacity: .75; }
.stp-chip.r-uncommon { --rc: var(--r-uncommon); } .stp-chip.r-rare { --rc: var(--r-rare); } .stp-chip.r-epic { --rc: var(--r-epic); } .stp-chip.r-legendary { --rc: var(--r-legendary); }
.stp-chip.on { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--brass); }
.stp-clear { font-size: .82rem; }
.stp-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; font: 600 .9rem/1.3 var(--sans); color: var(--text-dim); }
.stp-sum b { color: var(--text); }
.stp-sum > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.stp-sum .inv-ic { width: 16px; height: 16px; vertical-align: -3px; }
.inv.picking .inv-row:not(.pickable):not(.inv-slot) { opacity: .4; }
.inv-row.pickable { grid-template-columns: 22px 40px minmax(0, 1fr) auto auto; cursor: pointer; }
.inv-row.pickable:hover { background: rgba(240, 207, 142, .05); }
.inv-row.picked { background: rgba(240, 207, 142, .1); box-shadow: inset 3px 0 0 var(--brass); }
.inv-tick { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--brass-dim); background: rgba(var(--panel-rgb), .7); display: grid; place-items: center; }
.inv-row.picked .inv-tick { background: var(--btn-bg); border-color: var(--brass); }
.inv-row.picked .inv-tick::after { content: ""; width: 10px; height: 5px; border-left: 2.5px solid #f0cf8e; border-bottom: 2.5px solid #f0cf8e; transform: translateY(-1px) rotate(-45deg); }
.inv-pick-gold { display: inline-flex; align-items: center; gap: 4px; font: 800 .9rem var(--sans); color: var(--gold); white-space: nowrap; }
.inv-pick-gold .inv-ic { width: 16px; height: 16px; }
@media (max-width: 560px) {
  .inv-row.pickable { grid-template-columns: 22px 34px minmax(0, 1fr) auto; }
  .inv-row.pickable .inv-pick-gold { grid-column: 3 / -1; justify-self: start; }
  .inv-sell-pick { grid-column: 2 / -1; justify-content: flex-end; margin-top: 4px; } /* (Sell 1 under the finger that tapped Sell; All further off) */
}

/* ---- the keepsakes' shelf: world events' trophies, taking no space */
.shelf { margin-top: 22px; padding-top: 14px; border-top: 1px dashed var(--felt-line); }
.shelf[hidden] { display: none; }
.shelf h3 { margin: 0; font: 400 1.3rem/1.2 var(--display); color: var(--gold); }
.shelf-note { margin: 2px 0 12px; font: italic 400 .95rem/1.35 var(--serif); color: var(--text-dim); }
.shelf-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.shelf-it { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 8px 10px; border-radius: var(--btn-r); border: 1px solid var(--felt-line); background: rgba(var(--panel-rgb), .55); box-shadow: inset 0 -3px 0 var(--rc, var(--r-common)); text-align: center; cursor: help; }
.shelf-it .inv-ic, .shelf-it img { width: 40px; height: 40px; }
.shelf-it span { font: 400 .92rem/1.2 var(--serif); color: var(--text); }
.shelf-it i { position: absolute; top: 6px; right: 8px; font: 800 .75rem var(--sans); font-style: normal; color: var(--text-dim); }
.shelf-it.r-uncommon { --rc: var(--r-uncommon); } .shelf-it.r-rare { --rc: var(--r-rare); } .shelf-it.r-epic { --rc: var(--r-epic); } .shelf-it.r-legendary { --rc: var(--r-legendary); }
.stp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 40px; } /* (clear of the room's close button) */
.stp-head b { font: 400 1.1rem/1.2 var(--display); color: var(--gold); }
.stash-hint { margin: 10px 2px 0; font: italic 400 .92rem/1.35 var(--serif); color: var(--text-dim); text-align: center; }
.stash-hint[hidden] { display: none; }
.inv-row[data-id] { -webkit-touch-callout: none; }

/* ---- Refined UI (Nov 2026): an item that can't be used yet says why, under its name, instead of only in a
   tooltip on a greyed button. */
.inv-row .inv-why { display: block; margin-top: 3px; font: 600 .8rem/1.3 var(--sans); font-style: normal; color: var(--text-dim); }
.inv-row .inv-why::before { content: "Not now: "; font-weight: 800; }

/* ---- the item chosen, beside the list (a wide screen in the Road Out; elsewhere the panel stays hidden) */
.inv-detail { display: none; }
@media (min-width: 1100px) {
  html.ro-open .inv-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 24px; align-items: start; }
  html.ro-open .inv-detail { display: grid; gap: 10px; position: sticky; top: 0; padding: 20px; border-radius: 10px; border: 1px solid var(--felt-line); background: rgba(var(--panel-rgb), .55); }
  html.ro-open .inv-row[data-id] { cursor: pointer; }
  html.ro-open .inv-row.sel { background: rgba(240, 207, 142, .12); box-shadow: inset 3px 0 0 var(--brass); }
}
.inv-detail .invd-ic { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--felt-line); background: rgba(255, 255, 255, .04); }
.inv-detail .invd-ic > * { transform: scale(1.6); }
.inv-detail .invd-nm { margin: 4px 0 0; font: 400 1.5rem/1.15 var(--display); color: var(--text); }
.inv-detail .invd-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-detail .invd-tags .rar-tag { margin-left: 0; }
.inv-detail .invd-kind { font: 700 .72rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.inv-detail .invd-fl { margin: 0; font: italic .98rem/1.4 var(--serif); color: var(--text-dim); }
.inv-detail .invd-tx { margin: 0; font: 500 .95rem/1.45 var(--sans); color: var(--text); }
.inv-detail .invd-who { margin: 0; font: 600 .85rem/1.3 var(--sans); color: var(--text-dim); }
.inv-detail .invd-facts { margin: 4px 0 0; padding: 10px 0 0; border-top: 1px solid var(--felt-line); display: grid; gap: 6px; }
.inv-detail .invd-facts > div { display: flex; justify-content: space-between; gap: 12px; }
.inv-detail .invd-facts dt { font: 600 .85rem/1.3 var(--sans); color: var(--text-dim); }
.inv-detail .invd-facts dd { margin: 0; font: 800 .9rem/1.3 var(--sans); color: var(--text); }
.inv-detail .invd-why { margin: 0; font: 600 .85rem/1.3 var(--sans); color: var(--text-dim); }
.inv-detail .invd-why::before { content: "Not now: "; font-weight: 800; }
.inv-detail .invd-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.inv-detail .invd-act .inv-act { min-height: 40px; padding: 0 16px; }
.inv-detail .invd-none { margin: 0; font: italic .95rem/1.4 var(--serif); color: var(--text-dim); }

/* The gold, at the Quartermaster's and over the stash. */
.purse { display: inline-flex; align-items: center; gap: 5px; font: 600 .82rem var(--sans); color: var(--text-dim); white-space: nowrap; }
.purse b { color: var(--gold); font-size: .95rem; font-variant-numeric: tabular-nums; }
:root[data-theme="light"] .purse b { color: #8a6414; }
.purse .inv-ic { width: 18px; height: 18px; flex: none; }
.st-new[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
:root[data-theme="light"] .st-new[aria-pressed="true"] { color: #8a6414; }

/* The padlock on a line of the stash. */
.inv-lock { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 6px; padding: 0; vertical-align: -6px; border: 0; border-radius: 50%; background: none; color: var(--text-dim); opacity: .55; cursor: pointer; }
.inv-lock svg { width: 15px; height: 15px; }
.inv-lock:hover, .inv-lock:focus-visible { opacity: 1; }
.inv-lock.on { color: var(--gold); opacity: 1; }
:root[data-theme="light"] .inv-lock.on { color: #8a6414; }
.inv-locked { font: 600 .78rem var(--sans); color: var(--text-dim); white-space: nowrap; }

/* Combining a heap of something into something better. */
.inv-combine { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.inv-combine button { padding: 3px 0; border: 0; background: none; font: 600 .8rem var(--sans); color: var(--gold); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
:root[data-theme="light"] .inv-combine button { color: #8a6414; }
/* (a Bag of Holding's worth of lines: those off the screen aren't laid out or drawn) */
.inv.long > .inv-row { content-visibility: auto; contain-intrinsic-size: auto 66px; }
