:root{color-scheme:dark;
 --surface:#24221e;--edge:#74654a;--line:#484036;--text:#ece8dd;--muted:#b7ae9c;--gold:#dcc58d;--red:#9d453d;
 /* An old-style serif that ships with Windows, macOS and Android, so nothing is downloaded and
    nothing shifts on load. Calibri read as office software sitting on top of the game. */
 --serif:"Palatino Linotype","Book Antiqua",Palatino,"Iowan Old Style",Georgia,serif;
 /* Readouts stay on a plain face: an old-style serif gives figures varying heights, which makes
    a health counter jitter as it changes. */
 --numeric:"Calibri","Helvetica Neue",system-ui,sans-serif;
 /* Tanned leather and aged brass, as gradients rather than images: no asset to load, and it stays
    crisp at any size or zoom. The grain is a hairline repeat at very low contrast; at more than
    that it turns to moire against the pixel art underneath. */
 --leather:linear-gradient(176deg,#2e2922,#211d18 62%,#1b1814),
  repeating-linear-gradient(101deg,#ffffff06 0 1px,#0000 1px 3px);
 --parchment:linear-gradient(174deg,#322c23,#262119 70%,#1f1b15),
  repeating-linear-gradient(97deg,#ffffff05 0 1px,#0000 1px 4px);
 /* A lit top edge and a shadowed base: the whole reason a flat rectangle reads as a web panel. */
 --raised:inset 0 1px 0 #d8bb8426,inset 0 -1px 0 #00000059,0 2px 6px #0000004d;
 --sunk:inset 0 2px 4px #00000073,inset 0 -1px 0 #ffffff0d;
 /* A hotbar slot: a warm bezel at the rim falling to a cold, deep well in the middle. */
 --slot:radial-gradient(118% 92% at 50% -12%,#4a3f2d 0%,#332c21 38%,#241f18 68%,#1a1712 100%),
  repeating-linear-gradient(101deg,#ffffff05 0 1px,#0000 1px 3px)}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{background:#181715;color:var(--text);font:15px/1.45 var(--serif)}button,select,input{font:inherit}button,select{background:var(--leather);color:var(--text);border:1px solid #6b5a3e;border-radius:2px}button{cursor:pointer}button:hover{background:linear-gradient(176deg,#3b342a,#2b261f)}button:focus-visible,select:focus-visible,summary:focus-visible,input:focus-visible{outline:2px solid var(--gold);outline-offset:3px}button:disabled{cursor:default;opacity:.5}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%)}#game{position:absolute;inset:0}canvas{display:block;touch-action:none;image-rendering:pixelated}
/* Every control a finger lands on. Without this a mobile browser holds each tap back while it
   waits to see whether a double-tap-to-zoom is coming, which reads as the whole interface being
   slow -- the canvas was already covered, the buttons over it were not. */
button,select,input,label,summary,.hotbar-slot,.game-menu,.hud{touch-action:manipulation}
canvas:focus{outline:0}.hud{position:absolute;inset:0;pointer-events:none}.hud button{pointer-events:auto}
/* A scrim, not panels. The boxes came off so the world shows through, but a label over sand
   and moving monsters still needs a ground. A gradient at the foot of the screen gives the
   controls their contrast back without drawing a single border. */
.hud::before{content:"";position:absolute;left:0;right:0;bottom:0;height:250px;
 background:linear-gradient(to top,#0e0c0af2 0%,#0e0c0ad9 26%,#0e0c0a9e 52%,#0e0c0a45 76%,#0e0c0a00 100%);
 pointer-events:none}
.vitals{position:absolute;left:24px;bottom:25px;width:270px;padding:0}.vitals-title{display:flex;justify-content:space-between;align-items:baseline;gap:16px;margin-bottom:5px}
.vitals-title,.mana-title{text-shadow:0 1px 3px #000,0 0 6px #000}.vitals-title{font-size:15px}.vitals-title span:last-child{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}.health-track{height:11px;background:#141210;border:1px solid #6b5a3e;padding:1px;box-shadow:var(--sunk),0 1px 3px #00000080}#health-fill{height:100%;width:0;background:linear-gradient(#b8564c,#8d3a33);transition:width .12s linear}
.minimap{position:absolute;top:24px;right:24px;width:166px;padding:5px;background:var(--leather);border:1px solid #6b5a3e;box-shadow:var(--raised);text-align:left}.minimap:hover{background:#302b23}.minimap-view{display:block;position:relative;width:154px;height:102px;overflow:hidden;background:#181715}.minimap canvas{display:block;width:100%;height:100%}.minimap-caption{display:flex;justify-content:space-between;padding:7px 6px 3px;color:var(--gold);font-size:12px}.map-marker{position:absolute;left:50%;top:50%;width:9px;height:9px;background:#fff0ba;border:2px solid #352c1b;outline:1px solid #fff0ba;transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}.game-menu{position:absolute;right:24px;bottom:25px;display:flex;gap:6px}.game-menu button{width:76px;min-height:66px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:none;border-color:transparent;color:#d6cdb9;font-size:12px;text-shadow:0 1px 2px #000,0 0 5px #000,0 0 10px #000c}.game-menu button:hover{background:var(--leather);border-color:var(--edge);color:var(--gold);box-shadow:var(--raised)}.game-menu svg{width:23px;height:23px;fill:none;stroke:var(--gold);stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 2px #000) drop-shadow(0 0 4px #000)}.notice{position:absolute;left:50%;top:22%;transform:translateX(-50%);max-width:min(480px,calc(100% - 40px));margin:0;padding:12px 20px;text-align:center;background:var(--parchment);border:1px solid #6b5a3e;box-shadow:var(--raised);color:var(--gold)}
dialog{width:min(510px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:24px;border:1px solid #6b5a3e;border-radius:2px;background:var(--parchment);box-shadow:var(--raised),0 12px 40px #000000a6;color:var(--text);overflow:auto}dialog::backdrop{background:rgb(0 0 0 / .45)}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.panel-heading h2{font-size:23px;font-weight:500;margin:0;color:var(--gold)}.panel-heading button{padding:5px 12px;min-height:34px;font-size:13px}.panel-health{margin:0 0 20px;padding-bottom:15px;border-bottom:1px solid var(--line);color:var(--text);font-variant-numeric:tabular-nums}h3{font-weight:500;font-size:15px;color:var(--gold);margin:24px 0 12px}.primary-stats{display:grid;grid-template-columns:1fr auto 1fr auto;gap:14px 18px;margin:0}.primary-stats dt{color:var(--muted)}.primary-stats dd{margin:0;font-size:19px;font-variant-numeric:tabular-nums}.combat-stats{display:grid;grid-template-columns:1fr auto;gap:9px;margin:0}.combat-stats dt{color:var(--muted)}.combat-stats dd{margin:0}.stat-details{margin-top:25px;border-top:1px solid var(--line);padding-top:15px;font-size:13px}.stat-details summary{cursor:pointer;color:var(--muted)}.table-scroll{overflow:auto;margin-top:14px}table{border-collapse:collapse;width:100%;font-size:12px;font-variant-numeric:tabular-nums}th,td{border-bottom:1px solid var(--line);padding:8px 5px;text-align:right;white-space:nowrap}th:first-child{text-align:left;font-weight:400}thead{color:var(--muted)}#character-modifiers{padding-left:18px;color:var(--muted);overflow-wrap:anywhere}.world-panel{width:min(970px,calc(100vw - 32px))}.world-image{position:relative;width:fit-content;margin:auto;max-width:100%;line-height:0}.world-image canvas{display:block;height:min(calc(100dvh - 190px),calc(100vw - 80px),900px);max-width:100%}.map-key{display:flex;justify-content:space-between;gap:12px;margin-top:16px;font-size:13px;color:var(--muted)}.map-key i{display:inline-block;width:7px;height:7px;background:#fff0ba;margin-right:10px;transform:rotate(45deg)}.setting{display:flex;align-items:center;justify-content:space-between;padding:14px 0;border-bottom:1px solid var(--line);gap:20px}.setting select{padding:6px 10px;min-width:90px}.setting input{accent-color:var(--gold);width:17px;height:17px}.setting input[type=range]{width:160px;height:auto;margin:0}.session-note{font-size:13px;color:var(--muted);margin-top:24px}
body.compact .vitals{left:12px;bottom:12px;width:200px;padding:10px 12px}body.compact .vitals-title{font-size:13px;gap:8px}body.compact .game-menu{right:12px;bottom:12px;gap:4px}body.compact .game-menu button{width:54px;min-height:58px;font-size:10px}body.compact .minimap{top:12px;right:12px;width:112px}body.compact .minimap-view{width:100px;height:67px}body.compact .minimap-caption{padding:5px 2px 0;font-size:10px}body.compact .notice{top:26%}body.compact dialog{padding:18px}body.compact .primary-stats{gap:12px}body.compact .panel-heading h2{font-size:21px}
@media(max-width:390px){body.compact .vitals{width:170px}body.compact .vitals-title{font-size:12px}body.compact .vitals-title span:last-child{font-size:11px}body.compact .game-menu button{width:48px}body.compact .primary-stats{grid-template-columns:1fr auto;gap:8px}}
.skill-entry{padding:12px 0;border-bottom:1px solid #484036}.skill-heading{display:flex;justify-content:space-between;gap:12px;font-size:14px}.skill-heading strong{font-weight:500}.skill-heading span{color:#dcc58d;font-variant-numeric:tabular-nums}.skill-entry p{font-size:12px;color:#b7ae9c;margin:5px 0 0;line-height:1.5}
.trainer{margin-top:10px;border-top:1px solid #4a3f2c;padding-top:8px}.trainer h3{margin:0 0 4px;font-size:14px;color:#dcc58d}.trainer-closes{margin:2px 0 0;font-size:12px;color:#c08a6a}.quest-giver,.quest-log{margin-top:10px;border-top:1px solid #4a3f2c;padding-top:8px}.quest-giver h3,.quest-log h3{margin:0 0 4px;font-size:14px;color:#dcc58d}.quest-offers,.quest-log ul{list-style:none;margin:0;padding:0}.quest-offers>li{margin-bottom:10px}.quest-summary{margin:4px 0;font-size:12px;color:#b7ae9c}.quest-asks{list-style:none;margin:2px 0;padding:0 0 0 10px;font-size:12px;color:#9d9482}.quest-asks li[data-done=true]{color:#8fbf7a;text-decoration:line-through}.quest-pays{margin:2px 0 0;font-size:12px;color:#dcc58d}.quest-none{font-size:12px;color:#9d9482}#quest-log>li{margin-bottom:8px}.shop{margin-top:10px;border-top:1px solid #4a3f2c;padding-top:8px}.shop h3{margin:0 0 4px;font-size:14px;color:#dcc58d}.shop-note{margin:0 0 6px;font-size:12px;color:#9d9482}.shop-stock{list-style:none;margin:0 0 8px;padding:0;display:flex;flex-wrap:wrap;gap:6px}.shop-stock button{font-size:12px;padding:4px 8px}.shop-actions{display:flex;gap:6px;flex-wrap:wrap}.xp-title{display:flex;justify-content:space-between;margin:9px 0 3px;color:#9d9482;font-size:11px}.xp-title span:last-child{font-variant-numeric:tabular-nums}.xp-track{height:6px;background:#141210;border:1px solid #5c4e36;padding:1px;box-shadow:var(--sunk),0 1px 3px #00000080}#xp-fill{height:100%;width:0;background:linear-gradient(#d8b062,#9c7a34);transition:width .2s linear}.character-progress{margin:0 0 6px;color:#dcc58d;font-size:13px}.character-progress:empty{display:none}.mana-title{display:flex;justify-content:space-between;margin:9px 0 4px;color:#b7ae9c;font-size:12px}#mana-fill{height:100%;width:0;background:linear-gradient(#8098a8,#5a6b79);transition:width .12s linear}.aspect-picker{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;font-size:13px;color:#b7ae9c}.aspect-picker select{padding:5px 8px;min-width:130px}.skill-entry .passive-description{color:#dcc58d}.aspect-note,#aspect-message{font-size:12px;color:#b7ae9c}#aspect-message:empty{display:none}
/* Death (user, 2026-10-26: "make that look a bit more visually impressive"). The whole screen goes:
   the world drains of colour and darkens, a blood-dark vignette closes in and beats slowly, and the
   title rises out of a blur across a gold rule; Respawn arrives a moment later, so the fall is seen
   before it can be undone. The layer passes every touch through except the button. Android draws the
   same in player_hud.gd (_build_death_notice), timings included. */
.death-notice{position:absolute;inset:0;z-index:5;display:grid;place-items:center;pointer-events:none;
 backdrop-filter:grayscale(.85) brightness(.62);-webkit-backdrop-filter:grayscale(.85) brightness(.62);
 animation:death-drain 1.6s ease-out both}
.death-notice::before{content:"";position:absolute;inset:0;
 background:radial-gradient(ellipse 75% 70% at 50% 46%,#0000 30%,#3a0806a6 72%,#100202f0 100%);
 animation:death-close 1.6s ease-out both,death-beat 2.6s ease-in-out 1.6s infinite}
.death-card{position:relative;display:flex;flex-direction:column;align-items:center;margin-top:-6vh;
 padding:0 24px;text-align:center}
.death-card::before{content:"";position:absolute;left:50%;top:50%;z-index:-1;width:160%;height:200%;
 transform:translate(-50%,-50%);background:radial-gradient(closest-side,#000a,#0000);pointer-events:none}
.death-title{margin:0;font-size:clamp(34px,6.4vw,64px);line-height:1.1;letter-spacing:.14em;
 font-variant:small-caps;color:#e9c2a6;
 text-shadow:0 0 18px #b3241ab3,0 0 42px #6e0f0a99,0 2px 3px #000;
 animation:death-title 1.8s cubic-bezier(.2,.7,.2,1) .25s both}
.death-rule{position:relative;display:block;width:min(420px,70vw);height:1px;margin:14px 0 22px;
 background:linear-gradient(90deg,#0000,#dcc58d 35%,#dcc58d 65%,#0000);animation:death-rule 1.2s ease-out .9s both}
.death-rule::after{content:"";position:absolute;left:50%;top:50%;width:9px;height:9px;
 background:#8e1d16;border:1px solid #dcc58d;transform:translate(-50%,-50%) rotate(45deg);box-shadow:0 0 10px #c2281d}
.death-notice button{pointer-events:auto;padding:10px 38px;font-size:19px;letter-spacing:.1em;color:#f1e3c4;
 background:linear-gradient(176deg,#4a1d17,#2a1410 62%,#1d0f0c);border:1px solid #b89a5e;
 box-shadow:inset 0 1px 0 #f0c48a33,inset 0 -1px 0 #0008,0 0 16px #a3261a59,0 3px 8px #0009;
 animation:death-rise .7s ease-out 1.5s both}
.death-notice button:hover:not(:disabled){background:linear-gradient(176deg,#5e251d,#361913 62%,#251310);
 box-shadow:inset 0 1px 0 #f0c48a4d,inset 0 -1px 0 #0008,0 0 24px #c72f2088,0 3px 8px #0009}
.death-notice .respawn-message{margin:12px 0 0;font-size:13px;font-style:italic;color:#c9bca3;text-shadow:0 1px 2px #000;
 animation:death-rise .7s ease-out 1.7s both}
@keyframes death-drain{from{backdrop-filter:grayscale(0) brightness(1);-webkit-backdrop-filter:grayscale(0) brightness(1)}}
@keyframes death-close{from{opacity:0;transform:scale(1.25)}}
@keyframes death-beat{50%{opacity:.82}}
@keyframes death-title{from{opacity:0;letter-spacing:.42em;filter:blur(8px);transform:translateY(-10px) scale(1.06)}}
@keyframes death-rule{from{opacity:0;transform:scaleX(0)}}
@keyframes death-rise{from{opacity:0;transform:translateY(10px)}}
@media(prefers-reduced-motion:reduce){.death-notice,.death-notice::before,.death-title,.death-rule,.death-notice button,.death-notice .respawn-message{animation:none}}
/* Attack lives in the touch layout only (below); a mouse has its buttons and the keys. */
.thumb-actions{display:none}
/* The phone layout gives the bar a display of its own, which would otherwise beat `hidden`. */
.hotbar-hud[hidden]{display:none!important}
.hotbar-hud{position:absolute;left:50%;bottom:24px;transform:translateX(-50%);width:780px;max-width:calc(100% - 48px)}
.hotbar-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px;font-size:12px;color:var(--gold)}
.hotbar-toolbar>span{background:none;border:0;padding:3px 2px;text-shadow:0 1px 3px #000,0 0 6px #000}
.hotbar-toolbar button{padding:3px 8px;font-size:12px}
.skill-hotbar{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:4px;margin:0;padding:0;list-style:none}
.hotbar-entry{min-width:0}
.hotbar-slot{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;
 align-items:center;width:100%;height:126px;min-width:0;padding:22px 3px 5px;text-align:center;color:var(--text);
 border:1px solid #7d6742;border-radius:3px;background:var(--slot);
 /* Top edge catches the light, base falls into shadow, and the middle is sunk behind the bezel:
    the three things that separate a pressable object from a coloured rectangle. */
 box-shadow:inset 0 1px 0 #e8cb9640,inset 0 -1px 0 #00000080,inset 0 0 0 1px #0000005e,
  inset 0 4px 10px #00000059,0 2px 5px #000000a6}
/* A stud at each corner, sitting on the bezel rather than in the well. */
.hotbar-slot::after{content:"";position:absolute;inset:0;border-radius:3px;pointer-events:none;
 background:
  radial-gradient(circle at 4.5px 4.5px,#e2c58f 0 1px,#8a6f43 1px 1.8px,#0000 2.1px),
  radial-gradient(circle at calc(100% - 4.5px) 4.5px,#e2c58f 0 1px,#8a6f43 1px 1.8px,#0000 2.1px),
  radial-gradient(circle at 4.5px calc(100% - 4.5px),#e2c58f 0 1px,#8a6f43 1px 1.8px,#0000 2.1px),
  radial-gradient(circle at calc(100% - 4.5px) calc(100% - 4.5px),#e2c58f 0 1px,#8a6f43 1px 1.8px,#0000 2.1px);
 opacity:.85}
.hotbar-milestone{animation:hotbar-milestone var(--milestone-ms,600ms) ease-out var(--milestone-pulses,3)}
/* A level-up or rank-up for this skill (milestone-effects.ts): a glow in its Aspect's colour, pulsing, and its new rank for a moment. */
@keyframes hotbar-milestone{0%{box-shadow:inset 0 0 0 2px var(--milestone-colour),0 0 18px 4px var(--milestone-colour)}100%{box-shadow:inset 0 0 0 1px #0000,0 0 0 0 #0000}}
.hotbar-milestone-badge{position:absolute;top:3px;right:4px;z-index:2;padding:0 4px;border-radius:7px;background:#181715e6;border:1px solid var(--milestone-colour,#ffd66e);
 color:var(--milestone-colour,#ffd66e);font-size:11px;font-weight:700;line-height:14px;pointer-events:none;animation:hotbar-milestone-badge 2600ms ease-out both}
@keyframes hotbar-milestone-badge{0%{opacity:0;transform:scale(1.8)}10%{opacity:1;transform:scale(1)}80%{opacity:1}100%{opacity:0}}
.hotbar-slot:active{box-shadow:inset 0 2px 6px #000000a6,inset 0 0 0 1px #0000006b,0 1px 2px #00000080}
.hotbar-slot:active svg{transform:translateY(1px)}
.hotbar-slot kbd{position:absolute;top:3px;left:4px;z-index:1;min-width:14px;padding:0 3px;border-radius:2px;background:linear-gradient(#4b402e,#332b1f);border:1px solid #6b5a3e;box-shadow:inset 0 1px 0 #e8cb9626;font-size:10px;line-height:14px;color:#d8c49a}
.hotbar-slot svg{width:25px;height:25px;flex-shrink:0;margin-bottom:4px;fill:none;stroke:var(--gold);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 0 #0000009e) drop-shadow(0 0 5px #dcc58d33)}
.hotbar-name{display:flex;align-items:center;justify-content:center;min-height:30px;font-size:11px;line-height:14px;overflow-wrap:anywhere}
.hotbar-cost{color:var(--muted);font-size:11px;line-height:16px;min-height:16px}
.hotbar-state{color:var(--gold);font-size:12px;line-height:16px;min-height:16px;font-variant-numeric:tabular-nums}
.hotbar-cooldown{position:absolute;z-index:-1;inset:0 0 auto;height:var(--cooldown,0%);background:linear-gradient(#080706e6,#0d0c0bcc);border-bottom:1px solid #8a6f4359}
/* Painted skill icons (art backlog 10.1): bigger than the line symbols, since a painting needs room to read. */
.hotbar-slot img.hotbar-painting{width:36px;height:36px;flex-shrink:0;margin-bottom:3px;border-radius:4px;border:1px solid #6b5a3a;box-shadow:0 1px 3px #000a;pointer-events:none;position:relative;z-index:-2}
.hotbar-slot[data-cooling="true"] img.hotbar-painting{filter:saturate(.75)}.hotbar-slot[data-unavailable="true"] img.hotbar-painting{filter:grayscale(.85) brightness(.6)}
.hotbar-slot[data-cooling="true"] svg,.hotbar-slot[data-unavailable="true"] svg{stroke:var(--muted);filter:drop-shadow(0 1px 0 #0000009e)}
.hotbar-slot[data-cooling="true"],.hotbar-slot[data-unavailable="true"]{border-color:#5d4e35}
.hotbar-slot[data-cooling="true"]::after,.hotbar-slot[data-unavailable="true"]::after{opacity:.4}
/* Ready and affordable: the rim warms, which is readable at a glance on a crowded bar. */
.hotbar-slot:not([data-cooling="true"]):not([data-unavailable="true"]){border-color:#9b8052}
.hotbar-slot[data-unavailable="true"] .hotbar-state{color:#e4b9a0}
@media(min-width:651px){.vitals,.game-menu{bottom:190px}}
#hotbar-panel{width:min(790px,calc(100vw - 24px))}
.hotbar-help,#hotbar-message{font-size:13px;color:var(--muted)}
#hotbar-assignments{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:20px}
#hotbar-assignments fieldset{border:0;padding:0;margin:0;min-width:0}
#hotbar-assignments legend{color:var(--gold);padding:0 0 10px}
#hotbar-assignments label{display:grid;grid-template-columns:62px minmax(0,1fr);align-items:center;gap:6px;margin-bottom:8px;font-size:13px}
#hotbar-assignments select{width:100%;padding:5px}
@media(max-width:1120px){.hotbar-hud{bottom:160px}.vitals,.game-menu{bottom:24px}}
/* A short window -- a laptop not maximised, a tablet in landscape -- has no room for a
   126px bar floating above the vitals, and the toolbar row rides up into the minimap.
   Shrink the slot rather than move it: the icon and the state still fit. */
@media(min-width:651px) and (max-height:640px){
 .hotbar-hud{bottom:108px}
 .hotbar-slot{height:86px;padding-top:17px}
 .hotbar-name{min-height:22px;font-size:10px;line-height:12px}
 .hotbar-cost{display:none}
 .hotbar-slot svg{width:21px;height:21px;margin-bottom:2px}
 .hotbar-slot img.hotbar-painting{width:30px;height:30px;margin-bottom:2px}
}
/* Phone layout. The desktop bar carries a name, a mana cost and a state line inside every slot,
   which at phone width stacked into 118px tiles over two rows -- 33% of the screen for the bar
   alone, sat across the middle of the play area rather than at its edge. Here a slot is the icon
   and nothing else: you recognise a symbol, and the cooldown is already drawn as a fill. The three
   blocks dock to the bottom edge as one strip instead of floating in from it. */
/* --- phones ------------------------------------------------------------------------------------
   Reworked 2026-09-20 after the thing was tried on one and found unplayable: the chat box had taken
   the bottom strip the hotbar lived in, and the bar itself was ten slots wide on a 390px screen.
   The shape now is thumbs first -- what you press most sits where a thumb rests, and everything
   else folds away until asked for. See docs/player-interface.md. */
 /* Revised 2026-10-18 after a sword fight on a phone was found fiddly: the thumb's corner holds a
    large Attack button (the basic attack, on the target or the nearest monster) with Dodge beside
    it, then four skills in a square, then Ride/More/Edit stacked at the cluster's left. Every target
    is at least 48px; Attack is 80 and Dodge 64. The rest of the bar is behind More, which lifts it
    up as a sheet rather than making the cluster taller. Android lays out the same cluster. */
 body.compact .hotbar-hud{left:auto;right:calc(8px + env(safe-area-inset-right,0px));bottom:calc(8px + env(safe-area-inset-bottom,0px));
  width:auto;max-width:none;transform:none;padding:0;display:grid;gap:8px;align-items:end;
  grid-template-columns:auto auto auto;grid-template-areas:"tools skills thumb"}
 body.compact .skill-hotbar{grid-area:skills;grid-template-columns:repeat(2,56px);gap:8px;justify-content:end}
 body.compact .thumb-actions{grid-area:thumb;display:flex;align-items:flex-end;gap:8px}
 /* The basic attack has the Attack button; on the bar it shows only in the More sheet. */
 body.compact .hotbar-entry[data-basic="true"]{display:none}
 body.compact .hotbar-hud.expanded .hotbar-entry[data-basic="true"]{display:block}
 /* An unbound slot is noise here: half of the ten read "Empty" and cost a whole row. */
 body.compact .hotbar-entry[data-bound="false"]{display:none}
 /* Past the fourth bound slot, only while the sheet is up. */
 body.compact .hotbar-entry[data-rank]:not([data-rank="1"]):not([data-rank="2"]):not([data-rank="3"]):not([data-rank="4"]){display:none}
 body.compact .hotbar-hud.expanded .hotbar-entry[data-rank]{display:block}
 body.compact .hotbar-hud.expanded{left:8px;right:8px;width:auto;grid-template-columns:auto minmax(0,1fr) auto}
 body.compact .hotbar-hud.expanded .skill-hotbar{grid-template-columns:repeat(4,minmax(0,1fr));justify-content:stretch;
  max-height:46vh;overflow-y:auto}
 body.compact .hotbar-slot{height:56px;padding:0;justify-content:center}
 body.compact .hotbar-slot svg{width:28px;height:28px;margin:0}
 body.compact .hotbar-slot img.hotbar-painting{width:44px;height:44px;margin:0}
 body.compact .hotbar-name,body.compact .hotbar-cost,body.compact .hotbar-state{display:none}
 body.compact .hotbar-slot kbd{display:none}
 /* There is no Space bar on a phone, and the hint costs the button half its width. */
 body.compact .dodge kbd,body.compact .ride kbd{display:none}
 body.compact .hotbar-toolbar{grid-area:tools;flex-direction:column;align-items:stretch;justify-content:flex-end;margin:0;font-size:12px;gap:8px}
 body.compact .hotbar-toolbar>span{display:none}
 /* Editing is a button on a phone too (U18), beside long-press on a slot. With More showing, Edit
    waits in the sheet it opens, so the stack is never taller than the cluster. */
 body.compact #hotbar-more,body.compact #hotbar-edit{display:block;min-height:48px;min-width:64px;padding:6px 12px}
 body.compact #hotbar-more[hidden]{display:none}
 body.compact #hotbar-more:not([hidden])~#hotbar-edit{display:none}
 body.compact .hotbar-hud.expanded #hotbar-edit{display:block}
 /* Prefixed to outrank the base .dodge/.ride rule further down the sheet. */
 body.compact .hotbar-hud .ride{margin-right:0;padding:6px 12px;min-height:48px;min-width:64px;justify-content:center;font-size:12px}
 body.compact .hotbar-hud .dodge{margin:0;width:64px;height:64px;min-height:64px;padding:0;justify-content:center;border-radius:50%;font-size:13px}
 /* Disabled until something is aimed at you, but never faded out of sight: it lights up where it is. */
 body.compact .hotbar-hud .dodge:disabled{opacity:.85}
 body.compact .attack-button{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  width:80px;height:80px;padding:0;border-radius:50%;border:2px solid #b8955a;background:radial-gradient(circle at 50% 38%,#4a3c28,#221c14 70%);
  box-shadow:var(--raised);color:var(--gold);font:inherit;font-size:12px;letter-spacing:.04em;touch-action:manipulation}
 body.compact .attack-button svg{width:34px;height:34px;fill:none;stroke:var(--gold);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
 body.compact .attack-button:active{box-shadow:inset 0 2px 6px #000000a6}
 body.compact .attack-button[data-cooling="true"] svg{stroke:var(--muted)}
 body.compact .attack-button .attack-painting{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%;z-index:-2;pointer-events:none}
 body.compact .attack-button:has(.attack-painting) span:not(.hotbar-cooldown){margin-top:auto;margin-bottom:8px;text-shadow:0 0 3px #000,0 1px 4px #000}
 body.compact .attack-button[data-cooling="true"] .attack-painting{filter:grayscale(.6) brightness(.7)}
 body.compact .attack-button:disabled{opacity:.6}

 /* Vitals along the bottom left, clear of the cluster; the menu goes up under the minimap so the
    bottom right belongs to the thumb alone. */
 body.compact .vitals{left:calc(8px + env(safe-area-inset-left,0px));right:232px;bottom:calc(10px + env(safe-area-inset-bottom,0px));
  width:auto;padding:6px 9px 7px}
 body.compact .vitals-title,body.compact .mana-title{margin:0 0 3px;font-size:11px;gap:8px}
 body.compact .mana-title{margin-top:6px}
 body.compact .xp-title{margin-top:6px;font-size:10px}
 body.compact .health-track{height:8px}
 body.compact .game-menu{right:8px;top:70px;bottom:auto;gap:4px;flex-direction:column}
 body.compact .game-menu button{width:48px;min-height:48px;gap:0;padding:0}
 body.compact .game-menu button span{display:none}
 body.compact .game-menu svg{width:20px;height:20px}

 body.compact .hud::before{height:150px}
 body.compact .minimap{top:8px;right:8px;width:86px;padding:3px}
 body.compact .minimap-view{width:80px;height:52px}
 body.compact .minimap-caption{display:none}

 body.compact #hotbar-assignments{grid-template-columns:1fr;gap:20px}

@media(max-width:420px){
 body.compact .vitals{right:224px}
}
/* Upright, the Ride/More/Edit stack lies along the top of the cluster and Dodge sits over Attack,
   so the cluster stays narrow enough to leave the vitals their corner. */
@media(max-width:650px) and (orientation:portrait){
 body.compact .hotbar-hud{grid-template-columns:auto auto;grid-template-areas:"tools tools" "skills thumb"}
 body.compact .hotbar-toolbar{flex-direction:row;justify-content:flex-end}
 body.compact .thumb-actions{flex-direction:column;align-items:center}
 body.compact .hotbar-hud.expanded{grid-template-columns:minmax(0,1fr) auto}
 /* The vitals are narrower beside the cluster: the name gives way, the numbers stay on one line. */
 body.compact .vitals-title>span{white-space:nowrap}
}

/* --- a phone on its side ------------------------------------------------------------------------
   Landscape is not a wider portrait. Width stops being the scarce thing and height becomes it --
   844x390 rather than 390x844 -- so what changes here is the stacking, not the thinking. Every rule
   above carries over (their conditions name this one too); the cluster lies down into a single row
   of four, Dodge and More sit beside each other rather than stacked, and the menu gives up the right
   edge for a row along the top, because that edge is 390px tall now and the minimap, the buttons and
   the hotbar cannot all have it. Both thumbs still land on their own bottom corner.
   A short desktop window matches this too. That is deliberate: 500px of height is 500px of height,
   and the compact layout is the better answer at that size whatever is pointing at it. */
 body.compact-wide .hotbar-hud{bottom:calc(6px + env(safe-area-inset-bottom,0px))}
 body.compact-wide .hotbar-hud.expanded .skill-hotbar{grid-template-columns:repeat(8,minmax(0,1fr));max-height:52vh}
 /* Room across the bottom now, so the vitals take what they need rather than the gap to the cluster. */
 body.compact-wide .vitals{right:auto;width:min(232px,38vw);bottom:calc(6px + env(safe-area-inset-bottom,0px))}
 body.compact-wide .game-menu{top:calc(8px + env(safe-area-inset-top,0px));right:calc(92px + env(safe-area-inset-right,0px));
  bottom:auto;flex-direction:row;gap:4px}
 body.compact-wide .minimap{width:76px;padding:2px}
 body.compact-wide .minimap-view{width:72px;height:44px}
 body.compact-wide .hud::before{height:96px}
 body.compact-wide .notice{top:13%}
 body.compact-wide .death-card{margin-top:-10vh}


/* Dodge lives in the hotbar's own toolbar row rather than floating above it: positioned absolutely
   it sat underneath the game menu, where it could be neither seen nor pressed. It is lit only while
   something is actually aimed at the player's tile, so the control teaches when a telegraph can be
   answered at all. */
.dodge,.ride{display:inline-flex;align-items:center;gap:8px;margin-right:auto;
 padding:8px 16px;min-height:44px;border:1px solid var(--edge);border-radius:2px;
 background:var(--leather);box-shadow:var(--raised);color:var(--muted);font:inherit;font-size:13px;letter-spacing:.04em}
.hotbar-toolbar .dodge kbd{font-family:inherit;font-size:11px;color:var(--muted)}
.dodge[data-danger="true"]{border-color:#ffc4a3;background:linear-gradient(176deg,#a82a17,#7d1a0d);color:#fff3ea}
.dodge[data-danger="true"] kbd{color:#ffd9c4}
.dodge:disabled{opacity:.5}
/* Pulses while live, so it is found by the eye before the thumb goes looking (user, 2026-10-18). */
@keyframes dodge-pulse{0%,100%{box-shadow:0 0 0 0 #ff6a4a99}50%{box-shadow:0 0 0 9px #ff6a4a00}}
.dodge[data-danger="true"]:not(:disabled){animation:dodge-pulse .7s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){.dodge[data-danger="true"]{animation:none}}
/* Ride: shown only with something in the Mount slot; pressed while riding. See docs/mounts.md. */
.hotbar-toolbar .ride{margin-right:8px}
.ride[hidden]{display:none}
.hotbar-toolbar .ride kbd{font-family:inherit;font-size:11px;color:var(--muted)}
.ride[aria-pressed="true"]{border-color:#e6d49a;background:linear-gradient(176deg,#6b5a2a,#4a3d1a);color:#fff6dc}
.ride:disabled{opacity:.5}

/* Readouts: plain face, aligned figures, so a changing number does not shuffle its own width. */
.vitals-title span:last-child,.mana-title span:last-child,
.hotbar-state,.hotbar-cost,.hotbar-slot kbd,.primary-stats dd,.combat-stats dd,table,#fps{
 font-family:var(--numeric);font-variant-numeric:tabular-nums}
/* The build stamp: readable when you go looking, never competing with the settings above it. */
.build-note{font-family:var(--numeric);font-size:12px;color:var(--muted);word-break:break-all}
.build-note #build-state{color:var(--gold)}
.build-note #build-state[data-state="stale"]{color:#e0a45c}
.build-refresh{margin-top:6px;padding:6px 12px;font-size:13px}
/* Frame rate: legible over any terrain, and never in the way of anything you play with. */
/* Bottom left, clear of the vitals (user, 2026-11-01: "so it's more visible"); Android the same. */
.perf-readout{position:absolute;bottom:calc(8px + env(safe-area-inset-bottom,0px));left:12px;margin:0;pointer-events:none;white-space:pre-line;
 font-family:var(--numeric);font-variant-numeric:tabular-nums;font-size:12px;color:#ece8dd;
 text-shadow:0 1px 2px #000,0 0 5px #000,0 0 9px #000}
body.compact .perf-readout{font-size:11px;bottom:calc(6px + env(safe-area-inset-bottom,0px));left:8px}
/* The loading screen. Opaque, above everything, and present in the markup from the first paint so
   there is no moment where a half-built world shows through before it arrives.
   Styled up after the death screen (user, 2026-10-27: "can we do something similar for the loading
   screen"): the account screen's painted town gate, darkened, drifting slowly under a lantern glow that
   flickers and embers that rise; the wordmark gathers out of a blur over a gold rule whose diamond pulses
   while work goes on; the stage under way in small capitals over a gilded bar with a spark at its edge;
   the four stages as diamonds that fill as they finish. It fades into the world rather than vanishing.
   Android draws the same in online.gd (_build_loading_screen), timings included. */
.loading{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:24px;overflow:hidden;
 background:#0d0b09;color:var(--text);transition:opacity .7s ease-out}
.loading[hidden]{display:none!important}
.loading.loading-leaving{opacity:0;pointer-events:none}
.loading-scene{position:absolute;inset:0;background:#181715 url('art/login/town-gate.webp') center/cover no-repeat;
 filter:brightness(.46) saturate(.78);animation:loading-fade 1.4s ease-out both,loading-drift 50s ease-in-out infinite alternate}
.loading::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
 background:radial-gradient(ellipse 72% 66% at 50% 44%,#0000 22%,#0a0705b3 68%,#040302f5 100%)}
.loading::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
 background:radial-gradient(ellipse 46% 40% at 50% 42%,#e0a05a2e,#0000 70%);animation:loading-lantern 4.2s ease-in-out infinite}
.loading-embers{position:absolute;inset:0;z-index:2;pointer-events:none;opacity:.85;
 -webkit-mask-image:linear-gradient(to top,#000 10%,#0000 85%);mask-image:linear-gradient(to top,#000 10%,#0000 85%)}
.loading-embers::before,.loading-embers::after{content:"";position:absolute;inset:0}
.loading-embers::before{background-image:radial-gradient(circle at 12% 30%,#ffc46e 0 1.4px,#0000 2.5px),
 radial-gradient(circle at 47% 78%,#ffb35a 0 1.1px,#0000 2.2px),radial-gradient(circle at 81% 12%,#ffd28a 0 1.6px,#0000 2.8px),
 radial-gradient(circle at 66% 52%,#ff9f4a 0 1px,#0000 2px),radial-gradient(circle at 28% 90%,#ffc46e 0 1.2px,#0000 2.4px);
 background-size:420px 520px;animation:loading-rise 15s linear infinite,loading-sway 5s ease-in-out infinite alternate}
.loading-embers::after{background-image:radial-gradient(circle at 20% 60%,#ffb35a 0 1px,#0000 2px),
 radial-gradient(circle at 73% 25%,#ffd28a 0 .9px,#0000 1.9px),radial-gradient(circle at 52% 8%,#ff9f4a 0 1.2px,#0000 2.2px);
 background-size:300px 380px;opacity:.7;animation:loading-rise-near 10s linear infinite,loading-sway 3.6s ease-in-out -1.2s infinite alternate}
.loading-panel{position:relative;z-index:3;display:flex;flex-direction:column;align-items:center;width:min(680px,100%);
 margin-top:-3vh;text-align:center}
.loading-panel::before{content:"";position:absolute;left:50%;top:50%;z-index:-1;width:150%;height:150%;
 transform:translate(-50%,-50%);background:radial-gradient(closest-side,#000000a0,#0000);pointer-events:none}
.loading-title{margin:0;font-size:22px;font-weight:400;color:var(--gold)}
.game-wordmark{display:block;width:min(340px,100%);height:auto;margin:0 auto;image-rendering:auto}
.loading-title .game-wordmark{width:min(440px,72vw,78vh);
 filter:drop-shadow(0 0 22px #e6a85a47) drop-shadow(0 4px 8px #000c);animation:loading-title 1.8s cubic-bezier(.2,.7,.2,1) .15s both}
.loading-rule{position:relative;display:block;width:min(400px,70vw);height:1px;margin:6px 0 18px;
 background:linear-gradient(90deg,#0000,#dcc58d 35%,#dcc58d 65%,#0000);animation:loading-rule 1.2s ease-out .7s both}
.loading-rule::after{content:"";position:absolute;left:50%;top:50%;width:9px;height:9px;background:#3d2c14;
 border:1px solid #dcc58d;transform:translate(-50%,-50%) rotate(45deg);animation:loading-pulse 2.4s ease-in-out infinite}
.loading-step{margin:0 0 10px;min-height:1.4em;font-size:15px;letter-spacing:.16em;font-variant:small-caps;color:#ecdcb4;
 text-shadow:0 1px 3px #000,0 0 10px #000;animation:loading-rise-in .7s ease-out 1.1s both}
.loading-step .loading-percent{margin-left:.6em;font-family:var(--numeric);letter-spacing:.04em;color:var(--gold)}
.loading-track{position:relative;width:min(360px,70vw);height:6px;padding:1px;background:#0c0a08d9;border:1px solid #6b5a3eb3;
 border-radius:3px;box-shadow:0 0 0 1px #000a,0 2px 10px #000c;animation:loading-rise-in .7s ease-out 1.2s both}
.loading-track::before,.loading-track::after{content:"";position:absolute;top:50%;width:6px;height:6px;background:#1a140c;
 border:1px solid #b89a5e;transform:translateY(-50%) rotate(45deg)}
.loading-track::before{left:-11px}.loading-track::after{right:-11px}
.loading-fill{position:relative;height:100%;width:0;border-radius:2px;background:linear-gradient(90deg,#7a5f35,#c8a86a 60%,#f0d79a);
 box-shadow:0 0 8px #e6b86a80;transition:width .35s ease-out}
.loading-fill::after{content:"";position:absolute;right:-5px;top:50%;width:12px;height:12px;transform:translateY(-50%);border-radius:50%;
 background:radial-gradient(circle,#fff6dc 0 18%,#ffd28a99 40%,#0000 72%);animation:loading-spark 1.1s ease-in-out infinite}
.loading-stages{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;margin:16px 0 0;padding:0;
 animation:loading-rise-in .7s ease-out 1.3s both}
.loading-stages li{display:flex;align-items:center;gap:7px;font-size:12px;letter-spacing:.1em;font-variant:small-caps;color:#8a7d66;
 text-shadow:0 1px 2px #000}
/* The marker carries the state, so it reads at a glance without depending on colour alone: hollow
   waiting, glowing under way, filled done, amber and marked failed. */
.loading-stages li::before{content:"";width:7px;height:7px;flex:none;border:1px solid #6b5a3e;transform:rotate(45deg)}
.loading-stages li[data-state="active"]{color:var(--text)}
.loading-stages li[data-state="active"]::before{background:#f0d79a;border-color:#f0d79a;animation:loading-pulse 1.4s ease-in-out infinite}
.loading-stages li[data-state="done"]{color:#b7ae9c}
.loading-stages li[data-state="done"]::before{background:#b89a5e;border-color:#dcc58d}
.loading-stages li[data-state="failed"]{color:#e0a45c}
.loading-stages li[data-state="failed"]::before{background:#8e1d16;border-color:#e0a45c}
.loading-stages .loading-note{display:none}
.loading-detail{margin:12px 0 0;max-width:420px;min-height:1.4em;font-size:13px;font-style:italic;color:#c9bca3;text-shadow:0 1px 2px #000}
.loading-detail[data-failed="true"]{font-style:normal;color:#e0a45c}
@keyframes loading-fade{from{opacity:0}}
@keyframes loading-drift{from{transform:scale(1.04) translate(-1.2%,.4%)}to{transform:scale(1.12) translate(1.4%,-1%)}}
@keyframes loading-lantern{0%,100%{opacity:.75}22%{opacity:1}35%{opacity:.82}58%{opacity:.95}74%{opacity:.7}}
@keyframes loading-rise{to{background-position:0 -520px}}
@keyframes loading-rise-near{to{background-position:0 -380px}}
@keyframes loading-sway{from{transform:translateX(-6px)}to{transform:translateX(6px)}}
@keyframes loading-title{from{opacity:0;filter:blur(8px) drop-shadow(0 0 22px #e6a85a00);transform:translateY(-8px) scale(1.04)}}
@keyframes loading-rule{from{opacity:0;transform:scaleX(0)}}
@keyframes loading-pulse{50%{box-shadow:0 0 12px #f0c46acc}}
@keyframes loading-spark{50%{opacity:.55;transform:translateY(-50%) scale(.8)}}
@keyframes loading-rise-in{from{opacity:0;transform:translateY(8px)}}
@media(prefers-reduced-motion:reduce){.loading,.loading-scene,.loading::after,.loading-embers::before,.loading-embers::after,
 .loading-title .game-wordmark,.loading-rule,.loading-rule::after,.loading-step,.loading-track,.loading-fill::after,.loading-stages,
 .loading-stages li::before{animation:none;transition:none}}

/* The character screen. Shown before the world exists, so it styles itself from the same tokens
   as the loading screen it stands in for rather than assuming any of the HUD is present. */
.character-select{position:absolute;inset:0;z-index:30;display:grid;align-items:safe center;justify-items:start;overflow:auto;padding:40px clamp(24px,7vw,112px);background:#181715 url('art/login/town-gate.webp') center/cover no-repeat}
.select-panel{width:min(640px,100%);padding:32px;background:#24221e;border:1px solid #74654a;box-shadow:0 2px 8px #00000040;border-top:3px solid var(--gold)}
.select-account-form{width:min(420px,100%)}
.select-brand{margin:0 0 24px;padding-bottom:20px;border-bottom:1px solid var(--edge);color:var(--gold);font-family:var(--serif);line-height:1.15;text-align:center}
.select-brand span{font-style:italic;color:var(--muted);font-size:.8em}
.select-panel{position:relative;z-index:1}
.select-atmosphere{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:0}
.select-motion{position:fixed;top:16px;right:16px;z-index:2;padding:8px 12px;background:#24221e;color:var(--text);font-size:13px;box-shadow:none}
.select-preview{position:fixed;left:calc(50% + 90px);bottom:6vh;width:min(320px,28vw);margin:0;text-align:center;color:var(--text);pointer-events:none}
.select-preview canvas{width:100%;height:auto;image-rendering:auto}
.select-preview figcaption{font-size:23px;text-shadow:0 2px 4px #000}
.select-preview-status{font-size:13px;background:#24221e;line-height:1.5;margin:8px 0 0;padding:6px 10px}
.select-preview-status:empty{display:none}
/* The showcase (src/showcase.ts, docs/character-showcase.md): the character's live 3D model standing beside
   the panel, the whole height of the screen (sized in .select-live below). */
.select-preview.select-showcase{position:fixed;left:45vw;right:0;top:0;bottom:0;width:auto;z-index:0;pointer-events:none}
/* fallen: in cool moonlight */
.select-showcase.fallen canvas{filter:brightness(.62) saturate(.55) sepia(.15) hue-rotate(185deg)}
.select-showcase figcaption{position:absolute;left:0;right:0;bottom:3.5vh;font-family:var(--serif);font-size:34px;color:var(--gold);letter-spacing:.04em;text-shadow:0 2px 12px #000,0 0 2px #000;pointer-events:none}
.select-showcase .select-preview-status{position:absolute;left:50%;bottom:calc(3.5vh + 52px);transform:translateX(-50%);white-space:nowrap}
.character-select.showcase-3d:has(.select-showcase:not([hidden]))::before{content:"";position:fixed;inset:-24px;background:inherit;filter:blur(5px) brightness(.5) saturate(.85);pointer-events:none;z-index:0}
.character-select.showcase-3d:has(.select-showcase:not([hidden]))::after{content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
 background:radial-gradient(ellipse 38% 60% at 72% 62%,#ff9a4a1f,transparent 70%),radial-gradient(ellipse 120% 90% at 60% 50%,transparent 45%,#0b0907d9 100%)}
@media(max-width:900px){
 .select-preview.select-showcase{position:relative;left:auto;right:auto;top:auto;bottom:auto;width:100%;height:min(360px,50vh);margin:0 0 16px}
 .select-showcase figcaption{bottom:6px;font-size:22px}
 .select-showcase .select-preview-status{bottom:40px}
}
.select-new{margin:24px 0 18px;border-top:1px solid var(--line);padding-top:16px}
.select-new summary{cursor:pointer;color:var(--gold);min-height:44px;display:list-item;align-content:center}
.select-new .select-create{border-top:0;padding-top:12px;margin-bottom:0}
.select-panel[data-state=ready]>.select-play{margin-bottom:24px}
@media(min-width:901px) and (max-width:1200px){.select-panel[data-state=ready]{width:48vw}.select-preview{left:auto;right:4vw}}
@media(max-width:900px){.select-preview{position:relative;left:auto;bottom:auto;width:200px;margin:0 auto 20px}.select-preview figcaption{font-size:19px;text-shadow:none}}
.select-panel h2{margin:0 0 20px;font-size:25px;font-weight:500;color:var(--gold)}
.select-empty,.select-note{color:var(--muted);margin:0 0 16px}
.select-list{list-style:none;margin:0 0 22px;padding:0;display:grid;gap:10px}
.select-card{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);background:var(--leather)}
.select-card.selected{border-color:var(--gold);box-shadow:inset 0 0 0 1px #dcc58d40}
.select-card.unnamed{grid-template-columns:1fr;gap:8px}
.select-pick{display:grid;gap:3px;text-align:left;background:none;border:none;padding:4px}
.select-name{font-size:18px;color:var(--text)}
.select-detail{font-size:13px;color:var(--muted)}
.select-delete{padding:6px 12px;font-size:13px;color:#e0a99f;border-color:#6b4a44}
.select-name-form{grid-column:1/-1;display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}
.select-create{border-top:1px solid var(--line);padding-top:18px;margin-bottom:22px}
.select-create h3{margin:0 0 12px}
.select-create label,.select-name-form label{display:grid;gap:5px;color:var(--muted);font-size:13px}
.select-create input,.select-name-form input,.select-auth input{padding:8px 10px;background:#141210;color:var(--text);border:1px solid #6b5a3e;border-radius:2px}
.select-create fieldset{margin:14px 0;padding:10px 12px;border:1px solid var(--line)}
.select-create legend{padding:0 6px;color:var(--gold);font-size:13px}
.select-create fieldset label{display:inline-flex;align-items:center;gap:7px;margin-right:16px;color:var(--text)}
.select-create input[type=radio]{accent-color:var(--gold);width:16px;height:16px;padding:0}
.select-create button[type=submit]{padding:9px 22px;margin-top:6px}
.select-auth{display:grid;gap:14px}
.select-auth label{display:grid;gap:5px;color:var(--muted);font-size:13px}
.select-auth button[type=submit]{justify-self:start;padding:9px 22px}
.select-hint{margin:-6px 0 0;color:var(--muted);font-size:12px}
.select-links{display:flex;gap:18px;flex-wrap:wrap;margin-top:18px}
.select-link{padding:0;background:none;border:none;color:var(--gold);font-size:13px;text-decoration:underline;text-underline-offset:3px}
.select-link:hover{background:none;color:var(--text)}
.select-account{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px;padding-bottom:14px;border-bottom:1px solid var(--line);color:var(--muted);font-size:13px;overflow-wrap:anywhere}
.select-account strong{color:var(--text);font-weight:400}
.select-account button{padding:6px 12px;font-size:13px;flex:none}
.select-password{border-top:1px solid var(--line);padding-top:14px}
.select-password summary{cursor:pointer;color:var(--muted);font-size:13px}
.select-password .select-auth{margin-top:14px}
.select-message.select-notice{color:#b9d3a0}
.select-passkey{display:block;width:100%;margin-top:18px;padding:10px;color:var(--gold)}
.select-passkey+.select-hint{margin:6px 0 0;text-align:center}
.select-passkeys{margin-bottom:14px}
.select-passkeys>.select-hint{margin:12px 0}
.select-passkey-list{list-style:none;margin:0 0 12px;padding:0;display:grid;gap:8px}
.select-passkey-list li{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);background:var(--leather);font-size:13px}
.select-passkey-list strong{color:var(--text);font-weight:400}
.select-passkey-list button,#passkey-add{padding:6px 12px;font-size:13px}
.select-message{min-height:20px;margin:16px 0 0;color:#e4b9a0;font-size:13px}
.select-play{display:block;width:100%;margin-top:18px;padding:13px;font-size:17px;color:var(--gold)}
.character-select button,.character-select input{min-height:44px}
.character-select input[type=radio]{min-height:0}
.character-select :is(button,input,summary):focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.select-auth{gap:18px}
.select-auth label{font-size:15px;gap:8px;color:var(--text)}
.select-auth input{width:100%;font-size:16px;padding:11px 12px;border-color:var(--edge)}
.select-auth button[type=submit],.select-play{width:100%;background:#dcc58d;border:1px solid #dcc58d;color:#24221e;box-shadow:none;font-size:17px}
.select-auth button[type=submit]:hover,.select-play:hover{background:#ece0bd;color:#24221e}
.select-auth button[type=submit]:disabled,.select-play:disabled{background:#484036;color:#b7ae9c;border-color:#74654a}
.select-auth .select-check{display:flex;align-items:center;gap:10px}
.select-auth .select-check input{width:22px;height:22px;flex:none;padding:0}
.select-auth button.select-danger{background:#7a2c22;border-color:#a04536;color:#f6e9e2}
.select-auth button.select-danger:hover{background:#933628;color:#fff}
.select-passkey{background:#24221e;box-shadow:none;border-color:var(--edge);font-size:15px;margin-top:16px}
.select-passkey+.select-hint{font-size:13px;line-height:1.5;margin-top:10px}
.select-links{gap:8px 20px;justify-content:space-between;margin-top:20px}
.select-link{font-size:14px;text-align:left}
.select-hint,.select-note,.select-message{line-height:1.5}
.select-message:empty{margin:0;min-height:0}
@media(max-width:700px){
 .character-select{padding:160px 16px 24px;align-items:start;justify-items:center;background-position:68% top;background-size:auto max(100dvh,800px)}
 .select-panel{padding:24px;width:min(480px,100%)}
 .select-brand{font-size:32px;margin-bottom:24px;padding-bottom:20px}
 .select-account{flex-wrap:wrap}
}
@media(max-width:360px){.select-panel{padding:20px}.select-brand{font-size:28px}.select-links{gap:0}}
@media(max-height:500px) and (min-width:701px){.character-select{padding:24px}.select-panel{padding:24px}}
/* The character screen, styled after the death and loading screens (user, 2026-10-27: "can we update the
   character select screen in a similar style"). The painting dims and the lanterns breathe, embers rise
   (account-scene.ts), and the panel becomes a dark glass card in a fine gold frame with a diamond at its
   head; the wordmark sits over a gold rule; headings and labels are small capitals; the characters are
   cards marked with diamonds that fill and glow when chosen; "Enter the world" is a lit brass button.
   The showcase's name stands over a gold rule. The panel is redrawn on every change, so its rise-in plays
   only until the screen has settled (character-select.ts adds .settled). Android draws the same in
   account_style.gd. */
.character-select{background-color:#0d0b09}
.character-select:not(.showcase-3d)::after,.character-select.showcase-3d:not(:has(.select-showcase:not([hidden])))::after{
 content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
 background:radial-gradient(ellipse 120% 95% at 62% 45%,#0000 40%,#0a0806c7 100%),linear-gradient(90deg,#0a0806b3,#0a080626 55%,#0000)}
.select-panel{background:linear-gradient(180deg,#1d1a16f0,#13110ee8);border:1px solid #6b5a3e;border-top:1px solid #6b5a3e;
 box-shadow:0 0 0 1px #000000a6,inset 0 1px 0 #f0d79a14,0 26px 70px #000000c4;
 -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
/* An inner hairline frame and a diamond set into the top edge. */
.select-panel::before{content:"";position:absolute;inset:6px;border:1px solid #dcc58d1f;pointer-events:none}
.select-panel::after{content:"";position:absolute;left:50%;top:0;width:9px;height:9px;background:#3d2c14;border:1px solid #dcc58d;
 transform:translate(-50%,-50%) rotate(45deg);box-shadow:0 0 10px #e6b86a66}
.character-select:not(.settled) .select-panel{animation:select-rise .8s cubic-bezier(.2,.7,.2,1) both}
.character-select:not(.settled) .select-brand .game-wordmark{animation:select-title 1.6s cubic-bezier(.2,.7,.2,1) .1s both}
.select-brand{position:relative;border-bottom:0;padding-bottom:22px;margin-bottom:22px}
.select-brand .game-wordmark{filter:drop-shadow(0 0 20px #e6a85a40) drop-shadow(0 4px 8px #000c)}
.select-brand::after{content:"";position:absolute;left:8%;right:8%;bottom:0;height:1px;
 background:linear-gradient(90deg,#0000,#dcc58d 35%,#dcc58d 65%,#0000)}
.select-brand::before{content:"";position:absolute;left:50%;bottom:0;z-index:1;width:7px;height:7px;background:#3d2c14;border:1px solid #dcc58d;
 transform:translate(-50%,50%) rotate(45deg)}
.select-panel h2{display:flex;align-items:center;gap:14px;font-size:19px;font-weight:400;letter-spacing:.14em;font-variant:small-caps;
 color:#ecdcb4;text-shadow:0 1px 3px #000}
.select-panel h2::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,#dcc58d80,#0000)}
.select-account{border-bottom-color:#4a3f2c}
.select-account button,.select-passkey-list button,#passkey-add,.select-delete,.select-name-form button,.select-delete-form button{
 background:#0000;border-color:#6b5a3e;color:#d6cdb9;font-variant:small-caps;letter-spacing:.06em}
.select-account button:hover,.select-passkey-list button:hover,#passkey-add:hover{background:#2a241c;border-color:#b89a5e;color:var(--gold)}
.select-delete{color:#d9a092;border-color:#6b4a44}
.select-delete:hover{background:#3a1a15;border-color:#a04536;color:#f0c0b4}
/* The characters: a diamond carries the choice, hollow until picked, then filled and glowing. */
.select-list{gap:8px}
.select-card{position:relative;padding:10px 12px 10px 36px;border:1px solid #4a3f2c;
 background:linear-gradient(90deg,#2a241ce6,#181512cc);transition:border-color .2s,box-shadow .2s,background .2s}
.select-card::before{content:"";position:absolute;left:15px;top:50%;width:8px;height:8px;border:1px solid #8a7348;
 transform:translateY(-50%) rotate(45deg);transition:background .2s,box-shadow .2s,border-color .2s}
.select-card:hover{border-color:#8a7348;background:linear-gradient(90deg,#332b20eb,#1c1814d1)}
.select-card.selected{border-color:#dcc58d;background:linear-gradient(90deg,#3a2f1ef0,#1e1914d6);
 box-shadow:0 0 16px #dcc58d2e,inset 0 0 0 1px #dcc58d33}
.select-card.selected::before{background:#f0d79a;border-color:#f0d79a;box-shadow:0 0 10px #f0c46acc}
.select-name{font-size:19px;letter-spacing:.02em}
.select-card.selected .select-name{color:#f4e6c4}
.select-detail{font-size:12px;letter-spacing:.08em;font-variant:small-caps;color:#a79c86}
/* "Enter the world" and the forms' own buttons: lit brass, as Respawn is lit red. */
.select-auth button[type=submit],.select-play,.select-create button[type=submit]{
 background:linear-gradient(176deg,#5a3d1d,#352411 62%,#24180c);border:1px solid #c9a463;color:#f4e6c4;
 font-variant:small-caps;letter-spacing:.12em;text-shadow:0 1px 2px #000;
 box-shadow:inset 0 1px 0 #f0c48a40,inset 0 -1px 0 #0008,0 0 16px #e0a05a33,0 3px 8px #0009;transition:box-shadow .2s,background .2s}
.select-play{font-size:19px;padding:12px}
.select-auth button[type=submit]:hover:not(:disabled),.select-play:hover:not(:disabled),.select-create button[type=submit]:hover:not(:disabled){
 background:linear-gradient(176deg,#6e4b23,#402c15 62%,#2b1d0f);color:#fff3d6;
 box-shadow:inset 0 1px 0 #f0c48a59,inset 0 -1px 0 #0008,0 0 24px #f0b05a66,0 3px 8px #0009}
.select-auth button[type=submit]:disabled,.select-play:disabled,.select-create button[type=submit]:disabled{
 background:#2a241c;border-color:#5c4e36;color:#8a7d66;box-shadow:none;text-shadow:none}
.select-auth button.select-danger{background:linear-gradient(176deg,#4a1d17,#2a1410 62%,#1d0f0c);border-color:#b0574a;color:#f1e3c4;
 box-shadow:inset 0 1px 0 #f0c48a33,0 0 14px #a3261a40}
.select-auth button.select-danger:hover:not(:disabled){background:linear-gradient(176deg,#5e251d,#361913 62%,#251310);box-shadow:inset 0 1px 0 #f0c48a4d,0 0 22px #c72f2066}
.select-auth input,.select-create input,.select-name-form input{background:#0e0c0acc;border-color:#5c4e36;transition:border-color .2s,box-shadow .2s}
.select-auth input:focus,.select-create input:focus,.select-name-form input:focus{border-color:#b89a5e;box-shadow:0 0 10px #dcc58d26;outline:0}
.select-passkey{background:#0000;border-color:#6b5a3e;color:var(--gold);font-variant:small-caps;letter-spacing:.08em}
.select-passkey:hover:not(:disabled){background:#2a241c;border-color:#b89a5e}
.select-create fieldset{border-color:#4a3f2c}
.select-create legend{font-variant:small-caps;letter-spacing:.1em}
.select-passkey-list li{border-color:#4a3f2c;background:#1a1714cc}
/* The folding sections: small capitals behind a diamond that fills when open. */
.select-new,.select-password{border-top-color:#3a3226}
.select-new summary,.select-password summary{list-style:none;display:flex;align-items:center;gap:12px;font-variant:small-caps;letter-spacing:.1em}
.select-new summary::-webkit-details-marker,.select-password summary::-webkit-details-marker{display:none}
.select-new summary::before,.select-password summary::before{content:"";width:7px;height:7px;flex:none;border:1px solid currentColor;
 transform:rotate(45deg);transition:background .2s}
.select-new[open]>summary::before,.select-password[open]>summary::before{background:currentColor}
.select-new summary{font-size:16px}
.select-password summary{font-size:14px}
.select-password summary:hover,.select-new summary:hover{color:#f0d79a}
.select-link{text-decoration-color:#dcc58d66}
.select-motion{background:#0d0b09a6;border-color:#6b5a3e99;color:#b7ae9c;font-variant:small-caps;letter-spacing:.06em;min-height:0}
.select-motion:hover{background:#1d1a16d9;color:var(--gold)}
/* The showcase's name, in small capitals over a gold rule with a diamond, as the death screen's title. */
.select-showcase figcaption{font-size:30px;letter-spacing:.16em;font-variant:small-caps;color:#ecd6a2;
 text-shadow:0 0 18px #e0a05a59,0 2px 10px #000,0 0 2px #000}
.select-showcase figcaption::after{content:"";display:block;width:min(300px,60%);height:1px;margin:10px auto 0;
 background:linear-gradient(90deg,#0000,#dcc58d 35%,#dcc58d 65%,#0000)}
.character-select:not(.settled) .select-showcase{animation:loading-fade 1.2s ease-out .2s both}
/* The figure: the whole height beside the panel, standing a little above the name. Its canvas has room
   below the feet, so no ground shadow is drawn under them. */
.select-showcase.select-live canvas{position:absolute;left:0;right:0;top:2vh;bottom:calc(3.5vh + 44px);width:100%;height:calc(100% - 2vh - 3.5vh - 44px);
 object-fit:contain;object-position:50% 100%;pointer-events:none;
 filter:drop-shadow(0 18px 18px #000a) drop-shadow(0 0 28px #e0a05a26)}
@keyframes select-rise{from{opacity:0;transform:translateY(14px)}}
@keyframes select-title{from{opacity:0;transform:translateY(-6px) scale(1.03);filter:blur(6px) drop-shadow(0 0 20px #e6a85a00)}}
/* A phone on its side keeps the figure beside the panel (it was under the wordmark, below the fold). */
@media(min-width:701px) and (max-width:1200px){.select-panel[data-state=ready]{width:48vw}}
@media(min-width:701px) and (max-width:900px){
 .select-preview.select-showcase{position:fixed;left:50vw;right:0;top:0;bottom:0;width:auto;height:auto;margin:0}
 .select-showcase figcaption{bottom:3.5vh;font-size:24px}
}
@media(max-height:500px) and (min-width:701px){
 .character-select{padding:14px 20px}.select-panel{padding:18px 20px}
 .select-brand{margin-bottom:14px;padding-bottom:14px}.select-brand .game-wordmark{width:min(180px,100%)}
 .select-panel h2{margin-bottom:12px;font-size:17px}.select-account{margin-bottom:12px;padding-bottom:10px}
 .select-showcase figcaption{font-size:22px;bottom:2vh}
}
@media(prefers-reduced-motion:reduce){.character-select .select-panel,.character-select .select-brand .game-wordmark,.character-select .select-showcase{animation:none!important}}
/* Scoped like .loading[hidden] above, and for the same reason: the general [hidden] rule is not
   !important, and a class selector of equal specificity appearing later beats it. Without this the
   screen keeps its display:grid once hidden and goes on covering the canvas, swallowing every
   click meant for the world. */
.character-select[hidden]{display:none!important}
/* Same trap again: an id selector beats a bare [hidden], so the recovery form would sit open. */
#recovery-panel[hidden]{display:none!important}

.hotbar-slot .hotbar-icon{width:25px;height:25px;flex-shrink:0;margin-bottom:4px;image-rendering:pixelated;display:block}
.aspect-entry{margin:10px 0 4px;padding:8px 0 0;border-top:1px solid #5c4e36}.aspect-heading{display:flex;justify-content:space-between;gap:12px;font-size:14px;color:#dcc58d}.aspect-heading strong{font-weight:500}.aspect-heading span{font-variant-numeric:tabular-nums}.aspect-description,.aspect-xp{margin:4px 0;font-size:12px;color:#9d9482}.aspect-track{height:5px;margin-top:6px;background:#141210;border:1px solid #5c4e36;padding:1px}.aspect-fill{height:100%;background:linear-gradient(#b99bd8,#7a5c9c)}.aspect-entry .skill-entry{padding-left:10px}.skill-entry[data-known=false]{opacity:.55}.passive-description[data-open=false]{opacity:.55}
.inventory-load{margin:4px 0 0;font-size:12px;color:#9d9482}.inventory-load[data-over=true]{color:#c08a6a}
.aspect-drawn{margin:4px 0;font-size:12px;color:#b99bd8;font-style:italic}

#hotbar-panel[open] { display:flex; flex-direction:column; max-height:calc(100dvh - 24px); overflow:hidden; box-sizing:border-box; }
#hotbar-assignments { grid-template-columns:minmax(180px,1fr) minmax(0,2fr); gap:16px; min-height:0; overflow:hidden; }
.hotbar-slot-picker,.hotbar-choices { overflow:auto; min-height:0; overscroll-behavior:contain; }
#hotbar-assignments .hotbar-slot-picker button { display:block; width:100%; text-align:left; padding:9px; margin-bottom:4px; font-size:13px; min-height:40px; }
#hotbar-assignments button[aria-pressed=true] { border-color:#dcc58d; background:#3b3225; }
#hotbar-assignments .hotbar-choices button { display:block; text-align:left; width:100%; padding:10px; margin:8px 0; }
.hotbar-choices button span { display:block; margin-top:5px; font-size:13px; line-height:1.45; color:#b7ae9c; }
.hotbar-choices h3 { margin:0 0 8px; }
#hotbar-message { flex:none; min-height:1.5em; }
@media(max-width:600px) {
 #hotbar-assignments { display:flex; flex-direction:column; }
 .hotbar-slot-picker { flex:none; max-height:155px; }
 #hotbar-assignments .hotbar-slot-picker fieldset { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
 #hotbar-assignments .hotbar-slot-picker legend { padding-bottom:6px; }
 .hotbar-choices { flex:1; }
}
.hotbar-hud.expanded #hotbar-edit { display:inline-block; }
#character-panel .panel-heading,#hotbar-panel .panel-heading { flex:none; margin-bottom:8px; }
#character-panel .panel-heading h2,#hotbar-panel .panel-heading h2 { margin:0; }
#hotbar-panel .hotbar-help { margin:8px 0; }
#hotbar-assignments { margin-top:12px; }
@media(max-height:500px) {
 #hotbar-panel .hotbar-help { display:none; }
 #hotbar-panel { padding:12px; }
}

/* The selected target, as the Android HUD shows it (decision D8): name, health while alive, clear. */
.target-frame{position:absolute;left:50%;top:14px;transform:translateX(-50%);width:304px;max-width:calc(100% - 380px);min-width:180px;padding:6px 8px;background:#24221ee8;border:1px solid #6b5a3e;box-shadow:var(--raised)}
.target-row{display:flex;align-items:center;gap:8px}
#target-name{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--gold)}
#target-clear{width:32px;height:28px;padding:0;line-height:1}
.target-meter{height:8px;margin-top:5px;background:#151410;border:1px solid #665b42}
#target-fill{display:block;height:100%;width:var(--health,100%);background:#9e4036}
body.compact .target-frame{top:8px;width:240px;max-width:calc(100% - 260px)}
 body.compact #target-clear{width:48px;height:48px}
/* On its side the menu runs along the top right (seven 48px buttons, 452px with the minimap's
   gap), so the frame centres in what is left of it; too narrow for that, it drops below the row. */
body.compact-wide .target-frame{left:calc((100% - 452px)/2);max-width:calc(100% - 476px)}
@media(max-height:500px) and (orientation:landscape) and (max-width:720px){body.compact-wide .target-frame{left:50%;top:64px;max-width:240px}}

/* In-game Reconnect and Choose character (U53, as Android's menu). */
.menu-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.menu-actions button{flex:1 1 140px;min-height:40px}
/* Backing out of an aimed skill by touch (U24): Escape and right-click have no finger equivalent. */
.aim-cancel{position:absolute;left:50%;bottom:calc(150px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);pointer-events:auto;min-height:44px;padding:8px 22px;z-index:5}
.aim-cancel[hidden]{display:none}
body.compact .aim-cancel{bottom:calc(12px + env(safe-area-inset-bottom,0px));min-height:48px}
.skill-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}.skill-actions button{min-height:34px;padding:4px 12px;font-size:13px}
#vitals-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}

/* --- the thumb layout (user-approved 2026-10-20) -------------------------------------------------
   A landscape phone under a finger (body.touch-layout, set by touch-hud.ts): the joystick has the
   bottom left, so the vitals go to the top left with a potion beside them and the quest tracker
   under them; Attack keeps the bottom right with four skills fanned round it and Dodge (hold: Block
   in the feel test) beside them, six targets in that corner at 56px or more with clear gaps; the
   target frame drops under the top row; what is in reach gets one button, bottom centre. See
   docs/player-interface.md, "The thumb layout". */
/* The top-left group sits against the screen's left edge, not inside the camera cutout's inset
   (user, 2026-11-01: "move the health bar right over to the left"); a landscape phone reports the whole
   left edge as unsafe for a small punch-hole. Android does the same (player_hud.gd bleed_left). */
body.thumb-hud .vitals{top:calc(8px + env(safe-area-inset-top,0px));bottom:auto;left:8px;right:auto;width:206px;padding:5px 8px 6px}
body.thumb-hud .vitals .xp-title,body.thumb-hud .vitals .xp-track{display:none}
/* Past the two potions (the mana one, added 2026-10-24, had been landing under it). */
body.thumb-hud #chat-tab{left:336px;top:calc(8px + env(safe-area-inset-top,0px))}
/* The target frame is a slim strip in the top row, centred between Chat and the menu, no taller than the
   potions (user, 2026-11-01: "the current target box is too big and blocks the view of the actual monsters
   you're fighting"); it had sat under the row, 75 px tall, right over the fight. The × draws 28 px and keeps
   a 48 px touch area. Android the same (player_hud.gd _layout). */
/* The minimap under the menu button, as on Android (player_hud.gd: 76 x 50 under the button). Drawn live and
   fogged to what has been uncovered (docs/minimap.md); a tap opens the world map. */
body.thumb-hud .minimap{top:calc(64px + env(safe-area-inset-top,0px));right:calc(8px + env(safe-area-inset-right,0px));width:76px;padding:2px;z-index:26}
body.thumb-hud .minimap-view{width:70px;height:44px}
body.thumb-hud .minimap-caption{display:none}
body.thumb-hud .target-frame{top:calc(8px + env(safe-area-inset-top,0px));left:412px;right:64px;margin-inline:auto;transform:none;
 width:220px;min-width:0;max-width:calc(100% - 476px);padding:4px 4px 5px 8px}
body.thumb-hud .target-row{gap:4px}
body.thumb-hud #target-name{font-size:14px;line-height:28px}
body.thumb-hud #target-clear{position:relative;width:28px;height:28px;font-size:15px}
body.thumb-hud #target-clear::after{content:"";position:absolute;inset:-10px}
body.thumb-hud .target-meter{height:6px;margin-top:3px}
body.thumb-hud #feel-strip{top:calc(120px + env(safe-area-inset-top,0px))!important}
body.touch-layout #feel-block{display:none}
#touch-potion,#touch-mana,#touch-context,#touch-quests{display:none}
body.thumb-hud #touch-potion:not([hidden]){display:flex;position:fixed;z-index:26;left:222px;top:calc(8px + env(safe-area-inset-top,0px));
 width:48px;height:48px;padding:0;border-radius:50%;align-items:center;justify-content:center;border:2px solid #b9954d;
 background:radial-gradient(circle at 50% 60%,#9b3328,#3a1712);box-shadow:var(--raised)}
/* The mana potion beside it (2026-10-24). */
body.thumb-hud #touch-mana:not([hidden]){display:flex;position:fixed;z-index:26;left:278px;top:calc(8px + env(safe-area-inset-top,0px));
 width:48px;height:48px;padding:0;border-radius:50%;align-items:center;justify-content:center;border:2px solid #b9954d;
 background:radial-gradient(circle at 50% 60%,#2f4f9b,#121a3a);box-shadow:var(--raised)}
#touch-mana svg{width:24px;height:24px;fill:none;stroke:#d8e4ff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#touch-mana:disabled{filter:grayscale(.9);opacity:.6}
#touch-potion svg{width:24px;height:24px;fill:none;stroke:#f3e1c0;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#touch-potion .touch-potion-painting{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 1px 2px #000a)}
body.thumb-hud #touch-potion:has(.touch-potion-painting){background:radial-gradient(circle at 50% 38%,#4a3c28,#221c14 70%);padding:5px}
#touch-potion:disabled{filter:grayscale(.9);opacity:.6}
/* Each potion's wait, drawn as a skill's is: a shade draining from the top. */
.touch-potion-shade{position:absolute;inset:0;border-radius:50%;overflow:hidden;pointer-events:none;z-index:1;
 background:linear-gradient(to bottom,#080706d9 var(--cooldown,0%),transparent var(--cooldown,0%))}
#touch-potion[data-cooling="true"] .touch-potion-painting,#touch-mana[data-cooling="true"] svg{filter:grayscale(.6) brightness(.75)}
.touch-potion-count{position:absolute;right:-4px;bottom:-4px;font:700 11px var(--numeric);color:#fff;text-shadow:0 1px 2px #000,0 0 4px #000}
body.thumb-hud #touch-quests:not([hidden]){display:block;position:fixed;z-index:22;left:10px;top:calc(78px + env(safe-area-inset-top,0px));
 width:190px;margin:0;padding:0;list-style:none;pointer-events:none;font-size:11px;line-height:1.3;color:#ead9b0;text-shadow:0 1px 2px #000,0 0 6px #000}
#touch-quests li{margin-bottom:5px}#touch-quests b{display:block;color:#f2c14e;font-weight:600}#touch-quests b::before{content:"◆ ";font-size:9px}
body.thumb-hud #touch-context:not([hidden]){display:block;position:fixed;z-index:26;left:50%;transform:translateX(-50%);bottom:calc(12px + env(safe-area-inset-bottom,0px));
 min-height:44px;padding:8px 18px;border-radius:22px;border:1px solid #e8c25a;background:#1c1915e8;color:var(--gold);font:inherit;font-size:14px;box-shadow:var(--raised)}
/* The cluster: positioned by hand round Attack, rather than gridded, because a fan is not a grid. */
body.thumb-hud .hotbar-hud:not(.expanded){display:block;width:300px;height:212px;right:calc(8px + env(safe-area-inset-right,0px));bottom:calc(6px + env(safe-area-inset-bottom,0px));pointer-events:none}
body.thumb-hud .hotbar-hud:not(.expanded)>*{pointer-events:auto}
body.thumb-hud .hotbar-hud:not(.expanded) .thumb-actions{display:contents}
body.thumb-hud .hotbar-hud:not(.expanded) .attack-button{position:absolute;right:0;bottom:0;width:84px;height:84px;pointer-events:auto}
body.thumb-hud .hotbar-hud:not(.expanded) .dodge{position:absolute;right:210px;bottom:6px;width:64px;height:64px;pointer-events:auto;flex-direction:column;gap:0;font-size:12px}
body.thumb-hud .hotbar-hud:not(.expanded) .skill-hotbar{position:absolute;inset:0;display:block;pointer-events:none}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-entry{position:absolute;width:56px;height:56px;pointer-events:auto}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-entry[data-rank="1"]{right:137px;bottom:12px}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-entry[data-rank="2"]{right:120px;bottom:75px}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-entry[data-rank="3"]{right:75px;bottom:120px}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-entry[data-rank="4"]{right:12px;bottom:137px}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-slot{width:56px;height:56px;border-radius:50%;overflow:hidden;padding:0;touch-action:none}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-slot img.hotbar-painting{width:100%;height:100%;border:0;border-radius:50%;margin:0}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-toolbar{position:absolute;left:0;top:0;display:flex;flex-direction:row;gap:6px;pointer-events:auto}
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-toolbar>.dodge{position:absolute}
/* Phone play is landscape only (user, 2026-10-20): upright, the world asks to be turned. */
#touch-rotate{display:none}
@media (orientation:portrait) and (pointer:coarse) and (max-width:650px){
 body:has(#hotbar-hud:not([hidden])) #touch-rotate{display:flex;position:fixed;inset:0;z-index:1500;flex-direction:column;align-items:center;justify-content:center;gap:14px;
  background:#14120fee;color:var(--gold);font-size:18px;text-align:center;padding:24px}
 #touch-rotate svg{width:72px;height:72px;fill:none;stroke:var(--gold);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
}

/* --- landscape review (user, 2026-10-20): one menu button, full screen, panels that fit ---------- */
/* The row of menu icons and the stray Edit button give way to one button and a drawer. */
body.thumb-hud .game-menu,body.thumb-hud #hotbar-edit{display:none!important}
#touch-menu,#touch-drawer,#touch-fullscreen-tip{display:none}
body.thumb-hud #touch-menu:not([hidden]){display:flex;position:fixed;z-index:27;top:calc(8px + env(safe-area-inset-top,0px));right:calc(8px + env(safe-area-inset-right,0px));
 width:48px;height:48px;padding:0;align-items:center;justify-content:center;border:1px solid #6b5a3a;border-radius:8px;background:#1c1915e0;box-shadow:var(--raised)}
#touch-menu svg{width:24px;height:24px;fill:none;stroke:var(--gold);stroke-width:1.8;stroke-linecap:round}
body.thumb-hud #touch-drawer:not([hidden]){display:grid;grid-template-columns:1fr 1fr;align-content:start;gap:6px;position:fixed;z-index:1200;top:0;right:0;bottom:0;
 width:min(380px,60vw);padding:calc(10px + env(safe-area-inset-top,0px)) calc(12px + env(safe-area-inset-right,0px)) 12px 14px;overflow:auto;
 background:linear-gradient(90deg,#1c1915f2,#24201bf8);border-left:1px solid #6b5a3a;box-shadow:-8px 0 24px #000a;animation:drawer-in .16s ease-out}
@keyframes drawer-in{from{transform:translateX(30px);opacity:0}to{transform:none;opacity:1}}
#touch-drawer .touch-drawer-head{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;color:var(--gold);font-size:17px}
#touch-drawer>button{min-height:46px;text-align:left;padding:8px 14px;font:inherit;font-size:15px;color:#ead9b0;background:#2a251f;border:1px solid #4f4431;border-radius:6px}
#touch-drawer>button[hidden]{display:none}
body.touch-layout #touch-fullscreen-tip:not([hidden]){display:block;position:fixed;z-index:30;left:50%;transform:translateX(-50%);top:calc(110px + env(safe-area-inset-top,0px));
 min-height:44px;padding:8px 18px;border-radius:22px;border:1px solid #e8c25a;background:#1c1915ee;color:var(--gold);font:inherit;font-size:14px;box-shadow:var(--raised)}
/* The one way out of every panel: a big × held in its top corner while the panel scrolls. */
.touch-close{display:none}
body.touch-layout .touch-close{display:flex;align-items:center;justify-content:center;width:48px;height:48px;padding:0;border-radius:50%;
 border:1px solid #8a7340;background:#2a2219;color:#f0d79a;font:28px/1 Georgia,serif;box-shadow:0 2px 6px #000a;cursor:pointer;flex:none}
body.touch-layout dialog[open]>.touch-close{position:sticky;top:0;float:right;margin:-4px -4px 4px 8px;z-index:5}
body.touch-layout #dialogue>.touch-close,body.touch-layout #board>.touch-close{position:absolute;top:6px;right:6px;z-index:5}
/* The panels' own Close buttons stay on a desktop; here the × replaces them and gives the room back. */
body.touch-layout #inventory-close,body.touch-layout #character-close,body.touch-layout #hotbar-close,body.touch-layout #loot-close,body.touch-layout #dialogue .close,body.touch-layout #board .close{display:none}
/* Panels use the screen: the height is what a phone on its side lacks. */
body.touch-layout dialog[open]{max-width:calc(100vw - 16px);max-height:calc(100dvh - 12px);padding:10px 14px 12px;margin:auto;box-sizing:border-box}
body.touch-layout #inventory-panel[open],body.touch-layout #character-panel[open],body.touch-layout #hotbar-panel[open]{width:calc(100vw - 16px);max-height:calc(100dvh - 12px);padding:10px 14px}
body.touch-layout .bag-heading h2,body.touch-layout .panel-heading h2,body.touch-layout dialog h2{font-size:18px;margin:0}
body.touch-layout .bag-heading,body.touch-layout .panel-heading{margin-bottom:4px}
body.touch-layout #inventory-panel .inventory-nav button,body.touch-layout #character-panel [role="tab"]{padding:6px 10px;min-height:40px}
body.touch-layout .inventory-content{padding:8px 2px}
/* A conversation: centred in what height there is, portrait smaller, replies scrolling under it. */
body.touch-layout #dialogue{top:50%;bottom:auto;transform:translate(-50%,-50%);max-height:calc(100dvh - 16px);overflow:auto;
 grid-template-columns:96px 1fr;gap:12px;padding:12px 60px 12px 14px;width:min(700px,calc(100vw - 16px))}
body.touch-layout #dialogue .portrait{width:96px;height:96px}
body.touch-layout #dialogue button.reply{min-height:44px}
body.touch-layout #board{max-height:calc(100dvh - 16px);overflow:auto}
/* The rest of the bar, and riding: small round buttons at the top of the fan rather than mid-screen. */
body.thumb-hud .hotbar-hud:not(.expanded) .hotbar-toolbar{position:static}
body.thumb-hud .hotbar-hud:not(.expanded) #hotbar-more:not([hidden]){position:absolute;right:16px;bottom:204px;width:48px;height:48px;min-width:0;min-height:0;padding:0;border-radius:50%;font-size:11px;pointer-events:auto}
body.thumb-hud .hotbar-hud:not(.expanded) #ride:not([hidden]){position:absolute;right:72px;bottom:190px;width:48px;height:48px;min-width:0;padding:0;border-radius:50%;font-size:10px;justify-content:center;pointer-events:auto}
body.thumb-hud .hotbar-hud:not(.expanded) #hotbar-bank{display:none}
body.touch-layout .touch-close.in-heading{position:static;margin:0 0 0 auto;float:none}
/* The journal on a phone: the round x only, no second Close, and tabs a thumb can hit (user, 2026-11-14). */
body.touch-layout #quest-journal header>button:not(.touch-close){display:none}
body.touch-layout #quest-journal nav button{min-height:48px}
body.touch-layout #inventory-panel .bag-caption{margin:0 0 4px;font-size:13px}
body.touch-layout #character-panel .character-progress,body.touch-layout #character-panel .panel-health{margin:2px 0;font-size:14px}
/* One header row on a phone on its side (user, 2026-10-20: "we've lost so much space on the top part"):
   the tabs, the summary and the ×, side by side; the title is dropped, the pressed tab says where you are. */
body.touch-layout #inventory-panel[open],body.touch-layout #character-panel[open]{display:grid;grid-template-columns:auto minmax(0,1fr) auto;
 grid-template-rows:auto minmax(0,1fr);column-gap:10px;align-items:center;padding:6px 10px 8px max(10px,env(safe-area-inset-left,0px))}
body.touch-layout #inventory-panel .bag-heading,body.touch-layout #character-panel .panel-heading{display:contents}
body.touch-layout #inventory-panel .bag-heading h2,body.touch-layout #character-panel .panel-heading h2{display:none}
body.touch-layout #inventory-panel .inventory-nav,body.touch-layout #character-panel .character-nav{grid-row:1;grid-column:1;margin:0;padding:0;border:0;gap:4px;flex-wrap:nowrap;overflow-x:auto}
body.touch-layout #inventory-panel .inventory-balance{grid-row:1;grid-column:2;margin:0;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.touch-layout #inventory-panel[open]{grid-template-columns:auto minmax(0,1fr) auto auto}
body.touch-layout #inventory-panel #inventory-sort{grid-row:1;grid-column:3;min-height:48px;padding:4px 14px}
body.touch-layout #inventory-panel .touch-close{grid-row:1;grid-column:4;margin:0}
body.touch-layout #character-panel .touch-close{grid-row:1;grid-column:3;margin:0;width:44px;height:44px}
body.touch-layout #inventory-panel .inventory-content,body.touch-layout #character-panel .character-content{grid-row:2;grid-column:1/-1;align-self:stretch;margin-top:6px;padding:6px 0 0;border-top:1px solid #74654a}
body.touch-layout #inventory-capacity{display:none}
body.touch-layout #inventory-panel .inventory-nav button,body.touch-layout #character-panel .character-nav button{min-height:48px;padding:4px 12px;white-space:nowrap}
@media(max-height:375px){body.touch-layout #inventory-panel[open]{padding-top:2px!important;padding-bottom:2px!important}body.touch-layout #inventory-panel .inventory-content{margin-top:2px;padding-top:3px}}
/* Every panel takes the whole screen on a phone on its side (user, 2026-10-20: "go full screen with
   all the modals on mobile"). A partial panel there leaves a sliver of world nobody can use. Small
   prompts -- tapping another player, a party invitation -- are not panels and stay small. */
body.touch-layout dialog[open],body.touch-layout #dialogue:not([hidden]),body.touch-layout #board:not([hidden]){
 position:fixed;inset:0;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;
 margin:0!important;border:0!important;border-radius:0!important;transform:none!important;box-sizing:border-box;
 padding:max(6px,env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) max(8px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))!important;
 animation:none}
body.touch-layout dialog[open]::backdrop{background:#000}
/* Talk is a band across the bottom: the town and the person stay in view (user, 2026-11-09). The band's ::before
   still covers the whole screen, so taps reach neither the world nor the HUD, as when it was full screen; the thumb
   controls are hidden while it is open and the vitals and map stay. Replies never scroll away: only the line does. */
body.touch-layout #dialogue:not([hidden]){inset:auto 0 0 0;height:auto!important;max-height:min(66dvh,270px)!important;overflow:visible!important;display:flex;gap:12px;align-items:flex-start;
 padding:8px max(12px,env(safe-area-inset-right,0px)) max(8px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))!important;border-top:1px solid #8a7340!important;box-shadow:0 -6px 18px #000a}
body.touch-layout #dialogue:not([hidden])::before{content:'';position:fixed;inset:0;z-index:-1}
body.touch-layout #dialogue .portrait{flex:none;width:76px;height:76px}
body.touch-layout #dialogue .speech{flex:1;display:flex;flex-direction:column;min-width:0;max-height:calc(min(66dvh,270px) - 18px);overflow:auto;overscroll-behavior:contain}
body.touch-layout #dialogue .who,body.touch-layout #dialogue .rule{flex:none;margin-right:56px}
body.touch-layout #dialogue .rule{margin-top:4px;margin-bottom:4px}
body.touch-layout #dialogue .line{flex:0 1 auto;min-height:44px;overflow:auto;margin:0 56px 6px 0;font-size:14px;line-height:1.4}
body.touch-layout #dialogue .error{flex:none}
body.touch-layout #dialogue ol{flex:none;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:4px 6px}
body.touch-layout #dialogue button.reply{min-height:48px;align-items:center;padding:4px 11px}
body.touch-layout.talking :is(#hotbar-hud,#thumb-actions,#touch-stick,#touch-context,#touch-quests,#touch-potion,#touch-mana,#touch-menu,#chat-tab,#chat,#target-frame){visibility:hidden}
body.touch-layout #map-panel[open]{display:flex;flex-direction:column}
/* The × keeps its shape inside panels whose own button rules would square it off. */
body.touch-layout dialog .touch-close,body.touch-layout #dialogue .touch-close,body.touch-layout #board .touch-close{width:48px!important;height:48px!important;min-width:0!important;min-height:0!important;
 padding:0!important;border-radius:50%!important;border:1px solid #8a7340!important;background:#2a2219!important;color:#f0d79a!important;font:28px/1 Georgia,serif!important;box-shadow:0 2px 6px #000a!important}
body.touch-layout dialog [data-close]{display:none}
/* Painted icons (2026-10-21, shared/client-contract/fixtures/painted-icons.json): skills, Aspects, passives, statuses. */
.painted-icon{display:inline-block;flex:none;object-fit:cover;border:1px solid #6b5a3e;box-shadow:0 1px 3px #00000080;vertical-align:middle;background:#141210}
.skill-heading .skill-entry-icon,.aspect-heading .aspect-entry-icon{margin-right:10px}
.skill-heading:has(.skill-entry-icon),.aspect-heading:has(.aspect-entry-icon){display:flex;align-items:center;gap:0}
.skill-heading:has(.skill-entry-icon) strong,.aspect-heading:has(.aspect-entry-icon) strong{flex:1}
.passive-description .passive-icon{margin-right:8px;float:left}
.passive-description:has(.passive-icon){min-height:30px;overflow:hidden}
.passive-description[data-open="false"] .passive-icon{filter:grayscale(1) brightness(.6)}
.hotbar-choices .choice-icon{margin-right:8px}
.quest-summary .trainer-aspect-icon{float:left;margin:0 10px 4px 0}
.status-row{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}
.status-row[hidden]{display:none}
.status-chip{position:relative;width:28px;height:28px;border:1px solid #6b5a3e;box-shadow:0 1px 3px #00000080;background:#141210}
.status-chip img{display:block;width:100%;height:100%}
.status-time{position:absolute;right:1px;bottom:0;font-size:10px;line-height:1;font-weight:700;color:#f3ead2;text-shadow:0 0 2px #000,0 0 3px #000;font-variant-numeric:tabular-nums}
.status-more{align-self:center;font-size:12px;color:var(--muted);text-shadow:0 1px 3px #000}
.target-frame .status-row{margin:6px 0 0}
body.thumb-hud #own-statuses{position:absolute;top:100%;left:0;margin:6px 0 0}
/* Your statuses take the 34 px under the vitals, so the quest tracker goes below them rather than through them. */
body.thumb-hud:has(#own-statuses:not([hidden])) #touch-quests:not([hidden]){top:calc(112px + env(safe-area-inset-top,0px))}

/* --- the thumb layout on a desktop (user, 2026-10-24: "make the desktop interface look like the
   mobile? so burger menu, skill buttons etc.") ----------------------------------------------------
   body.thumb-hud without body.touch-layout: the same HUD as a phone on its side, with what a mouse
   and keyboard need on top of it. The HUD grows with the window, since it was sized for a phone's
   390px; panels stay windows rather than taking the whole screen; and each button shows its key. */
body.thumb-hud:not(.touch-layout){--hud-zoom:1}
@media(min-height:800px){body.thumb-hud:not(.touch-layout){--hud-zoom:1.2}}
@media(min-height:1000px){body.thumb-hud:not(.touch-layout){--hud-zoom:1.4}}
@media(min-height:1300px){body.thumb-hud:not(.touch-layout){--hud-zoom:1.6}}
body.thumb-hud:not(.touch-layout) :is(.vitals,.minimap,#touch-potion,#touch-mana,#companion-order,#companion-dismiss,#chat-tab,#chat-flash,#touch-quests,#touch-context,.hotbar-hud,#touch-menu,#touch-drawer,.target-frame,#party,.aim-cancel){zoom:var(--hud-zoom)}
/* A desktop's minimap is the old desktop size (user, 2026-11-01: "the mini map preview is too small on desktop"):
   154 x 102 rather than the phone's 70 x 44, still 40 tiles across, and grown with the rest of the HUD. */
body.thumb-hud:not(.touch-layout) .minimap{width:166px;padding:5px}
body.thumb-hud:not(.touch-layout) .minimap-view{width:154px;height:102px}
/* The keys, small on each button: 1 is Attack, 2-5 the fan, Space dodges, 6 and 7 drink. */
.attack-button kbd,.touch-key{display:none}
body.thumb-hud:not(.touch-layout):not(.no-keys) .hotbar-hud:not(.expanded) .hotbar-slot kbd{display:block;top:auto;bottom:3px;left:50%;transform:translateX(-50%);z-index:2}
body.thumb-hud:not(.touch-layout):not(.no-keys) .hotbar-hud:not(.expanded) .attack-button kbd,
body.thumb-hud:not(.touch-layout):not(.no-keys) .hotbar-hud:not(.expanded) .dodge kbd{display:block;font-family:var(--numeric);font-size:10px;line-height:14px;min-width:14px;padding:0 3px;border-radius:2px;
 background:linear-gradient(#4b402e,#332b1f);border:1px solid #6b5a3e;color:#d8c49a;box-shadow:inset 0 1px 0 #e8cb9626}
body.thumb-hud:not(.touch-layout):not(.no-keys) .hotbar-hud:not(.expanded) .attack-button kbd{position:absolute;top:6px;left:50%;transform:translateX(-50%);z-index:2}
body.thumb-hud:not(.touch-layout):not(.no-keys) .touch-key{display:block;position:absolute;left:-4px;top:-4px;min-width:14px;padding:0 3px;border-radius:2px;font:700 10px/14px var(--numeric);
 background:linear-gradient(#4b402e,#332b1f);border:1px solid #6b5a3e;color:#d8c49a}
/* A little more room for the name line, which a phone lets wrap; the potions and chat move along. */
body.thumb-hud:not(.touch-layout) .vitals{width:240px}
body.thumb-hud:not(.touch-layout) #touch-potion:not([hidden]){left:256px}
body.thumb-hud:not(.touch-layout) #touch-mana:not([hidden]){left:312px}
body.thumb-hud:not(.touch-layout) #chat-tab{left:370px}
body.thumb-hud:not(.touch-layout) .target-frame{left:446px;max-width:calc(100% - 510px)}
body.thumb-hud:not(.touch-layout):not(.no-keys) #touch-drawer kbd{float:right;margin-left:8px;padding:0 4px;border:1px solid #6b5a3e;border-radius:2px;font:11px/16px var(--numeric);color:#b7ae9c}
body.touch-layout #touch-drawer kbd,body.no-keys #touch-drawer kbd{display:none}
/* The drawer's own × shows with a mouse too; a click outside or Escape also closes it. */
body.thumb-hud:not(.touch-layout) #touch-drawer .touch-close{display:flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border-radius:50%;
 border:1px solid #8a7340;background:#2a2219;color:#f0d79a;font:24px/1 Georgia,serif;cursor:pointer}

/* Orders for a companion (backlog A6): under the potions, while one is out; at least 48 px to touch. */
#companion-order{display:none}
body.thumb-hud #companion-order:not([hidden]){display:block;position:fixed;z-index:26;left:222px;top:calc(62px + env(safe-area-inset-top,0px));
 width:104px;min-height:48px;padding:2px 6px;font:600 12px/1.15 Calibri,sans-serif;color:#f3e1c0;border:2px solid #b9954d;border-radius:8px;
 background:linear-gradient(#4a3c28,#221c14);box-shadow:var(--raised);cursor:pointer}
body.thumb-hud:not(.touch-layout) #companion-order:not([hidden]){left:256px}
/* Send away (2026-11-17): beside the order button while a Spirit familiar is out. */
#companion-dismiss{display:none}
body.thumb-hud #companion-dismiss:not([hidden]){display:block;position:fixed;z-index:26;left:332px;top:calc(62px + env(safe-area-inset-top,0px));
 width:76px;min-height:48px;padding:2px 6px;font:600 12px/1.15 Calibri,sans-serif;color:#f3e1c0;border:2px solid #8a7340;border-radius:8px;
 background:linear-gradient(#3a3024,#1c1712);box-shadow:var(--raised);cursor:pointer}
body.thumb-hud:not(.touch-layout) #companion-dismiss:not([hidden]){left:366px}
#target-study{font-size:11px;line-height:1.3;color:#d8c9a0;margin-top:2px}

/* Getting back to the server: this says what is happening instead of the loading stages. */
.loading-reconnecting .loading-step,.loading-reconnecting .loading-track,.loading-reconnecting .loading-stages,.loading-reconnecting .loading-detail{display:none}
.reconnect[hidden],.reconnect-button[hidden]{display:none!important}
.reconnect{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:10px;text-align:center}
.reconnect p{margin:0}
.reconnect-title{font-size:21px;letter-spacing:.04em;color:#f0ddb0}
.reconnect-detail{font-size:15px;color:#d8cdb6}
.reconnect-line{display:flex;align-items:center;gap:10px;font-size:16px;color:#e8bd7a;font-variant-numeric:tabular-nums}
.reconnect-spinner{width:18px;height:18px;flex:none;border-radius:50%;border:3px solid #6b5a3e;border-top-color:#f0c27a;animation:reconnect-turn .9s linear infinite}
@keyframes reconnect-turn{to{transform:rotate(360deg)}}
.reconnect-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:6px}
.reconnect-button{min-height:52px;min-width:150px;padding:0 22px;font:inherit;font-size:17px;color:#21180c;background:linear-gradient(#e6c584,#b98f4c);border:1px solid #f0d9a6;border-radius:4px;touch-action:manipulation;cursor:pointer}
.reconnect-button:disabled{opacity:.55;cursor:default}
.reconnect-quiet{color:#ecd9b0;background:#2a2118;border-color:#7a6543}
/* Friends and Guild live in the drawer; Settings holds settings only (user, 2026-11-14). The buttons stay, hidden, for the drawer to press. */
#menu-panel>#friends-open,#menu-panel>#guild-open{display:none!important}
