/* Study Quest — bag.css (V7.6 "The bag", lane A, builder v76-bag): THE TORBA (js/ui-bag.js).
 * A crafted leather bag with iron sockets, in the game's own look (theme.css tokens and textures). Flat colour + texture only:
 * NEVER a gradient (the user, 25 Oct). Readable at 1280 and at 480 x 360 (compact: smaller sockets, the details folded). */
.torba {
  position: fixed; right: 14px; bottom: 96px; z-index: 260;
  width: 272px; max-width: calc(100vw - 16px);
  padding: 8px 10px 9px;
  color: var(--cx-text);
  font: 400 var(--cx-fs-small, 13px)/1.35 var(--cx-font-body);
  background-color: #4a2f1a;
  background-image: var(--cx-tex-leather);
  border: 1px solid var(--cx-line, #030304);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #6b4527, inset 0 0 0 3px #22150b, 0 6px 18px rgba(0, 0, 0, 0.55);
}
.torba.hidden { display: none; }
.tb-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.tb-head__ico .tb-ico { width: 22px; height: 22px; display: block; }
.tb-title { flex: 1; font: 700 15px/1 var(--cx-font-title); letter-spacing: 0.05em; color: var(--cx-gold-leaf, #f4d58c); }
.tb-title .ot { color: inherit; border-bottom: 1px dotted rgba(244, 213, 140, 0.5); }
.tb-close, .tb-order {
  width: 22px; height: 22px; padding: 0; cursor: pointer; line-height: 20px; text-align: center;
  color: var(--cx-text); background-color: #2a2d31; background-image: var(--cx-tex-iron);
  border: 1px solid #000; border-radius: 3px; font-size: 12px;
}
.tb-order.is-on { color: var(--cx-gold-leaf, #f4d58c); box-shadow: inset 0 0 0 1px var(--cx-torch, #ff8a3d); }
.tb-close:hover, .tb-order:hover { color: var(--cx-gold-leaf, #f4d58c); }
.tb-tabs { display: flex; gap: 3px; margin: 0 0 6px; }
.tb-tab {
  flex: 1; padding: 3px 6px 4px; cursor: pointer;
  font: 700 11.5px/1.2 var(--cx-font-label); letter-spacing: 0.04em; color: #d8c4a2;
  background-color: #33200f; background-image: var(--cx-tex-leather);
  border: 1px solid #120a04; border-radius: 4px 4px 0 0;
}
.tb-tab.is-on { color: var(--cx-gold-leaf, #f4d58c); background-color: #6b4527; box-shadow: inset 0 -2px 0 var(--cx-torch, #ff8a3d); }
.tb-grid { display: grid; grid-template-columns: repeat(var(--tb-cols, 5), 1fr); gap: 4px; padding: 5px; background-color: #1a110a; border: 1px solid #000; border-radius: 4px; }
.tb-slot {
  position: relative; aspect-ratio: 1 / 1; min-width: 0; cursor: pointer;
  background-color: #23262a; background-image: var(--cx-tex-iron);
  border: 1px solid #000; border-radius: 3px;
  box-shadow: inset 0 0 0 1px #5a5f66, inset 0 0 0 3px #0c0d0f;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.tb-slot .tb-ico { width: 72%; height: 72%; display: block; pointer-events: none; }
.tb-slot:hover { box-shadow: inset 0 0 0 1px var(--cx-bronze-hi, #e2b56a), inset 0 0 0 3px #0c0d0f; }
.tb-slot.is-sel { box-shadow: inset 0 0 0 2px var(--cx-gold-leaf, #f4d58c), inset 0 0 0 4px #0c0d0f; }
.tb-slot.is-none .tb-ico { filter: grayscale(1); opacity: 0.55; }   /* V7.6 fixer (play nice 1): easier to tell apart; its 0 shows like the hotbar's */
.tb-slot.is-lit { background-color: #5a4220; }
.tb-slot--empty { cursor: default; box-shadow: inset 0 0 0 1px #2c2f33; background-image: none; background-color: #121315; }
.tb-n {
  position: absolute; right: 2px; bottom: 0; pointer-events: none;
  font: 700 12px/1.1 var(--cx-font-num); color: #fff; text-shadow: 0 0 2px #000, 1px 1px 0 #000, -1px -1px 0 #000;
}
.tb-n.is-zero { color: #a9a196; }
/* the rest (30 min after a full sitting): a flat dark shade on the cups only, falling as the rest runs out; nothing ever glows "ready" */
.tb-slot.is-rest::after {
  content: ''; position: absolute; left: 2px; right: 2px; bottom: 2px; border-radius: 2px; pointer-events: none;
  height: calc(var(--tb-rest, 0) * (100% - 4px)); background-color: rgba(0, 0, 0, 0.55);
}
/* V7.8 (v78-torba, TRACKER §8.40): the Log page — today's food and drink, each with Delete (no confirm; the Zaborav keeps it,
   Undo right after still works). Flat colour + texture, never a gradient (CLAUDE.md). */
.tb-log { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow: auto; padding: 2px; grid-column: 1 / -1; min-width: 0; }   /* V7.8 fixer: the whole width of the grid (it sat in its first column) */
.tb-log__row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; background-color: #1a110a; border: 1px solid #000; border-radius: 3px; }
.tb-log__time { color: var(--cx-text-dim); font-family: var(--cx-font-num); flex: 0 0 auto; }
.tb-log__name { color: var(--cx-text); flex: 1 1 auto; min-width: 0; }
.tb-log__del { padding: 2px 8px 3px; cursor: pointer; font: 700 11px/1.2 var(--cx-font-label); letter-spacing: 0.03em; color: var(--cx-text-dim); background-color: #3a2a18; border: 1px solid #000; border-radius: 3px; box-shadow: inset 0 0 0 1px #4a3a24; }
.tb-log__del:hover { color: #f0a090; box-shadow: inset 0 0 0 1px #7a3b22; }
.tb-log__empty { color: var(--cx-text-dim); font-style: italic; padding: 6px; }
.tb-log__row { cursor: default; }
.tb-log__row.is-sel { border-color: #6a5030; box-shadow: inset 0 0 0 1px #c8a050; }   /* V7.8 fixer: the row the keys act on */
.tb-tip__keys { margin-top: 4px; color: var(--cx-text-dim); font-size: 11px; }
.tb-info { margin-top: 6px; padding: 5px 8px; min-height: 56px; background-color: #1a110a; border: 1px solid #000; border-radius: 4px; }
.tb-info .tb-tip { max-height: var(--tb-tip-max, 108px); overflow: auto; }   /* V7.6 finish: ui-bag.js place() lowers it to keep a gap under the minimap */
.tb-info__btns { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tb-tip__name { font: 700 14px/1.25 var(--cx-font-body); color: #fff; }
.tb-tip__name .ot { color: inherit; border-bottom: 1px dotted rgba(255, 255, 255, 0.5); }
.tb-tip__sub { color: var(--cx-text-dim); }
.tb-tip__use { color: #9fd18a; }
.tb-tip__state { color: var(--cx-gold-text, #e3b562); }
.tb-tip__flav { color: var(--cx-gold-3, #d9a54a); font: italic 500 14px/1.3 var(--cx-font-flavor); margin-top: 2px; }
.tb-tip__foot { color: var(--cx-text-dim); margin-top: 3px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 3px; }
.tooltip .tb-tip { max-width: 300px; }
.tb-btn {
  padding: 3px 9px 4px; cursor: pointer;
  font: 700 11.5px/1.2 var(--cx-font-label); letter-spacing: 0.03em; color: var(--cx-text);
  background-color: #3a2a18; background-image: var(--cx-tex-leather);
  border: 1px solid #000; border-radius: 3px; box-shadow: inset 0 0 0 1px #8f6430;
}
.tb-btn:hover { color: var(--cx-gold-leaf, #f4d58c); box-shadow: inset 0 0 0 1px var(--cx-bronze-hi, #e2b56a); }
.tb-btn--use { color: var(--cx-gold-leaf, #f4d58c); background-color: #6b4527; }
.tb-btn--quiet { font-weight: 600; color: var(--cx-text-dim); box-shadow: inset 0 0 0 1px #4a3a24; }
.tb-btn--quiet.is-on { color: var(--cx-text); }
.tb-foot { margin-top: 6px; }
.tb-rule { color: #d8c4a2; font-style: italic; }
.tb-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tb-purse { color: var(--cx-gold-text, #e3b562); font-family: var(--cx-font-num); }
.tb-shop { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tb-btn .money { margin-left: 2px; font-family: var(--cx-font-num); letter-spacing: 0; text-transform: none; gap: 4px; }   /* V7.6 fixer (play S2): the game's coin marks in Buy and Restock */
/* compact (480 x 360) and short windows: smaller sockets, the details shortened */
.hud-compact .torba, .torba.is-compact { width: 236px; padding: 6px 7px; }
@media (max-width: 760px), (max-height: 520px) {
  .torba { width: 236px; padding: 6px 7px; }
  .tb-grid { gap: 3px; padding: 4px; }
  .tb-info { min-height: 0; padding: 4px 6px; }
  .tb-info .tb-tip { max-height: 58px; }
  .tb-info .tb-tip__flav, .tb-info .tb-tip__foot, .tb-info .ot-tip { display: none; }
  .tb-tab { font-size: 10.5px; padding: 2px 4px 3px; }
  .tb-rule { font-size: 11px; }
}
@media (max-height: 420px) {
  /* 480 x 360: the sockets, the purse and the shop; the details stay in each socket's tooltip */
  .torba { width: 212px; padding: 5px 6px; }
  .tb-head { margin-bottom: 3px; }
  .tb-tabs { margin-bottom: 3px; }
  .tb-foot .tb-rule, .tb-info .tb-tip { display: none; }   /* V7.6 fixer (code critic 4): the details go, Eat/Drink and Buy stay */
  .tb-info { min-height: 0; margin-top: 3px; padding: 0; background: none; border: 0; }
  .tb-info__btns { margin-top: 0; gap: 3px; }
  .tb-row { margin-top: 3px; }
  .tb-btn { padding: 2px 6px 3px; font-size: 10.5px; }
}
