/* Dungeons (ui/dungeon.js): window with list + details, group finder and best times, the HUD of a run in place of the
   quest tracker, the ready check and the result window. Art pixels like game.css (zoomed by --px). */
/* the window (Nutzer 01.11.2026: like the Battle Pass): every page the same height (the window never jumps), framed
   panels (.fp*, css/imperial.css) instead of loose text, rows of one height; on the page Dungeons the list on the left,
   the details in the middle scroll, the buttons stay under them */
#ui #dungeon { width: 316px; }
#ui #dungeon > .win-body { display: flex; flex-direction: column; padding: 4px 5px 5px; overflow: hidden; }
#ui #dungeon .dg-tabs { flex: none; margin-bottom: 4px; }
#ui #dungeon .dg-body { flex: none; height: 300px; min-height: 0; display: flex; flex-direction: column; }
#dungeon .dg-page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
#ui #dungeon .dg-page > .fp + .fp { margin-top: 0; }
#dungeon .dg-fill { flex: 1; }
#dungeon .dg-grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#dungeon .dg-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
#dungeon .dg-text { font-size: 7px; line-height: 8px; overflow-wrap: anywhere; }
.dg-small { font-size: 7px; line-height: 8px; overflow-wrap: anywhere; }
.dg-head { font-size: 8px; line-height: 9px; color: var(--gold); margin: 5px 0 2px; }

/* list | details */
#dungeon .dg-cols { flex-direction: row; }
#dungeon .dg-side { flex: none; width: 104px; display: flex; flex-direction: column; }
#dungeon .dg-cards { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 1px; }
#ui #dungeon .dg-card { --fp-row: 32px; min-height: var(--fp-row); height: auto; gap: 4px; padding: 2px 3px; cursor: pointer; }
#dungeon .dg-card.off { opacity: .6; }
#dungeon .dg-thumb { flex: none; width: 22px; height: 22px; background: #0b0a09 center / cover no-repeat; image-rendering: pixelated;
  box-shadow: inset 0 0 0 1px #8a7348, inset 0 0 0 2px rgba(0, 0, 0, .5); }
