/* Drachensteinalchemie (ui/dragonsoul.js): everything under #dragonsoul. Panels .fp of imperial.css. Like the original's
   two windows (user 19.11.2026): left the layout in use on its disc (a painted picture, shown at half size); at the
   Alchemist (.ds-near) in the middle the stones behind the tabs of kind and class in a grid of 8 x 10 and the materials,
   right the part Alchemie with the chosen stone and the three ways to improve it. Away from him (the button of the
   inventory) only the layout. Every part keeps its height whatever it shows. Nothing animates. */
#ui #dragonsoul { width: 184px; }
#ui #dragonsoul.ds-near { width: 474px; }
/* the title in the narrow window (it: "Alchimia delle Pietre del drago"): no letter spacing, less room on the left */
#ui #dragonsoul:not(.ds-near) .win-title:has(> .win-help) { padding-left: 8px; letter-spacing: 0; }
#dragonsoul .win-body { padding: 4px 5px 5px; }
#dragonsoul .ds-tic { flex: none; width: 10px; height: 10px; margin-right: 3px; image-rendering: auto; }
#dragonsoul .ds-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; height: 261px; }
#dragonsoul.ds-near .ds-main { grid-template-columns: 146px 154px minmax(0, 1fr); }
#dragonsoul:not(.ds-near) .ds-inv { display: none; }
#dragonsoul .ds-main .fp + .fp { margin-top: 0; }

/* ---------- the layouts ---------- */
#dragonsoul .ds-left { display: flex; flex-direction: column; min-height: 0; }
#dragonsoul .ds-lbody { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 3px 4px 4px; }
#dragonsoul .ds-decks { width: 100%; }
#dragonsoul .ds-decks > .btn { height: 12px; font-size: 7px; }
/* the disc: 124 art px (the picture has 264: sharp at UI size 2), 9 px of room around it for the slots on its rim */
#dragonsoul .ds-disc { position: relative; flex: none; width: 124px; height: 124px; margin: 7px 9px 5px; }
#dragonsoul .ds-dimg { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; pointer-events: none; }
#dragonsoul .ds-disc.off .ds-dimg { filter: grayscale(.9) brightness(.6); }
#dragonsoul .ds-slot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; cursor: pointer; background-color: #14110e; }
#dragonsoul .ds-slot:not(.full) img.ic { opacity: .22; filter: grayscale(1); }
#dragonsoul .ds-disc.off .ds-slot.full img.ic { filter: grayscale(.8) brightness(.7); }
#dragonsoul :is(.ds-slot, .ds-cell, .ds-rs).hl { box-shadow: inset 0 0 0 1px var(--gold), 0 0 3px 1px rgba(255, 200, 80, .5); }
#dragonsoul .ds-onrow { width: 100%; }
#dragonsoul .ds-on { display: flex; align-items: center; justify-content: center; gap: 3px; height: 13px; font-size: 7px; }
#dragonsoul .ds-dot { flex: none; width: 4px; height: 4px; background: #5a4d3c; box-shadow: inset 0 0 0 1px #2a2018; }
#dragonsoul .ds-on.on { color: #d6ffc4; }
#dragonsoul .ds-on.on .ds-dot { background: #8dff5e; box-shadow: 0 0 4px #8dff5e; }
#dragonsoul .ds-set { flex: none; width: 100%; min-height: 14px; font-size: 6px; line-height: 7px; text-align: center; color: var(--dim); overflow-wrap: anywhere; }
#dragonsoul .ds-set.on { color: var(--gold); }
#dragonsoul .ds-sum { flex: 1; min-height: 0; width: 100%; overflow: auto; padding: 2px 3px; font-size: 7px; line-height: 8px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px #2a241d; }
/* a bonus and beside it the part of the Setbonus: gold while it counts, grey while it does not yet */
#dragonsoul .ds-srow { overflow-wrap: anywhere; }
#dragonsoul .ds-amount { white-space: nowrap; }
#dragonsoul .ds-sp { color: #7d7466; }
#dragonsoul .ds-sp.on { color: var(--gold); }

