/* Phones and tablets (ui/touch.js sets html.touch; nothing here applies on a PC). Its own layout (user: change it
   completely if it plays well on a small screen):
   --tz (ui/scale.js) the controls under the thumbs, ~2 CSS px per art pixel (a 24 px button = 48 CSS px, what Apple and
       Google ask for); --wz the windows and tooltips, ~1.6 CSS px per art pixel, taller ones scroll inside, the
       inventory lies sideways. The HUD itself (frames, minimap, quests, chat) keeps the normal scale.
   The HUD of the world (joystick, attack button with the quickslots, chat, menu panel) is in css/touchhud.css. */
html.touch, html.touch body { touch-action: none; overscroll-behavior: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }

/* ---------- held upright: turn the phone ---------- */
#turn { display: none; }
html.touch #turn.on { position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; background: #0b0809; color: var(--text); font-family: var(--font); text-align: center; }
#turn img { width: 96px; height: 96px; image-rendering: pixelated; animation: turn-phone 2.6s ease-in-out infinite; }
#turn b { font-size: 30px; line-height: 1; font-weight: 400; color: var(--gold); text-shadow: 2px 2px 0 var(--ink); }
#turn span { max-width: 300px; font-size: 20px; line-height: 1.1; color: var(--dim); }
@keyframes turn-phone { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(-90deg); opacity: .6; } }

/* ---------- windows, dialogs and tooltips: bigger, never taller than the screen ---------- */
html.touch #ui > .win, html.touch #ui .dlg-back .win { scale: var(--wz); transform-origin: 0 0; max-height: calc((100% - 8px) / var(--wz)); display: flex; flex-direction: column; }
html.touch #ui .dlg-back .win { transform-origin: 50% 50%; }
html.touch #ui > .win > .win-body, html.touch #ui .dlg-back .win > .win-body { min-height: 0; overflow-y: auto; overflow-x: hidden; }
html.touch #ui > .win > .win-title, html.touch #ui .dlg-back .win > .win-title { flex: none; }
/* (never in the way of the next tap: a tooltip stays up after the finger is gone) */
html.touch #ui .tooltip { scale: var(--wz); transform-origin: 0 0; pointer-events: none; }
/* touch-only stack split button docked below the item tooltip (ui/inventory.js, Dev-Ticket #240) */
html.touch #ui #touch-split { position: absolute; z-index: 100001; scale: var(--wz); transform-origin: 0 0;
  min-width: var(--finger); min-height: var(--finger); height: auto; padding: 2px 10px;
  font-size: 9px; line-height: 11px; white-space: nowrap; }
html.touch #ui .dlg input.dlg-num { min-width: 56px; height: var(--finger); font-size: 10px; }
html.touch #ui #drag-ghost { scale: var(--wz); transform-origin: 8px 8px; }
/* the small menus at the finger (ui.js popMenu): as big as the windows, every entry 44 CSS px high; too many for the
   screen's height stand side by side (class cols, the columns set by fitTouchMenu) */
html.touch #ui .ctx-menu { scale: var(--wz); transform-origin: 0 0; display: grid; grid-template-columns: auto; gap: 1px; min-width: 110px; padding: 3px; }
html.touch #ui .ctx-menu.cols { column-gap: 2px; }
html.touch #ui .ctx-title { grid-column: 1 / -1; font-size: 8px; padding: 1px 5px 3px; margin-bottom: 2px; }
html.touch #ui .ctx-item { display: flex; align-items: center; min-height: calc(44px / (var(--px) * var(--wz))); padding: 0 6px;
  font-size: 8px; line-height: 10px; background: rgba(242, 196, 90, .05); box-shadow: inset 0 0 0 1px rgba(58, 46, 34, .7); }
/* the inventory sideways: equipment left, the bag right - a phone is wide, not tall (user 27./30.10.2026); the page tabs,
   "Sortieren" and "Müll" stand as a column right of the bag (with the 44-CSS-px tabs above it the last rows were cut off).
   That fits a whole 360 CSS px screen at the automatic UI size; on a shorter one (the bars of the browser, small phones) or
   with a bigger UI size the body scrolls with the finger (the rule for all windows above, ui/touch.js): nothing is out of reach */
