/*
 * assets/ui/gear-bench.css - THE GEAR BENCH's look (js/gear-bench.js): the stage with the painted subject and its
 * glowing slots, the stat bars with their ghost gain, and the drawer. One look for the Blacksmith, the War Machine
 * page, the Roost and the Eyrie (Goliath 2026-11-09; plan https://claude.ai/artifact/CHDuHdP1TNdwJYQ7MPvUmD).
 *
 * LAYOUT: the bench is its own container. Narrow (a phone, an upright tablet): the stage on top, kept in view while
 * the drawer scrolls under it, then the bars and the drawer. Wide (820 px of bench or more: a PC, a tablet sideways):
 * the stage the left two thirds and the bars and drawer a panel on the right (Goliath's PC rule, lesson PH-18).
 * Text never under 13 px (lesson UI-5, tools/text-floor.mjs), and inside a readable room never under the room's own
 * floor (16 px, scaled by its Aa text size: --gb-min below); every target 48 px; no motion under prefers-reduced-motion. Colours are the game's own (index.html :root), the Horde's in [data-side="horde"].
 */
.gb {
  --gb-ink: #fbf3e7;
  --gb-soft: #d2c5e4;
  --gb-base: #140d1e;
  --gb-surface: rgb(36 26 61 / 92%);
  --gb-line: rgb(201 168 245 / 28%);
  --gb-gold: #f5c242;
  --gb-ember: #ffb347;
  --gb-good: #6be04a;
  --gb-bad: #ff6b6b;
  --gb-teal: #7fe0d6;
  --gb-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --gb-body: "Trebuchet MS", "Lucida Grande", Verdana, sans-serif;
  --gb-tap: 48px;
  container: gb / inline-size;
  color: var(--gb-ink);
  font-family: var(--gb-body);
  /* THE WORDS' SIZES: inside a readable room (js/room-ui.css .rui, .rui-dlg-back) they follow the room's floor of 16 px and
     its text size (Aa: Larger 20, Largest 24, lesson UI-5); anywhere else the game's floor of 13 px */
  --gb-s: var(--rui-s, 1);
  --gb-min: var(--rui-min, 13px);
  --gb-text: calc(16px * var(--gb-s));
  font-size: var(--gb-text);
  line-height: 1.4;
}
.gb[data-side="horde"] { --gb-gold: #c77dff; --gb-teal: #8dff6b; --gb-ember: #9dff6b; }
/* THE FLESHSMITH'S STAGE (Goliath 2026-11-09 05:14Z: the Horde's rooms "to the same coolness standards"): witchfire
   instead of the forge's amber, a sickly green grid, the slots ringed in the Horde's green, the embers green */
.gb[data-side="horde"] .gb-stage {
  background-image:
    radial-gradient(ellipse at 50% 74%, rgb(141 255 107 / 22%), transparent 56%),
    linear-gradient(180deg, rgb(12 20 10 / 25%), rgb(14 8 20 / 74%)),
    linear-gradient(rgb(141 255 107 / 6%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(141 255 107 / 6%) 1px, transparent 1px),
    linear-gradient(rgb(20 13 30 / 45%), rgb(20 13 30 / 45%)),
    var(--gb-back, none);
}
.gb[data-side="horde"] .gb-slot { --gb-slot: rgb(141 255 107 / 50%); }
.gb[data-side="horde"] .gb-slot__num { background: #8dff6b; }
.gb [hidden] { display: none !important; }
.gb-in { display: grid; gap: 12px; }
.gb button { font-family: inherit; }
.gb button:focus-visible { outline: 3px solid var(--gb-teal); outline-offset: 2px; }

/* ---- the stage ------------------------------------------------------------------------------------------------- */
.gb-stage {
  position: relative; overflow: hidden; border-radius: 16px; border: 1.5px solid var(--gb-line);
  /* a height from the bench's own width (cqw), never a min-height with an aspect ratio, which widens a phone's page */
  width: 100%; height: clamp(340px, 92cqw, 560px);
  /* the backdrop is the stage's own background, top to bottom: the forge's glow, the grid, a tint that sets the painting
     at 55 per cent, the painting (--gb-back, a whole address set by js/gear-bench.js), the base; no layer of its own
     lies under a slot (convention 36, lesson UI-170) */
  background-color: var(--gb-base);
  background-image:
    radial-gradient(ellipse at 50% 72%, rgb(255 179 71 / 26%), transparent 58%),
    linear-gradient(180deg, rgb(20 13 30 / 20%), rgb(20 13 30 / 70%)),
    linear-gradient(rgb(127 224 214 / 7%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(127 224 214 / 7%) 1px, transparent 1px),
    linear-gradient(rgb(20 13 30 / 45%), rgb(20 13 30 / 45%)),
    var(--gb-back, none);
  background-size: auto, auto, 28px 28px, 28px 28px, auto, cover;
  background-repeat: no-repeat, no-repeat, repeat, repeat, no-repeat, no-repeat;
  background-position: center;
}
.gb-subject {
  /* sized to the field both ways (the field is a size container), so the subject stays clear of the slots at x 14 and
     84 per cent and of the nameplate under the field, at any width and on a short phone screen */
  position: absolute; left: 50%; top: 50%; width: min(42cqw, 80cqh); max-width: 420px; height: auto; transform: translate(-50%, -50%);
  filter: drop-shadow(0 16px 18px rgb(0 0 0 / 60%)); image-rendering: auto;
  animation: gb-breathe 3.2s ease-in-out infinite;
}
.gb-subject.is-pop { animation: gb-pop .6s ease; }
@keyframes gb-breathe { 50% { transform: translate(-50%, -51%) scale(1.015); } }
@keyframes gb-pop { 40% { transform: translate(-50%, -53%) scale(1.06); filter: drop-shadow(0 0 26px var(--gb-gold)); } }
.gb-stage[data-state="wrecked"] .gb-subject { filter: grayscale(1) brightness(.8) drop-shadow(0 16px 18px rgb(0 0 0 / 60%)); }
.gb-stage[data-state="destroyed"] .gb-subject { filter: grayscale(1) brightness(.35); }
.gb-stage { --gb-plate: calc(84px * var(--gb-s)); }
.gb-field {
  position: absolute; left: 0; right: 0; top: 0; bottom: var(--gb-plate); container: gb-field / size;
  background: center / 100% 100% no-repeat; /* the lines from each slot to its part (js/gear-bench.js linesArt) */
}
.gb-embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* the embers: two layers of dots drawn by the layer's own background, rising at two speeds (no element of their own,
   so none can lie on a slot) */
.gb-embers::before, .gb-embers::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 100%; opacity: 0;
  background-image: radial-gradient(circle, var(--gb-ember) 0 2px, transparent 2.5px), radial-gradient(circle, var(--gb-ember) 0 2px, transparent 2.5px),
    radial-gradient(circle, var(--gb-ember) 0 2px, transparent 2.5px), radial-gradient(circle, var(--gb-ember) 0 2px, transparent 2.5px),
    radial-gradient(circle, var(--gb-ember) 0 2px, transparent 2.5px), radial-gradient(circle, var(--gb-ember) 0 2px, transparent 2.5px),
    radial-gradient(circle, var(--gb-ember) 0 2px, transparent 2.5px);
  background-size: 6px 6px; background-repeat: no-repeat;
  background-position: 3% 82%, 17% 30%, 31% 64%, 46% 12%, 62% 74%, 77% 38%, 93% 90%;
  filter: drop-shadow(0 0 4px var(--gb-ember)); animation: gb-rise 7s linear infinite;
}
.gb-embers::after { background-position: 9% 20%, 24% 88%, 39% 46%, 54% 70%, 69% 8%, 85% 56%, 97% 28%; animation-duration: 10s; animation-delay: -5s; }
@keyframes gb-rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-200%); opacity: 0; } }

