/* Prestige, the Dunkler Sura's forge and the endless rift (ui/evolve.js): one window, three views */
#evolution { max-width: calc(100% - 12px); }
#evolution .win-body { padding: 5px 6px; }
#evolution .ev-tabs { margin-bottom: 4px; }
#evolution .ev-tabs.hidden { display: none; }
#evolution .ev-body { max-height: 300px; overflow-y: auto; overflow-x: hidden; padding: 0 1px 2px; }
/* the forge and the rift keep one height on both of their tabs and with a message under them (Nutzer 08.11.2026): the body
   takes the rest and scrolls */
html:not(.touch) #ui #evolution:is([data-view="forge"], [data-view="rift"]) > .win-body { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
html:not(.touch) #ui #evolution:is([data-view="forge"], [data-view="rift"]) :is(.ev-tabs, .ev-message) { flex: none; }
html:not(.touch) #ui #evolution:is([data-view="forge"], [data-view="rift"]) .ev-body { flex: 1 1 auto; min-height: 0; max-height: none; }
html:not(.touch) #ui #evolution[data-view="forge"] { height: 256px; }
html:not(.touch) #ui #evolution[data-view="rift"] { height: 349px; }
#evolution p { margin: 3px 0 4px; font-size: 7px; line-height: 8px; }
#evolution .ev-message { padding: 3px 2px 0; font-size: 7px; line-height: 8px; text-align: center; white-space: normal; overflow-wrap: anywhere; color: var(--green); }
#evolution .ev-message.red { color: var(--red); }
#evolution .ev-message:empty { display: none; }
/* head of a view: big emblem (fal pictures, tools/art/gen_evolve_icons.py) and the main number */
#evolution .ev-head { display: flex; align-items: center; gap: 6px; padding: 2px 0 4px; border-bottom: 1px solid #70593855; margin-bottom: 3px; }
#evolution .ev-emblem { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 0 3px #9d5cff66); }
#evolution .ev-head-text { min-width: 0; font-size: 7px; line-height: 9px; }
#evolution .ev-big { font-size: 10px; line-height: 11px; color: #ead2a0; text-shadow: var(--ol); }
#evolution .ev-list { margin: 2px 0 4px; }
#evolution .ev-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; min-height: 14px; font-size: 7px;
  border-bottom: 1px solid #70593833; padding: 1px 0; }
#evolution .ev-row > .num { min-width: 30px; text-align: right; }
#evolution .ev-actions { margin-top: 5px; }
/* Yang of the forge */
#evolution .ev-purse { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 7px; padding: 0 1px 3px; margin-bottom: 3px;
  border-bottom: 1px solid #70593855; }
/* the slots of fusion / corruption */
#evolution .ev-forge { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 3px 0; }
#evolution .ev-slots { display: flex; gap: 2px; align-items: flex-start; }
#evolution .ev-pick { width: 18px; min-height: 18px; cursor: pointer; }
#evolution .ev-pick.empty { height: 36px; opacity: .55; cursor: default; }
#evolution .ev-out { box-shadow: inset 0 0 0 1px #c9a24a, 0 0 5px #f2c45a66; }
#evolution .ev-arrow { color: var(--gold); font-size: 12px; line-height: 12px; }
#evolution .ev-chance { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px; align-items: center; font-size: 7px; margin: 1px 0 2px; }
#evolution .ev-bar { height: 4px; background: #0f0c0a; box-shadow: inset 0 0 0 1px #4d3e2c; }
#evolution .ev-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #8a4ad8, #f2c45a); }
#evolution .ev-outs { flex: 1; min-width: 0; }
#evolution .ev-out-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 3px; font-size: 7px; line-height: 9px; }
#evolution .ev-out-row > b { text-align: right; font-weight: normal; }
#evolution .ev-sel { text-align: center; font-size: 7px; margin-bottom: 2px; }
/* what corruption locks for good: a red box with a "!" (Nutzer 15.11.2026: as grey small print it was overlooked) */
#evolution .ev-warn { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 4px; align-items: center; margin: 3px 0 4px; padding: 3px 4px;
  font-size: 7px; line-height: 8px; color: #ffb09a; text-shadow: var(--ol); overflow-wrap: anywhere; background: #4a141088; box-shadow: inset 0 0 0 1px #b8402f; }
#evolution .ev-warn-i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); color: #fff; font-size: 8px; line-height: 9px; text-align: center;
  font-weight: normal; }
#evolution .ev-sub { font-size: 7px; color: var(--gold); margin: 4px 0 2px; }
/* the pieces that fit, slots like in the inventory */
#evolution .ev-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1px; max-height: 92px; overflow-y: auto; padding: 1px; background: #0f0c0a66;
  box-shadow: inset 0 0 0 1px #33281d; }
