/* Erfolge (ui/achievements.js, #achievements) and the Abenteurer-Profil (ui/profile.js, #profile), Nutzer 02.11.2026.
   Art pixels like game.css (zoomed by --px); the panels are the .fp of imperial.css. Phones: at the end (html.touch). */
#ui :is(#achievements, #profile) .ac-tic { flex: none; width: 10px; height: 10px; margin-right: 3px; image-rendering: auto; }

/* ---------- Erfolge: the level and the categories on the left, the list on the right ---------- */
#ui #achievements { width: 340px; }
#ui #achievements .win-body { padding: 4px 5px 5px; }
#ui #achievements .ac-wrap { display: grid; grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: 'sum right' 'nav right'; gap: 4px; height: 240px; }
#ui #achievements .ac-sum { grid-area: sum; }
#ui #achievements .ac-nav { grid-area: nav; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0; }
#ui #achievements .ac-right { grid-area: right; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 3px; }
#ui #achievements .ac-sum .fp-h > img { image-rendering: auto; }
#ui #achievements .ac-sumtop { display: flex; align-items: center; gap: 4px; }
#ui #achievements .ac-medal { flex: none; width: 24px; height: 24px; image-rendering: auto; }
#ui #achievements .ac-sumtxt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#ui #achievements .ac-lv { font-size: 11px; line-height: 11px; color: var(--gold); text-shadow: 1px 1px 0 var(--ink); white-space: nowrap; }
#ui #achievements .ac-pts-all { font-size: 7px; line-height: 8px; color: var(--dim); white-space: nowrap; }
#ui #achievements .ac-lvbar { margin-top: 3px; flex: none; }
#ui #achievements .ac-next { margin-top: 2px; font-size: 6px; line-height: 7px; color: #b8d89a; overflow-wrap: anywhere; }
#ui #achievements .ac-navrow { --fp-row: 15px; cursor: pointer; font-size: 7px; }
#ui #achievements .ac-navrow img { flex: none; width: 11px; height: 11px; object-fit: contain; image-rendering: auto; }
#ui #achievements .ac-navn { flex: none; font-size: 6px; color: var(--dim); }
#ui #achievements .ac-navrow.picked .fp-e { color: var(--gold); }
#ui #achievements .ac-title { display: none; flex: none; font-size: 8px; line-height: 10px; color: var(--gold); text-shadow: 1px 1px 0 var(--ink); }
#ui #achievements .ac-tools { flex: none; display: flex; align-items: center; gap: 3px; }
#ui #achievements .ac-search { flex: 1; min-width: 0; height: 13px; }
#ui #achievements .ac-filter { flex: none; width: 58px; }
#ui #achievements .ac-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 1px; background: linear-gradient(#1c1814, #110e0c); box-shadow: inset 0 0 0 1px #47423a; }
#ui #achievements .ac-list > .fp { box-shadow: none; background: none; }
#ui #achievements .ac-list > .fp + .fp { margin-top: 2px; box-shadow: inset 0 1px 0 #3a3229; }

/* one achievement: icon, name and what to do, progress or date, points */
#ui :is(#achievements, #profile) .ac-row { display: flex; align-items: center; gap: 4px; min-height: 26px; padding: 2px 3px; box-shadow: inset 0 -1px 0 #2a241d; }
#ui :is(#achievements, #profile) .ac-row:hover { background: rgba(242, 196, 90, .06); }
#ui #achievements .ac-ic { position: relative; flex: none; width: 20px; height: 20px; background: linear-gradient(#1f1b17, #100d0b); box-shadow: inset 0 0 0 1px #4c443a; }
#ui #achievements .ac-ic img { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; object-fit: contain; image-rendering: auto; }
#ui #achievements .ac-row:not(.done) .ac-ic img { filter: grayscale(.7) brightness(.7); }
#ui #achievements .ac-row.done .ac-ic { box-shadow: inset 0 0 0 1px #9a7a3a, 0 0 2px rgba(242, 196, 90, .4); }
#ui #achievements .ac-ok { position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; background: url(../assets/ui/battlepass/check.png) center / contain no-repeat; image-rendering: auto; }
#ui #achievements .ac-main { flex: 1; min-width: 0; }
#ui #achievements .ac-name { font-size: 8px; line-height: 9px; color: #e6dcc6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui #achievements .ac-row.done .ac-name { color: var(--gold); }
#ui #achievements .ac-text { font-size: 6px; line-height: 7px; color: var(--dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
#ui #achievements .ac-side { flex: none; width: 56px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
#ui #achievements .ac-bar { flex: none; width: 56px; height: 8px; }
#ui #achievements .ac-bar > span { font-size: 6px; line-height: 8px; }
#ui #achievements .ac-date { font-size: 7px; line-height: 8px; color: #a8e07a; white-space: nowrap; }
#ui #achievements .ac-p { font-size: 6px; line-height: 7px; color: #c8a868; white-space: nowrap; }