.gb-slot {
  --gb-slot: rgb(201 168 245 / 55%);
  position: absolute; width: 76px; height: 76px; transform: translate(-50%, -50%); padding: 0; border-radius: 50%;
  border: 3px solid var(--gb-slot); background: rgb(20 13 30 / 86%); color: var(--gb-soft);
  display: grid; place-items: center; cursor: pointer; animation: gb-glow 2.4s ease-in-out infinite;
}
.gb-slot img { width: 54px; height: 54px; object-fit: contain; }
.gb-slot__mark { width: 30px; height: 30px; }
/* an empty slot shows what it takes as a faded picture (a weapon, a piece of armor) with a small + on it: a word under
   the circle crossed the next slot on a phone held sideways, and one inside it would fall under the text floor */
.gb-slot__ghost { position: absolute; inset: 14%; width: 72%; height: 72%; object-fit: contain; opacity: .55; pointer-events: none; }
.gb-slot.has-ghost .gb-slot__mark { position: relative; width: 26px; height: 26px; filter: drop-shadow(0 0 3px rgb(20 13 30 / 90%)); }
.gb-slot__num {
  position: absolute; top: -8px; left: -8px; min-width: calc(var(--gb-min) + 10px); height: calc(var(--gb-min) + 10px); padding: 0 4px; box-sizing: border-box; border-radius: 999px; background: var(--gb-gold);
  color: #1a1226; font-weight: bold; font-size: var(--gb-min); display: grid; place-items: center;
}
.gb-slot.is-on { border-color: var(--gb-gold); box-shadow: 0 0 0 4px rgb(245 194 66 / 25%), 0 0 22px rgb(245 194 66 / 55%); }
.gb-slot.is-locked { opacity: .7; cursor: help; animation: none; }
/* a BROKEN piece (js/gear-wear.js): red ring, the piece greyed, a red crack over it */
.gb-slot.is-broken { --gb-slot: #FF6B6B; border-color: #FF6B6B; }
.gb-slot.is-broken img { filter: grayscale(1) brightness(.75); }
.gb-slot__crack { position: absolute; inset: 14%; width: 72%; height: 72%; color: #FF6B6B; stroke-width: 4; pointer-events: none; }
.gb-item.is-broken .gb-item__art img { filter: grayscale(1) brightness(.75); }
.gb-item.is-broken .gb-item__tag { color: #FF8A8A; font-weight: 700; }
.gb-slot.is-flash { animation: gb-flash .7s ease; }
@keyframes gb-glow { 50% { box-shadow: 0 0 18px var(--gb-slot); } }
@keyframes gb-flash { 30% { transform: translate(-50%, -50%) scale(1.25); box-shadow: 0 0 34px var(--gb-slot); } }
.gb-spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gb-ember); box-shadow: 0 0 8px var(--gb-ember); pointer-events: none; }

.gb-level {
  flex: none; width: calc(58px * var(--gb-s)); height: calc(58px * var(--gb-s)); border-radius: 50%; border: 2px solid var(--gb-gold);
  background: rgb(20 13 30 / 82%); display: grid; place-content: center; text-align: center; line-height: 1; font-size: var(--gb-min); color: var(--gb-gold);
}
.gb-level b { display: block; font-family: var(--gb-display); font-size: calc(24px * var(--gb-s)); color: var(--gb-ink); margin-top: 2px; }
.gb-badge {
  --gb-badge: #f5c242;
  display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 8px; background: var(--gb-badge);
  color: #1a1226; font-weight: bold; font-size: var(--gb-min); letter-spacing: .08em; text-transform: uppercase; text-shadow: none;
}
.gb-state {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 10px; background: rgb(20 13 30 / 88%); border: 1.5px solid var(--gb-gold); color: var(--gb-gold); font-weight: bold; font-size: var(--gb-min);
}
.gb-state .gb-mark { width: 20px; height: 20px; }
.gb-plate {
  position: absolute; left: 0; right: 0; bottom: 0; min-height: var(--gb-plate); padding: 10px 14px; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, transparent, rgb(20 13 30 / 85%) 35%);
}
.gb-plate__words { min-width: 0; flex: 1; }
.gb-plate__name { font-family: var(--gb-display); font-size: calc(26px * var(--gb-s)); font-weight: bold; line-height: 1.1; text-shadow: 0 2px 0 rgb(0 0 0 / 55%); overflow-wrap: anywhere; }
.gb-plate__sub { font-size: var(--gb-min); color: var(--gb-soft); text-shadow: 0 1px 0 rgb(0 0 0 / 60%); }
.gb-plate__nav { display: flex; gap: 6px; flex: none; }
.gb-round {
  width: var(--gb-tap); height: var(--gb-tap); border-radius: 50%; border: 1.5px solid var(--gb-line); background: rgb(36 26 61 / 92%);
  color: var(--gb-gold); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.gb-round .gb-mark { width: 26px; height: 26px; }
.gb-round:hover { border-color: var(--gb-gold); }

/* ---- the bars ------------------------------------------------------------------------------------------------- */
.gb-panel { display: grid; gap: 10px; align-content: start; min-width: 0; }
.gb-bars { display: grid; gap: 8px; background: var(--gb-surface); border: 1px solid var(--gb-line); border-radius: 14px; padding: 12px; }
.gb-bar { display: grid; grid-template-columns: minmax(84px, 7.5em) 1fr minmax(64px, auto); gap: 10px; align-items: center; font-size: var(--gb-min); }
.gb-bar__track { position: relative; height: 12px; border-radius: 6px; background: rgb(255 255 255 / 9%); overflow: hidden; }
.gb-bar__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--gb-teal), var(--gb-gold)); transition: width .45s; }
.gb-bar__ghost { position: absolute; top: 0; bottom: 0; background: rgb(107 224 74 / 88%); box-shadow: 0 0 10px var(--gb-good); animation: gb-ghost 1s ease-in-out infinite alternate; text-decoration: none; }
.gb-bar__ghost.is-loss { background: rgb(255 107 107 / 88%); box-shadow: 0 0 10px var(--gb-bad); }
@keyframes gb-ghost { from { opacity: .45; } to { opacity: 1; } }
.gb-bar__value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gb-bar__value em { font-style: normal; font-size: var(--gb-min); color: var(--gb-good); }
.gb-bar__value em.is-loss { color: var(--gb-bad); }

