/* Upgrade window (ui/refine.js): blacksmith, upgrade scrolls anywhere, alchemist */
#refine .win-body { padding: 5px 6px; }
/* one height in every state and tab (Nutzer 08.11.2026: it grew and shrank with the scrolls and materials): the contents
   scroll inside, the buttons (.ref-foot) stay at the bottom */
html:not(.touch) #ui #refine { height: 284px; }
html.touch #ui #refine { height: calc((100% - 8px) / var(--wz)); }
#ui #refine > .win-body { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
#refine .win-body > .tabs { flex: none; }
.ref-box { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.ref-box > * { flex-shrink: 0; }
.ref-foot { flex: none; }
.ref-box .orange { color: #ffaa40; }
.ref-top { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 3px; min-height: 22px; }
.ref-arrow { font-size: 12px; line-height: 12px; color: var(--gold); text-shadow: var(--ol); }
.ref-top .slot { --slot: 20px; width: 20px; }
.ref-top .slot img.ic { left: 2px; top: 1px; }
.ref-target.fx-up { box-shadow: inset 0 0 0 1px var(--green), 0 0 4px var(--green); }
.ref-target.fx-down, .ref-target.fx-keep { box-shadow: inset 0 0 0 1px #ffaa40, 0 0 4px #ffaa40; }
.ref-target.fx-gone { box-shadow: inset 0 0 0 1px var(--red), 0 0 4px var(--red); }
.ref-names { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 7px; line-height: 8px; text-align: center; }
.ref-hint { font-size: 7px; line-height: 8px; text-align: center; margin: 1px 2px 2px; }
.ref-flash { font-size: 7px; line-height: 8px; text-align: center; margin-top: 2px; }
.ref-err { font-size: 7px; line-height: 8px; text-align: center; margin-top: 4px; }
.ref-sec { margin-top: 4px; padding-top: 3px; border-top: 1px solid #2a2119; }
.ref-sec-t { color: var(--gold); font-size: 7px; line-height: 8px; margin-bottom: 2px; }
.ref-sec > .dim { font-size: 7px; line-height: 8px; }
.ref-helpers { display: flex; flex-wrap: wrap; gap: 2px; }
.ref-helpers .slot { cursor: pointer; }
.ref-helpers .slot.picked { box-shadow: inset 0 0 0 1px var(--gold), inset 1px 1px 0 1px var(--edge); background: #2a2018; }
.ref-none span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; color: var(--dim); }
.ref-chance { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; margin-top: 4px; font-size: 8px; line-height: 9px; }
.ref-chance .gold { font-size: 9px; }
.ref-event { font-size: 7px; line-height: 8px; margin-top: 1px; }
.ref-fail { font-size: 7px; line-height: 8px; margin-top: 1px; }
.ref-needs { display: flex; flex-direction: column; gap: 1px; }
.ref-need { display: flex; align-items: center; gap: 3px; min-height: 16px; font-size: 7px; line-height: 8px; }
.ref-need .ref-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-need .cic.yang { background: #0f0c0a var(--ic-coin) center / 16px 16px no-repeat; }
.ref-card { margin-top: 3px; padding: 2px 3px 3px; background: #1d1712; box-shadow: inset 0 0 0 1px var(--bronze-d); }
.ref-card .ref-craft-h .ref-nm { font-size: 8px; }
.ref-card-b { display: flex; justify-content: flex-end; margin-top: 2px; }
/* two buttons side by side (recipes, smelting): the equal grid of .eq-btns, at the right */
.ref-card-b.eq-btns { display: grid; margin: 2px 0 0 auto; }
.ref-btns { margin-top: 5px; }
/* tab "Taus" (game/dew.js): the six Taus, the recipe of the chosen one below */
.dew-list { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; }
.dew-row { display: flex; align-items: center; gap: 3px; padding: 1px 3px 1px 1px; cursor: pointer; background: #15100d; box-shadow: inset 0 0 0 1px #33281d; }
.dew-row:hover { background: #1d1712; }
.dew-row.picked { background: #2a2018; box-shadow: inset 0 0 0 1px var(--bronze), inset 0 0 0 2px #15100d; }
.dew-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 7px; line-height: 8px; }
.dew-txt .gold { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dew-can { flex-shrink: 0; font-size: 7px; line-height: 8px; }
.dew-auto { margin-top: 3px; }
/* the alchemist's grid (ui/refine.js extractView, Ticket #126): cells like the Lager, 8 x 6 (game/refine.js EXTRACT_COLS) */
#refine .ref-grid { grid-template-columns: repeat(8, var(--slot)); margin: 1px auto 2px; }
#refine .ref-exinfo { display: flex; flex-direction: column; }
/* phone: the grid and its lines without scrolling - the alchemist's greeting says what he does, the empty grid how to fill it */
html.touch #ui #refine .ref-exhint { display: none; }
html.touch #ui #refine .ref-grid { margin: 0 auto; }
html.touch #ui #refine .ref-exinfo .ref-chance { margin-top: 2px; }