#dungeon .dg-card.picked .dg-thumb { box-shadow: inset 0 0 0 1px #ffd86a, inset 0 0 0 2px rgba(0, 0, 0, .5); }
#dungeon .dg-cmid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#dungeon .dg-cname { max-height: 16px; font-size: 8px; line-height: 8px; color: #eee3c8; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#dungeon .dg-card.picked .dg-cname { color: var(--gold); }
#dungeon .dg-cline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 2px; font-size: 7px; line-height: 8px; white-space: nowrap; }
#dungeon .dg-cline > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dg-state { white-space: nowrap; }
.dg-state.ok { color: var(--green, #72c85a); }
.dg-state.wait { color: #e8a25a; }
.dg-state.lock { color: var(--dim); }
.dg-state.run { color: #8fc8ff; }

#dungeon .dg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#dungeon .dg-main > .dg-scroll { padding-right: 2px; }
#ui #dungeon .dg-scroll > .fp { margin-top: 4px; }
#dungeon .dg-banner { height: 52px; }
#dungeon .dg-bname { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 6px 3px; font-size: 11px; line-height: 12px; color: #ffe08a;
  background: linear-gradient(transparent, rgba(10, 7, 4, .85)); text-shadow: var(--ol); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dungeon .dg-blv { position: absolute; right: 4px; top: 4px; z-index: 1; height: 11px; padding: 0 4px; font-size: 7px; line-height: 11px; color: #f4ead2;
  background: rgba(16, 12, 8, .82); box-shadow: inset 0 0 0 1px #a0824a; text-shadow: var(--ol); }
#dungeon .dg-offtag { position: absolute; left: 4px; top: 4px; z-index: 1; height: 11px; padding: 0 4px; font-size: 7px; line-height: 11px; color: #e8a25a;
  background: rgba(16, 12, 8, .82); box-shadow: inset 0 0 0 1px #6e4a28; }
#dungeon .dg-diffbox { display: flex; flex-direction: column; gap: 3px; }
#ui #dungeon .dg-diffbox > * { margin: 0; }
#dungeon .dg-diffs { width: 100%; }
#ui #dungeon .dg-diffs > .btn { height: 14px; }
#ui #dungeon .dg-diff.on { color: var(--gold); box-shadow: 0 0 0 1px #060504, inset 0 0 0 1px #e2bf72, inset 0 -2px 0 #c4a469; background: linear-gradient(#4b4930, #322d27); }
#ui #dungeon .dg-diff.hard.on { color: #ffbe7a; box-shadow: 0 0 0 1px #060504, inset 0 0 0 1px #e8a25a, inset 0 -2px 0 #c47a3a; background: linear-gradient(#4e3a26, #2e2219); }
#ui #dungeon .dg-diff.hell.on { color: #ff8a72; box-shadow: 0 0 0 1px #060504, inset 0 0 0 1px #d8503a, inset 0 -2px 0 #a83a2a; background: linear-gradient(#4e2620, #2e1714); }
#ui #dungeon .dg-solo { padding-top: 0; }
#dungeon .dg-stages { padding: 1px; }
#ui #dungeon .dg-stage { --fp-row: 19px; }
.dg-kind { flex: none; width: 10px; height: 10px; background: var(--icon) center / 10px 10px no-repeat; image-rendering: pixelated; }
#ui .dg-chip.good { color: var(--green, #72c85a); box-shadow: inset 0 0 0 1px #2c4a22; }
.dg-chip.hz.fire, .dg-hz.fire { color: #ffa040; } .dg-chip.hz.ice, .dg-hz.ice { color: #8fc8ff; }
.dg-chip.hz.poison, .dg-hz.poison { color: #8fdc5a; } .dg-chip.hz.dark, .dg-hz.dark { color: #c49aff; }
.dg-hzdot { flex: none; width: 5px; height: 5px; margin-right: 2px; transform: rotate(45deg); box-shadow: 0 0 0 1px #000; }
.dg-hzdot.fire { background: #ff8a20; } .dg-hzdot.ice { background: #5aa8ff; } .dg-hzdot.poison { background: #5ac83a; } .dg-hzdot.dark { background: #9a5ae8; }
#dungeon .dg-rewards { align-items: center; }
/* the buttons under the details */
#dungeon .dg-act { flex: none; display: flex; flex-direction: column; gap: 3px; }
#dungeon .dg-btns { width: 100%; }
#ui #dungeon .dg-btns > .btn { height: 18px; padding: 0 4px; line-height: 8px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
#dungeon .dg-wide { width: 100%; }
#ui #dungeon .dg-wide > .btn { height: 14px; padding: 0 4px; line-height: 8px; white-space: normal; overflow-wrap: anywhere; }
/* Party Auto-Dungeon controls and status */
#dungeon .dg-pauto { display: flex; flex-direction: column; gap: 3px; }
#ui #dungeon .dg-pauto > * { margin: 0; }
#dungeon .dg-pauto-live { display: flex; align-items: center; gap: 3px; padding: 2px 4px; font-size: 7px; line-height: 9px; color: var(--gold);
  background: rgba(34, 52, 26, .45); box-shadow: inset 0 0 0 1px #4f8a37; }
.dg-pauto-dot { flex: none; width: 4px; height: 4px; background: var(--green, #72c85a); box-shadow: 0 0 2px var(--green, #72c85a); }
#ui #dungeon .dg-pauto-btns > .btn, #ui #dungeon .dg-act .dg-stop { height: auto; min-height: 18px; padding: 2px 4px; }
#ui #dungeon .dg-pauto-dbl.on { color: var(--gold); box-shadow: 0 0 0 1px #060504, inset 0 0 0 1px #e2bf72, inset 0 -2px 0 #c4a469; background: linear-gradient(#4b4930, #322d27); }
#ui .dg-stop { color: #ffb2a6; box-shadow: 0 0 0 1px #060504, inset 0 0 0 1px #a8483c, inset 0 -2px 0 #6e2a22; background: linear-gradient(#4a231e, #2a1412); }
#ui .dg-stop:hover { color: #ffd4cc; filter: brightness(1.12); }
#dungeon .dg-vip { flex: none; padding: 0 3px; font-size: 6px; line-height: 9px; height: 9px; letter-spacing: .3px; }
#dungeon .dg-vip.on { color: var(--gold); background: rgba(242, 196, 90, .14); box-shadow: inset 0 0 0 1px #8c6a28; }
#dungeon .dg-vip.off { color: #d87a70; background: rgba(140, 40, 34, .2); box-shadow: inset 0 0 0 1px #6a2c26; opacity: .85; }

/* ticket fragments and the instant ticket (page Tickets and the details, game/dungeon.js DG_FRAG) */
#ui #dungeon .dg-tlist > .fp + .fp { margin-top: 4px; }
#dungeon .dg-frag { display: flex; flex-direction: column; gap: 3px; }
#dungeon .dg-fline { display: flex; align-items: center; gap: 4px; min-width: 0; }
#dungeon .dg-arrow { flex: none; width: 6px; font-style: normal; font-size: 9px; line-height: 9px; color: var(--gold-d); text-align: center; }
#dungeon .dg-arrow::before { content: '\00bb'; }
#dungeon .dg-tcount { flex: none; width: 58px; font-size: 7px; line-height: 8px; overflow-wrap: anywhere; }
.dg-hmods { display: flex; flex-wrap: wrap; gap: 1px 3px; font-size: 6px; line-height: 8px; }
.dg-hdiff { color: var(--gold); } .dg-hdiff.hard { color: #ffbe7a; } .dg-hdiff.hell { color: #ff8a72; }
.dg-hchip { color: #e8a25a; } .dg-hchip.good { color: var(--green, #72c85a); }
.dg-rage { color: #ff8a72; }
.dg-heal { color: #8fdc5a; }
.dg-ward > i { background: #8fc8ff; }

/* the group */
#dungeon .dg-group { padding: 1px; }
#ui #dungeon .dg-mem { --fp-row: 14px; }
.dg-mgs { flex: none; }
.dg-bad { color: var(--red, #e2463a); }
.dg-dot { flex: none; width: 5px; height: 5px; display: inline-block; box-shadow: 0 0 0 1px #000; }
#dungeon .dg-mem .pt-crown { flex: none; }
#dungeon .dg-inv { display: flex; gap: 3px; }
#ui #dungeon .dg-inv input { flex: 1; min-width: 0; height: 14px; }
#ui #dungeon .dg-inv .btn { flex: none; height: 14px; }
#dungeon .dg-friends { margin-top: 2px; max-height: 84px; overflow-y: auto; overflow-x: hidden; }
#ui #dungeon .dg-friends .dg-mem { --fp-row: 16px; }

/* group finder and best times */
#dungeon .dg-form { display: flex; flex-direction: column; gap: 3px; }
#dungeon .dg-frow { display: flex; gap: 3px; align-items: center; }
#ui #dungeon :is(.dg-frow, .dg-tool) :is(input, .sel) { height: 14px; }
#ui #dungeon .dg-frow input { flex: 1; min-width: 0; }
#dungeon .dg-frow .sel { flex: none; width: 110px; }
#dungeon .dg-tool { flex: none; display: flex; gap: 3px; align-items: center; padding: 3px 4px; box-shadow: inset 0 -1px 0 #2a241d; }
#dungeon .dg-tool .sel { flex: 1; min-width: 0; }
#ui #dungeon .dg-tool .btn { flex: none; height: 14px; }
#ui #dungeon .dg-frow2 { --fp-row: 24px; }
#dungeon .dg-frow2 .btn { flex: none; min-width: 44px; }
.dg-badge { flex: none; width: 46px; height: 10px; text-align: center; font-size: 6px; line-height: 10px; padding: 0 2px; }
.dg-badge.grp { color: #8fc8ff; box-shadow: inset 0 0 0 1px #2a4a6a; }
.dg-badge.solo { color: var(--green, #72c85a); box-shadow: inset 0 0 0 1px #2c4a22; }
#dungeon .dg-fmid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 7px; line-height: 8px; }
#dungeon .dg-bhead { flex: none; display: flex; align-items: center; gap: 4px; height: 12px; padding: 0 4px; font-size: 7px; line-height: 12px; color: var(--dim);
  background: rgba(255, 228, 170, .035); box-shadow: inset 0 -1px 0 #3a3229; }
#ui #dungeon .dg-brow { --fp-row: 15px; }
#dungeon .dg-bc1 { flex: none; width: 24px; display: flex; justify-content: center; }
#dungeon .dg-btime { flex: none; width: 34px; color: var(--gold); }
#dungeon .dg-bhead .dg-btime { color: var(--dim); }
#dungeon .dg-bnames { flex: 1; min-width: 0; }
#dungeon .dg-bdate { flex: none; width: 44px; text-align: right; }
#dungeon .dg-admin { flex: none; box-shadow: inset 0 1px 0 #2a241d; }
#dungeon .dg-scroll > .fp-empty:only-child { height: 100%; }

/* the HUD of a run: where the quest tracker is (that one is hidden meanwhile) */
#ui.in-dungeon #quest-tracker, html.touch #ui.in-dungeon #quest-tracker { display: none; }
#dg-hud { position: absolute; right: 4px; top: 128px; width: 124px; padding: 3px 4px 4px; display: flex; flex-direction: column; gap: 2px; }
#dg-hud.hidden { display: none; }
.dg-hhead { display: flex; justify-content: space-between; align-items: center; gap: 3px; font-size: 8px; line-height: 9px; }
.dg-hname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-hclock { flex: none; color: var(--text); }
.dg-hclock.warn, .dg-warn { color: #ff8a72; }
.dg-htext { font-size: 8px; line-height: 9px; color: var(--text); overflow-wrap: anywhere; }
.dg-hdone { font-size: 9px; line-height: 10px; color: var(--green, #72c85a); }
.dg-hfail { font-size: 9px; line-height: 10px; color: var(--red, #e2463a); }
.dg-bbar { height: 5px; }
.dg-shield { color: #b8c8d8; }
.dg-hmem { display: flex; flex-wrap: wrap; gap: 1px 4px; font-size: 6px; line-height: 8px; margin-top: 1px; }
.dg-hm { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; overflow: hidden; white-space: nowrap; }
.dg-hm.away { opacity: .5; }
.dg-hm.dead { color: var(--red, #e2463a); }
.dg-hbtns { gap: 2px; margin-top: 2px; }
.dg-hpauto { display: flex; align-items: center; gap: 3px; padding: 1px 3px; font-size: 7px; line-height: 9px; color: var(--gold);
  background: rgba(34, 52, 26, .45); box-shadow: inset 0 0 0 1px #4f8a37; }
#ui #dg-hud .dg-hpauto-btns > .btn { height: auto; min-height: 14px; padding: 2px 4px; line-height: 8px; white-space: normal; text-align: center; overflow-wrap: anywhere; }

/* ready check */
.dg-ready { top: 24%; width: 170px; }
.dg-ready.auto { top: 18%; width: 196px; }
.dg-ready .dg-auto-warn { margin: 3px 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.dg-ready .dg-auto-warn > div { font-size: 7px; line-height: 8px; overflow-wrap: anywhere; }
.dg-ready-rows { display: flex; flex-direction: column; gap: 1px; margin: 3px 0; }
.dg-ready-row { display: flex; align-items: center; gap: 3px; font-size: 7px; line-height: 9px; }
.dg-rname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-rmark { flex: none; width: 6px; height: 6px; box-shadow: 0 0 0 1px #000; background: #6a5a48; }
.dg-rmark.yes { background: var(--green, #72c85a); }
.dg-rmark.no { background: var(--red, #e2463a); }

/* result */
#dg-result { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); width: 210px; padding: 6px 8px 7px; z-index: 7000; }
#dg-result .dg-res-title { text-align: center; font-size: 10px; line-height: 11px; margin-bottom: 4px; }
#dg-result .wb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-bottom: 3px; }
#dg-result .wb-stat { padding: 3px 1px; text-align: center; font-size: 7px; line-height: 8px; background: linear-gradient(#1c1814, #110e0c); box-shadow: inset 0 0 0 1px #47423a; }
#dg-result .wb-stat .dim { font-size: 6px; }
#dg-result .wb-top { display: flex; gap: 3px; height: 9px; line-height: 9px; font-size: 7px; padding: 0 2px; }
#dg-result .wb-top:nth-child(odd) { background: rgba(255, 228, 170, .035); }
#dg-result .dg-got { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: linear-gradient(#1c1814, #110e0c); box-shadow: inset 0 0 0 1px #47423a; }
#dg-result .wb-rank { width: 10px; color: var(--dim); }
#dg-result .wb-tn { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#dg-result .wb-tp { width: 34px; text-align: right; }
#dg-result .wb-res-btns { gap: 4px; margin-top: 5px; }
/* "Erneut laufen?" (ui/dungeon.js renderAgain) */
#dg-result .dg-again { margin-top: 3px; }
#dg-result .dg-again .dg-small { overflow-wrap: anywhere; }
#dg-result .dg-again-btns { gap: 4px; margin-top: 3px; }
#ui #dg-result .dg-again-btns > .btn { height: auto; min-height: 14px; padding: 2px 4px; line-height: 8px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
/* "Doppelte Beute" above it (ui/dungeon.js renderDouble) */
#dg-result .dg-dbl { margin-top: 3px; }
#dg-result .dg-dbl .dg-small { overflow-wrap: anywhere; }
html.touch #ui #dg-result .dg-dbl { margin-top: 0; margin-bottom: 4px; }
/* a row of a chest whose item is not in the game yet / a set piece without a picture: a "?" in the socket */
#ui .fp-slot.dg-unk > .q { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; line-height: 10px; color: var(--dim); text-shadow: var(--ol); pointer-events: none; }
.dg-record { text-align: center; font-size: 8px; color: #ffd84a; }

/* phones and tablets (html.touch, ui/touch.js): the HUD like the quest tracker, bigger targets */
html.touch #ui #dg-hud { max-height: calc(100% - 76px - 74px * var(--tz)); overflow-y: auto; }
html.touch #ui .dg-hbtns .btn { min-height: 22px; }
html.touch #ui #dg-hud .dg-hpauto-btns > .btn { min-height: max(22px, calc(44px / var(--px))); }
html.touch #ui .dg-ready { top: 8px; width: min(210px, calc((100% - 8px) / var(--wz))); transform-origin: top center; transform: none; translate: -50% 0; }
html.touch #ui .dg-ready .ask-btns > .btn { min-height: var(--finger); height: auto; padding: 2px 4px; white-space: normal; overflow-wrap: anywhere; }
/* the result like the windows (--wz), its two parts side by side (the screen is wide, not tall): "Erneut laufen?" and
   its buttons on the right never below the fold; taller results scroll */
html.touch #ui #dg-result { top: 4px; transform: none; translate: -50% 0; scale: var(--wz); transform-origin: top center;
  width: min(330px, calc((100% - 8px) / var(--wz))); max-height: calc((100% - 8px) / var(--wz)); overflow-y: auto; }
html.touch #ui #dg-result .dg-res-cols { display: flex; gap: 8px; align-items: flex-start; }
html.touch #ui #dg-result .dg-res-main, html.touch #ui #dg-result .dg-res-side { flex: 1; min-width: 0; }
html.touch #ui #dg-result .dg-again { margin-top: 0; }
html.touch #ui #dg-result .btn { min-height: 22px; }
html.touch #ui #dg-result .dg-again-btns > .btn { min-height: max(22px, var(--finger)); }
html.touch #ui #dg-hud { width: 132px; }
/* phones: the window is as high as the screen (scaled with --wz), the details scroll inside, the buttons stay in view
   under them; a finger per card, row and button */
html.touch #ui #dungeon { width: min(400px, calc((100% - 8px) / var(--wz))) !important; height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #dungeon > .win-body { flex: 1; min-height: 0; }
html.touch #ui #dungeon .dg-body { flex: 1; height: auto; }
html.touch #ui #dungeon .dg-side { width: 118px; }
html.touch #ui #dungeon .dg-card { --fp-row: max(30px, var(--finger)); }
html.touch #ui #dungeon :is(.dg-diffs, .dg-btns, .dg-wide) > .btn { min-height: var(--finger); }
html.touch #ui #dungeon .dg-stage { --fp-row: max(19px, var(--finger)); }
html.touch #ui #dungeon .dg-mem { --fp-row: var(--finger); }
html.touch #ui #dungeon .dg-frow2 { --fp-row: max(24px, var(--finger)); }
html.touch #ui #dungeon .dg-brow { --fp-row: var(--finger); }
html.touch #ui #dungeon :is(.dg-frow2, .dg-mem, .dg-tool, .dg-inv) .btn { min-height: var(--finger); }
html.touch #ui #dungeon :is(.dg-inv input, .dg-frow input) { height: var(--finger); }
/* captcha before the n-th run in a row (ui/dgcaptcha.js): the provider's widget lies over .dg-cap-slot, outside #ui (unscaled) */
.dg-cap { top: 30%; }
.dg-cap .dg-cap-slot { margin: 3px auto 2px; }
.dg-cap .dg-cap-msg { min-height: 9px; text-align: center; font-size: 7px; line-height: 9px; margin-bottom: 3px; }
.dg-cap .dg-cap-msg.err { color: #ff8a7a; }
.dg-cap-host { position: fixed; z-index: 10000; }
html.touch #ui .dg-cap .eq-btns > .btn { min-height: var(--finger); }
