/*
 * assets/ui/forge-room.css - THE BLACKSMITH'S OWN PARTS (js/forge-room.js): the stable sheet, the Anvil, the Rack,
 * the Souls card, the pickers and the forge reveal. The fitting screen's look is assets/ui/gear-bench.css.
 *
 * Inside a room these sit in js/room-ui.css's world (.rui, .rui-dlg); the colours here are the game's own (index.html
 * :root). Words follow the room's floor and its text size (var(--rui-min), 16 px at Normal, 20 at Larger, 24 at Largest,
 * lesson UI-5; a search box's words 16 px or more, PH-14), targets 44 px or more, no motion under prefers-reduced-motion.
 * Plan: https://claude.ai/artifact/CHDuHdP1TNdwJYQ7MPvUmD (Goliath picked "Build it as shown", 2026-11-09).
 */
/* THE FLESHSMITH (Goliath 2026-11-09 05:14Z, the Horde's rooms to the same standard): its room and its sheets wear the
   Horde's colours, the bench's own (assets/ui/gear-bench.css .gb[data-side="horde"]): purple for what is picked,
   witchfire green for the sparks, and a slab of bone for the anvil */
.rui[data-side="horde"], .fr-sheet--horde { --fr-gold: #c77dff; --fr-spark: #9dff6b; }
.fr-sheet--horde .fr-reveal__anvil { background: linear-gradient(180deg, #d8d2bf, #6f6a58); }
.fr-sheet--horde .fr-reveal__hammer { background: linear-gradient(#9dff6b, #9dff6b) 30% 0 / 60% 34% no-repeat, linear-gradient(#5a3d2a, #5a3d2a) 55% 100% / 12% 70% no-repeat; }

.fr-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-block: 4px 8px; }
.fr-search {
  display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 0; min-height: 48px; padding: 0 12px;
  border-radius: 12px; border: 1.5px solid rgb(201 168 245 / 35%); background: rgb(20 13 30 / 70%); color: #d2c5e4;
}
.fr-search:focus-within { border-color: var(--fr-gold, #f5c242); }
.fr-search__mark {
  width: 20px; height: 20px; flex: none; border: 2.5px solid currentColor; border-radius: 50%; position: relative;
}
.fr-search__mark::after { content: ""; position: absolute; width: 8px; height: 2.5px; background: currentColor; right: -7px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; }
.fr-search__input { flex: 1; min-width: 0; border: 0; background: none; color: #fbf3e7; font: inherit; font-size: calc(16px * var(--rui-s, 1)); padding: 10px 0; outline: none; }
.fr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fr-chip.rui-btn { min-height: 44px; border-radius: 999px; padding-inline: 14px; }
.fr-chip.is-on { border-color: var(--fr-gold, #f5c242); color: var(--fr-gold, #f5c242); background: color-mix(in srgb, var(--fr-gold, #f5c242) 14%, transparent); }
.fr-count { margin: 0 0 6px; font-size: var(--rui-min, 16px); color: #d2c5e4; }
.fr-note { margin: 8px 0 0; color: #d2c5e4; font-size: var(--rui-min, 16px); }
.fr-h3 { margin: 6px 0 4px; font-size: calc(17px * var(--rui-s, 1)); color: var(--fr-gold, #f5c242); }

/* ---- the stable's tiles ---------------------------------------------------------------------------------------- */
.fr-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.fr-tiles__item { position: relative; }
.fr-tile {
  --fr-rare: #9c93b8;
  width: 100%; min-height: 156px; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 8px 8px 10px;
  border-radius: 14px; border: 2px solid var(--fr-rare); background: rgb(20 13 30 / 72%); color: #fbf3e7; cursor: pointer; font: inherit;
}
.fr-tile:hover, .fr-tile:focus-visible { box-shadow: 0 0 14px var(--fr-rare); }
.fr-tile.is-current { box-shadow: 0 0 0 3px var(--fr-gold, #f5c242); }
.fr-tile__art { width: 92px; height: 92px; object-fit: contain; }
.fr-tile__name { font-weight: bold; font-size: var(--rui-min, 16px); line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.fr-pips { display: flex; gap: 4px; }
.fr-pips i { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid #d2c5e4; }
.fr-pips i.is-on { background: var(--fr-gold, #f5c242); border-color: var(--fr-gold, #f5c242); }
.fr-star {
  position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  color: #d2c5e4; -webkit-mask: var(--fav-star-off) center / 30px no-repeat; mask: var(--fav-star-off) center / 30px no-repeat; background-color: currentColor;
}
.fr-star.is-on { color: var(--fr-gold, #f5c242); -webkit-mask-image: var(--fav-star-on); mask-image: var(--fav-star-on); }
.fr-star:focus-visible { outline: 3px solid #7fe0d6; }

/* ---- rows in a sheet (Souls, a picker) ------------------------------------------------------------------------- */
.fr-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fr-row { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.fr-row__art { width: 40px; height: 40px; object-fit: contain; flex: none; }
.fr-row__words { display: grid; flex: 1; min-width: 0; gap: 2px; }
.fr-row__name { flex: 1; min-width: 0; }
.fr-row__line { font-size: var(--rui-min, 16px); color: #d2c5e4; }
.fr-row__why { font-size: var(--rui-min, 16px); color: #ffb347; }
.fr-row__price { display: inline-flex; align-items: center; gap: 4px; font-weight: bold; color: var(--fr-gold, #f5c242); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fr-row__price.is-free { color: #6be04a; font-weight: normal; }
.fr-row__coin { width: 24px; height: 24px; }

/* ---- the Anvil and the Rack ------------------------------------------------------------------------------------ */
.fr-stock { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fr-stock__item { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 999px; background: rgb(20 13 30 / 70%); border: 1px solid rgb(201 168 245 / 28%); font-variant-numeric: tabular-nums; }
.fr-stock__item img { width: 28px; height: 28px; object-fit: contain; }
.fr-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.fr-card {
  --fr-rare: #9c93b8;
  position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 10px; text-align: center;
  border-radius: 14px; border: 2px solid var(--fr-rare); background: rgb(20 13 30 / 76%);
}
.fr-card.is-picked { box-shadow: 0 0 0 3px var(--fr-gold, #f5c242); }
.fr-card__art { width: 76px; height: 76px; object-fit: contain; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--fr-rare) 45%, transparent)); }
.fr-card__name { font-size: calc(16px * var(--rui-s, 1)); line-height: 1.2; overflow-wrap: anywhere; }
.fr-card__kind { font-size: var(--rui-min, 16px); color: var(--fr-rare); }
.fr-card__line { font-size: var(--rui-min, 16px); color: #d2c5e4; }
.fr-card__sigil { font-size: var(--rui-min, 16px); font-weight: bold; color: #7fe0d6; }
.fr-card__why { font-size: var(--rui-min, 16px); color: #ffb347; }
.fr-card__acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; width: 100%; }
.fr-card__acts .rui-btn, .fr-card > .rui-btn { flex: 1 1 auto; width: 100%; }
.fr-card__acts .rui-btn { width: auto; }
.fr-card .gb-price { justify-content: center; }
.fr-new { position: absolute; top: 8px; left: 8px; background: #6be04a; color: #102010; font-weight: bold; font-size: var(--rui-min, 16px); border-radius: 6px; padding: 1px 6px; }
.fr-sockets { display: inline-flex; gap: 4px; align-items: center; }
.fr-sockets__gem { width: 22px; height: 22px; object-fit: contain; }
.fr-sockets__empty { width: 14px; height: 14px; border: 2px solid #d2c5e4; transform: rotate(45deg); border-radius: 2px; }

/* ---- the reveal ------------------------------------------------------------------------------------------------ */
.fr-sheet--reveal .rui-dlg__body { display: grid; justify-items: center; gap: 12px; text-align: center; }
.fr-reveal { --fr-rare: var(--fr-gold, #f5c242); position: relative; width: min(280px, 80vw); height: 240px; }
.fr-reveal__anvil {
  position: absolute; left: 50%; bottom: 14px; width: 170px; height: 70px; transform: translateX(-50%);
  background: linear-gradient(180deg, #5a4d78, #2b2142); border-radius: 10px 10px 18px 18px;
  clip-path: polygon(0 0, 100% 0, 88% 40%, 70% 45%, 66% 100%, 34% 100%, 30% 45%, 12% 40%);
}
.fr-reveal__hammer {
  position: absolute; right: 26px; top: 20px; width: 64px; height: 64px; transform-origin: 85% 85%; transform: rotate(-40deg);
  background: linear-gradient(#d2c5e4, #d2c5e4) 30% 0 / 60% 34% no-repeat, linear-gradient(#8a6a3a, #8a6a3a) 55% 100% / 12% 70% no-repeat;
}
.fr-reveal.is-striking .fr-reveal__hammer { animation: fr-strike .42s ease-in 3; }
@keyframes fr-strike { 50% { transform: rotate(14deg); } }
.fr-reveal__sparks { position: absolute; left: 50%; bottom: 84px; width: 0; height: 0; }
.fr-reveal__sparks i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--fr-spark, #ffb347); box-shadow: 0 0 8px var(--fr-spark, #ffb347); }
.fr-reveal__beam {
  position: absolute; left: 50%; bottom: 80px; width: 96px; height: 0; transform: translateX(-50%); border-radius: 48px 48px 0 0;
  background: linear-gradient(0deg, var(--fr-rare), transparent); filter: blur(4px); opacity: .85; transition: height .5s ease-out;
}
.fr-reveal__piece { position: absolute; left: 50%; bottom: 96px; width: 110px; height: 110px; object-fit: contain; transform: translateX(-50%) scale(.4); opacity: 0; filter: drop-shadow(0 0 18px var(--fr-rare)); transition: transform .7s ease-out, opacity .5s; }
.fr-reveal.is-done .fr-reveal__beam { height: 150px; }
.fr-reveal.is-done .fr-reveal__piece { transform: translateX(-50%) translateY(-14px) scale(1); opacity: 1; }
.fr-reveal.is-done .fr-reveal__hammer { opacity: 0; transition: opacity .3s; }
.fr-reveal__name { font-size: calc(22px * var(--rui-s, 1)); color: var(--fr-rare, var(--fr-gold, #f5c242)); }
.fr-reveal__acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* the Fitting section holds the bench: no extra card chrome around it */
.rsh-board--blacksmith .rsh-body--fit { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  .fr-reveal *, .fr-tile, .fr-card { animation: none !important; transition: none !important; }
}
