/* Phones and tablets in the browser (Claude „emoji“, 2. 11. 2026, Daniel: „potřebuju přidat optimalizaci na telefon pls v
   prohlížeči když to chce nekdo hrat“, „jdi do toho“). That day's stats had 10 launches from a phone and not one run: everyone
   stayed in Giran (no joystick there, a finger's tap on an NPC did nothing, the menu only under Esc). The rules wait for a touch
   screen as the main pointer (pointer:coarse), so a PC with a mouse, a touch laptop included, keeps its look; the layouts for a
   phone also need a small screen (narrower than 600 px, or lower than 520 px on its side). Loaded last (index.html). */

/* the joystick lives outside the HUD (index.html), so Giran has it too: in a run and in town, never in the menu (style.css shows
   it in a narrow window for a mouse too, as before only in the game) */
#joystick{position:fixed;z-index:6}
body:not(.in-game) #joystick{display:none}

@media (pointer:coarse){
 /* the browser's own text scaling (an Android's big system font) would grow the words over their frames: the layout here is
    made for the size it sets */
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 /* no browser gestures over the game: a double tap does not zoom the page, no pull to refresh, no text picked by a long press */
 html{touch-action:manipulation}
 body.in-game{overscroll-behavior:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
 #joystick{left:max(18px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom))}
 /* Giran: the Menu button in the head (l2-ui.css hides it for the client's look, a phone has no Esc) and the prompt of the NPC
    he stands by a button (game.js: a tap talks to him, as F does) */
 #townUi .town-head{grid-template-columns:auto 1fr auto}
 #townUi #townName,#townUi #townNameInput{grid-column:1/3}
 #townUi #townMenu{display:inline-flex;align-items:center;grid-row:1/span 2;grid-column:3;align-self:center;margin-left:.3rem;pointer-events:auto}
 #townUi .town-prompt{pointer-events:auto;cursor:pointer;padding:.55rem 1.2rem;border-color:var(--gold2)}
 /* the evade (Space on a keyboard) under the right thumb: a tap on it dodges (game.js), without the key's letters */
 #hud .slot-bar.dash .dash-icon:not(.aug-active){touch-action:none}
 #hud .dash-icon .key{display:none}
 /* the keys' line under Enter in the menu and the welcome's walking choice (W A S D or clicks) mean nothing on a phone; game.js
    writes the joystick's words under that row instead */
 #menu .keys{display:none}
 #welcomeModal [data-welcome="clickMove"]{display:none}
 /* a locked icon (style.css .dim at 35 %) was black on an iPhone's OLED (Daniel's screenshot of the talents, 3. 11. 2026) */
 .dim{filter:grayscale(1) brightness(.6)}
}

@media (pointer:coarse) and (max-width:600px),(pointer:coarse) and (max-height:520px){
 /* Giran: the head as small as its words, the chat at the top under it with a few lines (the hero, the joystick and the menu
    bar keep the bottom, and the keyboard does not cover the chat while one writes), the menu bar's buttons smaller so the
    joystick fits beside it, the NPC's prompt over the joystick's height */
 #townUi .town-head{min-width:0;left:max(.5rem,env(safe-area-inset-left));top:.4rem}
 #townUi .town-chat{top:5.7rem;bottom:auto;left:max(.5rem,env(safe-area-inset-left));width:min(24rem,calc(100vw - 1rem))}
 #townUi .town-log{height:4.4rem}
 #townUi .l2-menubar{right:max(.5rem,env(safe-area-inset-right));bottom:max(.5rem,env(safe-area-inset-bottom))}
 #townUi .town-prompt{bottom:calc(max(18px,env(safe-area-inset-bottom)) + 132px)}
 /* the NPC's window (the client's Dialogue at the left): from the top and scrolling inside when it is taller than the screen */
 #npcModal{align-items:flex-start;padding:.4rem}
 #npcModal .npc-inner{max-height:calc(100dvh - .8rem);overflow-y:auto}
 .modal{padding:.5rem}
 /* the Armory's ten tabs in ONE row that scrolls sideways (game.js keeps the open one in view), smaller: two rows hid half of the
    Armory on an iPhone and five rows on an Android with a big system font (a player on Discord 4. 11. 2026: "talenty na mobile sa
    nereaguju, nedalo by sa to spravit aj mensie pismo"); the grade's tag of a Collection cell over its icon (it hid under it) */
 #armoryTabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;padding:.4rem .5rem 1px;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
 #armoryTabs::-webkit-scrollbar{display:none}
 /* a finger's target: the tab as tall as a button (it was 16 px), the strip fading at the edge where more tabs wait (below) */
 #armoryTabs button{flex:0 0 auto;min-width:0;box-sizing:border-box;min-height:30px;padding:.45rem .75rem .4rem;font-size:13px;line-height:normal;margin-bottom:0;display:inline-flex;align-items:center}
 .armory-head>h2{font-size:15px;line-height:normal;padding:.5rem 2.6rem .25rem}
 /* the Character and Enchant tabs leave a gap between the header and the body, and the menu's tabs behind (85 % black) showed through it */
 .armory.char-open,.armory.forge-open{background:#0b0a09}
 /* the Armory's cards for a small screen: smaller words, and a line is as tall as its own words (a big system font of an Android
    scales the words but not a fixed line height: a slot's kind lay over its item's name and "Vzhled" broke in two on top of itself) */
 .armory-body :is(.slot-row,.scroll-slot,.coll-cell,.codex-item,.talent) :is(small,b,span,div){line-height:normal}
 .armory-body .slot-row{gap:.55rem;padding:.45rem .5rem}
 .armory-body .slot-row small{font-size:11px;letter-spacing:.02em}
 .armory-body .slot-row b{font-size:14px}
 .armory-body :is(.wear-pick,.looks){grid-template-columns:auto minmax(0,1fr)}
 .armory-body :is(.wear-pick,.looks)>small{height:auto;min-height:32px;white-space:nowrap}
 .armory-body .talent-text b{font-size:13px}
 .armory-body .talent-text small{font-size:11px}
 .coll-cell .grade-badge{z-index:1}
 /* Craft: the part's button under the piece's name instead of a third column that squeezed the name into a letter-wide strip */
 .forge>.armor-list{grid-template-columns:auto minmax(0,1fr)}
 .forge>.armor-list>h3{grid-column:1/-1}
 #armoryBody .armor-row>.armor-none{grid-column:1/-1}
 #armoryBody .armor-row>.armor-try[data-craft]{grid-column:1/-1;min-width:0;max-width:100%}
 #armoryBody .armor-row>.armor-try[data-craft]>span:last-child :is(b,small){white-space:normal;overflow-wrap:anywhere}
 /* Quests: the target look's line and its buttons wrap instead of running out of the window */
 .armory-body .journey-goal-compact{flex-wrap:wrap}
 .armory-body .contract-card{gap:.6rem;padding:.6rem .7rem}
 .armory-body .contract-card>.icon.big{width:44px;height:44px}
 .armory-body .contract-head{flex-wrap:wrap}
 .armory-body .contract-reward{white-space:normal}
 .armory-body .journey-goal-compact .goal-text{flex:1 1 0;min-width:0}
 .armory-body .journey-goal-compact .journey-view-actions{flex:1 1 100%;flex-wrap:wrap;justify-content:flex-start}

 /* The run's HUD is a thin frame round the fight (Daniel 3. 11. 2026 on his iPhone 13 Pro: „na výšku tím HUDem nic moc nevidím“,
    „na šířku taky toho moc nejde vidět“): HP and EXP as two thin bars at the top left, the time alone at the top in the middle, a
    small radar at the top right with the pause under it, the quests a small window under the HP; no skill or jewel bars (the
    skills cast themselves), only the evade and a Life Stone's skill as round buttons under the right thumb; no damage meter. The
    camera's free band (scene.js hudBand: under the timer, over the bottom bars) grows with it. */
 #hud .status-row{left:max(.4rem,env(safe-area-inset-left));top:.4rem;gap:.25rem}
 #hud .hp-card{width:min(14rem,38vw);padding:.15rem .4rem .3rem .75rem}
 #hud .hp-top{margin-bottom:0}
 #hud #hudClass{display:none}
 #hud .hp-card .bar{height:17px;margin-top:.2rem}
 #hud .hp-card .bar>:is(span,em){line-height:17px;letter-spacing:0}
 /* the label at the left and the number at the right, both small, so a big system font does not lay "HP" over "121 / 125" */
 #hud .hp-card .bar>span{justify-items:end;padding:0 .3rem;font-size:12px}
 #hud .hp-card .bar>em{left:.3rem;font-size:10px}
 #hud .buff-rows .icon{width:24px;height:24px}
 #hud .timer-card{top:.4rem;width:auto;padding:.05rem .6rem .1rem .9rem}
 #hud .timer-card>:not(#timer){display:none}
 #hud .timer-card strong{margin:0;font-size:calc(var(--l2) * 1.05)}
 #hud .radar-box{width:84px;right:max(.4rem,env(safe-area-inset-right));top:.4rem}
 #hud .run-stats{top:calc(84px + .8rem);right:max(.4rem,env(safe-area-inset-right));padding:0;background:none;border:0;box-shadow:none}
 /* the Adena of the run and the next chest's price stay (Daniel 4. 11. 2026, a player on Discord: "na mobilu není vidět stav Aden a
    tím pádem, jestli mám vyděláno na bednu"); the kills and Status do not */
 #hud .run-stats>:not(#pauseButton,#autoButton,.stat-adena,.stat-chest){display:none}
 #hud .run-stats{gap:.3rem}
 #hud .run-stats>:is(.stat-adena,.stat-chest){display:inline-flex;align-items:center;gap:.25rem;padding:.2rem .45rem;font:20px/1 var(--l2font);white-space:nowrap;background:rgba(30,27,23,.72);border:1px solid #000;border-radius:0;box-shadow:inset 0 0 0 1px var(--bevel)}
 #hud .run-stats .adena-icon{width:14px;height:14px}
 #hud #pauseButton{width:40px;height:40px}#hud #autoButton{min-width:56px;height:40px;padding:0 .5rem;font:22px/1 var(--l2font);background:rgba(30,27,23,.72);border:1px solid #000;border-radius:0;box-shadow:inset 0 0 0 1px var(--bevel)}#hud #autoButton.on{color:var(--gold)}
 #hud .top-stack{top:3.4rem}
 #hud #dps{display:none!important}
 #hud .jewel-row,#hud #skillBar,#hud #talentBar{display:none}
 #hud .bottom-bars{left:auto;right:max(1rem,env(safe-area-inset-right));bottom:max(1.1rem,env(safe-area-inset-bottom));transform:none;padding:0;background:none;border:0;box-shadow:none}
 #hud .slot-bar.dash{padding:0;gap:.7rem;align-items:flex-end;background:none;border:0;box-shadow:none}
 #hud .slot-bar.dash .dash-icon:not(.aug-active){width:64px;height:64px;border-radius:50%;box-shadow:0 0 0 2px var(--gold2),0 2px 10px #000c}
 #hud .slot-bar.dash .aug-active{width:52px;height:52px;border-radius:50%}
 /* the quests at the right under the Adena, the chest price and the pause (9. 11. 2026, as on a PC: the bottom left is the chat's,
    the top left the HP card's and its buffs') */
 #hud .expedition-tracker:not(.hud-positioned){top:calc(var(--hud-stats,calc(84px + .8rem + 40px)) + .4rem);bottom:auto;left:auto;right:max(.4rem,env(safe-area-inset-right));width:auto;min-width:0;max-width:min(15rem,56vw)}
 #hud .expedition-tracker{padding:.2rem .45rem .25rem .8rem}
 #hud .expedition-tracker small{display:none}
 #hud .expedition-tracker>*{min-width:0}
 /* the event's name whole in the narrow tracker: on two lines rather than cut short (session "emoji" 6. 11. 2026, the manager's point 3) */
 #hud .expedition-head>b{min-width:0;white-space:normal;overflow:visible;text-overflow:clip;line-height:.85}  /* (the L2 font draws its glyphs at about half the font size) */

 /* a level-up or a coffer: the cards without what a phone has no room for (the keys, the kind's line, the flavour text, the worn
    jewels row and the keys' hint under them), three side by side on its side; in portrait each card a row (game.js cardHtml) */
 #choiceModal{padding:.4rem;align-items:center}
 #choiceModal .choice-inner{padding:.5rem .7rem .6rem;max-height:calc(100dvh - .8rem);overflow-y:auto}
 #choiceModal .cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem;margin:.35rem 0}
 #choiceModal .card{min-height:0;padding:.45rem .55rem .5rem}
 #choiceModal .card::after{border-width:.5rem}
 #choiceModal .card kbd,#choiceModal .card .kind,#choiceModal .card .flavor,#choiceModal #choiceBuild,#choiceModal small.muted{display:none}
 #choiceModal .card-icon{margin:.1rem auto;padding:.15rem}
 #choiceModal .card .icon.big{width:40px;height:40px}
 #choiceModal .card-rarity{position:static;order:999}
 #choiceModal .card .lines{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;margin:0}
 /* denser, so the cards and the Reroll, Banish and Skip buttons fit the screen's height; the buttons in one row, without the key */
 #choiceModal .choice-inner{padding:.35rem .6rem .45rem}
 #choiceModal .card{gap:.2rem;padding:.35rem .5rem .4rem}
 #choiceModal .card-icon{padding:.1rem}
 #choiceModal .card .icon.big{width:34px;height:34px}
 #choiceModal .stat-block{margin:.1rem 0 0;padding:.25rem .45rem;gap:.05rem}
 #choiceModal .cards{margin:.25rem 0}
 #choiceModal .choice-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.35rem}
 #choiceModal .choice-actions button{min-width:0;padding:.15rem .4rem .15rem .25rem;gap:.35rem}
 #choiceModal .choice-actions kbd{display:none}
}

/* a phone on its side (360 to 412 px high): the choice's title shorter, no rarity line under the cards (their colour says it), so
   the cards and the Reroll, Banish and Skip under them fit the height */
@media (pointer:coarse) and (max-height:520px){
 #choiceModal .eyebrow,#choiceModal .card-rarity{display:none}
 #choiceModal .choice-inner>h2{margin:0;font-size:1.25rem}
 /* Giran's chat a line shorter, over the NPC's prompt it reached */
 #townUi .town-log{height:3.3rem}
}

/* a phone upright: Giran's target window at the right (in the middle it covered the head's Menu button); each card a row, its
   icon at the left and the rest beside it */
@media (pointer:coarse) and (max-width:600px){
 #townUi .town-target{left:auto;right:max(.5rem,env(safe-area-inset-right));transform:none}
 /* the boss bars and the target under the HP, the quests and the pause (between the HP and the radar there is no room) */
 #hud .top-stack{max-width:94vw}
 /* the time at the left of the radar (centred it lay over the HP card with a big font), the boss bars under the quests (they are at the
    right under the Adena, the chest price and the pause) */
 #hud .hp-card{width:min(14rem,41vw)}
 #hud .timer-card{left:auto;transform:none;right:calc(max(.4rem,env(safe-area-inset-right)) + 84px + .4rem)}
 #hud .top-stack{top:calc(124px + 5.6rem)}
 /* the big banner (a map, a raid boss, an event) under the hero: at the desktop's 24 % it lay over the quests and the boss bars for
    its seconds, an event's own row too (5. 11. 2026, Pixel 7: "Prokletý meč je tvůj" over the Zariche row) */
 #banner{top:62%}
 #choiceModal .cards{grid-template-columns:1fr}
 #choiceModal .card{display:grid;grid-template-columns:52px minmax(0,1fr);column-gap:.6rem;row-gap:.2rem;align-items:start}
 #choiceModal .card>*{grid-column:2}
 #choiceModal .card>.card-icon{grid-column:1;grid-row:1/span 4;margin:0}
 /* the menu's top bar: the compass alone (interface.css showed the name, and in the room beside the icons it read "A…"); the sticky
    Enter bar solid under its first line, so the race rows scrolling under it (the Rasa heading too) do not show through the fade */
 #menu .topbar>.brand>span:not(.sigil){display:none}
 #menu .menu-footer{background:linear-gradient(#0b0a0900,#0b0a09 1.1rem)}
}

/* A phone on its side that is a little wider than 860 px (a Pixel 7 is 863 px, a Pixel 7 Pro 915 px) got the desktop's menu: its bar
   (brand, the tabs, the icons) was about 920 px, the page stretched wider than the screen, every Armory tab lost its right edge and the
   close X lay outside, and the Postava tab squeezed three columns into 860 px (round 2 of the phone check, 4. 11. 2026). Here the
   bar's tabs scroll sideways in the room between the brand and the icons, and the Armory's Postava and Enchant tabs get the narrow
   screen's rules of style.css (one column, the window as wide as the screen), as on a phone of 780 px. */
@media (pointer:coarse) and (min-width:861px) and (max-height:520px){
 #menu .topbar{grid-template-columns:auto minmax(0,1fr) auto;gap:.4rem;padding-inline:.6rem;overflow:clip}
 #menu .topbar>.tabs{min-width:0;max-width:100%;flex-wrap:nowrap;justify-content:flex-start;gap:.15rem;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
 #menu .topbar>.tabs::-webkit-scrollbar{display:none}
 #menu .topbar .tabs button{flex:0 0 auto;font-size:14px;line-height:1.2;padding:.3rem .45rem}
 #menu .topbar>.topright{flex-wrap:nowrap;gap:.25rem}
 #menu .topbar .asc-best{display:none}
 .armory-inner{padding:.9rem .75rem}
 .close{width:2rem;height:2rem;top:.15rem}
 .armory.char-open{background:#0b0a09}
 .armory.char-open .armory-body{display:block;overflow-y:auto}
 .char-side{margin-bottom:.8rem}
 .char-mid{display:none}
 .armory.forge-open{background:#0b0a09}
 .armory.forge-open .armory-body{width:auto;margin-left:0}
 /* the menu's gear strips: four icons in a column (a Paladin's right side, with its shield) are 145 px, the stage between the hero's
    name and the Collection bar 87 px, so the last icon lay under that bar; the icons in two rows, a column or two */
 #menu .hero-stage{grid-template-columns:5rem minmax(0,1fr) 5rem}
 #menu .equip-col{display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,auto);gap:3px;align-content:center}
 #menu #equipLeft{justify-content:start}
 #menu #equipRight{justify-content:end}
}

/* a phone on its side: the raid boss bars and the target window sit between the HP card (with its buffs) and the Adena counters
   instead of reaching over the HP card's buffs */
@media (pointer:coarse) and (max-height:520px){
 /* the menu's Controls row (Manual / Auto) stays out of the low bottom bar of a phone on its side; the Gatekeeper window has the switch */
 #menu #controlHead,#menu #control{display:none}
 /* the run finder's Solo / Co-op / Public row too, the Gatekeeper window has it */
 #menu #runModeHead,#menu #runMode{display:none}
 #hud .top-stack{max-width:max(240px,calc(100vw - 500px))}
 #hud .top-stack>*{max-width:100%;box-sizing:border-box}
 /* the rows end before the run-stats row at the right: at up to 60vw they ran over its buttons (a siege's squad, three
    rows, 1. 12. 2026; the gate's row alone had 38vw): every row of a siege (gate, squad, elite, raid boss), a zone's raid boss
   rows stay as they were */
 #hud .boss-slim.gate,#hud .boss-slim.in-siege{width:min(calc(var(--l2)*17),max(180px,calc(100vw - 624px)))}
 /* the buffs under the HP card (style.css does it up to 860 px, a Pixel 7 is 863 px: there they stood beside the card, under the
    time and the boss bar); the quests are at the right */
 #hud .status-row{flex-direction:column;gap:.2rem}
 /* the big banner (a map at a run's start, a raid boss, an event) under the hero, as upright: at the desktop's 24 % it lay over
    the Chest, Status and Inventory buttons at the right (the siege's title, tester 2. 12. 2026). It stays between the joystick
    and the skill button, a long title on two lines */
 #hud #banner{top:62%;font-size:1.9rem;white-space:normal;width:max-content;max-width:calc(100vw - 300px);text-wrap:balance}
}

/* a narrow phone upright (360 px): Giran's joystick ring and the menu bar beside it shared 24 px; the ring a little nearer the edge */
@media (pointer:coarse) and (max-width:400px) and (min-height:521px){
 #joystick{left:max(8px,env(safe-area-inset-left))}
}

/* The Armory's tab strip scrolls sideways on a phone, so the tabs past the edge (Kosmetika, Úkoly) were not to be guessed: the strip
   fades out at the edge where more tabs wait (game.js armoryTabsMore sets data-more on it: left, right, or both). */
@media (pointer:coarse) and (max-width:600px),(pointer:coarse) and (max-height:520px){
 #armoryTabs[data-more~=right]{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
 #armoryTabs[data-more~=left]{-webkit-mask-image:linear-gradient(90deg,transparent,#000 28px);mask-image:linear-gradient(90deg,transparent,#000 28px)}
 #armoryTabs[data-more~=left][data-more~=right]{-webkit-mask-image:linear-gradient(90deg,transparent,#000 28px,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,transparent,#000 28px,#000 calc(100% - 28px),transparent)}
}
/* a phone upright (Pixel 7, 412 px): the gear icons beside the hero are 66 px (style.css .equip-col .icon) but their columns
   3.6rem, 58 px, so the right column stuck 8 px out of the panel, 6 px from the screen's edge (session rozlišení 5. 11. 2026,
   .work/small-res-2026-11-04/s1/crop-pixel7.png); the columns as wide as the icons, as window-fit.css does on a desktop */
/* and the sticky Enter bar solid under its first line on a small phone on its side too (780 x 360, 750 x 342: the scrolling menu,
   where the zone list showed through its fade, phone check round 3), as the block for phones upright above does */
@media (pointer:coarse) and (max-width:860px){#menu .hero-stage{grid-template-columns:max(3.6rem,66px) minmax(0,1fr) max(3.6rem,66px)}#menu .menu-footer{background:linear-gradient(#0b0a0900,#0b0a09 1.1rem)}}
/* an upright phone no taller than 760 px (iPhone 13 664, SE 667, 13 Mini 629; a Pixel 7 at 839 is not one): the sticky Enter bar
   covered the bottom gear icons at first and a Paladin's shield nearly whole (5. 11. 2026, left from phone check round 3: the stage
   starts at ~237 px and the Enter bar with its fade takes ~177 px at the bottom, so about 100svh - 416px is free, .work/
   party-version-2026-11-05/iphone-gear.py). The columns start at the top of the stage with 6 px between the icons, and when a column
   has four (a class with a shield) the icons shrink to fit with ~12 px to spare, at most 64 px and its 1 px frame as before; a
   browser without svh takes vh */
@media (pointer:coarse) and (max-width:860px) and (orientation:portrait) and (max-height:760px){#menu .equip-col{align-self:start;gap:6px}#menu .hero-stage:has(.equip-col>:nth-child(4)){grid-template-columns:calc(clamp(40px,calc((100vh - 452px)/4),64px) + 2px) minmax(0,1fr) calc(clamp(40px,calc((100vh - 452px)/4),64px) + 2px);grid-template-columns:calc(clamp(40px,calc((100svh - 452px)/4),64px) + 2px) minmax(0,1fr) calc(clamp(40px,calc((100svh - 452px)/4),64px) + 2px)}#menu .hero-stage:has(.equip-col>:nth-child(4)) .equip-col .icon{width:clamp(40px,calc((100vh - 452px)/4),64px);height:clamp(40px,calc((100vh - 452px)/4),64px);width:clamp(40px,calc((100svh - 452px)/4),64px);height:clamp(40px,calc((100svh - 452px)/4),64px)}}

/* The loading screen on a tall phone in portrait (Pixel 7, iPhone 13 and longer, 5. 11. 2026): the key art covering the whole
   screen cut the title ADEN SURVIVORS at the right (the title is 546 px of the picture's 1920, its middle 15 px right of the
   picture's). Here the picture is only as tall as lets the whole title in with 3 % at each side, the title in the middle, and
   its bottom fades into the blurred copy under the footer (loading.css ::before, darkened by its ::after). */
@media (orientation:portrait) and (max-aspect-ratio:50/93){#loading .ls-art{height:min(100%,calc(100vw * 1.859));object-position:51.1% 0;-webkit-mask-image:linear-gradient(#000 84%,transparent);mask-image:linear-gradient(#000 84%,transparent)}}
/* a short screen (a phone on its side, 360 to 412 px high, or any window this low): a choice's cards denser, so a Life Stone's card
   with two stat lines and the glow line fits whole with the buttons under it (session "emoji" 6. 11. 2026, the manager's task:
   Mammon's wares ran off the bottom on a Pixel 7 on its side); the stat lines without their explanations, the notes and the price
   tighter, the icon and the title smaller. Last in the file, over the phone's rules above. */
@media (max-height:520px){
 #choiceModal .stat.aug-line small{display:none}
 #choiceModal .card .notes{font-size:.85rem;line-height:1.15;margin-top:.05rem}
 #choiceModal .card .ware-price{padding-top:.1rem;line-height:.8}
 #choiceModal .card .icon.big{width:28px;height:28px}
 #choiceModal .choice-inner>h2{font-size:1.1rem;line-height:1.1}
}
/* the run's loot feed on a touch screen (game.js lootShown; session "emoji" 7. 11. 2026, the manager's task after Marieke's
   screenshot from Android: the drops covered half the screen, and with the font fixed they still took 42 % of a 360 px phone, as
   on Windows in a window that size: the column 13 x --l2 wide and its lines 1.15 x 19.5 px high, both from the 26 px and not from
   the drawn text). Its lines as tall as the drawn text (--l2k, like the login box in loading.css), a narrower column with a
   smaller icon and the three newest only (lootShown prepends, the feed is column-reverse: from the 4th child on the older ones);
   a phone on its side has it lower, just over the skill button, below the counters and the pause button (ILikePwnS 7. 11. 2026,
   a Pixel 10 on its side). Measured: .work/pismo-oprava-2026-11-07 (toasty.py). */
@media (pointer:coarse){
 html[data-font="l2"] .loot-feed{line-height:calc(var(--l2k) * 1.25em)}
 .loot-feed{width:min(calc(var(--l2) * 13),60vw);gap:.2rem}
 .loot-entry{padding:.15rem .4rem .15rem .25rem}
 .loot-entry .icon{width:24px;height:24px}
 .loot-feed .loot-entry:nth-child(n+4){display:none}
}
@media (pointer:coarse) and (max-height:520px){.loot-feed{bottom:5.5rem}}

/* The chat in a run on a touch screen (run-chat.js, 9. 11. 2026): at the bottom left as in the client, just over the joystick, its
   lines whole (wrapped, they were cut short in a thin column at the top right: Marieke on a phone, Daniel "ten chat na mobilu že je
   takový weird"), as wide as the loot feed at the right leaves it; on a phone on its side beside the joystick (over it lie the party's
   frames). The button that opens the line (no Enter on a touch screen) beside the joystick. Typing, the window rises over the phone's
   keyboard (run-chat.js --kb: how much of the screen the keyboard covers). A tablet keeps the desktop's HUD around it. */
@media (pointer:coarse){
 #runChat{left:max(.7rem,env(safe-area-inset-left));bottom:calc(max(18px,env(safe-area-inset-bottom)) + 126px)}
 #runChat.typing{left:calc(var(--l2text,22px) / 11 * 156 + 1rem);bottom:max(calc(max(18px,env(safe-area-inset-bottom)) + 126px),calc(var(--kb,0px) + .5rem))}
 #runChatBtn:not([hidden]){display:block}
 #runChatBtn{left:calc(max(18px,env(safe-area-inset-left)) + 120px + .8rem);bottom:max(18px,env(safe-area-inset-bottom))}
 #runChat .run-chat-log{max-height:calc(var(--l2text,22px) * 1.35 * 3 + 2px)}
 #runChat .run-chat-quick button::after{content:'';position:absolute;left:0;right:0;top:calc(50% - 20px);bottom:calc(50% - 20px)}
}
@media (pointer:coarse) and (max-width:600px){
 #runChat{left:max(.4rem,env(safe-area-inset-left));width:calc(100vw - min(var(--l2) * 13,60vw) - 1.6rem - env(safe-area-inset-left) - env(safe-area-inset-right));box-sizing:border-box;padding:.15rem .35rem}
 #runChat .run-chat-log{max-height:calc(var(--l2text,22px) * 1.35 * 4 + 2px)}
 /* typing, over the keyboard in the right column, wider (at the left over the keyboard lie the party's frames) */
 #runChat.typing{left:auto;right:max(.4rem,env(safe-area-inset-right));width:min(15rem,calc(100vw - var(--l2text,22px) / 11 * 156 - 1.4rem))}
}
@media (pointer:coarse) and (max-height:520px){
 #runChatBtn{left:max(calc(max(18px,env(safe-area-inset-left)) + 120px + .8rem),calc(var(--l2text,22px) / 11 * 156 + 1rem))}
 #runChat{left:calc(max(calc(max(18px,env(safe-area-inset-left)) + 120px + .8rem),calc(var(--l2text,22px) / 11 * 156 + 1rem)) + 40px + .4rem);bottom:max(18px,env(safe-area-inset-bottom));width:min(24rem,calc(100vw - max(calc(max(18px,env(safe-area-inset-left)) + 120px + .8rem),calc(var(--l2text,22px) / 11 * 156 + 1rem)) - 40px - .4rem - min(var(--l2) * 13,60vw) - 1.6rem - env(safe-area-inset-right)));box-sizing:border-box;padding:.15rem .35rem}
 #runChat.typing{left:calc(min(14rem,38vw) + max(.4rem,env(safe-area-inset-left)) + .5rem);bottom:max(max(18px,env(safe-area-inset-bottom)),calc(var(--kb,0px) + .5rem))}
 #hud:has(.expedition-tracker:not([hidden],.hud-positioned)) .loot-feed .loot-entry:nth-child(n+3){display:none}
 #runChat .run-chat-log{max-height:calc(var(--l2text,22px) * 1.35 * 3 + 2px)}
}

/* The toast of a run on a phone held upright (9. 11. 2026, the manager after the drop and meter check): at the bottom in the middle,
   12.5rem up, it lay for its 2.8 s over the chat's top line and the top drop of a Pixel 7, on a 375 x 667 phone over the party's
   frames too (between them and the drops there is no room for it across the screen). Here it is in the drops' column right over the
   drops a phone shows (the feed's base and right edge, a 26 px icon or two lines, .3rem of padding, 2 px of border, .2rem between
   them; three drops, two up to 760 px of height), its left edge past the party's frames as the chat's typing line has it, so the
   chat, the party, the joystick and the skill buttons stay free. On its side, on a tablet, on a computer and in Giran it stays where
   it was (tests/toast-phone-css.test.mjs keeps these numbers those of the feed and the party). */
@media (pointer:coarse) and (max-width:600px) and (min-height:521px){
 body:not(.in-town) #hud:not([hidden])~#toast{--toast-lh:1.15;--toast-step:calc(max(26px,var(--l2) * 1.5 * var(--toast-lh)) + .3rem + 2px + .2rem);left:auto;right:.7rem;bottom:calc(var(--l2) * 5 + 1.5rem + 2 * var(--toast-step) + .2rem);max-width:calc(100vw - (var(--l2text,22px) / 11 * 156 + 1rem) - .7rem);padding:.45rem .7rem;transform:translateY(-10px)}
 body:not(.in-town) #hud:not([hidden])~#toast.visible{transform:none}
 html[data-font="l2"] body:not(.in-town) #hud:not([hidden])~#toast{--toast-lh:calc(var(--l2k) * 1.25);line-height:calc(var(--l2k) * 1.5em)}
}
@media (pointer:coarse) and (max-width:600px) and (min-height:761px){
 body:not(.in-town) #hud:not([hidden])~#toast{bottom:calc(var(--l2) * 5 + 1.5rem + 3 * var(--toast-step) + .2rem)}
}

/* The banner's layer on a phone (9. 11. 2026, the manager after the toast check; on its side too since 3. 12. 2026, where the banner
   went under the hero and the drop lines lay over it): upright at 62 % it lies over the top drop, on a
   375 x 667 phone over the chat too, and a toast at the same time lay over it, Pagan's hint (7 s) among it. It stays where it is and
   goes over them: over the drops and the chat in the HUD, the chat's typing line over it (what a player writes is never covered), and
   while it shows or a player types the toast goes under the HUD (in the drops' column it lay over the typing line risen over the
   keyboard; at other times the toast stays over the HUD and the windows). While it shows the toast and the drops are dimmed to .2
   (their text showed between its letters, the manager) and come back in .25 s when it goes. A banner shows when it has its class
   and no window is open: under a window style.css hides it, and then nothing is dimmed and the toast stays over the window. */
@media (pointer:coarse) and (max-width:600px) and (min-height:521px),(pointer:coarse) and (max-height:520px){
 #hud #banner{z-index:4}
 #hud #runChat.typing{z-index:5}
 body:not(.in-town):is(:has(#banner.visible):not(:has(.modal:not([hidden]))),:has(#runChat.typing)) #hud:not([hidden])~#toast{z-index:4}
 #hud .loot-feed{transition:opacity .25s}
 body:not(.in-town):has(#banner.visible):not(:has(.modal:not([hidden]))) #hud .loot-feed{opacity:.2}
 body:not(.in-town):has(#banner.visible):not(:has(.modal:not([hidden]))) #hud:not([hidden])~#toast.visible{opacity:.2}
}

/* a phone upright: Giran's target window at the right under the chat (at the top it lay over the head's Menu button and the
   chat's first lines, a plate's line made it two lines longer over them; Pixel 7, 10. 11. 2026): the chat's top and its height
   (its log, frame, paddings and gap, the typing line's frame, paddings and line, the outer shadow, l2-chat.css) and a .4rem gap;
   on its side plate-ui.css keeps the window in the band at the right of the chat */
@media (pointer:coarse) and (max-width:600px) and (min-height:521px){
 #townUi .town-target{top:calc(5.7rem + 4.4rem + var(--cpx) * 35 + max(1px,var(--cpx)) * 5 + var(--l2text,22px) * 1.35 + .4rem)}
}

/* a phone: Giran's party list (game.js townPartyBox) never under the chat or the target window (from 6.2rem the chat covered its
   first member wholly, on its side it went off the screen over the joystick; the manager, 10. 11. 2026). Upright at the left under the
   chat (the target window's top above), as wide as a member or 40 % of the screen, its foot above the joystick (120 px from 18 px
   over the bottom) and the first starts' balloon over the menu bar: the screen's last 152 px. On its side (a phone wider than 600 px,
   where the chat leaves a band at its right) at the top right. The target window beside it, narrower, with the thin sides of its
   frame and its buttons one under the other where they do not fit beside each other. Without the hint (the Gatekeeper says who
   picks the map), on a short screen without the members' class (a tap on a member shows it in the target window), with a bigger
   font (pixel, smooth) also without their bars (in town they are always full) and a member's right padding only clearing its
   frame's arrow (a 6 letter name was cut). The members' lines as tall as the drawn L2 text (26 px lines of 11 px text made a
   member twice its client's height). A finger cannot scroll the list (body.in-game has touch-action:none), so it is cut only where
   nothing else fits (a pixel font on a phone 568 px high). */
@media (pointer:coarse) and (max-width:600px) and (min-height:521px){
 #townUi .town-party{left:max(.5rem,env(safe-area-inset-left));top:calc(5.7rem + 4.4rem + var(--cpx) * 35 + max(1px,var(--cpx)) * 5 + var(--l2text,22px) * 1.35 + .4rem);width:min(calc(var(--cpx) * 156),40vw);
  max-height:calc(100vh - 5.7rem - 4.4rem - var(--cpx) * 35 - max(1px,var(--cpx)) * 5 - var(--l2text,22px) * 1.35 - .4rem - 152px);
  max-height:calc(100dvh - 5.7rem - 4.4rem - var(--cpx) * 35 - max(1px,var(--cpx)) * 5 - var(--l2text,22px) * 1.35 - .4rem - 152px)}
 #townUi .town-party-hint{display:none}
 #townUi .town-party:not([hidden])+.town-target{min-width:0;max-width:calc(100vw - max(.5rem,env(safe-area-inset-left)) - min(calc(var(--cpx) * 156),40vw) - .5rem - max(.5rem,env(safe-area-inset-right)));padding-left:calc(var(--cpx) * 8);padding-right:calc(var(--cpx) * 26)}
 #townUi .town-party:not([hidden])+.town-target .town-target-actions{flex-wrap:wrap;justify-content:center}
}
@media (pointer:coarse) and (max-width:600px) and (min-height:521px) and (max-height:600px){
 #townUi .town-party .town-member>small{display:none}
}
@media (pointer:coarse) and (max-height:520px) and (min-width:601px){
 #townUi .town-party{left:auto;right:max(.5rem,env(safe-area-inset-right));top:.5rem;width:min(calc(var(--cpx) * 156),40vw);
  max-height:calc(100vh - 1rem - 132px);max-height:calc(100dvh - 1rem - 132px)}
 #townUi .town-party .town-member>small,#townUi .town-party-hint{display:none}
 #townUi .town-party:not([hidden])+.town-target{right:calc(max(.5rem,env(safe-area-inset-right)) + min(calc(var(--cpx) * 156),40vw) + .5rem);min-width:0;
  max-width:calc(100vw - max(.5rem,env(safe-area-inset-left)) - min(24rem,calc(100vw - 1rem)) - .5rem - min(calc(var(--cpx) * 156),40vw) - .5rem - max(.5rem,env(safe-area-inset-right)));
  padding-left:calc(var(--cpx) * 8);padding-right:calc(var(--cpx) * 26)}
 #townUi .town-party:not([hidden])+.town-target .town-target-actions{flex-wrap:wrap;justify-content:center}
}
@media (pointer:coarse) and (max-width:600px) and (min-height:521px),(pointer:coarse) and (max-height:520px) and (min-width:601px){
 #townUi .town-party-list{align-self:stretch;min-height:0;overflow-y:auto}
 #townUi .town-party>:not(.town-party-list){flex-shrink:0}
 #townUi .town-party .town-member{width:100%}
 html[data-font="l2"] #townUi .town-party .town-member>:is(b,small){line-height:calc(var(--l2k) * 1.5em)}
 html:not([data-font="l2"]) #townUi .town-party .town-member{padding-right:calc(var(--cpx) * 12)}
}
@media (pointer:coarse) and (max-width:600px) and (min-height:521px) and (max-height:800px),(pointer:coarse) and (max-height:520px) and (min-width:601px){
 html:not([data-font="l2"]) #townUi .town-party .town-member>:is(small,.town-member-bars){display:none}
}
/* the Endless's line (its time to the cap, its AA, its raid bosses) stays under the timer on a phone, the other objectives do not
   (game.js hud: .endless on the timer card while the run is in its Endless) */
@media (pointer:coarse){
 #hud .timer-card.endless>#objective{display:block;max-width:10rem;margin:.05rem auto .1rem;font-size:11px;line-height:1.25;white-space:normal;text-align:center}
 #hud .timer-card.trip>#objective{display:block;max-width:10rem;margin:.05rem auto .1rem;font-size:11px;line-height:1.25;white-space:normal;text-align:center}  /* a venture's task too (game.js .trip: its seals, crystal or guard and its time; a phone saw only the timer, emoji 15. 11. 2026) */
 @media (max-width:600px){#hud .timer-card.trip>#objective{position:absolute;top:calc(84px + .4rem + 40px);right:calc(-84px - .4rem);box-sizing:border-box;width:max-content;max-width:210px;margin:0;padding:.1rem .3rem;text-align:right;text-wrap:balance;background:rgba(30,27,23,.62)}}  /* upright the card stays small and the task stands under the run's stats (84px + .8rem, 35 px high), at their right edge, above the quests (124px + 5.6rem): in the card it widened it over the HP bar, between the HP card and the radar (118 px on a Pixel 7) a boss's long name took four lines over the stats */
}
/* a party's level-up cards as high as solo ones: style.css's party rule (the height less 7rem) beat the choice's height above,
   so on a phone on its side the cards and the Reroll row were cut at the bottom (manager "město" 11. 11. 2026) */
@media (pointer:coarse){
 body.coop-run #choiceModal .modal-inner.choice-inner{max-height:calc(100dvh - .8rem)}
}

/* a party of 5 on a phone on its side: four members in the party frame (each with a class line) ran off the bottom of a
   360 px screen from top:38%; right under the status window, a bit smaller and without the class line (a member down or
   away still shows by the grey HP bar and the fade) (manager "město" 12. 11. 2026) */
@media (pointer:coarse) and (max-height:520px){
 #partyFrame.party-frame{top:104px;zoom:.85}  /* (zoom scales top too: 88 px, under the status window) */
 #partyFrame .party-member>small{display:none}
}
/* a party of 5 or 6 on a phone on its side: four or five allies in PartyWnd's rows (46 client px) ran into the joystick (in a
   party of 5 the 4th ally's class line). From four allies on the rows are PartyWndCompact's (interface.xdat: 26 px, the CP, HP
   and MP bars 5 px each at 6, 11 and 16), the name left of the bars where the compact window has the class icon, without the
   class and ping line (rozlišení 1. 12. 2026). The role bonus line under the rows goes too, as the compact window has none: with
   the warning of a weak link over the rows it lay on the joystick (a member of a party of 6, 2. 12. 2026); the town and the
   run's result still show it */
@media (pointer:coarse) and (max-height:520px){
 #partyFrame:has(>.party-member~.party-member~.party-member~.party-member) .party-member{height:calc(26*var(--hpx));padding-top:calc(6*var(--hpx))}
 #partyFrame:has(>.party-member~.party-member~.party-member~.party-member) .party-member>small,#partyFrame:has(>.party-member~.party-member~.party-member~.party-member) .party-role{display:none}
 #partyFrame:has(>.party-member~.party-member~.party-member~.party-member) .party-member>b{max-width:calc(100% - 66*var(--hpx))}
 #partyFrame:has(>.party-member~.party-member~.party-member~.party-member) .town-member-bars{left:auto;right:calc(10*var(--hpx));top:calc(6*var(--hpx));width:calc(62*var(--hpx));gap:0}
}

/* the client window kit (l2-wnd.css) on a finger: the bar's close and minimise buttons and the scroll arrows are 15 client px
   (17 CSS px on a Pixel 7), so each reaches further out to the window's edge and down into the body, without the two bar
   buttons' areas meeting (manager "město" 13. 11. 2026) */
@media (pointer:coarse){
 .l2w-x::after,.l2w-min::after,.l2-scroll-up::after,.l2-scroll-down::after{content:'';position:absolute}
 .l2w-x::after{inset:calc(-3 * var(--wpx)) calc(-8 * var(--wpx)) calc(-9 * var(--wpx)) calc(-1 * var(--wpx))}
 .l2w-min::after{inset:calc(-3 * var(--wpx)) calc(-1 * var(--wpx)) calc(-9 * var(--wpx)) calc(-8 * var(--wpx))}
 .l2-scroll-up::after,.l2-scroll-down::after{inset:calc(-4 * var(--wpx)) calc(-1 * var(--wpx)) calc(-4 * var(--wpx)) calc(-8 * var(--wpx))}
}

/* UI port step 4: the map window (l2-map.js) on the phone is the computer's, opened by town's MenuWnd Map and dragged by the finger
   (.l2map touch-action:none). A run has no Map button, the phone neither (l2-hudwnd.css, Daniel 16. 11. 2026) */

/* UI port step 5 (l2-hudrun.css): on a phone the run's Adena and Chest sit in the run-stats panel (the client's small window) as
   on the desktop, without a box, a bevel and a shade of their own inside it; the row's buttons stay the client's Btn1 at the
   HUD's size but a finger's to tap (at least 40 px wide, 40 px tall by an invisible ::after), and Status is there too, as in town
   and on the computer (step 4: Skills & Magic is its page, MenuWnd is not in a run; its Btn1 rule outranks the phone rules above;
   it is (2,3,1) through its :is(), hence #hud#hud#hud) */
@media (pointer:coarse){
 #hud#hud .run-stats>:is(.stat-adena,.stat-chest){padding:0 calc(2*var(--hpx));background:none;border:0;box-shadow:none}
 #hud#hud .run-stats>#statusButton{display:inline-grid}
 #hud#hud#hud .run-stats>:is(.stat-btn,.icon-btn){position:relative;min-width:40px}
 #hud#hud#hud .run-stats>:is(.stat-btn,.icon-btn)::after{content:'';position:absolute;left:0;right:0;top:calc(50% - 20px);bottom:calc(50% - 20px)}
}

/* a phone held upright: a chest's skip pays a quarter of its price (core.js skipGold), up to five digits late in a run ("+14 742"), more
   than a third of the screen's width holds beside the icon and "Skip" (Pixel 7: 9 px over the edge); the count goes under the label in all
   three buttons, the icon beside both lines (nápad 2, tester 14. 11. 2026) */
@media (pointer:coarse) and (max-width:600px) and (min-height:521px){
 #choiceModal .choice-actions button{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:center;align-items:center;column-gap:.35rem;row-gap:0}
 #choiceModal .choice-actions button>.icon{grid-row:1 / span 2}
 #choiceModal .choice-actions :is(.cb-label,.cb-count){grid-column:2;min-width:0;line-height:1.1;white-space:nowrap}
}
/* UI port step 6 (l2-npc.js, l2-npc.css): the NPC window on a phone. Npc1_back is drawn as the client draws it, (16,16,16) at
   alpha 221, and on a phone's small screen the window covers the town chat and the target window, whose text then showed through
   the window's text, so on a phone the same colour sits under it and nothing shows through (an Aden addition). The links get a
   finger's height by padding (the line stays the client's text), the party's link in a map's row too; the HTML's buttons and the
   Gatekeeper's and Monument's tabs a finger's area by an invisible ::after over a margin of the same size, so two neighbours'
   areas never meet (DefaultButton and inputbox have no top and bottom slices, so their textures are not stretched) */
@media (pointer:coarse){
 #npcModal#npcModal .npc-back{background-color:#101010}
 #npcModal#npcModal .npc-option:not(.l2-hbtn){padding:7px 0}
 #npcModal#npcModal .npc-map>.npc-map-party{padding:5px 0}
 #npcModal#npcModal :is(.l2-hbtn,#npcTabs>.l2-tab){position:relative;margin-block:6px}
 #npcModal#npcModal :is(.l2-hbtn,#npcTabs>.l2-tab)::after{content:'';position:absolute;left:0;right:0;top:-6px;bottom:-6px}
}

/* UI port step 6, Mammon's Vault on a phone (e9 14. 11. 2026 from Daniel's Pixel 7): the Merchant's words on two
   lines ran under the opened coffer's result, which started a fixed 3.2rem below the stage's top (room for one line). Here the
   words, the result and the buy buttons stand one under another in the stage, so the result starts under the words however many
   lines they take, and the 3D scene (the canvas, still absolute) stays the whole stage's background. While the result is up the
   buttons do nothing (vault-ui.js busy), so they leave and the result takes their room, as the block above has it. */
/* (from style.css, e9 15. 11. 2026 from Codex's review: there it was also a narrow window's with a mouse, which went into the
   column at 800 x 600; a computer keeps its layout at any width) */
@media (pointer:coarse){.vault-stage{display:flex;flex-direction:column}.vault-stage>.vault-say{position:relative;inset:auto;flex:none;margin:.8rem 1rem 0!important}.vault-stage>.vault-reveal{position:relative;inset:auto;flex:1 1 0;min-height:0;margin:.4rem .8rem .8rem}.vault-stage>.vault-reveal:not([hidden])~.vault-buy{display:none}.vault-stage>.vault-buy{position:relative;inset:auto;margin:auto 1rem 1rem}}
/* ... and turned on its side: the narrow layout's stage is 24rem under the window's head, taller than Pixel 7's 412 px that way,
   so the buy buttons stood under the screen's edge. There the window is the screen's height, the head stays and the stage takes
   the rest; the odds and the feed under it scroll in the window's body (a max-content row: an auto one gave the side, whose
   min-height is 0, what was left of the body, 35 px). The card of one coffer and of the gilded one is tighter there (the icon
   64 px = 2 x 32, less padding), so the card, Owned and Click to continue fit under the words in what the stage has. */
@media (pointer:coarse) and (max-width:860px) and (orientation:landscape){.vault-win{height:100%;min-height:0}.vault-body{grid-template-rows:100% max-content;overflow-y:auto}.vault-stage{height:auto}.vault-reveal.one .vault-card{padding:.7rem 1.2rem;gap:.2rem}.vault-reveal.one .icon.big{width:64px;height:64px}}
/* UI port step 4, the inventory (l2-inventory.js): in a run on the phone the run's Inventory button sits next to Map, by a tap
   (on the computer the button and Alt+V, in town MenuWnd's Inventory); the button is the row's Btn1 at the HUD's size, a finger's
   area by step 5's phone rule; the window is the same as on the computer (a short screen: the kit gives it the screen's height and
   its body scrolls) */
@media (pointer:coarse){
 #hud .run-stats>#invButton{display:inline-grid}
}

/* Giran's shortcut bar on a phone or a tablet (l2-actions.js townBar sets --wpx and --hpx on it, whole device pixels a client px
   where its 8 wells fit): the run's ShortcutWnd back cut 5 px after the 8th well's outline as the desktop's after the 12th (x 0..322)
   and its right line and edge drawn again by ::after, 325 client px; upright over the joystick in the screen's middle, on its side
   at the bottom between the joystick and the menu bar. A finger drags an action from the Actions page onto it (touch-action none
   on the slots, the page does not pan). The NPC's prompt upright over the bar (--tbh, the bar's height). */
@media (pointer:coarse){
 #townBar{--sbw:calc(492*var(--hpx));--sw:calc(325*var(--hpx));--sh:calc(46*var(--hpx));--si:calc(32*var(--hpx));--sy:calc(7*var(--hpx));
  display:block;box-sizing:content-box;width:var(--sw);height:var(--sh);padding:0;margin:0;
  left:round(nearest,calc(50% - var(--sw) / 2),var(--wpx));right:auto;bottom:calc(max(18px,env(safe-area-inset-bottom)) + 128px);
  border:0;border-radius:0;box-shadow:none;background:url(assets/ui/wnd/shortcut-back.png) 0 0/var(--sbw) var(--sh) no-repeat;
  image-rendering:pixelated;pointer-events:auto;touch-action:none}
 #townBar::after{content:'';position:absolute;right:0;top:0;width:calc(2*var(--wpx));height:100%;pointer-events:none;
  background:inherit;background-position:right 0 top 0}
 #townBar .icon{position:absolute;left:calc(var(--x,21)*var(--hpx));top:var(--sy);box-sizing:border-box;width:var(--si);height:var(--si);
  margin:0;padding:0;border:0;border-radius:0;box-shadow:none;outline:0;background-color:transparent;background-size:100% 100%;
  background-repeat:no-repeat;image-rendering:pixelated;opacity:1;filter:none;touch-action:none}
 #townBar .icon.empty{background-image:none}
 #townBar .icon:nth-child(n+9){display:none}
 #townBar .icon:not(.empty)::before{content:'';position:absolute;left:calc(-1*var(--wpx));top:calc(-1*var(--wpx));
  width:calc(var(--si) + 4*var(--wpx));height:calc(var(--si) + 4*var(--wpx));margin:0;border:0;
  background:url(assets/ui/wnd/icon-outline.png) 0 0/100% 100% no-repeat;image-rendering:pixelated;pointer-events:none}
 #townBar .icon:not(.empty):active::before{background-image:url(assets/ui/wnd/icon-outline-down.png)}
 .xd-slot[data-action]{touch-action:none}
}
@media (pointer:coarse) and (orientation:landscape){
 #townBar{left:calc(max(18px,env(safe-area-inset-left)) + 128px);bottom:max(18px,env(safe-area-inset-bottom))}
}
@media (pointer:coarse) and (orientation:portrait){
 #townUi .town-prompt{bottom:calc(max(18px,env(safe-area-inset-bottom)) + 136px + var(--tbh,0px))}
}

/* the run's level-up and coffer choice on a phone (emoji 17. 11. 2026, a Pixel 7 on its side: Reroll, Banish and Skip 20 px under
   the screen, a subclass's cards 38): style.css's (max-height:820px) #choiceModal:not(.hunt-choice) rules (an id and two classes)
   outrank the blocks above, so the phone's paddings, gaps and height never applied (a card kept 2.1rem under it for the rarity's
   line, hidden or in the flow here); the doubled id gives them back */
@media (pointer:coarse) and (max-width:600px),(pointer:coarse) and (max-height:520px){
 #choiceModal#choiceModal .choice-inner{padding:.35rem .6rem .45rem;max-height:calc(100dvh - .8rem)}
 #choiceModal#choiceModal .cards{gap:.4rem;margin:.25rem 0}
 #choiceModal#choiceModal .card{padding:.35rem .5rem .4rem}
 #choiceModal#choiceModal .card-icon{margin:.1rem auto;padding:.1rem}
}
@media (pointer:coarse) and (max-width:600px){
 #choiceModal#choiceModal .card>.card-icon{margin:0}
}
/* on its side the rarity's line is hidden: the card's last stat row clear of the frame's corner ornaments, the room from the gap above
   and under the cards */
@media (pointer:coarse) and (max-height:520px){
 #choiceModal#choiceModal .card{padding-bottom:.9rem}
 #choiceModal#choiceModal .cards{margin:.15rem 0}
}


/* The same GM and petition windows; the shared kit scrolls the body on short screens. */
@media (pointer:coarse){
 .l2-htmlwnd .npc-view a{display:inline-block;min-height:calc(19 * var(--wpx));line-height:calc(19 * var(--wpx))}
 .xd-combo-list>.l2-hbtn{min-height:calc(23 * var(--wpx))}
 .l2w .xd-multi{touch-action:pan-y}
}

@media (pointer:coarse){
 .l2w .petition-send{display:inline-flex}
 .l2w [data-xd="PetitionChatEditBox"]{width:calc(226 * var(--wpx))}
}

/* On a narrow touch screen the numeric keyboard replaces the optional 128 px NumberPad. */
@media (pointer:coarse) and (max-width:460px){
 #gmNumberDialog{width:calc(306 * var(--wpx));left:50%;top:50%;transform:translate(-50%,-50%) !important}
 #gmNumberDialog [data-xd="NumberPad"]{display:none}
 #gmNumberDialog [data-xd="BackTexture"]{width:calc(306 * var(--wpx))}
}
/* With a tip and a button under it (Leave in town, Back to menu on the result) the role bonus line is tall enough for a finger
   and stands off the button. On a phone on its side in a run the party's frames are short of height (zoom above): the line's
   parts follow each other there, " · " between them */
@media (pointer:coarse){#townUi #townPartyRole{margin-bottom:calc(var(--cpx) * 6)}
 #resultRole#resultRole{padding-top:calc(.4rem + 1px);padding-bottom:.4rem;margin-bottom:.4rem}
 @media (max-height:520px){#partyFrame .party-role>span{display:inline}
  #partyFrame .party-role>span:not(:last-child)::after{content:'\a0·'}
  #partyFrame .party-role>span+span::before{content:' '}}}
/* the short survey after login (survey-ui.js) on a phone: a choice is a 12 px row 17 to 19 px apart, so its tap area reaches over the gap
   above and under it (not into the next row), and the edit box takes a finger; the keyboard moves the window up (survey-ui.js lift) */
@media (pointer:coarse){
 #surveyWnd .xd-check::after{content:'';position:absolute;left:0;right:0;top:calc(-2 * var(--wpx));bottom:calc(-2 * var(--wpx))}
 #surveyWnd .survey-line{touch-action:manipulation}
}
/* a siege's seal on a phone: the drops stand where the casting bar does (Pixel 7 upright, 1. 12. 2026), so while it is up they are
   dimmed as under a banner */
@media (pointer:coarse){
 #hud .loot-feed{transition:opacity .25s}
 #hud:has(#tripCast:not([hidden])) .loot-feed{opacity:.2}
}

/* a map's boss rows in the menu on a phone on its side: the zone list is 150 px wide there and the name had a column of 36 px, one
   word on a line ("Captain / of the / Ice / Queen's", 3. 12. 2026). The time and the pieces come first, under them the name
   across the row, ending in "…" when it is longer */
@media (pointer:coarse){
 @container (max-width:200px){
  #menu #zoneList .boss-line{grid-template-columns:auto minmax(0,1fr);row-gap:.25rem}
  #menu #zoneList .boss-line .zone-drops{grid-column:2;grid-row:1;justify-content:flex-end;margin:0}
  #menu #zoneList .boss-line .boss-who{grid-column:1/-1;grid-row:2}
  #menu #zoneList .boss-line .boss-who em{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 }
}

/* the results on a phone (emoji 17. 11. 2026, 3b: on a Pixel 7 on its side "Next run", "Back to menu" and the links stood under the
   screen's edge, and a venture's phase rows put even "Next run" there): the window is the screen's height at most, what the run brought
   (.results-body, index.html; a plain block on a computer) scrolls inside it, and the buttons, the save's note and the links stay
   under it on the screen. The doubled id outranks the window's own rules (style.css .results-inner, menu-nav.css #resultsModal …) */
@media (pointer:coarse){
 #resultsModal#resultsModal .results-inner{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr);column-gap:.5rem;max-height:calc(100dvh - 1rem)}
 #resultsModal#resultsModal .results-inner>*{grid-column:1/-1}
 /* the same gap above the buttons as between the two: the body ended on their top edge, so a frame the scroll cut (Ancient
    Adena on the Endless result) read as lying under "Back to menu" (30. 11. 2026) */
 #resultsModal#resultsModal .results-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;margin-bottom:.5rem}
 #resultsModal#resultsModal #again{grid-column:1;justify-self:end}
 #resultsModal#resultsModal #backMenu{grid-column:2;justify-self:start;margin-top:0}
}

/* a co-op run's cards on a phone held upright (the manager's round of 1. 12. 2026 on a Pixel 7: the window's title lay over the
   status and the HUD's counters row, and the guard's name showed through the window): coop.css keeps the run in view around the
   cards, so here the window starts under the HUD's top, where the counters' row ends (#hud .run-stats at 84px + .8rem, 40px high as
   the expedition tracker counts it), and its back is solid as a client's window is, so no name nor bar shows through (l2-ui.md).
   The quest tracker under the counters and the party's window at the left lie under it too and only their edges showed beside
   it, so they hide while the cards are open (visibility keeps the HUD's layout). The computer and a phone on its side keep
   coop.css's window. */
@media (pointer:coarse) and (max-width:600px) and (min-height:521px){
 body.coop-run #choiceModal#choiceModal{align-items:flex-start;padding-top:calc(env(safe-area-inset-top,0px) + 84px + .8rem + 40px + .4rem)}
 body.coop-run #choiceModal#choiceModal .modal-inner.choice-inner{max-height:calc(100dvh - env(safe-area-inset-top,0px) - 84px - .8rem - 40px - .8rem);background:rgba(20,18,15,.94)}
 body.coop-run:has(#choiceModal:not([hidden])) #hud .expedition-tracker,body.coop-run:has(#choiceModal:not([hidden])) #partyFrame{visibility:hidden}
 /* four cards or more (a subclass's skills) did not fit under the counters: 825 px of window in 689 px of room on a Pixel 7 upright
    (412 x 839, the Mac's round of 3. 12. 2026), the cards scrolled. So the window starts under the status instead, the counters'
    row hides under it as the quest tracker does (the run goes on in co-op and the status with HP and the minimap stay in view), and
    the eyebrow and the cards' rarity go, as on a phone on its side (the rules above this block). Three cards keep the window above. */
 body.coop-run #choiceModal#choiceModal:has(.cards>:nth-child(4)){padding-top:calc(env(safe-area-inset-top,0px) + 84px + .4rem)}
 body.coop-run #choiceModal#choiceModal:has(.cards>:nth-child(4)) .modal-inner.choice-inner{max-height:calc(100dvh - env(safe-area-inset-top,0px) - 84px - .8rem)}
 body.coop-run #choiceModal#choiceModal:has(.cards>:nth-child(4)) :is(.eyebrow,.card-rarity){display:none}
 body.coop-run:has(#choiceModal:not([hidden]) .cards>:nth-child(4)) #hud .run-stats{visibility:hidden}
}

/* the server boss's small window (server-boss.css, session emoji 3. 12. 2026) on a phone: in town it stands at the top right, where the
   target's window stands on a phone upright and on its side; the target wins while it shows and the boss's window comes back when it
   goes (a tap on the boss's window opens its window, as a click does) */
@media (pointer:coarse) and (max-width:600px),(pointer:coarse) and (max-height:520px) and (min-width:601px){
 #townUi:has(#townTarget:not([hidden]):not(.npc-open)) #serverBoss.server-boss{display:none}
 /* in a run the boss's window, open, lies over it in the top stack (manager 82 3. 12. 2026 over the Pixel 7 shots): it hides
    meanwhile and keeps its place, so nothing in the stack moves (server-boss-ui.js sb-open) */
 #hud #serverBoss.server-boss.sb-run.sb-open{visibility:hidden}
}