#evolution .ev-cell { width: 18px; cursor: pointer; position: relative; }
#evolution .ev-cell.picked { box-shadow: inset 0 0 0 1px var(--gold), 0 0 4px #f2c45a88; background: #2a2018; }
#evolution .ev-no { position: absolute; right: 1px; top: 0; font-size: 7px; color: var(--gold); text-shadow: var(--ol); }
#evolution .ev-none { font-size: 7px; line-height: 8px; padding: 4px; }
#evolution .keyhelp { text-align: center; margin-top: 2px; }
/* what the floors of the rift give */
#evolution .ev-table { font-size: 7px; }
#evolution .ev-tr { display: grid; gap: 4px; padding: 1px 2px; border-bottom: 1px solid #70593833; }
#evolution .ev-tr > span:last-child { text-align: right; }
#evolution .ev-tr > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#evolution .ev-th { color: var(--dim); }
#evolution .ev-tr.boss > span:first-child { color: #ff8a6a; }
/* a locked bonus in the item tooltip */
.tooltip .tt-spos.tt-lock { color: #f2d27a; }
/* a bonus on its highest step (game/bonus.js attrAtMax, Dev-Ticket #156) */
.tooltip .tt-spos.tt-max { color: #8fc6ff; }

/* the run: on the right under the minimap like the dungeon's #dg-hud, the quest tracker steps aside (the screen notices
   in the middle covered it before) */
#rift-hud { position: absolute; right: 4px; top: 128px; width: 124px; padding: 3px 4px 4px; display: flex; flex-direction: column; gap: 2px;
  font-size: 7px; line-height: 9px; }
#rift-hud.hidden { display: none; }
#rift-hud > strong { font-size: 8px; }
#rift-hud .rh-kind { color: #d9a8ff; }
#rift-hud .btn { width: 100%; margin-top: 2px; }
#ui.in-rift #quest-tracker, html.touch #ui.in-rift #quest-tracker { display: none; }
/* the summary at the end of a run (ui/evolve.js showResult): time, floors, damage, loot; again / leave */
#rift-result { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); width: 214px; padding: 6px 8px 7px; z-index: 7000;
  display: flex; flex-direction: column; gap: 3px; font-size: 7px; line-height: 9px; }
#rift-result .rr-title { text-align: center; font-size: 10px; line-height: 11px; overflow-wrap: anywhere; }
#rift-result .rr-sub, #rift-result .rr-wait, #rift-result .rr-tip { text-align: center; overflow-wrap: anywhere; }
#rift-result .rr-record { text-align: center; font-size: 8px; color: #ffd84a; text-shadow: 0 0 4px rgba(255, 200, 60, .6), var(--ol); }
#rift-result .rr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
#rift-result .rr-stat { padding: 2px 1px; text-align: center; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px #2e251c; overflow-wrap: anywhere; }
#rift-result .rr-stat .dim { font-size: 6px; line-height: 7px; }
#rift-result .rr-head { color: var(--gold); font-size: 8px; margin-top: 2px; }
#rift-result .rr-got { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; max-height: 64px; overflow-y: auto; }
#rift-result .rr-gold { padding: 0 2px; }
#rift-result .rr-item { position: relative; width: 18px; height: 18px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px #2e251c; }
#rift-result .rr-item img { width: 16px; height: 16px; margin: 1px; object-fit: contain; }
#rift-result .rr-item b { position: absolute; right: 0; bottom: -1px; font-size: 6px; line-height: 7px; text-shadow: var(--ol); font-weight: normal; }
#rift-result .rr-btns { gap: 4px; margin-top: 2px; }
/* the item rolls of the rift */
#evolution .ev-loot { display: flex; flex-direction: column; }
#evolution .ev-lr { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 28px; gap: 4px; align-items: center; min-height: 13px; font-size: 7px;
  border-bottom: 1px solid #70593833; }
#evolution .ev-lr img { width: 12px; height: 12px; object-fit: contain; }
#evolution .ev-lr > b { text-align: right; font-weight: normal; }
#evolution .ev-ln { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#evolution .ev-tr { grid-template-columns: 30px minmax(0, 1fr) 46px; }
#rare-drop-flash { position: fixed; inset: 0; pointer-events: none; z-index: 2; box-shadow: inset 0 0 80px 12px #efbf4970; animation: rare-gold 650ms ease-out forwards; }
@keyframes rare-gold { from { opacity: .75; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #rare-drop-flash { display: none; } }

/* phones and tablets: bigger targets (≥ 44 CSS px), the grid as high as there is room */
html.touch #evolution { width: min(244px, calc((100% - 8px) / var(--wz))) !important; }
html.touch #evolution .btn { min-height: calc(44px / (var(--px) * var(--wz))); height: auto; white-space: normal; padding: 2px 6px; }
html.touch #evolution .ev-tabs .tab { height: calc(44px / (var(--px) * var(--wz))); line-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #evolution .ev-body { max-height: none; }
html.touch #evolution .ev-cell, html.touch #evolution .ev-pick { width: 22px; }
html.touch #evolution .ev-grid { max-height: 70px; }
html.touch #ui #rift-hud { width: 132px; max-height: calc(100% - 136px - 74px * var(--tz)); overflow-y: auto; }
html.touch #rift-hud .btn { min-height: calc(44px / var(--px)); }
/* the summary like the windows (--wz): from the top, taller ones scroll */
html.touch #ui #rift-result { top: 4px; transform: none; translate: -50% 0; scale: var(--wz); transform-origin: top center;
  width: min(260px, calc((100% - 8px) / var(--wz))); max-height: calc((100% - 8px) / var(--wz)); overflow-y: auto; }
html.touch #ui #rift-result .btn { min-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #ui #rift-result .rr-item { width: 24px; height: 24px; }
html.touch #ui #rift-result .rr-item img { width: 22px; height: 22px; }