/* the Erfolgsstufen of the overview */
#ui #achievements .ac-lrow { --fp-row: 14px; font-size: 7px; }
#ui #achievements .ac-lrow .fp-e { color: var(--dim); }
#ui #achievements .ac-lrow.got .fp-e { color: #b8d89a; }
#ui #achievements .ac-lp { flex: none; width: 36px; color: #c8a868; white-space: nowrap; }

/* the Namensschild-Effekte: a card per effect with the own name moving */
#ui #achievements .ac-nts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin-top: 3px; }
#ui #achievements .ac-nt { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 2px 3px; cursor: pointer;
  background: linear-gradient(#221d18, #14110f); box-shadow: inset 0 0 0 1px #3a3229; }
#ui #achievements .ac-nt:hover { box-shadow: inset 0 0 0 1px #8a7044; }
#ui #achievements .ac-nt.picked { box-shadow: inset 0 0 0 1px #e2bf72, 0 0 3px rgba(242, 196, 90, .45); background: linear-gradient(#35280f, #191208); }
#ui #achievements .ac-nt.locked { cursor: default; }
#ui #achievements .ac-nt.locked .ac-ntcv { opacity: .45; filter: grayscale(.6); }
#ui #achievements .ac-ntcv { display: block; width: 100%; height: 24px; image-rendering: pixelated; pointer-events: none; }
#ui #achievements .ac-ntname { font-size: 7px; line-height: 8px; color: #e6dcc6; text-align: center; overflow-wrap: anywhere; }
#ui #achievements .ac-nt.picked .ac-ntname { color: var(--gold); }
#ui #achievements .ac-ntst { font-size: 6px; line-height: 7px; color: var(--dim); text-align: center; overflow-wrap: anywhere; }
#ui #achievements .ac-nt.picked .ac-ntst { color: #a8e07a; }

/* ---------- Abenteurer-Profil ---------- */
#ui #profile { width: 268px; }
#ui #profile .win-body { padding: 4px 5px 5px; }
#ui #profile .pf-head { position: relative; display: flex; flex-direction: column; align-items: center; padding: 2px 4px 3px; }
#ui #profile .pf-name { display: block; width: 100%; height: 16px; image-rendering: pixelated; }
#ui #profile .pf-sub { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 7px; line-height: 9px; white-space: nowrap; max-width: 100%; overflow: hidden; }
#ui #profile .pf-flag { flex: none; width: 8px; height: 8px; object-fit: contain; }
#ui #profile .pf-sub .tidle { margin-left: 3px; }
#ui #profile .pf-main { display: flex; gap: 4px; margin-top: 4px; height: 196px; }
#ui #profile .pf-tabs { flex: none; width: 78px; display: flex; flex-direction: column; gap: 1px; padding: 1px; background: linear-gradient(#1c1814, #110e0c); box-shadow: inset 0 0 0 1px #47423a; }
#ui #profile .pf-tab { --fp-row: 18px; flex: none; cursor: pointer; font-size: 7px; }
/* (long names in two lines: "Cei mai buni timpi", "Teljesítmények") */
#ui #profile .pf-tab .fp-e { white-space: normal; overflow-wrap: anywhere; line-height: 7px; max-height: 14px; }
#ui #profile .pf-tab img { flex: none; width: 11px; height: 11px; object-fit: contain; image-rendering: auto; }
#ui #profile .pf-tab.picked .fp-e { color: var(--gold); }
#ui #profile .pf-page { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; }
#ui #profile .pf-page .fp-kv > div { font-size: 7px; }
/* the overview in one column (ui/profile.js kv: in two the values were cut off), every other row a little lighter */
#ui #profile .fp-kv.pf-kv1 { grid-template-columns: minmax(0, 1fr); }
#ui #profile .fp-kv.pf-kv1 > div { background: none; }
#ui #profile .fp-kv.pf-kv1 > div:nth-child(odd) { background: rgba(255, 228, 170, .035); }
#ui #profile .pf-fav { display: flex; align-items: center; gap: 4px; font-size: 7px; line-height: 8px; }
#ui #profile .pf-fav img { flex: none; width: 16px; height: 16px; object-fit: contain; }
#ui #profile .pf-favt { min-width: 0; overflow-wrap: anywhere; }
#ui #profile .pf-cat, #ui #profile .pf-last { --fp-row: 15px; font-size: 7px; }
#ui #profile :is(.pf-cat, .pf-last) img { flex: none; width: 11px; height: 11px; object-fit: contain; image-rendering: auto; }
#ui #profile .pf-cbar { flex: none; width: 52px; height: 8px; }
#ui #profile .pf-cbar > span { font-size: 6px; line-height: 8px; }
#ui #profile .pf-ti { --fp-row: 22px; font-size: 7px; }
#ui #profile .pf-tit { flex: 1; min-width: 0; }
#ui #profile :is(.pf-tin, .pf-tid) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 8px; }
#ui #profile .pf-tid { font-size: 6px; line-height: 7px; }
#ui #profile .pf-tiimg { flex: none; height: 12px; width: auto; max-width: 34px; object-fit: contain; image-rendering: pixelated; }
#ui #profile .pf-stage { position: relative; width: 104px; height: 132px; margin: 0 auto; overflow: hidden;
  background: radial-gradient(ellipse at 50% 85%, rgba(242, 196, 90, .14), rgba(0, 0, 0, 0) 70%); }