/* ---- the tabs and the drawer ---------------------------------------------------------------------------------- */
.gb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.gb-tab {
  min-height: var(--gb-tap); padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--gb-line); background: var(--gb-surface);
  color: var(--gb-soft); font-weight: bold; font-size: var(--gb-min); cursor: pointer;
}
.gb-tab.is-on { background: var(--gb-gold); border-color: var(--gb-gold); color: #1a1226; }
.gb-drawer { scroll-margin-top: 12px; display: grid; gap: 8px; background: var(--gb-surface); border: 1.5px solid var(--gb-gold); border-radius: 14px; padding: 12px; }
.gb-drawer__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gb-drawer__num { min-width: calc(var(--gb-min) + 10px); height: calc(var(--gb-min) + 10px); border-radius: 999px; background: var(--gb-gold); color: #1a1226; font-weight: bold; font-size: var(--gb-min); display: grid; place-items: center; flex: none; }
.gb-drawer__title { margin: 0; font-family: var(--gb-display); font-size: calc(20px * var(--gb-s)); color: var(--gb-gold); }
.gb-drawer__hint { margin-left: auto; font-size: var(--gb-min); color: var(--gb-soft); }
.gb-drawer__empty { margin: 0; color: var(--gb-soft); }
.gb-drawer__list { display: grid; gap: 8px; }
.gb-item {
  --gb-item: rgb(201 168 245 / 55%);
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px;
  border-radius: 12px; border: 1.5px solid var(--gb-line); background: rgb(20 13 30 / 62%); cursor: default;
}
.gb-item[data-peek] { cursor: pointer; }
.gb-item.is-worn { border-color: var(--gb-gold); }
.gb-item.is-peek, .gb-item[data-peek]:hover { border-color: var(--gb-teal); }
.gb-item__art { width: 58px; height: 58px; border-radius: 10px; border: 2px solid var(--gb-item); background: rgb(20 13 30 / 70%); display: grid; place-items: center; }
.gb-item__art img { width: 48px; height: 48px; object-fit: contain; }
.gb-item__words { display: grid; gap: 4px; min-width: 0; }
.gb-item__name { font-weight: bold; font-size: var(--gb-text); line-height: 1.2; overflow-wrap: anywhere; }
.gb-item__tag, .gb-item__why { font-size: var(--gb-min); color: var(--gb-soft); }
.gb-item__why { color: var(--gb-ember); }
.gb-item__sockets { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.gb-item__acts { display: flex; flex-direction: column; gap: 6px; }
.gb-socket {
  min-width: var(--gb-tap); height: var(--gb-tap); padding: 0 6px; border-radius: 10px; border: 1.5px dashed var(--gb-line);
  background: none; color: var(--gb-soft); display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.gb-socket .gb-mark { width: 22px; height: 22px; }
.gb-socket img { width: 28px; height: 28px; object-fit: contain; }
.gb-socket.is-filled { border-style: solid; border-color: var(--gb-teal); cursor: default; }
.gb-socket.is-sigil.is-filled { cursor: help; }
.gb-socket.is-locked { opacity: .72; border-style: dashed; border-color: var(--gb-soft); cursor: help; }
.gb-socket:disabled { opacity: 1; }
.gb-socket__word { font-size: var(--gb-min); font-weight: bold; color: var(--gb-teal); }
.gb-btn {
  min-height: var(--gb-tap); min-width: 72px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--gb-gold);
  background: var(--gb-gold); color: #1a1226; font-weight: bold; font-size: var(--gb-min); cursor: pointer; white-space: nowrap;
}
/* a hold button: the light fill grows under the words while it is held (js/gear-bench.js holdToFire) */
.gb-btn.is-hold { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.gb-btn__hold { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgb(255 255 255 / 45%); pointer-events: none; }
.gb-btn.is-hold > span { position: relative; }
.gb-btn.is-quiet { background: transparent; color: var(--gb-gold); border-color: var(--gb-line); }
.gb-btn:disabled { opacity: .5; cursor: not-allowed; }
.gb-price { display: flex; gap: 6px; flex-wrap: wrap; }
.gb-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 3px; border-radius: 999px; background: rgb(255 255 255 / 7%); font-size: var(--gb-min); font-variant-numeric: tabular-nums; }
.gb-chip img { width: 24px; height: 24px; object-fit: contain; }
.gb-chip.is-short { color: var(--gb-bad); background: rgb(255 107 107 / 13%); }
.gb-chip__word { font-size: var(--gb-min); color: var(--gb-soft); }

/* ---- wide: the stage left, the panel right; narrow: the stage stays in view ------------------------------------ */
@container gb (min-width: 820px) {
  .gb-in { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
  .gb-stage { height: clamp(300px, calc(100dvh - 260px), 620px); }
}
@container gb (max-width: 819px) {
  .gb-stage { position: sticky; top: 0; z-index: 2; }
}
/* a phone held sideways (the game is landscape only): the stage fits the screen's height, and it scrolls with the page,
   since a sticky stage would leave no room under it for the drawer */
@media (max-height: 520px) {
  .gb-stage { height: clamp(250px, calc(100dvh - 110px), 340px); position: relative; top: auto; --gb-plate: calc(64px * var(--gb-s)); }
  .gb-slot { width: 56px; height: 56px; }
  .gb-slot img { width: 40px; height: 40px; }
  .gb-plate { padding-block: 6px; }
  .gb-plate__name { font-size: calc(20px * var(--gb-s)); }
}
@container gb (max-width: 460px) {
  .gb-slot { width: 62px; height: 62px; }
  .gb-slot img { width: 44px; height: 44px; }
  .gb-plate__name { font-size: calc(22px * var(--gb-s)); }
  .gb-stage { --gb-plate: calc(112px * var(--gb-s)); }
  .gb-plate { flex-wrap: wrap; align-items: flex-end; }
  .gb-plate__nav { margin-left: auto; }
  .gb-item { grid-template-columns: 48px minmax(0, 1fr); }
  .gb-item__art { width: 48px; height: 48px; }
  .gb-item__art img { width: 40px; height: 40px; }
  .gb-item__acts { grid-column: 1 / -1; flex-direction: row; }
  .gb-item__acts .gb-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gb *, .gb *::before, .gb *::after { animation: none !important; transition: none !important; }
  .gb-embers { display: none; }
}