/* ---------- the stones: tabs of kind (the raw stone of each) and class, the grid, the materials ---------- */
#dragonsoul .ds-inv { display: flex; flex-direction: column; min-height: 0; }
#dragonsoul .ds-ibody { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3px; padding: 3px 4px 4px; }
#dragonsoul .ds-ibody > .tabs { flex: none; margin: 0; }
#dragonsoul .ds-kinds .tab { display: grid; place-items: center; height: 18px; }
#dragonsoul .ds-kic { width: 16px; height: 16px; object-fit: contain; pointer-events: none; }
#dragonsoul .ds-kinds .tab:not(.has):not(.on) .ds-kic { opacity: .4; filter: grayscale(1); }
#dragonsoul .ds-classes .tab { flex: 1 1 auto; height: 13px; line-height: 13px; padding: 0 2px; }
#dragonsoul .ds-classes .tab.myth { flex-grow: 3; }
#dragonsoul .ds-classes .tab.has:not(.on) { color: #e6d7b0; }
/* eight columns like the original's grid of the alchemy, ten rows on the page; more stones scroll */
#dragonsoul .ds-grid { flex: none; display: grid; grid-template-columns: repeat(8, 18px); grid-auto-rows: 18px; align-content: start; justify-content: center;
  height: 180px; overflow-y: auto; overflow-x: hidden; }
#dragonsoul .ds-cell[data-i] { cursor: pointer; }
#dragonsoul .ds-cell.pinned::after { content: ''; position: absolute; left: 1px; top: 1px; width: 4px; height: 4px; background: var(--gold); box-shadow: 0 0 0 1px #000; pointer-events: none; }
/* the eight materials (the beans at the end) in one row under the grid, a second one where there is no room (phones) */
#dragonsoul .ds-mats { flex: none; display: flex; flex-wrap: wrap; justify-content: center; padding-top: 3px; box-shadow: inset 0 1px 0 #2a241d; }
#dragonsoul .ds-mat.none img.ic { opacity: .35; filter: grayscale(1); }
#dragonsoul .ds-mat.none .cnt { color: var(--dim); }

/* ---------- the part of the Alchemist: only beside him ---------- */
#dragonsoul .ds-ref { display: none; flex-direction: column; min-height: 0; }
#dragonsoul.ds-near .ds-ref { display: flex; }
#dragonsoul .ds-rbody { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3px; padding: 3px 4px 4px; }
#dragonsoul .ds-rbody > * { flex: none; }
/* the chosen stone: icon, name (two lines at most), strength */
#dragonsoul .ds-pick { display: flex; align-items: center; gap: 4px; height: 24px; }
#dragonsoul .ds-pick > .slot { flex: none; }
#dragonsoul .ds-pt { flex: 1; min-width: 0; font-size: 6px; line-height: 7px; }
#dragonsoul .ds-pn { font-size: 7px; line-height: 8px; color: #eee3c8; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-height: 16px; }
#dragonsoul .ds-pn.special { color: var(--bon, #b0dfb4); }
#dragonsoul .ds-pt > .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui #dragonsoul .ds-rbody > .ds-lines { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 2px 3px; font-size: 7px; line-height: 8px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px #2a241d; }
#dragonsoul .ds-place, #dragonsoul .ds-acts, #dragonsoul .ds-shop { width: 100%; }
#dragonsoul :is(.ds-place, .ds-acts, .ds-shop) > .btn { height: 13px; font-size: 7px; padding: 0 3px; white-space: nowrap; }
#dragonsoul .ds-modes { margin: 0; }
#dragonsoul .ds-modes .tab { flex: 1 1 auto; padding: 0 3px; }
/* what goes in -> what comes out (the original's refine window): the stone, its like ones / beans / flames, the result */
#dragonsoul .ds-recipe { display: flex; align-items: center; justify-content: center; gap: 4px; height: 20px; }
#dragonsoul .ds-ins { display: flex; gap: 2px; }
#dragonsoul .ds-rs.none img.ic { opacity: .35; filter: grayscale(1); }
#dragonsoul .ds-rs.none .cnt { color: var(--red, #ff7b6b); }
#dragonsoul .ds-rs.pickable { cursor: pointer; }
#dragonsoul .slot .cnt { right: 3px; white-space: nowrap; }
#dragonsoul .ds-arrow { flex: none; width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 5px; border-color: transparent transparent transparent var(--gold); }
#dragonsoul .ds-q { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; color: var(--gold); text-shadow: var(--ol); pointer-events: none; }
/* the text of the way chosen: one height for every text (five lines), the Yang, the answer of the server */
#dragonsoul .ds-info { height: 35px; overflow: hidden; font-size: 6px; line-height: 7px; color: var(--dim); overflow-wrap: anywhere; }
#dragonsoul .ds-cost { display: flex; justify-content: space-between; gap: 4px; height: 8px; font-size: 7px; line-height: 8px; }
#dragonsoul .ds-cost > .red { color: var(--red, #ff7b6b); }
#dragonsoul .ds-flash { height: 8px; overflow: hidden; font-size: 7px; line-height: 8px; white-space: nowrap; text-overflow: ellipsis; }
#dragonsoul .ds-flash.red { color: var(--red, #ff7b6b); }
#dragonsoul .ds-flash.green { color: var(--green); }
#dragonsoul .ds-flash.gold { color: var(--gold); }
#dragonsoul .ds-shop { margin-top: 1px; }
/* the tongs in the question how to take a stone out (ui/dialog.js pickBox) */
#ui .dlg-pick .ds-pic { width: 12px; height: 12px; margin-right: 3px; vertical-align: -3px; object-fit: contain; }