#ui #profile .pf-stage::before { content: ''; position: absolute; left: 22px; right: 22px; bottom: 3px; height: 12px; border-radius: 50%; background: rgba(0, 0, 0, .45); }
#ui #profile .pf-stage canvas { position: absolute; left: 0; top: 0; width: 104px; height: 132px; z-index: 1; image-rendering: pixelated; cursor: grab; }
#ui #profile .pf-btns { margin-top: 4px; }
#ui #profile .equip-panel { margin: 2px auto 3px; }
/* Fertigkeiten and Boni (ticket #129): the rows of the character window (.cw-sk) and of the bonus board (.bb-row) as the
   rows of a panel; under a skill's name its first value, wrapping instead of cut off */
#ui #profile .cw-skills { gap: 0; }
#ui #profile .cw-sk { min-height: 22px; padding: 2px 0; background: none; box-shadow: inset 0 -1px 0 #2a241d; }
#ui #profile .cw-sk:last-child, #ui #profile .bb-row:last-child { box-shadow: none; }
#ui #profile :is(.cw-sk, .bb-row):hover { background: rgba(242, 196, 90, .07); }
#ui #profile .cw-sk-mid { gap: 2px; }
#ui #profile .cw-sk-name { font-size: 7px; line-height: 8px; }
#ui #profile .pf-skv { font-size: 7px; line-height: 8px; color: #8ab98e; overflow-wrap: anywhere; }
#ui #profile .fp-b > .cw-sec { margin: 4px 0 1px; padding: 0 1px 1px; font-size: 7px; line-height: 9px; box-shadow: none; }
#ui #profile .fp-b > .cw-sec:first-child { margin-top: 0; }
#ui #profile .bb-row { margin: 0; padding: 2px 2px 1px; background: none; box-shadow: inset 0 -1px 0 #2a241d; }