html.touch #ui #inventory { width: max-content !important; }
html.touch #ui #inventory > .win-body { display: grid; grid-template-columns: 94px auto auto; grid-template-rows: auto auto 1fr; column-gap: 6px; align-items: start; }
html.touch #ui #inventory .eq-tabs { grid-column: 1; grid-row: 1; }
html.touch #ui #inventory .equip-panel { grid-column: 1; grid-row: 2; }
html.touch #ui #inventory .inv-gs { grid-column: 1; grid-row: 3; }
html.touch #ui #inventory .win-body > .tabs:not(.eq-tabs) { grid-column: 3; grid-row: 1 / 4; flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; }
html.touch #ui #inventory .win-body > .tabs:not(.eq-tabs) > :is(.tab, .btn) { margin: 0; }
/* more than two pages (bought in the Itemshop, ui/inventory.js syncPageTabs): the column in two, a finger each - eight in one
   column were taller than the bag */
html.touch #ui #inventory .win-body > .inv-pages.many { display: grid; grid-template-columns: repeat(2, var(--finger)); align-content: start; }
html.touch #ui #inventory .inv-grid { grid-column: 2; grid-row: 1 / 4; }
/* the special inventory the same way (user 30.10.2026: the three rows of category tabs pushed its bag below the screen):
   categories as a column on the left, the bag in the middle, pages and "Sortieren" as a column on the right; the
   right-click hint is in every item tooltip already. Scrolls like the inventory; with no room beside the inventory it lies
   over the inventory's left part and folds in with its own X (place, ui/special.js) */
html.touch #ui :is(#special-inv, #supply-inv) { width: max-content !important; }
html.touch #ui :is(#special-inv, #supply-inv) > .win-body { display: grid; grid-template-columns: 50px auto auto; column-gap: 6px; align-items: start; }
html.touch #ui :is(#special-inv, #supply-inv) .sp-cats { grid-column: 1; grid-row: 1; flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; }
html.touch #ui :is(#special-inv, #supply-inv) .sp-cats .tab { flex: none; width: 100%; margin: 0; }
html.touch #ui :is(#special-inv, #supply-inv) .inv-grid { grid-column: 2; grid-row: 1; }
html.touch #ui :is(#special-inv, #supply-inv) .sp-pages { grid-column: 3; grid-row: 1; flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0; }
html.touch #ui :is(#special-inv, #supply-inv) .sp-pages > :is(.tab, .btn) { margin: 0; }
html.touch #ui :is(#special-inv, #supply-inv) .sp-help { display: none; }
html.touch #ui #supply-inv > .win-body { grid-template-columns: auto auto; }
html.touch #ui #supply-inv .inv-grid { grid-column: 1; }
html.touch #ui #supply-inv .sp-pages { grid-column: 2; }
/* "Sortieren" / "Müll" (icons, game.css) wider for a finger; not higher: the window already scrolls on a phone */
html.touch #ui .tabs > .btn.sort-btn { width: 18px; }

/* ---------- the HUD of the world (joystick, attack button, quickslots, chat, menu panel): css/touchhud.css ---------- */

/* ---------- small targets get a bigger invisible hit area (window X, target X) ---------- */
html.touch #ui .win-close::after, html.touch #ui #target .tclose::after { content: ''; position: absolute; inset: -5px -3px -5px -7px; }
/* the own buffs under the player frame: a tap anywhere on the bar lists them to end (ui.js, ui/affects.js pickAffect) */
html.touch #ui #affects:not(:empty)::before { content: ''; position: absolute; inset: -2px -14px -4px -6px; }
/* Begleiter window (ui/pets.js): the gems of the rarities wider for a finger, the clear button of the search with a
   bigger hit area; the columns get the height of the screen (PetWindow.fitTouch) */
html.touch #ui #pets .pet-chip { width: 18px; }
html.touch #ui #pets .pet-qx::after { content: ''; position: absolute; inset: -2px -2px -2px -6px; }
/* the star of the favourites a finger wide, inside the corner of the stage (it cuts off what sticks out; 2 px: the
   scroll bar of the column lies over the stage's right edge) */
