/* Statistik der Auto-Jagd (ui/huntstats.js): everything under #huntstats; panels .fp of imperial.css. PC: one column,
   phones: two side by side (left: now, range, averages; right: chart, finds) so it fits a 360 px screen. */
#ui #huntstats { width: 262px; }
#huntstats .win-body { padding: 4px 5px 5px; }
#huntstats .hs-col { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#huntstats .hs-col + .hs-col { margin-top: 4px; }
#huntstats .hs-col .fp + .fp { margin-top: 0; }

/* now: the big number, when the next level comes, the level bar */
#huntstats .hs-now { display: flex; flex-direction: column; gap: 3px; }
#huntstats .hs-big { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
#huntstats .hs-big b { font-weight: 400; font-size: 16px; line-height: 14px; color: #ffe08a; text-shadow: 1px 1px 0 var(--ink), 0 0 4px rgba(242, 196, 90, .35); }
#huntstats .hs-big span { font-size: 7px; line-height: 8px; color: var(--dim); }
#huntstats .hs-next { font-size: 8px; line-height: 9px; color: #a3d39b; overflow-wrap: anywhere; }
#huntstats .hs-plan { font-size: 7px; line-height: 8px; overflow-wrap: anywhere; }
#huntstats .hs-now > .fp-bar { flex: none; }

/* the time range: four equal buttons */
#huntstats .hs-range > .btn.on { color: #ffe08a; box-shadow: inset 0 0 0 1px #d8b46a, inset 0 0 0 2px #0a0907; background: linear-gradient(#5a4526, #2c2112); }

/* the averages: key / value in two columns; the four rates choose the chart (.picked = gold edge) */
#huntstats .hs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 1px; }
#huntstats .hs-kv { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; height: 13px; padding: 0 4px;
  font-size: 7px; line-height: 8px; box-shadow: inset 0 -1px 0 #2a241d; }
#huntstats .hs-kv:nth-child(4n+1), #huntstats .hs-kv:nth-child(4n+2) { background: rgba(255, 228, 170, .035); }
#huntstats .hs-kv > span:first-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
#huntstats .hs-kv > span:last-child { flex: none; color: #eee3c8; text-align: right; white-space: nowrap; }
#huntstats .hs-kv.hs-m:hover { background: rgba(242, 196, 90, .08); }
#huntstats .hs-kv.picked { background: linear-gradient(90deg, rgba(242, 196, 90, .22), rgba(242, 196, 90, .04)); box-shadow: inset 2px 0 0 #e2bf72, inset 0 -1px 0 #2a241d; }
#huntstats .hs-kv.picked > span { color: #ffe08a; }

/* the chart: bars from the floor (gaps where nobody hunted), the average solid, the planner dashed */
#huntstats .hs-chart { position: relative; height: 58px; margin: 1px 0 0; padding: 7px 0 0;
  background: repeating-linear-gradient(to top, transparent 0 13px, rgba(255, 228, 170, .05) 13px 14px), #0c0a08; box-shadow: inset 0 0 0 1px #3a2e22; }
#huntstats .hs-bars { position: absolute; left: 2px; right: 2px; top: 8px; bottom: 1px; display: flex; align-items: flex-end; gap: 1px; }
#huntstats .hs-bars > i { flex: 1 1 0; min-width: 0; background: linear-gradient(#ffe8a0 0 1px, #f2c45a 1px, #9c7330); border-radius: 1px 1px 0 0; }
#huntstats .hs-bars > i.gap { height: 1px; background: #3a2e22; }
#huntstats .hs-bars > i.on { background: linear-gradient(#fff6d0 0 1px, #ffe08a 1px, #c4974a); box-shadow: 0 0 3px rgba(255, 224, 138, .7); }
#huntstats .hs-line { position: absolute; left: 2px; right: 2px; height: 0; border-top: 1px solid rgba(163, 211, 155, .9); pointer-events: none; transform: translateY(1px); }
#huntstats .hs-line.est { border-top: 1px dashed rgba(170, 200, 255, .85); }
#huntstats .hs-line > span { position: absolute; right: 1px; bottom: 1px; padding: 0 2px; font-size: 6px; line-height: 6px; color: #a3d39b; background: #0c0a08cc; text-shadow: var(--ol); }
#huntstats .hs-line.est > span { right: auto; left: 1px; color: #aac8ff; }
#huntstats .hs-top { position: absolute; left: 3px; top: 1px; font-size: 6px; line-height: 6px; color: var(--dim); text-shadow: var(--ol); pointer-events: none; }
#huntstats .hs-none { position: absolute; inset: 0; display: grid; place-items: center; padding: 4px; font-size: 7px; line-height: 8px; color: var(--dim); text-align: center; }
#huntstats .hs-axis { display: flex; justify-content: space-between; height: 8px; font-size: 6px; line-height: 8px; color: var(--dim); }
#huntstats .hs-info { min-height: 9px; font-size: 7px; line-height: 9px; color: #e6dcc6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the newest finds: square slots (tall items fit by height), the rarity glow of dom.js rarityIcon */
#huntstats .hs-finds { display: flex; flex-wrap: wrap; gap: 2px; max-height: 58px; overflow-y: auto; }
#huntstats .hs-find { --slot: 18px; }
#huntstats .hs-foot { margin-top: 3px; font-size: 6px; line-height: 7px; overflow-wrap: anywhere; }