/* ---------- phones (ui/touch.js): as high as the screen, a finger per row and button ---------- */
html.touch #ui #achievements { width: min(380px, calc((100% - 8px) / var(--wz))); height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #achievements > .win-body { flex: 1; display: flex; overflow: hidden; padding: 3px 4px 3px; }
html.touch #ui #achievements .ac-wrap { flex: 1; width: 100%; height: auto; min-height: 0; grid-template-columns: var(--finger) minmax(0, 1fr); grid-template-areas: 'nav sum' 'nav right'; }
html.touch #ui #achievements .ac-sum .fp-h, html.touch #ui #achievements .ac-medal, html.touch #ui #achievements .ac-next { display: none; }
html.touch #ui #achievements .ac-sum .fp-b { display: flex; align-items: center; gap: 6px; padding: 2px 4px; }
html.touch #ui #achievements .ac-sumtop { flex: none; }
html.touch #ui #achievements .ac-sumtxt { flex-direction: row; align-items: baseline; gap: 4px; }
html.touch #ui #achievements .ac-lv { font-size: 9px; line-height: 10px; }
html.touch #ui #achievements .ac-lvbar { flex: 1; margin: 0; height: 10px; }
html.touch #ui #achievements .ac-nav { overflow-y: auto; }
html.touch #ui #achievements .ac-navrow { --fp-row: var(--finger); justify-content: center; padding: 0; }
html.touch #ui #achievements .ac-navrow img { width: 16px; height: 16px; }
html.touch #ui #achievements .ac-navrow :is(.fp-e, .ac-navn) { display: none; }
html.touch #ui #achievements .ac-title:not(:empty) { display: block; }
html.touch #ui #achievements .ac-search { height: var(--finger); }
html.touch #ui #achievements .ac-filter { width: 70px; height: var(--finger); }
html.touch #ui #achievements .ac-row { min-height: var(--finger); }
html.touch #ui #achievements .ac-nts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.touch #ui #achievements .ac-nt { min-height: var(--finger); }

html.touch #ui #profile { width: min(330px, calc((100% - 8px) / var(--wz))); height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #profile > .win-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 3px 4px 3px; }
html.touch #ui #profile .pf-head { flex: none; flex-direction: row; justify-content: center; gap: 6px; padding: 1px 4px; }
html.touch #ui #profile .pf-name { width: 110px; height: 14px; }
html.touch #ui #profile .pf-main { flex: 1; min-height: 0; height: auto; margin-top: 3px; }
/* (seven pages since ticket #129: the tabs in two columns, a phone's height takes four fingers, not seven) */
html.touch #ui #profile .pf-tabs { display: grid; grid-template-columns: repeat(2, var(--finger)); grid-auto-rows: var(--finger); align-content: start;
  width: calc(var(--finger) * 2 + 3px); overflow-y: auto; }
html.touch #ui #profile .pf-sub { min-width: 0; flex: 1 1 auto; justify-content: flex-start; }
html.touch #ui #profile .pf-sub .pf-emp { display: none; }
html.touch #ui #profile .pf-tab { --fp-row: var(--finger); justify-content: center; padding: 0; }
html.touch #ui #profile .pf-tab img { width: 16px; height: 16px; }
html.touch #ui #profile .pf-tab .fp-e { display: none; }
html.touch #ui #profile .pf-btns .btn { min-height: var(--finger); }
html.touch #ui #profile .cw-sk { min-height: var(--finger); }

/* the Server-Firsts (ui/achievements.js renderFirsts): the moving emblem of the title, what it takes, who got it */
#ui #achievements .sf-row { align-items: flex-start; padding: 3px; }
#ui #achievements .sf-em { flex: none; width: 64px; height: 26px; display: flex; align-items: center; justify-content: center; }
#ui #achievements .sf-cv { width: 64px; height: 26px; }
#ui #achievements .sf-em img { width: 16px; height: 16px; object-fit: contain; }
#ui #achievements .sf-row:not(.done) .sf-em { opacity: .6; filter: grayscale(.5); }
#ui #achievements .sf-row.mine { background: rgba(242, 196, 90, .08); box-shadow: inset 2px 0 0 var(--gold), inset 0 -1px 0 #2a241d; }
#ui #achievements .sf-row .ac-text { -webkit-line-clamp: 3; }
#ui #achievements .sf-who { display: flex; align-items: baseline; gap: 4px; margin-top: 1px; font-size: 7px; line-height: 8px; min-width: 0; }
#ui #achievements .sf-by { flex: 1; min-width: 0; color: var(--gold); overflow-wrap: anywhere; }
#ui #achievements .sf-open { color: var(--dim); }