html.touch #ui #pets .pet-fav { right: 2px; bottom: 0; width: var(--finger); height: var(--finger); }
/* Horse training gets independent columns so the exam and feed remain reachable on landscape phones. */
html.touch #ui #pets { width: min(356px, calc((100% - 8px) / var(--wz))) !important; height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #pets[data-tab="horse"] .pet-body { max-height: none; overflow: hidden; }
html.touch #ui #pets .horse-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 6px; height: calc(100vh / (var(--px) * var(--wz)) - 70px); }
html.touch #ui #pets .horse-training { padding-left: 6px; }
html.touch #ui #pets[data-tab="horse"] .btn,
html.touch #ui #pets[data-tab="horse"] .tab { min-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #ui #pets[data-tab="horse"] .btn { white-space: normal; height: auto; padding: 4px; }

/* "Müll" (ui/trash.js): wider instead of taller - the grid left, what it brings and the buttons right; places, kinds and
   buttons big enough for a finger (24 / 22 art px) */
html.touch #ui #trash { width: max-content !important; height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #trash > .win-body { display: grid; grid-template-columns: auto 92px; grid-template-rows: auto auto 1fr; column-gap: 6px; }
html.touch #trash .tr-tabs, html.touch #trash .tr-bar, html.touch #trash .tr-grid { grid-column: 1; }
html.touch #trash .tr-sum { grid-column: 2; grid-row: 1 / 3; align-self: start; margin: 0; }
html.touch #ui #trash .tr-btns { grid-column: 2; grid-row: 3; align-self: end; grid-auto-flow: row; }
html.touch #trash .tr-btns > .btn { height: 22px; }
html.touch #trash .tr-grid { grid-template-columns: repeat(8, 24px); grid-auto-rows: 24px; width: 214px; height: 112px; background-size: 26px 26px;
  background-image: linear-gradient(90deg, transparent 24px, #0b0907 24px), linear-gradient(transparent 24px, #0b0907 24px), linear-gradient(#14100c, #14100c); }
html.touch #trash .tr-cell > img, html.touch #trash .tr-cell .rar-shine { left: 2px; top: 2px; width: 20px; height: calc(100% - 4px) !important; }
html.touch #trash .tr-chip { width: 22px; height: 22px; }
html.touch #trash .tr-chip img { width: 18px; height: 18px; }
html.touch #trash .tr-chip.txt { width: auto; line-height: 22px; }

/* Rangliste (ui/ranking.js): the lists and the table get the height of the screen (they scroll themselves), the lists,
   classes and periods are big enough for a finger */
html.touch #ui #ranking > .win-body { overflow: hidden; }
html.touch #ranking .rk-main { flex: 1 1 auto; min-height: 60px; height: 214px; }
html.touch #ranking .rk-cats { width: 104px; }
html.touch #ranking .rk-reset { width: 104px; }
html.touch #ranking .rk-cat { min-height: 18px; }
html.touch #ranking .rk-sub { min-height: 16px; }
html.touch #ranking .rk-cat img { width: 13px; height: 13px; }
html.touch #ranking .rk-arrow { width: 14px; height: 14px; }
html.touch #ranking .rk-arrow::before { left: 4px; top: 5px; }
html.touch #ranking .rk-job { height: 28px; }
html.touch #ranking .rk-job img { width: 14px; height: 14px; }
html.touch #ranking .rk-pers .tab { height: 16px; line-height: 16px; }
html.touch #ranking .rk-rows .rk-row { height: 14px; }

/* window "Titel" (ui/titlewin.js): the categories as a row of tabs on top, the list below as high as the screen allows
   (TitleWindow.fit), rows and buttons big enough for a finger */
html.touch #titles .tw-wrap { flex-direction: column; }
html.touch #titles .tw-side { width: auto; flex: none; }
html.touch #titles .tw-side > .tw-h, html.touch #titles .tw-show { display: none; }
html.touch #titles .tw-cats { display: flex; gap: 1px; }
html.touch #titles .tw-cat { flex: 1 1 0; min-width: 0; min-height: 28px; margin-top: 0; flex-direction: column; justify-content: center; gap: 1px; padding: 2px; }
html.touch #titles .tw-cat .tw-cc { display: none; }
html.touch #titles .tw-cn { flex: none; max-width: 100%; text-align: center; overflow-wrap: normal; }
html.touch #titles .tw-row { min-height: 30px; }
html.touch #titles .tw-btns > .btn { height: 22px; }

/* Feldlager (ui/camp.js): side by side instead of one under the other, as wide as the screen allows - the troops left
   as big rows over the darkened camp picture (tents, banners and chests only on the PC: a troop that is back opens with
   its button), the order board right with a scroll of its own, the trader up in the head; buttons for a finger */
html.touch #ui #camp { width: min(460px, calc((100% - 8px) / var(--wz))) !important; }
html.touch #ui #camp > .win-body { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "head head foot" "troops bh bh" "troops board board"; column-gap: 6px; overflow: hidden; }
html.touch #camp .c2-head { grid-area: head; height: 22px; }
html.touch #camp .c2-foot { grid-area: foot; height: 22px; margin: 0 0 3px; }
html.touch #camp .c2-foot .keyhelp { display: none; }
html.touch #camp :is(.c2-head, .c2-foot, .c2-bh, .c2-card) .btn.small { height: 22px; padding: 0 8px; }
html.touch #camp .c2-scene { grid-area: troops; display: flex; flex-direction: column; width: auto; height: auto; min-height: 0; overflow-y: auto;
  background-size: cover; background-position: 50% 75%;
  box-shadow: inset 0 0 0 1px var(--bronze-d), inset 0 0 0 999px rgba(12, 9, 7, .5), 0 0 0 1px var(--edge); }