/* ---------- phones: a finger for every target, the window as high as the screen and scrolling inside; the part of the
   Alchemist under the other two ---------- */
html.touch #ui #dragonsoul { width: 186px; height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #dragonsoul.ds-near { width: min(340px, calc((100% - 8px) / var(--wz))); }
html.touch #ui #dragonsoul .win-body { flex: 1; min-height: 0; overflow: auto; padding: 3px 4px; }
html.touch #ui #dragonsoul .ds-main { height: auto; grid-template-columns: minmax(0, 1fr); }
html.touch #ui #dragonsoul.ds-near .ds-main { grid-template-columns: 150px minmax(0, 1fr); }
html.touch #ui #dragonsoul .ds-ref { grid-column: 1 / -1; }
html.touch #ui #dragonsoul .ds-slot { width: var(--finger); height: var(--finger); margin: calc(var(--finger) / -2) 0 0 calc(var(--finger) / -2); }
html.touch #ui #dragonsoul :is(.ds-slot, .ds-cell, .ds-mat, .ds-rs) img.ic { left: calc((var(--finger) - 16px) / 2); top: calc((var(--finger) - 16px) / 2); }
html.touch #ui #dragonsoul .ds-disc { margin: calc(var(--finger) / 2 - 2px) calc(var(--finger) / 2) calc(var(--finger) / 2 - 4px); }
html.touch #ui #dragonsoul :is(.ds-decks > .btn, .ds-on, .ds-place > .btn, .ds-acts > .btn, .ds-shop > .btn) { height: var(--finger); min-height: var(--finger); }
html.touch #ui #dragonsoul :is(.ds-kinds, .ds-classes, .ds-modes) .tab { height: var(--finger); line-height: var(--finger); }
html.touch #ui #dragonsoul .ds-classes { flex-wrap: wrap; }
html.touch #ui #dragonsoul .ds-sum { flex: none; height: 44px; }
html.touch #ui #dragonsoul .ds-grid { grid-template-columns: repeat(auto-fill, var(--finger)); grid-auto-rows: var(--finger); height: calc(var(--finger) * 2); }
html.touch #ui #dragonsoul :is(.ds-cell, .ds-mat, .ds-rs) { width: var(--finger); height: var(--finger) !important; }
html.touch #ui #dragonsoul .ds-mats { gap: 2px; }
html.touch #ui #dragonsoul .ds-recipe { height: auto; }
html.touch #ui #dragonsoul .ds-pick { height: auto; min-height: var(--finger); }
html.touch #ui #dragonsoul .ds-rbody > .ds-lines { flex: none; overflow: visible; }
html.touch #ui #dragonsoul .ds-info { height: auto; min-height: 35px; }
html.touch #ui #dragonsoul .fp-h { height: 16px; line-height: 16px; }