/* the plaque over the action bar opens it: it takes the mouse (game.css: none) and brightens */
#ui #autopill { pointer-events: auto; }
#ui #autopill:hover { box-shadow: 0 0 0 1px #060504, inset 0 0 0 1px #d8b46a, inset 0 0 0 2px #0c0b09, inset 0 3px 0 #c4ac7124, 0 2px 6px #0009, 0 0 5px rgba(242, 196, 90, .35); }
/* phones: a finger high, growing upwards (the quickslot row lies right under it) */
html.touch #ui #autopill::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: max(100%, calc(44px / var(--px))); }

/* the note: under the finds on the PC, under the averages on phones */
html:not(.touch) #huntstats .hs-ph, html.touch #huntstats .hs-pc { display: none; }

/* ---------- phones (ui/touch.js): three columns side by side, as high as the screen (~145 art px inside), finger-sized
   buttons and tiles: now + range | averages + note | chart + finds ---------- */
html.touch #ui #huntstats { width: min(430px, calc((100% - 8px) / var(--wz))); height: calc((100% - 8px) / var(--wz)); display: flex; flex-direction: column; }
html.touch #ui #huntstats > .win-body { flex: 1; min-height: 0; padding: 3px 4px; overflow: hidden; display: flex; flex-direction: column; }
html.touch #ui #huntstats .hs-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: minmax(0, 1fr); gap: 4px; }
html.touch #ui #huntstats .hs-col { min-height: 0; overflow-y: auto; }
html.touch #ui #huntstats .hs-col + .hs-col { margin-top: 0; }
html.touch #ui #huntstats .hs-big b { font-size: 14px; line-height: 12px; }
/* the planner's estimate is the dashed line of the chart there (no room for its line) */
html.touch #ui #huntstats .hs-plan { display: none; }
html.touch #ui #huntstats .hs-range { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 2px; }
html.touch #ui #huntstats .hs-range > .btn.small { height: var(--finger); line-height: var(--finger); }
/* the averages: two tiles a row, the label over the value (a finger high, long words wrap) */
html.touch #ui #huntstats .hs-kv { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; height: auto; min-height: var(--finger); padding: 2px 3px; background: none; }
html.touch #ui #huntstats .hs-kv > span:first-child { max-width: 100%; white-space: normal; line-height: 8px; max-height: 16px; overflow-wrap: anywhere; }
html.touch #ui #huntstats .hs-kv:nth-child(4n+1), html.touch #ui #huntstats .hs-kv:nth-child(4n+2) { background: rgba(255, 228, 170, .035); }
html.touch #ui #huntstats .hs-kv.picked { background: linear-gradient(90deg, rgba(242, 196, 90, .22), rgba(242, 196, 90, .04)); }
html.touch #ui #huntstats .hs-ph .hs-foot { margin: 3px 2px 0; }
/* chart and finds: the chart smaller, the finds fill the rest, their slots scroll */
html.touch #ui #huntstats .hs-col:last-child { display: flex; flex-direction: column; overflow: hidden; }
html.touch #ui #huntstats .hs-chart { height: 44px; }
html.touch #ui #huntstats .hs-drops { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
html.touch #ui #huntstats .hs-drops > .fp-b { flex: 1; min-height: 0; display: flex; flex-direction: column; }
html.touch #ui #huntstats .hs-finds { flex: 1; min-height: 0; max-height: none; align-content: flex-start; }
html.touch #ui #huntstats .hs-find { --slot: 22px; }
/* (the heads keep their title: the range is the lit button, the minutes per bar are not worth the room) */
html.touch #ui #huntstats .hs-col:nth-child(2) .fp-x, html.touch #ui #huntstats .hs-course .fp-x { display: none; }