html.touch #camp .c2-pole, html.touch #camp .c2-chest { display: none; }
html.touch #camp .c2-strip { position: static; height: auto; display: flex; flex-direction: column; gap: 2px; padding: 2px; background: none; box-shadow: none; }
/* a troop: name and state in two lines, a troop that is back with its button on the right (a tap on one that is away
   asks to give the order up) */
html.touch #camp .c2-seg { grid-template-rows: auto auto; row-gap: 1px; min-height: 26px; padding: 2px 4px; white-space: normal;
  background: rgba(12, 9, 7, .8); box-shadow: inset 0 0 0 1px var(--bronze-d); }
html.touch #camp .c2-seg.ready { grid-template-columns: 6px minmax(0, 1fr) auto; background: rgba(58, 42, 16, .9); box-shadow: inset 0 0 0 1px var(--gold-d); }
html.touch #camp .c2-seg.ready .nm { grid-row: 1 / 3; }
html.touch #camp .c2-seg.ready .r2 { grid-column: 3; grid-row: 1 / 3; }
html.touch #camp .c2-seg .r2 { height: auto; min-height: 10px; }
html.touch #camp .c2-seg .st { flex: 0 1 auto; white-space: normal; }
html.touch #camp .c2-seg .btn.small { height: 22px; padding: 0 6px; font-size: 8px; }
html.touch #camp .c2-lock { position: static; order: -1; flex: none; margin: 2px 2px 0; }
html.touch #camp .c2-bh { grid-area: bh; flex-wrap: wrap; margin: 0 0 2px; }
html.touch #camp .c2-board { grid-area: board; max-height: none; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); align-content: start; }
html.touch #camp .c2-card.chosen .foot { align-items: stretch; min-height: 22px; }
html.touch #camp .c2-card.chosen .who { align-items: center; }
/* (no mouse over the window shows the scrollbars: the board and the troops show theirs always) */
html.touch #ui #camp :is(.c2-board, .c2-scene)::-webkit-scrollbar { width: 2px; }
/* the chest of a troop and the coin trader: one scroll for the window, buttons and tabs for a finger */
html.touch #camp-chest .eq-btns > .btn { height: 22px; }
html.touch #coin-shop .coin-list { max-height: none; overflow: visible; }
html.touch #coin-shop .coin-tabs .tab { height: 18px; line-height: 18px; }
html.touch #coin-shop .coin-row { min-height: 28px; }
html.touch #coin-shop .coin-list .btn.small { height: 22px; }
/* the stage stays in view while the rows scroll with the window */
html.touch #coin-shop .coin-stage-box { position: sticky; top: 0; align-self: flex-start; }
/* Freunde werben (ui/referral.js): one scroll for the whole window, buttons and tabs for a finger */
html.touch #ui #referral { width: min(220px, calc((100% - 8px) / var(--wz))) !important; height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #referral > .win-body { max-height: none; }
html.touch #referral .rf-btns > .btn, html.touch #referral .rf-take { height: 22px; }
html.touch #referral .rf-tier { min-height: 26px; }
html.touch #referral .rf-tabs .tab { height: 18px; line-height: 18px; }
html.touch #referral .rf-row { min-height: 16px; }
/* Lager des Lagerverwalters (ui/safebox.js): sideways on phones (grid left, finger-sized pages right), sits cleanly left of
   the inventory; scrolls like the inventory where the screen is too short */
html.touch #ui #safebox { width: max-content !important; }
html.touch #ui #safebox > .win-body { display: grid; grid-template-columns: 90px 66px; grid-template-rows: auto 1fr; column-gap: 5px; row-gap: 4px; align-items: start; }
html.touch #safebox .inv-grid { grid-column: 1; grid-row: 1 / 3; }
html.touch #safebox .sb-pages { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0; }
html.touch #safebox .sb-pages > .tab, html.touch #safebox .sb-pages > .btn.sort-btn { width: auto; min-height: calc(44px / (var(--px) * var(--wz))); display: flex; align-items: center; justify-content: center; margin: 0; }
html.touch #safebox .sb-help { grid-column: 2; grid-row: 2; align-self: end; margin: 0; white-space: normal; line-height: 8px; }
/* Event-Kalender (ui/events.js): 7-column calendar sheet left (fits 360px phone height without scrolling, each tile ~50 CSS px),
   status + chosen day right with its own touch scrolling; finger-sized nav buttons */
html.touch #ui #ev-win { width: min(464px, calc((100% - 8px) / var(--wz))) !important; }
html.touch #ui #ev-win > .win-body { display: grid; grid-template-columns: 223px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); column-gap: 7px; overflow: hidden; }
html.touch #ui #ev-win .ec-grid { grid-template-rows: repeat(4, 32px); }
html.touch #ui #ev-win .ec-arr { min-width: calc(44px / (var(--px) * var(--wz))); height: calc(36px / (var(--px) * var(--wz))); font-size: 9px; }
html.touch #ui #ev-win .ec-side { max-height: none; min-height: 0; overflow-y: auto; align-self: stretch; }
html.touch #ui #ev-win .ec-goto, html.touch #ui #ev-win .ec-tag { height: 13px; line-height: 13px; padding: 0 5px; font-size: 7px; }
html.touch #ui #ev-win .ec-ucard { min-height: 20px; }
/* PvP Arena (ui/arena.js): finger-sized buttons (>= 44 CSS px), wide result card with teams side by side on landscape phones */
html.touch #ui #arena { width: min(296px, calc((100% - 8px) / var(--wz))) !important; }
html.touch #arena .ar-btn, html.touch #arena .ar-qbar .btn { min-height: calc(44px / (var(--px) * var(--wz))); padding: 2px 8px; }
html.touch #arena .ar-card { min-height: calc(48px / (var(--px) * var(--wz))); }
html.touch #arena .ar-intro { display: none; }
html.touch #ui #arena-q { bottom: calc(12px + 22px * var(--tz)); scale: var(--tz); transform-origin: 50% 100%; translate: -50% 0; transform: none; }
html.touch #ui.compact #arena-q { bottom: calc(12px + 42px * var(--tz)); }
html.touch #ui #arena-q .ar-qp-btn { min-height: calc(44px / (var(--px) * var(--tz))); padding: 0 7px; }
html.touch #ui #arena-hud { width: 132px; max-height: calc(100% - 118px - 74px * var(--tz)); overflow-y: auto; }
html.touch #ui #arena-hud .ar-hf.ar-pick { min-height: calc(44px / var(--px)); justify-content: center; }
html.touch #ui #arena-result { top: 4px; transform: none; translate: -50% 0; scale: var(--wz); transform-origin: top center;
  width: min(340px, calc((100% - 8px) / var(--wz))); max-height: calc((100% - 8px) / var(--wz)); overflow-y: auto; }
html.touch #ui #arena-result .ar-res-teams { flex-direction: row; gap: 6px; }
html.touch #ui #arena-result .ar-res-team { flex: 1; min-width: 0; }
html.touch #ui #arena-result .ar-res-btns .btn { min-height: calc(44px / (var(--px) * var(--wz))); min-width: 96px; }

/* emotes of the character window (ui/emotes.js): a finger needs bigger targets */
html.touch #character .em-grid { grid-template-columns: repeat(5, 28px); gap: 3px; }
html.touch #character .em-slot { width: 28px; height: 28px; }
html.touch #character .em-slot img { left: 2px; top: 2px; width: 24px; height: 24px; }
html.touch #character .em-slot:active img { top: 3px; }

/* Complete daily rewards scroll on short phones; claim and hide stay reachable below the list. */
html.touch #ui #daily > .win-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(40px, 1fr) auto auto; column-gap: 8px; align-items: center; padding: 6px 9px; }
html.touch #ui #daily :is(.dl-head, .dl-grid, .dl-box) { grid-column: 1 / -1; }
html.touch #ui #daily .dl-head { margin-bottom: 5px; }
html.touch #ui #daily .dl-grid { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); align-self: stretch; }
html.touch #ui #daily .dl-card { padding: 0; }
html.touch #ui #daily .dl-box { margin-top: 6px; max-height: 40px; }
html.touch #ui #daily .dl-btns { margin: 6px 0 0; }
html.touch #ui #daily .dl-hide { margin: 6px 0 0; }
/* text fields in windows (names, codes, searches) as high as a button for a finger */
html.touch #ui .win input:is([type=text], [type=search], [type=number], :not([type])) { min-height: var(--finger); }

/* world boss (ui/worldboss.js): the join box and the result window with finger-sized buttons */
html.touch #ui #wb-call { width: 230px; top: 40px; }
html.touch #ui #wb-call .btn, html.touch #ui #wb-result .btn, html.touch #ui #wb-timer .wb-tjoin { min-height: calc(44px / var(--px)); }
html.touch #ui #wb-win .btn { min-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #ui #wb-count { top: 18%; }
html.touch #ui #wb-count .wb-c-mech { width: 240px; }
html.touch #ui #wb-title .wb-t-mech { width: 260px; }

/* friend window with a conversation (ui/messenger.js, user 03.11.2026): as high as the screen, the left column scrolls as
   one, the conversation fills the rest - its bar to write always in sight; rows, field and buttons a finger high */
html.touch #ui #friends-win.ms-open { width: min(396px, calc((100% - 8px) / var(--wz))) !important; height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #friends-win.ms-open > .win-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
html.touch #ui #friends-win.ms-open .fr-cols { flex: 1; min-height: 0; }
html.touch #ui #friends-win.ms-open .fr-left { width: 150px; overflow-y: auto; overflow-x: hidden; }
html.touch #ui #friends-win.ms-open .fr-list { height: auto; min-height: 0; max-height: none; overflow: visible; }
/* the list alone: never higher than the screen (a mentor has one row more, ui/friends.js renderDuty), the friends take what is
   left, the field to add one at the bottom; when "Team online" / "Mentor online" and the friends do not fit (they show every row,
   Nutzer 13.11.2026), the column scrolls as one - no box with a scroll bar of its own */
html.touch #ui #friends-win:not(.ms-open) { display: flex; flex-direction: column; height: calc((100% - 8px) / var(--wz)); }
html.touch #ui #friends-win:not(.ms-open) > .win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
html.touch #ui #friends-win:not(.ms-open) .fr-cols { flex: 1; min-height: 0; }
html.touch #ui #friends-win:not(.ms-open) .fr-left { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }
html.touch #ui #friends-win:not(.ms-open) .fr-left > * { flex: none; }
html.touch #ui #friends-win:not(.ms-open) .fr-left > .fr-list { flex: 1 0 auto; min-height: 40px; max-height: none; overflow: visible; }
html.touch #ui #friends-win .ms-row { height: var(--finger); }
html.touch #ui #friends-win .fr-duty .btn.small { height: var(--finger); min-height: var(--finger); }
/* (padding of an inline element: a bigger target without moving the lines) */
html.touch #ui #friends-win .web-link { padding-block: calc((var(--finger) - 9px) / 2); }
html.touch #ui #friends-win .ms-head { height: calc(var(--finger) + 4px); }
html.touch #ui #friends-win .ms-close { width: var(--finger); height: var(--finger); margin-right: -4px; }
html.touch #ui #friends-win .ms-bar :is(.ms-text, .btn.small) { height: var(--finger); min-height: var(--finger); }
html.touch #ui #friends-win .ms-bar .emo-btn { width: var(--finger); }

/* Vote4Buff (ui/vote.js): both steps side by side (fits 360 px without scrolling), the bar under them, a finger per
   button (stacked in the left column, equal), the cards stay side by side */
html.touch #ui #vote4buff .win-body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: 'one two' 'bar two'; align-items: stretch; }
html.touch #ui #vote4buff .win-body > .vb-step:first-child { grid-area: one; }
html.touch #ui #vote4buff .win-body > .vb-step + .vb-step { grid-area: two; }
/* the bar under the left column (the buffs and the Serie take the right one up to the bottom) */
html.touch #ui #vote4buff .vb-bar { grid-area: bar; height: auto; min-height: 14px; padding: 2px 4px; line-height: 10px; white-space: normal; }
html.touch #ui #vote4buff .vb-btns { grid-auto-flow: row; width: 100%; }
html.touch #ui #vote4buff .vb-btns > * { height: var(--finger); min-height: var(--finger); }
html.touch #ui #vote4buff .vb-card { min-height: max(88px, var(--finger)); }
html.touch #ui #vote4buff .vb-status { min-height: 9px; }
/* (the intro says what the status line under the buttons says too: only the status line, so it fits) */
html.touch #ui #vote4buff .vb-text { display: none; }
html.touch #ui #vote4buff .vb-btns { margin-top: 0; }
/* Drachenspiele (ui/fest.js): finger-sized buttons (>= 44 CSS px); the window, the call and the results like the arena and the world boss */
html.touch #ui #fest { width: min(296px, calc((100% - 8px) / var(--wz))) !important; }
html.touch #fest .fe-page { height: auto; max-height: calc((100vh - 64px) / (var(--px) * var(--wz))); }
html.touch #fest .btn, html.touch #fest .tab { min-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #ui #fest-call { width: 230px; top: 40px; }
html.touch #ui #fest-call .btn, html.touch #ui #fest-hud .btn { min-height: calc(44px / var(--px)); display: flex; align-items: center; justify-content: center; }
html.touch #ui #fest-result { top: 4px; transform: none; translate: -50% 0; scale: var(--wz); transform-origin: top center; width: min(340px, calc((100% - 8px) / var(--wz))); max-height: calc((100% - 8px) / var(--wz)); overflow-y: auto; }
html.touch #ui #fest-result .btn { min-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #ui #fest-result .fe-card { min-height: calc(50px / (var(--px) * var(--wz))); flex-basis: 84px; }
html.touch #ui #fest-result .fe-rtab { max-height: 44px; }
/* Gildenkriege (ui/guildwar.js): the window as high as the screen, rows, inputs and buttons finger-sized (>= 44 CSS px), the results scaled like the arena's */
html.touch #ui #gw { width: min(320px, calc((100% - 8px) / var(--wz))) !important; }
html.touch #gw .gw-body { max-height: calc((100vh - 64px) / (var(--px) * var(--wz))); }
html.touch #gw .btn, html.touch #gw .gw-rt, html.touch #gw .gw-bid, html.touch #gw .gw-sel { min-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #gw .gw-x { display: inline-flex; align-items: center; justify-content: center; min-width: calc(44px / (var(--px) * var(--wz))); min-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #ui #gw-result { top: 4px; transform: none; translate: -50% 0; scale: var(--wz); transform-origin: top center; max-height: calc((100% - 8px) / var(--wz)); overflow-y: auto; }
html.touch #ui #gw-result .btn { min-height: calc(44px / (var(--px) * var(--wz))); }
html.touch #ui #fest-banner { top: 30%; }
html.touch #ui #fest-banner.tile { top: 9%; }
