/* OSRS mobile look at exactly 2× (SPEC §0): baked OSRS fonts at 32 px (16 px only for the chat log, the dialogue lines and
   world labels), ui.png sprites as .ui2-*, kits composed in ui.js (--t-win, --t-btn, --t-thumb, --t-track ...). Each kit only
   applies when its sprites are in the atlas (html.kit-*); otherwise the older 601 9-slice look stays. */
@font-face { font-family: "OSRS p12_full"; src: url(assets/fonts/p12_full.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "OSRS b12_full"; src: url(assets/fonts/b12_full.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "OSRS q8_full"; src: url(assets/fonts/q8_full.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "OSRS p11_full"; src: url(assets/fonts/p11_full.woff2) format("woff2"); font-display: block; }
:root {
  --text: #ff981f; --yellow: #ffff00; --white: #ffffff; --green: #00ff00; --red: #ff0000; --cyan: #00ffff;
  /* OSRS menu target colours (xrsps client/ui/menu/MenuBridge.ts:109-122 osrsTargetLabel; item = widgets/menu/utils.ts:53):
     item #ff9040, NPC #ffff00, object (loc) #00ffff, player #ffffff */
  --item: #ff9040; --npc: #ffff00; --obj: #00ffff; --player: #ffffff;
  /* OSRS stone-text "off" / disabled: the interface orange, dimmed (no grey in the OSRS interface palette) */
  --off: rgba(255, 152, 31, .55);
  --done: #0dc10d; --menu: #5d5447; --stone-c: #3e3529;
  --p11: "OSRS p11_full", monospace; --p12: "OSRS p12_full", monospace; --b12: "OSRS b12_full", monospace; --q8: "OSRS q8_full", monospace;
  --tab-h: 80px; --chat-h: 108px; --act-h: 52px; --filt-h: 44px;
  --safe-b: var(--safe-bottom, env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--stone-c); color: var(--text); font: 400 32px/32px var(--p12); }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: none; }
button, input, select { font: inherit; color: inherit; }
img, .spr, .px, .win, .btn, .slider { image-rendering: pixelated; }
.spr { display: inline-block; flex: 0 0 auto; font-style: normal; }
.dim { color: var(--text); }
.sh, #world .win, #world .stone, #hud .win, .btn, #tabs, .tag, #menu, #usebar, #xpdrops, #chatbar, .counter, #top { text-shadow: 2px 2px 0 #000; }
/* the shadow is one game pixel: 2 px under the 32 px (2x) text, 1 px under 16 px (1x) text. The 16 px compact windows
   (.cpt: shop, stall, makeover, signs, hiscores, lock) need their own 1 px here, or #world .win's 2 px wins over #makeover */
#world .win.cpt, #hud .win.cpt, .win.cpt { text-shadow: 1px 1px 0 #000; }
h3, h4, h5, b { font-family: var(--b12); font-weight: 400; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }

#app { position: fixed; left: 0; top: 0; width: 100%; height: var(--app-h, 100%); max-width: 100vw; overflow: hidden; display: flex; flex-direction: column;
  padding: var(--safe-top, env(safe-area-inset-top, 0px)) var(--safe-right, env(safe-area-inset-right, 0px)) 0 var(--safe-left, env(safe-area-inset-left, 0px)); }
/* big screens (Cass 2026-10-18: "scale up"): ui.js sets --ui = 1 / 1.5 / 2; the HUD, windows, menus and overlays zoom by
   it, the world canvas (#gl, #labels) never does */
#hud, #world > .win, #top, #orbs, #xpdrops, #usebar, #odds, #banner, #loading, #reward, #dev-toggle, #tip { zoom: var(--ui, 1); }
#menu { zoom: var(--menu-z, var(--ui, 1)); }   /* x 1.5 on the desktop frame (ui.js MZ) */
#world { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #000; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#gl.use { cursor: crosshair; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
/* your own snap (world.js stepWasted): the dark edge that comes with the grey; opacity set per frame */
#vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .55) 100%); }   /* under every panel, window and card */

/* stone fill + the 601 mobile 9-slice (fallback frame for windows and buttons; the side panel keeps it) */
.stone, .win, .btn, #hud { background: var(--t-stone_dark) 0 0 / 176px 120px repeat, var(--stone-c); }
.win, .btn, .stone { border: 6px solid transparent; border-image: var(--t-nine) 3 / 6px repeat; background-clip: padding-box; }

/* ---------- SPEC §13 window kit: 297 tiled, 25x30 corners, 6 px edges, title b12 + divider 2546, mobile close 1731 ---------- */
.win { display: flex; flex-direction: column; padding: 62px 8px 10px; color: var(--text); }
.win > .wt { position: absolute; left: 0; right: 0; top: 0; height: 48px; margin: 0; padding: 8px 60px 0; font: 32px/32px var(--b12); color: var(--text);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; }
.win > .wdiv { position: absolute; left: -2px; right: -2px; top: 16px; height: 72px; background: var(--t-win_divider, none) 0 0 / 72px 72px repeat-x; pointer-events: none; z-index: 1; }
/* a title too wide for one line (Gerrant's Fishy Business) wraps to two; the divider and body move down 32 px */
.win.tall > .wt { white-space: normal; text-wrap: balance; height: 80px; padding: 8px 44px 0; }
.win.tall > .wdiv { top: 48px; }
.win.tall { padding-top: 94px; }
.kit-win .win.tall { padding-top: 92px; }
/* narrow phones: keep the second line clear of the close button */
@media (max-width: 359px) { .win.tall > .wt { padding: 8px 56px 0 20px; } }
.win > .wbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.kit-win .win { border: 12px solid transparent; border-image: none; background: var(--t-stone) 0 0 / 176px 120px repeat, var(--stone-c); background-clip: border-box; }
.kit-win .win::before { content: ''; position: absolute; inset: -12px; border: solid transparent; border-width: 60px 50px;
  border-image: var(--t-win) 30 25 / 60px 50px repeat; pointer-events: none; z-index: 1; }
.kit-win .win { padding: 60px 0 0; }
.kit-win .win > .wbody { padding: 0 2px 12px; }
.x { position: absolute; right: -10px; top: -10px; width: 66px; height: 66px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; z-index: 3; }

/* ---------- SPEC §12 stone buttons: 913-920 (normal) / 921-928 (pressed, #30201c at trans 200) ---------- */
.btn { min-height: 44px; min-width: 44px; padding: 0 10px; color: var(--text); font: 32px/32px var(--b12); cursor: pointer; white-space: nowrap; }
.btn:active { background: var(--t-stone) 0 0 / 176px 120px repeat, #48402f; background-clip: padding-box; }
.kit-btn .btn { border: 6px solid transparent; border-image: var(--t-btn) 9 / 18px repeat; background: var(--t-stone_dark) 0 0 / 176px 120px repeat, var(--stone-c); background-clip: padding-box; }
.kit-btn .win .btn, .kit-btn #hud .btn { background: none; }
.kit-btnd .btn:active:not(:disabled), .kit-btnd .btn[aria-pressed="true"] { border-image-source: var(--t-btnd); background: rgba(48, 32, 28, .22); }
@media (hover: hover) { .btn:hover:not(:disabled) { color: var(--white); } }
.btn.pri { color: var(--yellow); }   /* the primary action of a window (like Cast); secondary buttons stay --text */
.btn:disabled { color: var(--off); cursor: default; }
#live:disabled { color: #b8a47e; }   /* Cass: the Live bait button stays as it was */

/* ---------- SPEC §11 scrollbar: 792 track, 789-791 thumb, 773 / 788 arrows, 32 px wide ---------- */
.kit-scroll .scroll::-webkit-scrollbar { width: 32px; }
.kit-scroll .scroll::-webkit-scrollbar-track { background: var(--t-scroll_track) 0 0 / 32px 100% no-repeat; }
.kit-scroll .scroll::-webkit-scrollbar-thumb { min-height: 40px; border: solid transparent; border-width: 10px 0; border-image: var(--t-thumb) 5 0 fill / 10px 0 stretch; }
.kit-scroll .scroll::-webkit-scrollbar-button:single-button { display: block; height: 32px; background-size: 32px 32px; }
.kit-scroll .scroll::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: var(--t-scroll_up2); }
.kit-scroll .scroll::-webkit-scrollbar-button:single-button:vertical:increment { background-image: var(--t-scroll_down2); }
.kit-scroll #chat.scroll::-webkit-scrollbar { width: 32px; }

#top { position: absolute; left: 4px; top: 4px; padding: 0 4px; max-width: calc(100% - 128px); pointer-events: none; background: none; border: 0; }
#spot-name { font-family: var(--b12); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stats-line { color: var(--yellow); }
/* worlds (SCALE_SPEC): "World 3 · 42 fishing" in OSRS world-list green; the only tappable line in the top corner.
   A 44 px tap target: the padding is taken back by the negative margin, so the lines above and below stay put */
/* Cass 2026-10-25: on the spot name's line, to its right and smaller; the name gives way (ellipsis), the world never wraps */
#where { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
#where > #spot-name { flex: 0 1 auto; min-width: 0; }
#world-btn { flex: 0 0 auto; box-sizing: border-box; min-height: 44px; margin: -14px 0; padding: 14px 0; border: 0; background: none; font: 16px/16px var(--p12); color: var(--green); text-align: left;
  white-space: nowrap; pointer-events: auto; cursor: pointer; text-shadow: 1px 1px 0 #000; }
#world-btn[hidden] { display: none; }
/* the desktop frame draws the HUD at about half (--ui = s / 2): 24 px keeps the world line readable and still under the name */
html.desk #world-btn { min-height: 44px; margin: -10px 0; padding: 10px 0; font: 24px/24px var(--p12); }
#world-btn:focus-visible { outline: 2px solid var(--yellow); }
#stats-line span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 16px; text-align: center; color: var(--yellow); background: #000; text-shadow: 2px 2px 0 #000; z-index: 20; }
#loading[hidden] { display: none; }
/* the line starts just above the middle and grows down, so a long notice never runs up into the wordmark above it */
#loading::before { content: ''; flex: 0 0 calc(50% - 16px); }
/* Polystation wordmark (Cass 2026-10-19: "bottom right of the screen above emotes ... 85% opacity"): the supplied art as-is,
   in the world's bottom-right corner over the Emotes button, 10 px in from the right (Cass 2026-10-19: "padded", every layout)
   and 8 px above the HUD; taps pass through.
   Windows, the odds card and the catch card sit above it (z 5+). Loading screen: "much larger", fully opaque, centred over its line */
#pslogo { position: absolute; right: calc(10px + env(safe-area-inset-right, 0px)); bottom: 8px; width: clamp(96px, 32vw, 124px); height: auto; opacity: .85; pointer-events: none;
  z-index: 1; filter: drop-shadow(1px 1px 0 #000) drop-shadow(0 0 1.5px rgba(0, 0, 0, .8)); image-rendering: auto; zoom: var(--ui, 1); }
#pslogo:not([src]) { display: none; }
#loading:not([hidden]) ~ #pslogo { z-index: 21; right: auto; bottom: auto; left: 50%; top: calc(50% - 28px); width: min(76vw, 420px); zoom: 1;
  transform: translate(-50%, -100%); opacity: 1; }

/* ---------- SPEC §8 orbs: 1071 frame, p11 value at (4,16), fill at (27,4) trans 25, 1059 drained mask ---------- */
#orbs { position: absolute; right: 2px; top: 4px; display: flex; flex-direction: column; align-items: flex-end; gap: 0; z-index: 3; }
.orb { position: relative; width: 114px; height: 68px; padding: 0; border: 0; background: none; cursor: pointer; }
.orb > .ui2-orb_frame { position: absolute; left: 0; top: 0; }
.orb b { position: absolute; left: 8px; top: 30px; width: 46px; text-align: center; color: var(--yellow); font: 32px/28px var(--p11); text-shadow: 2px 2px 0 #000; }
.orb .fill { position: absolute; left: 54px; top: 8px; width: 52px; height: 52px; opacity: .9; }
.orb .fill > * { position: absolute; left: 0; top: 0; }
#orb-level { position: relative; width: 124px; height: 72px; padding: 0; border: 0; background: none; cursor: pointer; margin-bottom: 4px; }
#orb-level .skill { position: absolute; left: 0; top: 0; }
#orb-level .xpbar { position: absolute; left: 4px; right: 4px; top: 64px; height: 6px; background: #3a0b05; box-shadow: 0 0 0 2px #000; }
#orb-level #level-fill { display: block; height: 100%; width: 0; background: #0dc10d; }
.orb .drain { position: absolute; left: 54px; top: 8px; width: 52px; height: calc((1 - var(--p, 0)) * 52px); overflow: hidden; }
.orb .oi { position: absolute; left: 55px; top: 9px; }
.orb .ring { position: absolute; left: 56px; top: 10px; width: 48px; height: 48px; border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--p, 0) * 1turn), #3a0000 0);
  -webkit-mask: radial-gradient(circle, transparent 18px, #000 19px); mask: radial-gradient(circle, transparent 18px, #000 19px); }
.orb[aria-pressed="false"] b { color: var(--text); }
#keep-word { color: var(--yellow); padding-right: 4px; font-size: 16px; line-height: 16px; text-shadow: 1px 1px 0 #000; }
#keep-word.off { color: var(--text); }

/* ---------- SPEC §9 XP drops: 211 at 2×, "+N" p12 white ---------- */
#xpdrops { position: absolute; right: 0; top: 168px; width: 220px; height: 160px; pointer-events: none; overflow: hidden; }
.xpd { position: absolute; right: 8px; top: 100px; display: flex; align-items: center; gap: 4px; color: var(--white); font: 32px/50px var(--p12); white-space: nowrap; animation: xpd 2.4s linear forwards; }
@keyframes xpd { 0% { transform: translate(220px, 0); } 12% { transform: translate(0, 0); } 30% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(0, -100px); opacity: 0; } }

#banner { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font: 48px/60px var(--q8); pointer-events: none; opacity: 0; text-shadow: 3px 3px 0 #000; }
#banner.show { animation: banner 2.4s ease-out forwards; }
#banner.good { color: var(--green); } #banner.stands { color: var(--yellow); } #banner.lost { color: var(--red); }
@keyframes banner { 0% { opacity: 0; transform: scale(.6); } 12% { opacity: 1; transform: scale(1.08); } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
/* SNAPPED (your own snap, Cass 2026-10-20): a slow GTA "Wasted" fade-in that settles, no pop. It starts on the sound's
   hit (main.js WASTED_HIT_MS, 2.25 s) and is gone with the sound (4.4 s): 2.15 s */
#banner.show.wasted { animation: bannerwasted 2.15s ease-out forwards; }
@keyframes bannerwasted { 0% { opacity: 0; transform: scale(1.1); } 30% { opacity: 1; transform: scale(1); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }

/* ---------- Use mode (SPEC §16): OSRS top-left "Use X ->" text, odds in an XP-counter box ---------- */
#usebar { position: absolute; left: 4px; right: 4px; top: 4px; z-index: 6; color: var(--white); font: 32px/32px var(--b12); pointer-events: none; }
#usebar[hidden] { display: none; }
/* the slim bar takes the spot name / shells corner (#top is hidden while Use is on), clear of the orbs on the right */
#usebar .row { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: calc(100% - 124px); }
#usebar .row > span { padding: 2px 4px 0; max-width: 100%; overflow-wrap: break-word; }
#usebar .btn { pointer-events: auto; }
#usebar .t { color: var(--cyan); }
#usebar .btns { display: flex; gap: 8px; }
/* live-bait odds: a small card above the chat, closed by default (Odds on the Use bar), chat-size text, tap to close */
#odds { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); width: min(300px, calc(100% - 8px)); max-height: calc(var(--app-h, 100vh) * .25);
  overflow-y: auto; z-index: 6; padding: 4px 8px 6px; background: var(--stone-c); color: var(--white); font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; cursor: pointer; }
#odds[hidden] { display: none; }
#odds .oh { display: flex; align-items: center; gap: 6px; color: var(--text); margin-bottom: 4px; }
#odds dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; }
#odds dt { color: var(--yellow); text-align: right; }
#odds dd { margin: 0; }
/* SPEC §9 counter box: 297 at trans 100, #383023 / #5a5245 outlines */
.counter { position: relative; isolation: isolate; border: 2px solid #383023; box-shadow: inset 0 0 0 2px #5a5245; }
.counter::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--t-stone) 0 0 / 176px 120px repeat; opacity: .61; }

/* ---------- fisher card (SPEC §15) ---------- */
#card { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: min(380px, calc(100% - 8px)); z-index: 5; }
.kv { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 36px; }
.kv > span:first-child { color: var(--text); white-space: nowrap; }
.kv > span + span { min-width: 0; }
.kv > b, .kv > span + span { color: var(--done); text-align: right; }
.skill { position: relative; display: inline-flex; width: 124px; height: 60px; }
.skill > .spr { position: absolute; top: 0; }
.skill .oi { left: 8px; top: 8px; }
.skill i.b { position: absolute; left: 62px; top: 8px; width: 28px; text-align: center; font: 32px/28px var(--p11); color: var(--yellow); font-style: normal; }
.skill i.b2 { top: 24px; left: 86px; }

/* centred windows, one size (Cass 2026-10-18): Gerrant's shop, the signpost, Hiscores, Online, the creator, Pollyanna's stall */
.win.cos { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100% - 8px)); max-height: calc(100% - 8px); z-index: 8; }
.win.cos[hidden], #card[hidden], #panel[hidden] { display: none; }
/* wide windows (html.wide, ui.js): the creator and the stall go two-column */
.wide #makeover, .wide #stall { width: min(640px, calc(100% - 8px)); }
.sec { margin: 8px 0 4px; color: var(--text); font: 32px/32px var(--b12); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sec .btn { margin-left: auto; padding: 0 6px; }
.divider { height: 12px; margin: 4px 0; background: var(--t-shop_divider, none) 0 -30px / 72px 72px repeat-x; }
.value { display: flex; align-items: center; gap: 8px; color: var(--text); }
#shop > .divider { flex: 0 0 auto; margin: 0 2px 4px; }
#shop > .value { flex: 0 0 auto; padding: 0 8px 8px; }

/* ---------- chatbox (SPEC §7): 1017 parchment, filter buttons 3051-3054, p12 lines ---------- */
#hud { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; padding: 2px 1px calc(var(--safe-b) + 0px); gap: 0; z-index: 4; }
/* OSRS chat filter buttons (interface 162: 56x22 sprites 3051-3054 at 2x = 112x44, 62 px step at 1x = a 12 px gap at 2x,
   the first 5 px in = 10 px): the label white, and under a channel the status line (OSRS: On #00ff00, Filtered / Friends
   #ffff00, Off #ff0000; All and Emotes have none). Never stretched: where 4 x 112 + gaps don't fit (a 390 px phone) the gaps
   go first, then the button art scales down evenly (keeps its 56:22 shape, centred in a 44 px tall tap target) */
#chatbar { flex: 0 0 var(--filt-h); display: flex; align-items: flex-start; justify-content: flex-start; padding-left: 10px; container-type: inline-size; }
#chatbar button { flex: 0 0 auto; width: min(112px, 100cqw / 4); height: 44px; padding: 0; border: 0; background: none; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--white); font: 32px/32px var(--p11); cursor: pointer; white-space: nowrap; }
#chatbar button + button { margin-left: clamp(0px, (100cqw - 448px) / 3, 12px); }
#chatbar button > .spr.ui2-chat_filter, #chatbar button > .spr.ui2-chat_filter_selected { position: absolute; left: 0; top: 50%; width: 100%; height: auto;
  aspect-ratio: 56 / 22; transform: translateY(-50%);
  background: var(--t-chat_filter) 0 0 / 100% 100% no-repeat; }
#chatbar button > .spr.ui2-chat_filter_selected { background-image: var(--t-chat_filter_selected); }
@media (hover: hover) {
  #chatbar button:hover > .spr.ui2-chat_filter { background-image: var(--t-chat_filter_hover); }
  #chatbar button:hover > .spr.ui2-chat_filter_selected { background-image: var(--t-chat_filter_selected_hover); }
}
#chatbar button > span, #chatbar button > .cs { position: relative; }
#chatbar button:has(> .cs) > span { line-height: 18px; margin-top: -2px; }
#chatbar .cs { font: 32px/18px var(--p11); }
#chatbar .cs.on { color: #00ff00; } #chatbar .cs.filtered { color: #ffff00; } #chatbar .cs.off { color: #ff0000; }
/* Cass 2026-10-22 "Chat should stretch": the chatbox takes the HUD's full width at every size (was capped at OSRS's 519 px,
   which left an empty strip beside it in a wide Mini App window). Past a phone's width it is inset 4 px a side so its edges
   line up with Cast and Live bait; the parchment is nine-sliced so the frame stays 1:1 (below #dialog). The filter buttons keep their OSRS size and
   12 px step, left-aligned, as in the OSRS client. A phone (<= 519 px) is unchanged */
#chatbar, #chatwrap { width: 100%; }
@media (min-width: 520px) {
  html:not(.square):not(.desk) #chatbar, html:not(.square):not(.desk) #chatwrap { width: auto; margin: 0 4px; }
}
#chatwrap { position: relative; flex: 0 0 var(--chat-h); }
#chat { height: var(--chat-h); border: 6px solid transparent; border-image: var(--t-chat_background) 6 fill / 6px stretch;
  padding: 0 4px; overflow-y: auto; overflow-x: hidden; overflow-wrap: anywhere; color: #000; text-shadow: none; font: 16px/16px var(--p12); -webkit-user-select: text; user-select: text; }
#chat p { margin: 0; line-height: 16px; }
#chat .game { color: #000; }
/* OSRS chatbox (transparency off): game messages black; a valuable / collection-log message red #ef1020 (xrsps
   server/src/game/notifications/CollectionLogNotification.ts:29 <col=ef1020>); level-up / system lines navy #000080 (the
   level-up dialogue title, SPEC §10); a warning / error is a plain black game message */
#chat .lvl { color: #000080; } #chat .good { color: #ef1020; } #chat .bad { color: #000; } #chat .sys { color: #000080; }
#chat[data-filter="game"] .clan, #chat[data-filter="clan"] p:not(.clan) { display: none; }
/* OSRS clan chat: [black bracket, blue clan name, black bracket] black name: dark red message */
#chat .clan .cb { color: #000; } #chat .clan .cn { color: #0000ff; } #chat .clan .who { color: #000; } #chat .clan .say { color: #7f0000; }
/* SPEC §10 level-up dialogue in the chatbox: q8 title #000080, body black, "Click here to continue" #0000c0 */
#dialog { position: absolute; inset: 0; border: 6px solid transparent; border-image: var(--t-chat_background) 6 fill / 6px stretch; color: #000; text-shadow: none;
  display: grid; grid-template-columns: 80px 1fr; align-items: center; padding: 0 6px 0 0; font: 16px/16px var(--q8); z-index: 2; }
#dialog[hidden] { display: none; }
/* (after the #chat / #dialog border-image shorthands) a wide chatbox nine-slices the 519 x 142 parchment with 40 px side
   slices: the frame and the shaded margins at each end stay 1:1 and only the plain middle of the parchment widens (tiling
   it shows the frame's inner line as a seam) */
/* Scale step 4 in-game chat: "[World] Name: text" (OSRS public chat: black name, blue text) and "[Global] Name: text"
   (purple); muted players' lines hidden; the Game filter shows world chat but not global */
#chat .pub .cb, #chat .pub .who { color: #000; } #chat .pub .ct, #chat .pub .txt { color: #0000ff; }
#chat .pub.gl .ct, #chat .pub.gl .txt { color: #7f007f; }
#chat .muted { display: none; }
#chat[data-filter="game"] .gl { display: none; }
/* the input line under the log, on the same parchment (OSRS: the chatbox's "Name: *" line): [World]/[Global] toggle + input */
#say { display: flex; align-items: center; gap: 4px; height: 20px; flex: 0 0 20px; box-sizing: border-box; border-top: 1px solid #807660; padding: 1px 4px 0;
  font: 16px/16px var(--p12); text-shadow: none; }
#say[hidden] { display: none; }
/* both 44 px tall to tap, laid out as 18 px (negative margin, like #world-btn) so the line stays tight */
#say-to { flex: 0 0 auto; box-sizing: border-box; height: 44px; margin: -13px 0; padding: 13px 2px; border: 0; background: none; font: inherit; color: #0000ff; cursor: pointer; text-shadow: none; }
#say-to::before { content: '['; color: #000; } #say-to::after { content: ']'; color: #000; }
#say-to[data-ch="global"] { color: #7f007f; }
#say-in { flex: 1 1 auto; min-width: 0; box-sizing: border-box; height: 44px; border: 0; padding: 13px 0; margin: -13px 0; background: none; font: inherit; color: #0000ff; outline: none; border-radius: 0; -webkit-appearance: none; appearance: none; }
#say-in::placeholder { color: #6b604a; }
/* scale step 5: the 20 px input line sits under the log, so the box grows by it and the log still shows 6 lines */
html.saying:not(.desk):not(.square) { --chat-h: 128px; }
html.saying:not(.desk) #chatwrap { display: flex; flex-direction: column; box-sizing: border-box; height: var(--chat-h); border: 6px solid transparent; border-image: var(--t-chat_background) 6 fill / 6px stretch; }
html.saying:not(.desk) #chat { flex: 1 1 0; min-height: 0; height: auto; border: 0; border-image: none; }
#card .btn.mute { display: block; margin: 8px auto 0; min-width: 96px; height: 32px; }
@media (min-width: 520px) { #chat, #dialog, html.saying:not(.desk) #chatwrap { border-image-slice: 6 40 fill; border-image-width: 6px 40px; } }
#dialog .di { display: grid; place-items: center; }
/* club step 2b: an NPC's dialogue (OSRS 231): chathead, her name #800000, her line, Click here to continue; Select an
   Option (OSRS 219): the title #800000 over the options, black, white on hover */
#dialog.npc .dn { color: #800000; }
/* the chathead (client/src/chathead.js): the 231 dialogue's head column, OSRS 96 x 110, drawn at device resolution */
#dialog .chead { width: 80px; height: 92px; }
#dialog.opts { grid-template-columns: 1fr; align-content: center; align-items: stretch; gap: 0; padding: 4px 6px; }
#dialog.opts .dsel { color: #800000; margin-bottom: 2px; }
#dialog.opts .dopt { min-height: 18px; line-height: 18px; color: #000; text-align: center; }
#dialog.opts .dopt:disabled { cursor: default; }
@media (hover: hover) { #dialog.opts .dopt:not(:disabled):hover { color: var(--white); } }
/* club step 2b: the fade through the back room's door (its Leave is on the club bar) */
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 600ms linear; z-index: 1; }
#fade.on { opacity: 1; }
/* club step 3: your place in the stage queue, an OSRS minigame-lobby overlay (Pest Control lander, Castle Wars): plain
   shadowed text top left under the room name, no box; leave from the pole's menu */
#stage-q { position: absolute; left: 8px; top: 84px; z-index: 3; pointer-events: none; white-space: nowrap; font-size: 16px; line-height: 18px; color: #fff; text-shadow: 1px 1px 0 #000; }
#stage-q #stage-q-s { color: var(--yellow); }
#stage-q[hidden] { display: none; }
#dialog .dt { color: #000080; text-align: center; }
#dialog .db { color: #000; text-align: center; margin-top: 8px; }
#dialog button { display: block; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; color: #0000c0; font: 16px/16px var(--q8); cursor: pointer; }
@media (hover: hover) { #dialog button:hover { color: var(--white); } }

#actions { flex: 0 0 var(--act-h); display: grid; grid-template-columns: auto 1fr auto; gap: 4px; align-items: center; padding: 4px 4px; }
#actions .btn { max-width: 176px; overflow: hidden; text-overflow: ellipsis; }
#line-status { text-align: center; color: var(--yellow); font-size: 16px; line-height: 16px; max-height: 32px; overflow: hidden; text-shadow: 1px 1px 0 #000; }
#cast { color: var(--yellow); }
#cast.use { color: var(--item); }
#cast:disabled { color: #8c8c8c; }
#cast { display: flex; align-items: center; justify-content: center; gap: 6px; }
#cast > :not(span) { image-rendering: pixelated; flex: none; }
#cast:disabled > :not(span) { opacity: .45; filter: grayscale(1); }
/* watching another spot: Fish here | status | Back to <home> */
#actions .btn[hidden] { display: none; }
#actions.watch #fish-here { grid-column: 1; color: var(--yellow); }
#actions.watch #line-status { grid-column: 2; }
#actions.watch #watch-back { grid-column: 3; }
@media (max-width: 359px) { #watch-back .lg { display: none; } }
/* visitor mode (Cass 2026-10-18): one bar across the Cast row; orbs and the Bucket/Fishdex/Rods tabs hidden */
#actions.visitor > :not(#visitor-bar) { display: none; }
#visitor-bar:not([hidden]) { grid-column: 1 / -1; text-align: center; color: var(--yellow); font-size: 16px; line-height: 16px; max-height: 44px; overflow: hidden; text-shadow: 1px 1px 0 #000; }
#visitor-bar[hidden], #orbs[hidden], #tabs button[hidden] { display: none; }

/* ---------- the club bar (Cass 2026-11-26; main.js renderClubBar): the Party Room's row where Cast / Live bait were. The drink
   chip (an OSRS inventory slot: the glass you hold + 3 sip pips; empty: a faded glass, opens the Bucket), then one card: the
   stone info strip (line 1: her name in orange + what is happening, line 2: a thin bar + seconds), then its buttons ---------- */
#clubbar { grid-column: 1 / -1; display: flex; gap: 4px; align-items: stretch; height: 44px; min-width: 0; font: 16px/16px var(--p12); color: var(--yellow); text-shadow: 1px 1px 0 #000; }
#clubbar[hidden] { display: none; }
#cb-drink { position: relative; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; cursor: pointer;
  border: 6px solid transparent; border-image: var(--t-nine) 3 / 6px repeat; background: rgba(0, 0, 0, .35) padding-box; }
#cb-drink > .spr { grid-area: 1 / 1; margin-top: -4px; }
#cb-drink.empty .cb-glass { display: grid; filter: grayscale(1) brightness(.75); opacity: .45; }
#cb-drink .stk, #panel .bk-drinks .stk { position: absolute; left: 0; top: -3px; color: var(--yellow); font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; pointer-events: none; }
#cb-drink .cb-pips { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 3px; pointer-events: none; }
#cb-drink .cb-pips i { width: 6px; height: 4px; box-sizing: border-box; border: 1px solid #8c7d5f; background: #1e1a14; box-shadow: 1px 1px 0 #000; }
#cb-drink .cb-pips i.on { border-color: var(--yellow); }
#cb-drink .cb-pips i.on { background: var(--yellow); }
/* the floating glass (Cass 2026-11-26 picked B; ?drinkui=bar for the old chip): bottom right of the room view, above the watermark */
html.drink-float #cb-drink { position: absolute; right: 8px; bottom: 64px; z-index: 5; flex: none; width: 76px; height: 76px; }
html.drink-float #cb-drink[hidden], html:not(.clubbar) #world > #cb-drink { display: none; }
html.drink-float #cb-drink > .spr { margin-top: -6px; }
html.drink-float #cb-drink .cb-pips { bottom: 2px; gap: 4px; }
html.drink-float #cb-drink .cb-pips i { width: 10px; height: 6px; }
#cb-main { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; align-items: stretch; }
#cb-main .cb-info { flex: 1 1 auto; min-width: 0; box-sizing: border-box; height: 44px; padding: 0 6px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
#cb-main .cb-l1 { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cb-main .cb-l1 > * { flex: none; }
#cb-main .cb-who { color: var(--text); }
#cb-main .cb-price { color: var(--white); }
#cb-main .cb-g { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; color: var(--white); min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
#cb-main .cb-dots { color: #b8a47e; }
#cb-main .cb-l2 { display: flex; align-items: center; gap: 6px; }
#cb-main .cb-track { position: relative; flex: 1 1 auto; height: 5px; background: #1e1a14; box-shadow: inset 1px 1px 0 #000, 1px 1px 0 rgba(255, 255, 255, .08); }
#cb-main .cb-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--yellow); transition: width .2s linear; }
#cb-main[data-mode="dance"] .cb-fill { background: var(--text); }
#cb-main[data-mode="drunk"] .cb-fill { background: #d8a060; }
#cb-main .cb-n { flex: none; min-width: 3ch; text-align: right; color: var(--white); }
#cb-main .cb-ic { width: 12px; height: 12px; flex: none; filter: drop-shadow(1px 1px 0 #000); }
#cb-main .cb-beer { zoom: .62; margin: 0 2px 0 -2px; }
#cb-main .cb-x { color: var(--white); }
#cb-main .cb-b { flex: none; min-width: 44px; height: 44px; min-height: 44px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font: 16px/16px var(--b12); text-shadow: 1px 1px 0 #000; }
#cb-main .cb-b .cb-ic { width: 14px; height: 14px; }
#cb-main .cb-b:disabled .cb-ic { opacity: .4; }
/* narrow phones: Accept / Decline keep only their tick and cross */
@media (max-width: 400px) { #cb-main[data-mode="inv"] .cb-b > span { display: none; } }
/* the drunk timer lives on the club bar in the Party Room (elsewhere the top-right box stays) */
html.clubbar #drunk-buff { display: none; }
/* the square layout: the bar is its own row under the chat box (where the line status is elsewhere) */
html.square #clubbar { order: 1; flex: 0 0 100%; margin-bottom: 2px; }
/* html.desk: over the foot of the game view, centred */
html.desk #world > #clubbar { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: 460px; max-width: calc(100% / (var(--osrs, 2) * .7) - 12px); z-index: 5; zoom: calc(var(--osrs, 2) * .7); }
/* the Bucket's drinks (Cass 2026-11-26): a labelled row of the drink kinds above the fish, OSRS stack numbers */
#panel .bk-drinks { margin: 0 0 4px; }
#panel .bk-drinks .bk-dh { display: block; margin: 0 4px; color: var(--text); font: 16px/18px var(--b12); text-shadow: 1px 1px 0 #000; }
#panel .bk-drinks .stk { font-size: 32px; line-height: 32px; left: 8px; top: 4px; text-shadow: 2px 2px 0 #000; }   /* inside the 0.5 zoom */
/* the group guest picker (#grpwin): Party Pete's invite window, a tick box per row */
#grpwin .hs-rows { grid-template-columns: 16px minmax(0, 1fr); column-gap: 8px; margin: 0; padding: 0; list-style: none; background: none; }
#grpwin .hs-rows li.hs-row.on { color: var(--white); background: rgba(255, 255, 255, .07); }
#grpwin .gw-box { width: 16px; height: 16px; box-sizing: border-box; display: grid; place-items: center; background: #1e1a14; border: 1px solid #000; box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .6), 1px 1px 0 rgba(255, 255, 255, .1); }
#grpwin .gw-box .cb-ic { width: 12px; height: 12px; filter: drop-shadow(1px 1px 0 #000); }
#grpwin .gw-note { color: var(--red, #f00); }
/* ---------- SPEC §1 tab bar: 40x40 stones at 2× (80 px), 77 px step, icons centred ---------- */
#tabs { flex: 0 0 var(--tab-h); display: flex; justify-content: center; align-items: flex-start; }
#tabs button { position: relative; width: 80px; height: 80px; flex: 0 0 80px; border: 0; padding: 0; background: none; display: grid; place-items: center; cursor: pointer; }
#tabs button + button { margin-left: -3px; }
#tabs button > .spr { grid-area: 1 / 1; }
#tabs .tx { grid-area: 1 / 1; font: 32px/32px var(--b12); color: var(--text); }

/* Cass 2026-10-22 "too much gaps and whatnot": a wide Mini App window (past 519 px, never the square card or html.desk) runs
   every HUD row edge to edge between the chatbox's edges (4 px in from the HUD): the filter buttons share the row, Cast and
   Live bait widen with the status in a framed panel between them, and the five stones share the bottom bar. The OSRS art
   is nine-sliced at 2x (corners and edges 1:1, only the plain middle widens, pixelated); the icons keep their 2x size,
   centred. Rows sit 2 px apart. A phone (<= 519 px) and the desktop layout are unchanged */
@media (min-width: 520px) {
  html:not(.square):not(.desk) { --act-h: 48px; }
  html:not(.square):not(.desk) #chatbar { padding-left: 0; gap: 6px; }
  html:not(.square):not(.desk) #chatbar button { flex: 1 1 0; width: auto; min-width: 0; }
  html:not(.square):not(.desk) #chatbar button + button { margin-left: 0; }
  html:not(.square):not(.desk) #chatbar button > .spr.ui2-chat_filter, html:not(.square):not(.desk) #chatbar button > .spr.ui2-chat_filter_selected {
    top: 0; height: 44px; aspect-ratio: auto; transform: none; background: none; border: 10px solid transparent;
    border-image: var(--t-chat_filter) 5 fill / 10px stretch; }
  html:not(.square):not(.desk) #chatbar button > .spr.ui2-chat_filter_selected { border-image-source: var(--t-chat_filter_selected); }
  @media (hover: hover) {
    html:not(.square):not(.desk) #chatbar button:hover > .spr.ui2-chat_filter { border-image-source: var(--t-chat_filter_hover); }
    html:not(.square):not(.desk) #chatbar button:hover > .spr.ui2-chat_filter_selected { border-image-source: var(--t-chat_filter_selected_hover); }
  }
  html:not(.square):not(.desk) #actions { grid-template-columns: clamp(160px, 24%, 288px) minmax(0, 1fr) clamp(160px, 24%, 288px); gap: 6px; padding: 2px 4px; }
  html:not(.square):not(.desk) #actions .btn { max-width: none; width: 100%; }
  html:not(.square):not(.desk) #line-status, html:not(.square):not(.desk) #visitor-bar:not([hidden]) { align-self: stretch; height: 44px; max-height: none; display: flex; align-items: center; justify-content: center;
    padding: 0 10px; border: 6px solid transparent; border-image: var(--t-nine) 3 / 6px repeat; background: rgba(0, 0, 0, .3) padding-box;
    font: 32px/32px var(--p12); text-shadow: 2px 2px 0 #000; white-space: nowrap; overflow: hidden; }
  html.kit-btnd:not(.square):not(.desk) #line-status, html.kit-btnd:not(.square):not(.desk) #visitor-bar:not([hidden]) { border-image: var(--t-btnd) 9 / 18px repeat; }
  /* a line too long for the panel (main.js fitLine): up to two lines at the 16 px size, clipped below as on a phone */
  html:not(.square):not(.desk) #line-status.sm, html:not(.square):not(.desk) #visitor-bar:not([hidden]) { display: block; padding: 0 4px; font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; white-space: normal; text-align: center; }
  html:not(.square):not(.desk) #tabs { margin: 0 4px; }
  html:not(.square):not(.desk) #tabs button { flex: 1 1 0; width: auto; min-width: 0; }
  html:not(.square):not(.desk) #tabs .stone40.ui2-tab40, html:not(.square):not(.desk) #tabs .stone40.ui2-tab40_selected { width: 100%; height: 80px; background: none;
    border: 10px solid transparent; border-image: var(--t-tab40) 5 fill / 10px stretch; }
  html:not(.square):not(.desk) #tabs .stone40.ui2-tab40_selected { border-image-source: var(--t-tab40_selected); }
}
/* a phone narrower than the five 80 px stones at their 77 px step (388 px: iPhone SE / 8 at 375, 320): the stones share the
   bar the same nine-sliced way, so the end ones stay whole on screen. 388 px and up keep the fixed 2x stones */
@media (max-width: 387px) {
  html:not(.square):not(.desk) #tabs button { flex: 1 1 0; width: auto; min-width: 0; }
  html:not(.square):not(.desk) #tabs .stone40.ui2-tab40, html:not(.square):not(.desk) #tabs .stone40.ui2-tab40_selected { width: 100%; height: 80px; background: none;
    border: 10px solid transparent; border-image: var(--t-tab40) 5 fill / 10px stretch; }
  html:not(.square):not(.desk) #tabs .stone40.ui2-tab40_selected { border-image-source: var(--t-tab40_selected); }
}

/* side panel: every tab in the window kit (Bucket + Emotes at 2x, the rest compact 1x); the 601 9-slice only without the kit */
/* Cass 2026-10-18: capped at 420 px and centred, so a desktop window doesn't stretch it edge to edge (phones: 5 px gutters as before);
   inside the zoomed #hud, the app height is divided by --ui */
#panel { position: absolute; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 10px)); bottom: calc(var(--tab-h) + var(--safe-b));
  max-height: calc(var(--app-h, 100vh) / var(--ui, 1) - var(--tab-h) - 96px);
  display: flex; flex-direction: column; padding: 4px 4px 6px; color: var(--text); z-index: 7; }
#panel:not(.win) { border: 6px solid transparent; border-image: var(--t-nine) 3 / 6px repeat; background: var(--t-stone_dark) 0 0 / 176px 120px repeat, var(--stone-c); background-clip: padding-box; }
#panel.win { padding: 62px 8px 10px; }
.kit-win #panel.win { padding: 60px 0 0; }
#panel > .pbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
#panel.ghost { opacity: .35; pointer-events: none; }
.ptitle { margin: 0 0 6px; color: var(--text); font: 32px/36px var(--b12); text-align: center; }
#panel h4.ptitle { justify-content: center; color: var(--text); }
#panel h4, .pager { margin: 4px 0 6px; color: var(--yellow); font-size: 32px; line-height: 32px; display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
#panel ul, #shop ul, #signs ul { list-style: none; margin: 0; padding: 0; }
.note { color: var(--text); margin: 6px 0; }
.kg { color: var(--text); white-space: nowrap; }
.tagw { color: var(--white); }

/* ---------- SPEC §4 Quest List rows: black at trans 212 box, p12, red / yellow / green ---------- */
.qlist { background: rgba(0, 0, 0, .17); margin: 0 1px; }
.qlist li { display: flex; align-items: stretch; }
.qlist .q { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; min-width: 0; padding: 0 6px;
  border: 0; background: none; text-align: left; font: 32px/32px var(--p12); cursor: pointer; color: var(--yellow); }
.qlist .q > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qlist .q small { font: inherit; white-space: nowrap; }
.qlist li.locked .q { color: var(--red); }
.qlist li.here .q { color: var(--green); }
.qlist .q:focus-visible { background: rgba(255, 255, 255, .22); }
.qfoot { color: var(--text); font: 32px/32px var(--p11); text-align: center; margin: 6px 0 2px; }

/* ---------- SPEC §4 Rods: worn-equipment slot 170 + weapon silhouette 159 ---------- */
.worn { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; }
.worn .slab { position: relative; width: 72px; height: 72px; flex: 0 0 72px; }
.worn .slab > * { position: absolute; left: 0; top: 0; }
.worn .nm { color: var(--green); }

/* ---------- SPEC §2 inventory: 36x32 slots at 2× (72x64), 84 x 72 step, no slot boxes ---------- */
.inv { display: grid; grid-template-columns: repeat(4, 72px); grid-auto-rows: 64px; justify-content: center; gap: 8px min(12px, max(0px, (100% - 288px) / 3)); padding: 4px 0; }
/* the bucket tab (Cass 2026-10-19: "too large"): the same 28 slots at half size (the 2x item art drawn 1x), 7 x 4 instead of
   4 x 7, so the window is well under half as tall. Each slot keeps a 44 px tap target (88 px before the zoom, the art
   centred in it, no column gap): 7 a row where they fit (390 px phone), 6 at 320 px (five rows, still about half) */
#panel[data-tab="bucket"] .inv { zoom: .5; grid-template-columns: repeat(auto-fill, 88px); grid-auto-rows: 88px; gap: 8px 0; max-width: 616px; margin: 0 auto; }
#panel[data-tab="bucket"] .inv > .slot { width: 88px; height: 88px; }
.slot { position: relative; width: 72px; height: 64px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; touch-action: none; }
.slot::before { content: ''; position: absolute; inset: -4px -6px; }
.slot.empty { cursor: default; }
.slot img { display: block; pointer-events: none; filter: drop-shadow(2px 2px 0 #333); }
.slot.sel img { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff); }
.slot.miss img { opacity: .32; }
/* Legend tab (Cass 2026-10-21): an uncaught legendary is a dark silhouette */
#panel .inv.dx > .slot.miss.sil img, #panel .slot.miss.sil img { opacity: .55; filter: brightness(0) drop-shadow(1px 1px 0 #333); }
.cbox .lg-count { margin-top: 2px; }
/* emote tab (Cass 2026-10-18): the 48x48 cache icons, OSRS order; locked = the cache's silhouette, dimmed. Cass 2026-10-19:
   1x (was 2x, 4 rows covered the whole screen): 48 px cells, no column gap (the icons have their own margins), so 7 fit a
   row on a 390 px phone (the window's inner width is ~356 px): all 13 in two rows; 6 a row (three rows) at 320 px */
.emotes { display: grid; grid-template-columns: repeat(auto-fill, 48px); grid-auto-rows: 48px; justify-content: center; gap: 4px 0; padding: 2px 0 6px; }
.slot.emote { width: 48px; height: 48px; touch-action: manipulation; }
.slot.emote::before { inset: 0; }
.slot.emote > .spr { pointer-events: none; }
.slot.emote:active > .spr { filter: brightness(1.25); }
.slot.emote.miss > .spr { opacity: .6; }
.slot.emote .lbl { color: var(--text); font: 16px/16px var(--p11); text-align: center; }
/* Cass 2026-10-22: the phone's Emotes button is in the chatbar at the top of the HUD, so the emote window (opened from it)
   sits above the whole HUD, its bottom on the chatbar's top edge, instead of on the tab stones: the button stays
   uncovered and a second tap closes it. Capped under the top bar; past that the grid scrolls (icons stay 48 px).
   The square layout (#sq-emotes in the bottom row) and the desktop dock keep their own placement */
html:not(.square):not(.desk) #panel[data-tab="emotes"] { bottom: 100%;
  max-height: calc(var(--app-h, 100vh) / var(--ui, 1) - var(--filt-h) - var(--chat-h) - var(--act-h) - var(--tab-h) - var(--safe-b) - 2px - 84px); }
/* Cass 2026-10-24 "just have emotes replace the chat instead": on a phone the emote tab takes the chat box's place (same rect,
   the chat hidden under it: #chatwrap.emo), nothing floats over the game view. No title: the icons fill the box in rows of
   48 px (as many as its height holds: two in the 108 px box, framed 6 px like the chat), the Emotes button above stays
   the toggle. The camera is untouched.
   Cass 2026-10-26 "the bottom bar in the emote tab sucks and I don't like how the cut off is set": scrolls like the OSRS
   emote tab, down, never sideways. The 48 px columns fill the width (the leftover split either side, never a part
   column), rows snap so the box shows whole rows only (its height rounded down to whole rows, centred), and the chat's
   own OSRS scrollbar (.kit-scroll .scroll, 32 px, always shown) sits in a lane of its own on the right. The 46 px
   padding kept for the old X column is gone */
html:not(.square):not(.desk) #panel.strip[data-tab="emotes"] { top: calc(2px + var(--filt-h)); bottom: auto; left: 1px; right: 1px; width: auto;
  transform: none; height: var(--chat-h); max-height: none; padding: 0; justify-content: center;
  border: 6px solid transparent; border-image: var(--t-nine) 3 / 6px repeat; background-clip: padding-box; }
html:not(.square):not(.desk) #panel.strip[data-tab="emotes"]::before { display: none; }   /* the thin stone frame: 2 rows of 48 in the 108 px box */
@media (min-width: 520px) { html:not(.square):not(.desk) #panel.strip[data-tab="emotes"] { left: 5px; right: 5px; } }
html:not(.square):not(.desk) #panel.strip > .wt, html:not(.square):not(.desk) #panel.strip > .wdiv { display: none; }
html:not(.square):not(.desk) #panel.strip[data-tab="emotes"] > .wbody { flex: 0 0 auto; min-height: 0; height: 96px; height: round(down, var(--chat-h) - 12px, 48px);
  overflow-x: hidden; overflow-y: scroll; padding: 0; overscroll-behavior-y: contain; scroll-snap-type: y mandatory; }
html:not(.square):not(.desk) #panel.strip .emotes { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, 48px); grid-auto-rows: 48px;
  justify-content: center; gap: 0; padding: 0; }
html:not(.square):not(.desk) #panel.strip .slot.emote { scroll-snap-align: start; }
html:not(.square):not(.desk) #panel.strip .slot.emote::before { inset: 0; }   /* not .cpt's -2 px: it made the scroll run 2 px past the last row */
#chatwrap.emo > * { visibility: hidden; }
.slot .badge { position: absolute; left: 0; top: 0; color: var(--yellow); font: 32px/28px var(--p11); text-shadow: 2px 2px 0 #000; pointer-events: none; }
.slot .badge.l { color: #ff00ff; } .slot .badge.s { color: var(--cyan); }
.slot .rb { position: absolute; left: 0; top: 0; pointer-events: none; }
/* sandwich slot: the baked item icon (icon_sandwich) instead of a fish img */
.slot.sand > .spr { pointer-events: none; filter: drop-shadow(2px 2px 0 #333); }
.slot.sand.sel > .spr { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff); }
.slot.sand .lbl { color: var(--item); font: 32px/28px var(--p11); }
#tip { position: fixed; z-index: 30; padding: 2px 6px; background: #ffffa0; color: #000; border: 1px solid #000; pointer-events: none; white-space: nowrap; font: 32px/32px var(--p12); }
#drag { position: fixed; z-index: 31; pointer-events: none; transform: translate(-50%, -50%); }

/* ---------- SPEC §3 collection log ---------- */
.ctabs { display: flex; justify-content: center; gap: 0; margin: 0 0 6px; }
.ctabs button { flex: 1 1 0; width: auto; height: 52px; padding: 0; border: 0; color: var(--text); font: 32px/32px var(--p12); cursor: pointer; background: #2c2921; text-shadow: 2px 2px 0 #000; }
.ctabs button[aria-selected="true"] { color: var(--white); background: #41382c; }
.kit-subtab .ctabs button { background: none; border-image: var(--t-subtab) 0 20 fill / 0 40px stretch; }
.kit-subtab_sel .ctabs button[aria-selected="true"] { border-image-source: var(--t-subtab_sel); }
.cbox { border: 2px solid #585040; background: var(--t-stone_light) 0 0 / 176px 120px repeat; padding: 6px 8px; margin: 0 1px 6px; }
.cbox h5 { margin: 0 0 4px; color: var(--text); font: 32px/32px var(--b12); }
.cbox p { margin: 0; font: 32px/32px var(--p11); color: var(--text); }
.cbox .w { color: var(--white); }
.ob-all { color: var(--done); } .ob-some { color: var(--yellow); } .ob-none { color: var(--red); }
.marks { display: flex; flex-wrap: wrap; gap: 0 12px; }
.marks span { color: var(--red); } .marks span.got { color: var(--done); }

/* ---------- SPEC §14 Settings → Audio ---------- */
.vol { display: flex; align-items: center; justify-content: space-between; height: 76px; margin: 8px 0 0; }
.vol .mute { position: relative; width: 72px; height: 76px; flex: 0 0 72px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.vol .mute > * { grid-area: 1 / 1; }
.vol .mute .no { display: none; }
.vol .mute.off .no { display: block; }
.vol .mute .lbl { font: 32px/32px var(--b12); color: var(--text); }
.slider { position: relative; width: 288px; height: 76px; flex: 0 1 288px; touch-action: none; cursor: pointer; }
.slider .track { position: absolute; left: 0; right: 0; top: 22px; height: 32px; background: #2c2921; border: 2px solid #000; }
.kit-slider .slider .track { background: var(--t-track) 0 0 / 288px 32px no-repeat; border: 0; }
.slider .handle { position: absolute; top: 22px; left: calc(32px + var(--v, 0) * 1.92px); width: 32px; height: 32px; background: #385535; }
.kit-slider .slider .handle { background: none; }
.slider .handle .off { display: none; }
/* SPEC §14 (script 7101): the master handle turns grey (4894) at 0 */
.master0 .vol[data-kind="master"] .handle .off { display: block; position: absolute; left: 0; top: 0; }
.slider .val { position: absolute; bottom: 54px; left: calc(32px + var(--v, 0) * 1.92px - 24px); width: 80px; text-align: center; padding: 0 2px; background: #ffffa0; color: #000; border: 1px solid #000; font: 16px/20px var(--p12); display: none; }
.slider.drag .val { display: block; }

/* ---------- the OSRS "Choose Option" menu (SPEC §6), ported from xrsps client/widgets/gl/choose-option.ts (BSD-2, see
   tools/bake/LICENSES/xrsps.LICENSE) at S = 2 (our b12 is 32 px = 2x): its layout constants (lines 76-96) and fills
   (lines 584-590, 912-926), scaled by sp(px, S) = round(px * S) (line 191). Our fonts stay; widths come from them.
   box: fill 0x5D5447, w = max(text) + 8*S, h = rows * 15*S + 22*S (computeMenuSize, lines 212-228)
   title: black bar at (1*S, 1*S, w - 2*S, 16*S), text at x + 3*S in COL_TITLE_TEXT 0x5D5447 (line 588), no shadow
   options: 1*S black outline at (1*S, 18*S, w - 2*S, h - 19*S); rows 15*S tall, text at x + 3*S; hover = yellow on the option
   text only (lines 990-1005: <col> targets keep their colour). A tap / click open focuses the menu box, not the first
   option, so nothing is lit until hovered; a keyboard open focuses the first option (:focus-visible) ---------- */
#menu-back { position: fixed; inset: 0; z-index: 40; }
#menu { position: fixed; z-index: 41; width: max-content; max-width: calc(100vw / var(--menu-z, var(--ui, 1))); background: var(--menu); padding: 1px; }
/* Cass 2026-10-19: 20 px rows (the OSRS 1x menu's 15 px rows were hard to hit on a phone). The text stays at b12's 1x
   16 px: 18 px put a glyph pixel on 1.125 CSS px (3.375 device px at DPR 3), which phones smear into fat, blurry letters.
   Options get the OSRS 1 px black shadow (choose-option.ts draws them with shadow, the title without); set on the button
   itself because the UA stylesheet gives buttons text-shadow: none, so #menu's inherited shadow never reached them */
#menu .mt { background: #000; color: var(--menu); font: 16px/18px var(--b12); padding: 0 2px; height: 18px; text-shadow: none; white-space: nowrap; overflow: hidden; }
#menu .mo { margin-top: 1px; border: 1px solid #000; padding-bottom: 1px; }
#menu button { display: block; width: 100%; height: 20px; padding: 0 4px 0 1px; border: 0; background: none; text-align: left; color: var(--white); font: 16px/20px var(--b12); text-shadow: 1px 1px 0 #000; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#menu:focus { outline: none; }
#menu button:focus { outline: none; }
#menu button:hover, #menu button:focus-visible { color: var(--yellow); }
#menu .it { color: var(--item); } #menu .npc { color: var(--npc); } #menu .obj { color: var(--obj); } #menu .pl { color: var(--player); }

/* labels above heads (world text stays 16 px) */
.tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; font-size: 16px; line-height: 16px; will-change: transform; text-shadow: 1px 1px 0 #000; }
/* scene NPC overhead text (scenes.js): OSRS yellow, same look as the player tags */
/* wraps at 200 px and is kept on screen and off the HUD by scenes.js placeLabels (Cass 2026-10-20: Docks, Pond, Harbour) */
.npc-say { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); text-align: center; white-space: normal; width: max-content; max-width: min(200px, calc(100% - 8px)); font-size: 16px; line-height: 16px; will-change: transform; text-shadow: 1px 1px 0 #000; color: var(--yellow); pointer-events: none; }
/* a player's World chat line over their head (scenes.js sayOver, Cass 2026-10-26): the OSRS bold font; colour and effect
   set per frame (shared/chatfx.js). wave / wave2 / shake move each character; scroll runs through a 100 px window,
   slide drops into its own box (both clipped) */
.npc-say.over { font-family: var(--b12); }
.npc-say.over i { display: inline-block; font-style: normal; }
.npc-say.over .in { display: inline-block; }
.npc-say.fx-scroll { width: 100px; max-width: none; white-space: nowrap; overflow: hidden; text-align: left; }
.npc-say.fx-slide { overflow: hidden; }
/* shop NPC icons (main.js NPC_ICONS, Cass 2026-10-19): the map sprite at a whole-number zoom, no smoothing; taps fall
   through to the world (hitWorld counts the icon as its NPC) */
.npc-icon { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.npc-icon > .spr { display: block; }
/* free roam (the Party Room): the OSRS yellow click cross, centred on the click (main.js clickCross) */
.xcross { position: absolute; left: 0; top: 0; pointer-events: none; }
.xcross[hidden] { display: none; }
.xcross > .spr { display: block; }
.tag .n { color: var(--white); }
.tag.you .n { color: var(--cyan); }
.tag.ghost .n { color: #a0a0a0; }
.tag .l { color: var(--green); }
.pop { position: absolute; left: 0; top: 0; pointer-events: none; }
.pop img { display: block; transform: translate(-50%, -100%); animation: popicon 2.6s ease-out forwards; }
@keyframes popicon { 0% { transform: translate(-50%, -60%) scale(.5); opacity: 0; } 15% { transform: translate(-50%, -110%); opacity: 1; } 25% { transform: translate(-50%, -100%); } 80% { opacity: 1; } 100% { transform: translate(-50%, -130%); opacity: 0; } }
.sparkle { position: absolute; left: 0; top: 0; pointer-events: none; }
.sparkle i { position: absolute; color: var(--yellow); font-style: normal; font-size: 16px; text-shadow: 0 0 4px #fff; animation: twinkle 1.2s ease-in-out infinite; }
.sparkle.shiny i { color: var(--cyan); }
.sparkle.legendary i { color: #ff00ff; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(45deg); } }

/* ---------- dev fake-bet panel (SPEC §16): window + stone buttons, chat-input fields ---------- */
/* dev only: under every window (z 5+), so it never covers a window title; over its own
   Fake bet window (which has no close button) so a second tap still closes it */
#dev-toggle { position: absolute; left: 4px; top: 136px; color: var(--cyan); z-index: 2; }
#world:has(> #dev-panel:not([hidden])) > #dev-toggle { z-index: 10; }
#world.using #dev-toggle { display: none; }   /* dev only: out of the way of the Use bar's Back / Odds while Use is on */
#dev-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100% - 8px)); z-index: 9; }
#dev-panel[hidden] { display: none; }
#dev-panel .wbody { display: grid; gap: 4px; }
#dev-panel label { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 4px; }
#dev-panel input, #dev-panel select { width: 100%; min-width: 0; min-height: 44px; color: #000; padding: 0 6px; font: 32px/32px var(--b12); text-shadow: none;
  border: 6px solid transparent; border-image: var(--t-chat_background) 6 fill / 6px stretch; background: #b1a283; }

@media (prefers-reduced-motion: reduce) {
  .xpd { animation: xpdcalm 2.4s linear forwards; }
  @keyframes xpdcalm { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
  #banner.show { animation: bannercalm 2.4s linear forwards; }
  #banner.show.wasted { animation: bannercalm 2.15s linear forwards; }
  @keyframes bannercalm { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
  .pop img { animation: none; }
  .sparkle i { animation: none; opacity: .8; }
  .sparkle i:nth-child(n+3) { display: none; }
}
img.goldtint { filter: sepia(1) saturate(3) brightness(1.15) hue-rotate(-8deg); }
img.lavatint { filter: sepia(1) saturate(5) brightness(0.95) hue-rotate(-40deg); }
.slot img.goldtint { filter: sepia(1) saturate(3) brightness(1.15) hue-rotate(-8deg) drop-shadow(2px 2px 0 #333); }
.slot img.lavatint { filter: sepia(1) saturate(5) brightness(0.95) hue-rotate(-40deg) drop-shadow(2px 2px 0 #333); }
.counter#freebets { padding: 4px 8px; margin: 8px 1px; color: var(--white); }
.counter#freebets { display: flex; align-items: center; gap: 6px; }
.counter#freebets .fb-ic { flex: 0 0 auto; display: flex; }
.counter#freebets .fb-tx { flex: 1 1 auto; min-width: 0; }
.counter#freebets p { margin: 0; overflow-wrap: anywhere; }
.counter#freebets .fb-src { color: var(--text); }
.counter#freebets b { color: var(--yellow); }
#bait-fill .spr.dim { filter: brightness(.6); }

/* Hiscores (hiscores.js): OSRS hiscores table in the window kit; own row white, searched row yellow */
#online ul { list-style: none; margin: 0; padding: 0; }
.hs-btns { display: flex; gap: 6px; margin: 0 1px 6px; }
.hs-btns .hs-open { flex: 1 1 0; width: auto; min-width: 0; margin: 0; }
/* Online = OSRS Friends List: name white, the spot green on the right like "World 302" */
.ol-rows .q { color: var(--white); }
.ol-rows .q > .nm { flex: 1 1 auto; }
.ol-rows .q > small.w { flex: 0 1 auto; min-width: min-content; max-width: 60%; color: var(--green); white-space: normal; text-align: right; }
.ol-rows li.me .q > .nm { color: var(--cyan); }
.ol-rows li:nth-child(odd) { background: rgba(0, 0, 0, .12); }
/* World Switcher (worlds.js): the Worlds tab of the Spots side tab / Signpost; OSRS world list, "World N" white, players
   green, yours cyan, a full world red */
.wl-host ul { list-style: none; margin: 0; padding: 0; }
.wl-sum { margin: 2px 2px 6px; color: var(--yellow); }
.wl-rows li.me .q > .nm, .wl-rows li.me .q > small.w { color: var(--cyan); }
.wl-rows li.full .q > small.w { color: var(--red, #ff3030); }
.wl-rows .wl-v { color: var(--green); }
.wl-rows .q[disabled] { cursor: default; opacity: 1; }
#hiscores ul { list-style: none; margin: 0; padding: 0; }
.hs-open { display: block; width: calc(100% - 2px); margin: 0 1px 6px; }
.hs-you { margin: 2px 2px 6px; font: 32px/32px var(--p12); } .hs-you b { color: var(--yellow); }
.hs-find { display: flex; gap: 6px; margin: 0 1px 6px; }
.hs-find input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 6px; border: 2px solid #585040; background: rgba(0, 0, 0, .3); color: var(--white);
  font: 32px/32px var(--p12); -webkit-user-select: text; user-select: text; text-shadow: 2px 2px 0 #000; }
.hs-find input::placeholder { color: var(--off); }
.hs-find .btn { flex: 0 0 auto; padding: 0 6px; }
.hs-miss { margin: 0 2px 6px; color: var(--red); }
.hs-rows { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; column-gap: 8px; }
.hs-rows.hs-heavy { grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr); }
.hs-rows li.hs-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; min-height: 36px; padding: 2px 4px; color: var(--text); font: 32px/32px var(--p11); }
.hs-row > span { white-space: nowrap; text-align: right; }
.hs-row > .nm { text-align: left; overflow: hidden; text-overflow: ellipsis; }
.hs-row.crown > .nm::before { content: '👑'; font: 22px/1 sans-serif; margin-right: 6px; vertical-align: 3px; }   /* rank 1 wears the Gold partyhat */
.hs-row > .fish { text-align: left; white-space: normal; }
.hs-heavy .hs-row > span:first-child, .hs-row > span:nth-child(2), .hs-heavy .hs-row > span:nth-child(3) { text-align: left; }
.hs-heavy .hs-row > span:nth-child(2) { text-align: right; }
.hs-rows li.hs-head { color: var(--yellow); font-family: var(--b12); background: rgba(0, 0, 0, .2); }
.hs-head .sm { display: none; }
@media (max-width: 359px) { .hs-head .lg { display: none; } .hs-head .sm { display: inline; } }
.hs-rows li.hs-row:nth-child(odd):not(.hs-head) { background: rgba(0, 0, 0, .12); }
.hs-rows li.me { color: var(--white); }
.hs-rows li.hit { color: var(--yellow); background: rgba(255, 255, 0, .14); }
/* Postie Pete's parcel: the clue-casket-style reward window (any tap closes it) */
#reward { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(0, 0, 0, .35); }
#reward[hidden] { display: none; }
#reward > .win { position: relative; width: min(380px, calc(100% - 8px)); }
#reward > .win > .wt, #reward > .win.tall > .wt { padding: 8px 12px 0; }
#reward .inv.rw { grid-template-columns: repeat(auto-fit, 72px); padding: 8px 0 12px; }
#reward .slot.rw-cos img { filter: none; }   /* the cosmetic's icon (already outlined, like the stall's) */
#reward .rw-cos .st-lbl { max-width: 72px; color: var(--item); font: 16px/16px var(--p11); text-align: center; overflow-wrap: anywhere; text-shadow: 1px 1px 0 #000; }
.slot .qty { position: absolute; left: 0; top: -4px; color: var(--yellow); font: 32px/32px var(--p11); text-shadow: 2px 2px 0 #000; pointer-events: none; }
/* the Sandwich lady's tray (Cass 2026-10-18): 7 items in the inventory grid (4 + 3), her line on top, a small countdown */
#tray { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: min(380px, calc(100% - 8px)); z-index: 8; }
#tray[hidden] { display: none; }
#tray .say { margin: 4px 0; text-align: center; color: var(--yellow); }
#tray .inv.tr { padding: 4px 0 8px; }
#tray .cd { position: absolute; right: 12px; bottom: 6px; color: var(--text); font: 32px/32px var(--p11); text-shadow: 2px 2px 0 #000; }

/* ---------- the cosmetics windows, compact (Cass 2026-10-18: "the actual viewing window is way too small"): the creator,
   Madame Pollyanna's stall and the wardrobe. 16 px bitmap text, the window kit, buttons and tabs at their native 1× art,
   36-40 px controls on a 4 / 8 / 12 px spacing; the window takes the app height (over the chat) and the preview takes the rest ---------- */
#makeover, #stall { z-index: 11; position: fixed; left: 0; right: 0; bottom: auto; margin: 0 auto; transform: none;
  top: calc(var(--safe-top, env(safe-area-inset-top, 0px)) / var(--ui, 1) + 8px);
  width: min(380px, calc(100vw / var(--ui, 1) - 16px));
  height: min(960px, calc((var(--app-h, 100vh) - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-b)) / var(--ui, 1) - 16px));
  max-height: none; font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
.wide #makeover, .wide #stall { width: min(640px, calc(100vw / var(--ui, 1) - 16px)); }
/* frame + title band at 1×: 30 px band, 16 px b12 title, 36 px close; never the two-line title */
.win.cpt, .win.cpt.tall { border-width: 3px; padding: 30px 6px 8px; gap: 8px; }
.kit-win .win.cpt, .kit-win .win.cpt.tall { border-width: 6px; padding: 26px 4px 6px; background-size: 88px 60px, auto; }
.kit-win .win.cpt::before { inset: -6px; border-width: 30px 25px; border-image: var(--t-win) 30 25 / 30px 25px repeat; }
.win.cpt > .wt, .win.cpt.tall > .wt { height: 24px; padding: 2px 40px 0; font: 16px/16px var(--b12); white-space: nowrap; text-shadow: 1px 1px 0 #000; }
.win.cpt > .wdiv, .win.cpt.tall > .wdiv { top: 8px; left: -1px; right: -1px; height: 36px; background-size: 36px 36px; }
.win.cpt > .x { right: -6px; top: -6px; width: 36px; height: 36px; }
.cpt .btn { min-height: 36px; min-width: 36px; padding: 0 8px; border-width: 3px; border-image-width: 3px; font: 16px/16px var(--b12); text-shadow: 1px 1px 0 #000; }
.kit-btn .cpt .btn { border-image-width: 9px; }
.cpt .btn.pri { min-height: 40px; }
.cpt .sec { margin: 4px 0; font: 16px/16px var(--b12); }
.cpt .sec .btn { padding: 0 8px; }
.cpt .note { margin: 4px 0; }
.cpt .ctabs { margin: 0; }
.cpt .ctabs button { height: 36px; padding: 0 12px; font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
.kit-subtab .cpt .ctabs button { border-image-width: 0 20px; }
.cpt .qlist .q { min-height: 36px; padding: 0 8px; font: 16px/16px var(--p12); }
.cpt .slot::before { inset: -2px; }

/* the preview box: flexes into the free height; the figure is x2 (main.js PV_K, Cass 2026-10-19: 272x384 + the 12 px ground
   line + 4 px headroom = 400 px) wherever that fits. In a short window (a phone browser with its toolbars, Cass 2026-10-19)
   the box gives up height first, down to the whole figure at x1 (192 + 16), and main.js pvFit shrinks the figure with it,
   so the footer (Save / Buy) stays on screen; only below that does the middle scroll (.mk-main, .st-try, the wardrobe split).
   280 px wide fits a 320 px phone's window */
.pvb { position: relative; flex: 1 0 auto; min-height: 208px; min-width: 280px; overflow: hidden; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.pvb::before { content: ''; position: absolute; left: 8px; right: 8px; bottom: 10px; height: 2px; background: rgba(0, 0, 0, .3); pointer-events: none; }
.pv { image-rendering: pixelated; }
.pvb > .pv { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: calc(136px * var(--k, 2)); height: calc(192px * var(--k, 2)); }

/* ---------- the creator / Makeover (COSMETICS_SPEC Phase 2): preview (body pair left, Polywizard pieces right, over it),
   hair / beard arrows, the colour rows scrolling below; Skip + Save ---------- */
.mk-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overflow-x: hidden; }
.mk-pvb { flex: 1 0 auto; }
.mk-main > * { flex-shrink: 0; }
.mk-bt, .mk-wear { position: absolute; top: 4px; display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.mk-bt { left: 4px; } .mk-wear { right: 4px; }
/* body pair and Polywizard pieces: the worn-equipment slot back 170 at 1x (36x36), not a CSS box */
.slot.mk-b, .slot.mk-w { background: var(--t-slot_bg) 50% 50% / 36px 36px no-repeat; image-rendering: pixelated; }
.slot.mk-b { width: 40px; height: 40px; }
.slot.mk-b[aria-checked="true"] { outline: 2px solid var(--yellow); outline-offset: -2px; }
.mk-b img { width: 32px; height: 32px; filter: none; }
.slot.mk-w { width: 44px; height: 40px; }
.slot.mk-w img { width: 36px; height: 32px; }
/* two columns: Hair | Beard or Personality, then Assets under Personality (Cass 2026-10-25) */
.mk-ar { flex: 0 0 auto; display: grid; grid-template-columns: auto auto; justify-content: center; gap: 4px 8px; }
.mk-ar [data-row="figure"] { grid-column: 2; }
.mk-row { display: flex; align-items: center; gap: 4px; }
#makeover .mk-row[hidden], #makeover .mk-col[hidden] { display: none; }
.mk-row .mk-a { flex: 0 0 36px; padding: 0; }
.mk-v { min-width: 56px; text-align: center; font: 16px/16px var(--b12); color: var(--text); white-space: nowrap; }
.mk-cols { flex: 0 0 auto; height: max(112px, 28%); overflow-y: auto; overflow-x: hidden; }
.mk-l { margin: 4px 0; font: 16px/16px var(--b12); color: var(--text); }
.mk-col:first-child .mk-l { margin-top: 0; }
/* colour swatches: a 32 px chip in a 36 px button; picked = white outline + yellow inner ring */
.sw-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.swatch { width: 36px; height: 36px; flex: 0 0 36px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.swatch > i { width: 32px; height: 32px; border: 2px solid #383023; box-shadow: inset 0 0 0 2px #5a5245; pointer-events: none; }
.swatch[aria-checked="true"] { outline: 2px solid var(--white); outline-offset: -2px; }
.swatch[aria-checked="true"] > i { box-shadow: inset 0 0 0 2px var(--yellow); }
.mk-foot { flex: 0 0 auto; display: flex; gap: 8px; }
.mk-foot .btn { flex: 1 1 0; min-width: 0; min-height: 40px; }
/* wide: the preview on the left, arrows + colours on the right */
.wide .mk-main { display: grid; grid-template-columns: minmax(0, 1fr) 296px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "pv ar" "pv cols"; gap: 8px 12px; }
.wide .mk-pvb { grid-area: pv; } .wide .mk-ar { grid-area: ar; justify-content: flex-start; } .wide .mk-cols { grid-area: cols; height: auto; }

/* ---------- Madame Pollyanna's stall + wardrobe (Phase 3b): [Stall | Wardrobe] + the shells chip, shop slots, the try-on ---------- */
.st-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.st-bar .ctabs { flex: 0 1 auto; min-width: 0; }
/* the shells chip: the OSRS counter box (.counter, SPEC §9) */
.chip { margin-left: auto; flex: 0 0 auto; display: flex; align-items: center; gap: 2px; height: 32px; padding: 0 8px 0 0; color: var(--white); font: 16px/16px var(--b12); }
.chip > .spr { margin: 0 -3px 0 -2px; }
#stall ul { list-style: none; margin: 0; padding: 0; }
.st-split { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.st-split > .wbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.st-next { font: 16px/16px var(--p12); }
/* shop slot: the item (the content here, so 2×: 72x64), the price under it in 16 px, a green tick when owned */
.st-inv { display: grid; grid-template-columns: repeat(auto-fill, 72px); grid-auto-rows: 84px; gap: 4px; justify-content: start; padding: 0; }
/* stall stock on bare stone, as OSRS shops (interface 300); a wardrobe piece (worn-equipment style) on the slot back 170
   (36x36, 2x = 72x72, centred on the 64 px icon row) */
.slot.st-item { width: 72px; height: 84px; grid-template-rows: 64px 16px; align-content: start; justify-items: center; background: none; isolation: isolate; }
.slot.st-item[data-st="wear"]::after { content: ''; position: absolute; left: 0; top: -4px; width: 72px; height: 72px; z-index: -1; pointer-events: none;
  background: var(--t-slot_bg) 0 0 / 72px 72px no-repeat; image-rendering: pixelated; }
/* the xrsps item sprite has OSRS's own outline + 0x302020 shadow baked in: no CSS shadow on top */
.slot.st-item img, .slot.mk-w img { filter: none; }
.st-item > img, .st-item > .st-lbl { grid-row: 1; }
.slot.st-item.sel { box-shadow: inset 0 0 0 2px var(--yellow); }
/* the Football shirt's team picker (Cass 2026-10-22): the 20 crests on the worn-equipment slot back, the picked one ringed */
.st-teams { display: grid; grid-template-columns: repeat(auto-fill, 52px); grid-auto-rows: 52px; gap: 4px; justify-content: start; padding: 0; }
.slot.st-team { width: 52px; height: 52px; background: var(--t-slot_bg) 0 0 / 52px 52px no-repeat; image-rendering: pixelated; }
.slot.st-team::before { inset: -2px; }
.slot.st-team img { width: 36px; height: 36px; object-fit: contain; image-rendering: auto; pointer-events: none; }
.slot.st-team.sel { box-shadow: inset 0 0 0 2px var(--yellow); }
.st-nations .slot.st-team img { width: 40px; height: 27px; object-fit: fill; }   /* flags (Cass 2026-10-22), 3:2 */
.slot.st-item.sel img { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff); }
.st-item .st-lbl { max-width: 72px; color: var(--item); font: 16px/16px var(--p11); text-align: center; overflow-wrap: anywhere; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.st-item .st-price, .st-item .st-worn { grid-row: 2; color: var(--yellow); font: 16px/16px var(--p11); text-shadow: 1px 1px 0 #000; pointer-events: none; }
.st-item .st-worn { color: var(--green); }
.st-item .st-own { position: absolute; right: 2px; top: 46px; pointer-events: none; image-rendering: pixelated; shape-rendering: crispEdges; }
/* try-on: preview > name + price > examine > Buy (primary, twice Back's width; a short Buy says why) */
.st-try { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overflow-x: hidden; }
.st-try > * { flex-shrink: 0; }
.st-info { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
.st-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.st-name { min-width: 0; color: var(--item); font: 16px/16px var(--b12); }
.st-cost { flex: 0 0 auto; color: var(--yellow); font: 16px/16px var(--b12); white-space: nowrap; }
.st-own2 { flex: 0 0 auto; color: var(--green); font: 16px/16px var(--b12); }
.st-ex { margin: 0; color: var(--text); }
.btn .st-why { color: var(--red); }
.mk-foot.st-buy { display: grid; grid-template-columns: 1fr 2fr; }
.st-pane .mk-foot.st-buy { grid-template-columns: 1fr; }
/* Y2K drop: the set of the week card on top of the stall (name + set price over the struck full price, pieces, Try on | Buy set) */
.st-set { display: flex; flex-direction: column; gap: 4px; padding: 4px; margin-bottom: 4px; background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); }
.st-set.sel { box-shadow: inset 0 0 0 2px var(--yellow); }
.st-full { color: var(--text); text-decoration-thickness: 1px; }
.st-set .st-inv { grid-template-columns: repeat(auto-fill, 72px); }
.st-set .mk-foot.st-buy { grid-template-columns: 1fr 2fr; }
.st-sets li { align-items: center; gap: 8px; padding-right: 6px; }
/* Catalogue (Cass 2026-10-22): the page bar under the tabs, < [page name n/m] > (the makeover's arrow buttons; the name opens
   a Choose Option menu of the pages); a locked item greyed with its requirement's tag where the price goes */
.st-pg { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; margin: 0 0 6px; }
.st-pg .st-ar { flex: 0 0 44px; padding: 0; }
.st-pg .st-pgn { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-content: center; align-items: baseline; justify-content: center; gap: 8px; color: var(--white); }
.st-pgn small { color: var(--text); font: 16px/16px var(--p12); }
.slot.st-item.st-lock img, .slot.st-item.st-lock.sel img { filter: grayscale(1); opacity: .5; }
.st-item.st-lock .st-price { color: var(--off); }
.st-lockt { flex: 0 0 auto; color: var(--off); font: 16px/16px var(--b12); }
.mk-foot .btn.st-req { white-space: normal; padding: 4px 8px; }
.btn.st-req .st-why { color: var(--orange, #ff981f); font: 16px/16px var(--p12); }
/* wardrobe: the preview over the owned pieces per slot (Take off in the slot heading; scroll) */
.st-split.wd { overflow-y: auto; overflow-x: hidden; }
.st-split.wd > .st-side { flex: 1 0 auto; }
.st-split.wd > .wbody { flex: 0 0 auto; height: max(128px, 30%); }
.btn.sm { flex: 0 0 auto; font-family: var(--p11); }
.qlist li.grey .q { color: var(--off); }
.qlist li.grey .q small { color: var(--off); }
.st-locked .q { flex-wrap: wrap; gap: 0 8px; padding: 4px 8px; }
.st-locked .q small { white-space: normal; }
/* wide: the grid | the docked try-on (the phone try-on without Back); wardrobe: the preview | worn + pieces */
.wide .st-split { flex-direction: row; gap: 12px; }
.wide .st-split:not(.wd) > .wbody { flex: 0 0 320px; }
/* Cass 2026-10-24 "Today grid is ragged": on the desktop and beside the docked try-on the stall's grids are 4 fixed columns
   (Today's 8 picks = two full rows), left-aligned so they share column lines with the set card's pieces above (3 columns
   beside the try-on, as before). The pane is 4 x 72 + 3 x 4 px wide, plus room for a desktop scrollbar. Phones keep auto-fill */
html.desk #stall .st-split:not(.wd) > .wbody .st-inv:not(.st-pieces), .wide #stall .st-split:not(.wd) > .wbody .st-inv:not(.st-pieces) { grid-template-columns: repeat(4, 72px); }
.wide #stall .st-split:not(.wd) > .wbody .st-set .st-inv { grid-template-columns: repeat(3, 72px); }
.st-pane { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.wide .st-split.wd > .st-side { flex: 0 0 168px; min-width: 0; }
.wide .st-split.wd > .wbody { flex: 1 1 auto; height: auto; }
/* Cass 2026-10-23 "shrink the character preview to half the size and give more ui space to browsing": on a phone the
   try-on and the wardrobe give the preview a fixed ~26% of the app height (half what it took; pvFit scales the whole
   figure, hats included, down to fit, its backing store at the device's pixel ratio) and the rest to browsing, which
   scrolls on its own under it (the wardrobe's slots, crests, To earn); the try-on's Buy sits at the bottom. Wide: the
   wardrobe's preview is a narrow column, the pieces get the rest */
html:not(.wide) #stall .pvb { flex: 0 0 auto; height: clamp(160px, calc(var(--app-h, 100vh) / var(--ui, 1) * .26), 264px); min-height: 0; min-width: 0; }
html:not(.wide) #stall .st-split.wd { overflow: hidden; }
html:not(.wide) #stall .st-split.wd > .wbody { flex: 1 1 auto; height: auto; min-height: 0; }
html:not(.wide) #stall .st-try > .mk-foot.st-buy { margin-top: auto; }
html.square:not(.wide) #stall .st-try > .pvb { height: auto; min-height: 0; }
/* Cass 2026-10-24: on a phone the try-on sits on top of the stall (main.js stInline): the small preview, then a compact bar
   (name + price, the examine text on one line, Back + Buy), then the page bar and the grid, which keeps the rest and scrolls */
#stall .st-try.st-top { flex: 0 0 auto; overflow: visible; gap: 4px; margin: 0 0 6px; }
#stall .st-top > .st-info { gap: 0; }
#stall .st-top .st-ex { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stall .st-top > .mk-foot.st-buy { margin-top: 0; }

/* ---------- Gerrant's shop (Cass 2026-10-19): an OSRS shop window (xrsps interface 300, its 301 inventory stacked under it)
   at the compact 1× of the stall: the rods as shop stock (cache icon, price under it), your bucket at the Bucket tab's half
   size (88 px cells zoomed .5 = 44 px, 7 a row; 6 at 320 px), shells pinned under. Only the bucket scrolls. ---------- */
#shop.cpt { font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#shop.cpt > .x { right: -10px; top: -10px; width: 44px; height: 44px; }
#shop .sh-body { display: flex; flex-direction: column; overflow: hidden; }
#shop .sh-body > * { flex: 0 0 auto; }
.sh-stock { display: grid; grid-template-columns: repeat(6, minmax(44px, 56px)); justify-content: space-between; padding: 2px 0; }
.slot.sh-rod { width: auto; height: 52px; grid-template-rows: 34px 16px; align-content: center; justify-items: center; touch-action: manipulation; }
.slot.sh-rod::before { inset: 0; }
.sh-rod > .spr { grid-row: 1; align-self: center; pointer-events: none; }
.sh-rod > .lbl { grid-row: 1; color: var(--item); font: 16px/16px var(--p11); }
.sh-rod .st-price { grid-row: 2; color: var(--yellow); font: 16px/16px var(--p11); text-shadow: 1px 1px 0 #000; pointer-events: none; }
.sh-rod .st-own { position: absolute; right: 0; top: 20px; width: 10px; height: 8px; pointer-events: none; image-rendering: pixelated; shape-rendering: crispEdges; }
.sh-rod.sel > .spr { filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff); }
.sh-rod.owned > .spr { opacity: .5; }
.sh-rod.owned .st-price, .sh-rod.equipped .st-price { color: var(--text); }
.sh-rod.poor .st-price { color: var(--red); }
.sh-rod.locked > .spr { opacity: .3; filter: grayscale(1); }
.sh-rod.locked .st-price { color: var(--off); }
#shop .divider { height: 6px; margin: 4px 0; background-size: 36px 36px; background-position: 0 -15px; }
#shop > .divider { margin: 0 0 4px; }
#shop .sec { margin: 2px 0 4px; }
#shop .sec .btn { min-height: 44px; }
#shop .note { margin: 4px 0 8px; font: 16px/16px var(--p12); }
#shop .sh-bag { flex: 0 1 auto; min-height: 44px; overflow-y: auto; overflow-x: hidden; }
#shop .sh-bag .inv { zoom: .5; grid-template-columns: repeat(auto-fill, 88px); grid-auto-rows: 88px; gap: 8px 0; max-width: 616px; margin: 0 auto; padding: 0; }
#shop .sh-bag .inv > .slot { width: 88px; height: 88px; }
#shop > .value { padding: 0 4px 2px; gap: 4px; font: 16px/16px var(--b12); }

/* ---------- Fishdex / Rods / Spots / Settings (Cass 2026-10-19, "match the new shop"): the side panel in the compact 1x kit of
   Gerrant's shop: one-line 16 px title, 44 px close, 16 px text, 44 px tap targets; the window is as tall as its content and only
   the list in it (the Fishdex grid, the bait, the spots) scrolls ---------- */
#panel.cpt { font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#panel.win.cpt { padding: 30px 6px 8px; }
.kit-win #panel.win.cpt { padding: 26px 4px 6px; }
#panel.cpt > .x, #signs.cpt > .x { right: -10px; top: -10px; width: 44px; height: 44px; }
#panel .cp-body { display: flex; flex-direction: column; gap: 4px; overflow: hidden; padding: 0 2px 2px; }
#panel .cp-body > * { flex: 0 0 auto; }
#panel.cpt .btn { min-height: 44px; }
#panel.cpt .divider { height: 6px; margin: 2px 0; background-size: 36px 36px; background-position: 0 -15px; }
#panel.cpt > .divider { flex: 0 0 auto; margin: 0 0 4px; }
#panel.cpt .sec { margin: 0; }
#panel.cpt .note { margin: 2px 0 4px; font: 16px/16px var(--p12); }
#panel.cpt .hs-btns { margin: 0; gap: 4px; }
#panel.cpt .ctabs { margin: 0; }
#panel.cpt .ctabs button { height: 44px; }

/* Fishdex: the entry (name + Obtained on one line), then the collection-log grid of 1x icons in 44 px cells */
#panel.cpt .cbox { margin: 0; padding: 4px 6px; }
#panel.cpt .cbox h5, #panel.cpt .cbox p { font: 16px/18px var(--p12); }
#panel.cpt .cbox h5 { font-family: var(--b12); margin: 0; }
.dx-top { display: flex; justify-content: space-between; gap: 8px; }
#panel .dx-grid { flex: 0 1 auto; min-height: 44px; overflow-y: auto; overflow-x: hidden; }
#panel .inv.dx { grid-template-columns: repeat(auto-fill, 44px); grid-auto-rows: 44px; gap: 0; justify-content: center; padding: 0; }
#panel .inv.dx > .slot { width: 44px; height: 44px; touch-action: manipulation; }
#panel .inv.dx > .slot::before { inset: 0; }
#panel .inv.dx > .slot img { filter: drop-shadow(1px 1px 0 #333); }
#panel .inv.dx > .slot.sel img { filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff); }
#panel.cpt .counter#freebets { margin: 0 1px; padding: 4px 6px; font: 16px/18px var(--p12); text-shadow: 1px 1px 0 #000; }
#panel.cpt .counter#freebets .fb-ic { margin: -4px 0 -4px -2px; }

/* Rods: the shop's stock grid, then the bait list (only it scrolls), shells + Trade with Gerrant at the foot.
   Cass 2026-10-25: 18 px rows (border-box, the divider inside), the box 4 rows tall (72 px), scrolls for the rest;
   the rows are text, not controls, so no 44 px tap rule applies to them */
#panel .bt-list { flex: 0 1 auto; min-height: 18px; max-height: 72px; overflow-y: auto; overflow-x: hidden; background: rgba(0, 0, 0, .17); }
.bt-list li { display: flex; align-items: center; gap: 4px; height: 18px; padding: 0 4px 0 2px; font-family: var(--p11); color: var(--yellow); white-space: nowrap; }
.bt-list li + li { border-top: 1px solid rgba(0, 0, 0, .25); }
.bt-list .bt-ic { flex: 0 0 auto; zoom: .5; }   /* Cass 2026-10-24: shrink the bait rows */
.bt-list .bt-stake { flex: 0 0 auto; color: var(--white); }
.bt-list .bt-match { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bt-list small { flex: 0 0 auto; font: inherit; color: var(--green); }
#panel .rd-foot { display: flex; align-items: center; gap: 4px; padding: 0 2px; font: 16px/16px var(--b12); }
#panel .rd-foot { flex-wrap: wrap; row-gap: 4px; }
#panel .rd-npcs { display: flex; gap: 4px; margin-left: auto; }
#panel .rd-foot .btn { min-width: 96px; padding: 0 8px; }
/* 320 px: the two shopkeepers take their own row, half each */
@media (max-width: 359px) { #panel .rd-npcs { flex: 1 0 100%; } #panel .rd-npcs .btn { flex: 1 1 0; min-width: 0; } }

/* Spots (the tab and the signpost): Quest-List colours in two columns of 44 px rows (320 px too), the cache padlock.
   Fix-up 2026-10-19 ("tidier"): rows ruled like the bait list, a darker gutter between the columns, the name left and the
   status right with 8 px clear of the gutter, the padlock cropped to its 10x13 art and centred 4 px before the level,
   your spot (green Here) and the one you watch (white Watching) on a lit row */
#panel .sp-scroll { flex: 0 1 auto; min-height: 44px; overflow-y: auto; overflow-x: hidden; }
.cpt .qlist.sp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; background: rgba(0, 0, 0, .17); }
.cpt .sp-list li { --rule: inset 0 -1px 0 rgba(0, 0, 0, .3); box-shadow: var(--rule); }
.cpt .sp-list li:nth-child(odd) { box-shadow: var(--rule), inset -2px 0 0 rgba(0, 0, 0, .3); }
.cpt .sp-list li:nth-last-child(-n + 2):nth-child(odd), .cpt .sp-list li:last-child { --rule: 0 0 transparent; }
.cpt .sp-list li.here, .cpt .sp-list li.view { background: rgba(255, 255, 255, .07); }
.cpt .sp-list li.view .q { color: var(--white); }
.cpt .sp-list .q { min-height: 44px; padding: 0 8px; gap: 6px; font: 16px/16px var(--p12); }
.cpt .sp-list .q:active { background: rgba(255, 255, 255, .08); }
.cpt .sp-list .q > span:first-child { flex: 1 1 auto; }
.cpt .sp-list .q small { display: flex; align-items: center; gap: 4px; }
.cpt .sp-list .sp-lock { flex: 0 0 auto; margin: -1px -1px -10px -13px; pointer-events: none; }
.cpt .qfoot { font: 16px/16px var(--p12); margin: 4px 0 0; }
#signs.cpt { font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
/* the signpost's title band is the wooden signboard (190x30, native size) hung over the frame */
#signs.cpt.board > .wt { top: -4px; left: 50%; right: auto; width: 190px; height: 30px; margin-left: -95px; padding: 7px 24px 0;
  background: var(--t-gen_signboard) 0 0 / 190px 30px no-repeat; }
#signs.cpt.board > .wdiv { display: none; }
/* a short phone (320x568: the world is ~280 px tall) has room for the ten rows but not the count under them */
@media (max-height: 640px) { #signs .qfoot { display: none; } }

/* Settings: the Audio sub-tab header, then icon / name / slider rows at 1x (the 144x16 track, 16 px handle, 44 px tall) */
#panel .set-sub { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font: 16px/16px var(--b12); color: var(--text); }
#panel .set-rows { background: rgba(0, 0, 0, .17); padding: 0 4px; }
#panel.cpt .vol { height: 44px; margin: 0; gap: 6px; justify-content: flex-start; }
#panel.cpt .vol .mute { width: 44px; height: 44px; flex: 0 0 44px; }
#panel.cpt .vol .vol-nm { flex: 1 1 auto; min-width: 0; color: var(--text); }
#panel.cpt .slider { width: 144px; height: 44px; flex: 0 0 144px; }
#panel.cpt .slider .track { top: 14px; height: 16px; }
.kit-slider #panel.cpt .slider .track { background-size: 144px 16px; }
#panel.cpt .slider .handle { top: 14px; left: calc(16px + var(--v, 0) * .96px); width: 16px; height: 16px; }
#panel.cpt .slider .val { bottom: 32px; left: calc(16px + var(--v, 0) * .96px - 32px); }
#signs.cpt > .wbody { padding-bottom: 2px; }
/* Spots | Worlds (Cass 2026-10-25): the Fishdex-style tabs, 44 px to tap, above the list (only the list scrolls) */
#signs.cpt > .sp-tabs { flex: 0 0 auto; margin: 0 0 4px; }
#signs.cpt .ctabs button { height: 44px; }

/* Hiscores (Cass 2026-10-19, "hiscores ui needs fixing"): the compact 1x kit. 16 px text, 44 px tabs / search / pager; tabs,
   your rank, the search and the pager stay put and only the table scrolls, its header row stuck on top. Ruled rows in fixed
   columns (rank right, name left and cut, level right, xp right); your row lit like the Spots "Here" row */
#hiscores.cpt { font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#hiscores.cpt > .x { right: -10px; top: -10px; width: 44px; height: 44px; }
#hiscores .hs-body { display: flex; flex-direction: column; gap: 4px; overflow: hidden; padding: 0 2px 2px; }
#hiscores .hs-body > * { flex: 0 0 auto; margin: 0; }
#hiscores.cpt .ctabs button { height: 44px; }
#hiscores.cpt .btn { min-height: 44px; }
#hiscores .hs-you { margin: 0 2px; font: 16px/18px var(--p12); }
#hiscores .hs-find { margin: 0; gap: 4px; }
#hiscores .hs-find input { height: 44px; font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#hiscores .hs-miss { margin: 0 2px; font: 16px/18px var(--p12); }
#hiscores .hs-scroll { flex: 0 1 auto; min-height: 44px; overflow-y: auto; overflow-x: hidden; background: rgba(0, 0, 0, .17); }
#hiscores .hs-rows { grid-template-columns: 5ch minmax(0, 1fr) 3ch 10ch; column-gap: 8px; margin: 0; background: none; }
#hiscores .hs-rows.hs-heavy { grid-template-columns: minmax(0, 1.2fr) 9ch minmax(0, 1fr); }
#hiscores .hs-rows li.hs-row { min-height: 28px; padding: 0 6px; font: 16px/16px var(--p12); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .3); background: none; }
#hiscores .hs-rows li.hs-row:last-child { box-shadow: none; }
#hiscores .hs-rows li.hs-head { position: sticky; top: 0; z-index: 1; min-height: 24px; font-family: var(--b12); background: #2e281f; }
#hiscores .hs-row > .nm { text-overflow: clip; }
#hiscores .hs-row > .fish { padding: 4px 0; }
#hiscores .hs-rows li.me { color: var(--white); background: rgba(255, 255, 255, .07); }
#hiscores .hs-rows li.hit { color: var(--yellow); background: rgba(255, 255, 0, .14); }
#hiscores .hs-head .sm { display: inline; }
#hiscores .hs-head .lg { display: none; }
#hiscores .note { margin: 4px 6px; font: 16px/16px var(--p12); }
#hiscores .pager { margin: 0; font: 16px/16px var(--b12); flex-wrap: nowrap; }
#hiscores .pager .btn { padding: 0 12px; }
#hiscores .hs-bar { display: flex; flex-direction: column; gap: 4px; }
/* a short phone (320x568: the world is ~280 px tall): your rank beside the search, tighter rows, so the table keeps 3+ rows */
@media (max-height: 640px) {
  #hiscores .hs-bar { flex-direction: row; align-items: center; }
  #hiscores .hs-you { flex: 0 1 auto; max-width: 50%; }
  #hiscores .hs-find { flex: 1 1 auto; min-width: 0; }
  #hiscores .hs-rows li.hs-row { min-height: 22px; }
  #hiscores .hs-rows li.hs-head { min-height: 20px; }
}

/* Party Pete's invite list (Cass 2026-11-24): the hiscores' compact kit, names only; a tap asks to confirm */
#invite.cpt, #grpwin.cpt { font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#invite.cpt > .x, #grpwin.cpt > .x { right: -10px; top: -10px; width: 44px; height: 44px; }
#invite .hs-body, #grpwin .hs-body { display: flex; flex-direction: column; gap: 4px; overflow: hidden; padding: 0 2px 2px; }
#invite .hs-body > *, #grpwin .hs-body > * { flex: 0 0 auto; margin: 0; }
#invite.cpt .btn, #grpwin.cpt .btn { min-height: 44px; }
#invite .hs-you, #grpwin .hs-you { margin: 0 2px; font: 16px/18px var(--p12); }
#invite .hs-find { margin: 0; gap: 4px; }
#invite .hs-find input { height: 44px; font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#invite .hs-scroll, #grpwin .hs-scroll { flex: 0 1 auto; min-height: 44px; overflow-y: auto; overflow-x: hidden; background: rgba(0, 0, 0, .17); }
#invite .hs-rows { grid-template-columns: minmax(0, 1fr) 3ch; column-gap: 8px; margin: 0; padding: 0; list-style: none; background: none; }
#invite .hs-rows li.hs-row, #grpwin .hs-rows li.hs-row { min-height: 36px; padding: 0 6px; font: 16px/16px var(--p12); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .3); background: none; cursor: pointer; }
#invite .hs-rows li.hs-row:last-child, #grpwin .hs-rows li.hs-row:last-child { box-shadow: none; }
#invite .hs-rows li.hs-head, #grpwin .hs-rows li.hs-head { position: sticky; top: 0; z-index: 1; min-height: 24px; font-family: var(--b12); background: #2e281f; cursor: default; }
#invite .hs-row > .nm, #grpwin .hs-row > .nm { text-overflow: clip; overflow: hidden; white-space: nowrap; }
#invite .note, #grpwin .note { margin: 4px 6px; font: 16px/18px var(--p12); }
#invite .iv-ask { margin: 12px 6px; font: 16px/20px var(--p12); text-align: center; }
#invite .iv-btns, #grpwin .iv-btns { display: flex; gap: 6px; justify-content: center; }
#invite .iv-btns .btn, #grpwin .iv-btns .btn { flex: 1 1 0; }

/* ---------- web play (Cass 2026-10-19, main.js webMe): a guest's Log in with Telegram button under the spot name, and the
   lock when a guest runs out of bait (the whole game behind it; the button and a link to the bot if no tab opened) ---------- */
#login { position: absolute; left: 4px; top: 72px; z-index: 3; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; zoom: var(--ui, 1); }
/* Telegram's mark, pixel-passed (tools/bake/src/tglogo.mjs: 20 px + a black outline, 22 x 22) at 2x, nearest-neighbour */
.tg-ic { display: block; width: 44px; height: 44px; image-rendering: pixelated; pointer-events: none; }
.tg-ic:not([src]) { visibility: hidden; }
#login:active .tg-ic { transform: translateY(1px); }
#login[hidden] { display: none; }
#lock { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; padding: 8px; background: rgba(0, 0, 0, .55); }
#lock[hidden] { display: none; }
#lock > .win { position: relative; width: min(380px, 100%); max-height: 100%; text-align: center; zoom: var(--ui, 1); }
#lock .wbody { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px 12px; font: 16px/18px var(--p12); text-shadow: 1px 1px 0 #000; }
#lock p { margin: 4px 0 0; color: var(--yellow); }
#lock #lock-wait { color: var(--text); }
#lock .btn { min-height: 44px; font: 16px/16px var(--b12); text-shadow: 1px 1px 0 #000; }
#lock-go { display: flex; align-items: center; gap: 6px; padding: 0 14px 0 4px; }
#lock-link { display: grid; place-items: center; min-height: 44px; padding: 0 8px; color: var(--cyan); }
#lock-wait[hidden], #lock-link[hidden] { display: none; }

/* ---------- square layout (html.square, main.js fitSquare; web play only): an X player card (480 x 480) and other
   near-square windows up to ~700 px tall. The world fills most of the square: the orbs sit in a row over its top right,
   the Telegram login icon under the spot name. Under it (Cass 2026-10-19, "we are wasting a lot of space"): three chat
   lines (no filter bar, so the chat shows All), the line status as one yellow strip, then ONE 44 px row that fills the
   width: Cast, the five tab stones, Emotes, Live bait (Cast and Live bait drop to a short label under 440 px). Every
   window opens over the whole square and closes back to it ---------- */
html.square { --tab-h: 46px; --chat-h: 90px; }   /* Cass 2026-11-03: the chat 50% taller (was 60 / 80) */
html.square.saying { --chat-h: 120px; }   /* scale step 4: the log lines + the chat input line */   /* --tab-h: the bottom row + its 2 px pad (a tab window ends on the row) */
html.square #chatbar { display: none; }
html.square #hud { flex-flow: row wrap; align-items: center; gap: 0; padding: 2px 2px calc(var(--safe-b) + 2px); }
html.square #chatwrap { order: 0; flex: 0 0 100%; }
html.square #actions { display: contents; }
html.square #line-status, html.square #visitor-bar:not([hidden]) { order: 1; flex: 0 0 100%; height: 20px; max-height: 20px; padding: 2px 4px 0; line-height: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.square #cast, html.square #fish-here { order: 2; }
html.square #tabs { order: 3; flex: 5 1 220px; min-width: 220px; display: flex; justify-content: space-between; }
html.square #sq-emotes { order: 4; }
html.square #live, html.square #watch-back { order: 5; }
html.square #hud > #actions > .btn { flex: 0 0 auto; min-width: 44px; height: 44px; min-height: 44px; max-width: none; padding: 0 6px;
  font: 16px/16px var(--b12); text-shadow: 1px 1px 0 #000; }
html.square #actions .btn[hidden] { display: none; }
html.square #tabs button, html.square #sq-emotes { flex: 1 1 44px; width: auto; min-width: 44px; height: 44px; }
html.square #tabs button + button { margin-left: 0; }
html.square #tabs button > *, html.square #sq-emotes > * { zoom: .55; }
html.square #sq-emotes > .ti { zoom: .42; }
#sq-emotes { display: none; position: relative; border: 0; padding: 0; background: none; place-items: center; cursor: pointer; }
#sq-emotes > * { grid-area: 1 / 1; }
html.square #sq-emotes { display: grid; flex: 1 1 44px; }
@media (max-width: 439px) { html.square #cast > :not(span) { display: none; } html.square #watch-back .lg { display: none; } html.square #hud > #actions > .btn { padding: 0 2px; } }
html.square #orbs { flex-direction: row; align-items: flex-start; zoom: .7; }
html.square #orb-level { margin: 0 4px 0 0; }
html.square #keep-word { display: none; }
html.square #top { max-width: calc(100% - 176px); }
html.square #usebar .row { max-width: calc(100% - 176px); }
html.square #login { top: 68px; }
/* the wordmark: ~25% of the square's width (90-150 px), still in the world's bottom-right corner */
html.square #pslogo { width: clamp(90px, 25vw, 150px); }
html.square #dialog { top: auto; height: 108px; }
/* the tab windows (the five stones + Emotes; Cass 2026-11-03 "when you press the buttons it should open everything to take up
   not that much screen space"): the desktop's OSRS side panel (html.desk #panel, 190 x 261 OSRS px at 1 OSRS px a CSS px) on
   the right, between the orbs row and the chat, so the world, the chat lines, the status strip and the bottom row stay in view
   and in reach. --sqp-t: under the orbs; --sqp-b: the bottom row + the status strip + the chat + a 4 px gap. A shorter card
   gives a shorter panel; what doesn't fit scrolls inside it */
/* Cass 2026-11-03 "like the Telegram Mini App, fill the chatbox": the window takes the chat + status strip's place, full width,
   ending on the bottom row and rising into the world to 45% of the card (the Mini App's window covers its chat the same way) */
html.square { --sqp-b: calc(var(--tab-h) + var(--safe-b)); --sqp-h: max(calc(20px + var(--chat-h) + 2px), calc(var(--app-h, 100vh) * .45)); }   /* the chat's own 100 px hid Fishdex's fish: up to 45% of the card */
/* under ~387 px the bottom row (Cast 46 + six 44 px stones + Live bait ~73 + the 4 px pad) wraps to a second 44 px row */
@media (max-width: 386px) { html.square { --sqp-b: calc(var(--tab-h) + 44px + var(--safe-b)); } }
html.square #panel { position: fixed; left: 2px; right: 2px; top: auto; bottom: var(--sqp-b); transform: none; box-sizing: border-box;
  width: auto; height: var(--sqp-h); max-height: none; min-height: 0; }
/* the Bucket + Emotes: the 2x window kit at half zoom, as html.desk (380 x 522 at --ui); lengths in here are doubled */
html.square #panel.win:not(.cpt) { zoom: .5; left: 4px; right: 4px; bottom: calc(2 * var(--sqp-b)); width: auto; height: calc(2 * var(--sqp-h)); }
html.square #panel.win:not(.cpt) > .x { right: -8px; top: -8px; }
html.square #panel[data-tab="bucket"] .pbody { display: flex; flex-direction: column; }
html.square #panel[data-tab="bucket"] .bk-empty { flex: 1 1 auto; }
/* the fish at about 3 / 4 of desktop's (32 px slots, five a row), so they read at the card's 1 OSRS px a CSS px */
html.square #panel[data-tab="bucket"] .inv { zoom: .72; flex: 0 0 auto; grid-template-columns: repeat(auto-fill, 88px); justify-content: space-between; gap: 0; max-width: none; margin: 0; }   /* full width (Cass 2026-11-03): 14 a row, a page in two rows */   /* all 28 slots + the pager in 261 px; a shorter card scrolls the body */
/* the emotes at 2 / 3 of their 1x size (32 px, five a row), not desktop's half: they are tapped on a phone's X card */
html.square #panel[data-tab="emotes"] .emotes { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 112px; justify-items: center; align-items: center; gap: 0; padding: 0; }   /* Cass 2026-11-03: seven a row, three rows fill the window, each centred in its cell */
html.square #panel[data-tab="emotes"] .slot.emote { zoom: 2; }
/* the compact tabs: the close inside the card's edge; desktop's denser rows, so the 190 px panel holds them */
html.square #panel.cpt > .x { right: -4px; top: -6px; width: 36px; height: 36px; }
html.square #panel.cpt > .wt { padding: 2px 28px 0; }
/* the body scrolls as a whole (Rods: the bait list kept its rows instead of shrinking to one under the rod grid) */
html.square #panel .cp-body { overflow-y: auto; }
html.square #panel .bt-list { flex: 0 0 auto; }
html.square #panel.cpt .btn { min-height: 28px; min-width: 0; padding: 0 4px; }
html.square #panel.cpt .ctabs button { height: 28px; padding: 0 4px; }
html.square #panel.cpt .cbox { padding: 2px 4px; }
html.square #panel .dx-top { gap: 4px; }
html.square #panel .inv.dx { grid-template-columns: repeat(auto-fill, 40px); grid-auto-rows: 40px; justify-content: space-between; }
html.square #panel .inv.dx > .slot { width: 40px; height: 40px; }
/* the full-width window: the entry on the left, the fish grid beside it on the right, both under the buttons and tabs */
html.square #panel[data-tab="dex"] .cp-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); align-content: stretch; gap: 4px; }
html.square #panel[data-tab="dex"] .cp-body > .hs-btns, html.square #panel[data-tab="dex"] .cp-body > .ctabs { grid-column: 1 / -1; }
html.square #panel[data-tab="dex"] #dex-entry { min-height: 0; overflow-y: auto; margin: 0; }
html.square #panel[data-tab="dex"] .dx-grid { min-height: 0; height: auto; }
html.square #panel .dx-grid { min-height: 68px; }   /* two rows of fish even on a short card (the body scrolls past them) */
html.square #panel .sh-stock { grid-template-columns: repeat(6, minmax(44px, 1fr)); row-gap: 2px; }   /* all six rods in one row across the window */
html.square #panel .rd-foot .btn { flex: 1 1 0; min-width: 0; }
html.square #panel .rd-npcs { flex: 1 0 100%; margin: 0; }
html.square #panel .cp-body:has(.sp-list) { overflow-y: auto; }
html.square #panel .set-rows:not(.set-cam-row) { display: grid; grid-template-columns: repeat(auto-fill, minmax(182px, 1fr)); column-gap: 8px; }   /* the volume rows side by side */
html.square #panel.cpt .vol { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: 14px 22px; column-gap: 4px; height: 36px; margin: 2px 0 0; }
html.square #panel.cpt .vol .mute { grid-row: 1 / 3; width: 30px; height: 36px; }
html.square #panel.cpt .vol .mute > .spr { zoom: .75; }
html.square #panel.cpt .vol .vol-nm { align-self: end; }
html.square #panel.cpt .slider { width: 144px; height: 22px; }
html.square #panel.cpt .slider .track, html.square #panel.cpt .slider .handle { top: 3px; }
html.square .win.cos { position: fixed; left: 4px; right: 4px; top: 4px; bottom: 4px; width: auto; max-height: none; transform: none; }
html.square #makeover, html.square #stall { top: 4px; height: calc(var(--app-h, 100vh) - 8px); width: min(380px, calc(100vw - 8px)); }
/* the stall's try-on (set or piece): preview left, name / price / examine right, Back over Buy under them, so Buy is on
   screen at 360 x 360 with no scrolling (only the examine text scrolls) */
html.square .st-try { display: grid; grid-template-columns: 144px 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; overflow: hidden; }
html.square .st-try > .pvb { grid-row: 1 / 3; min-width: 0; min-height: 208px; }
html.square .st-try > .st-info { min-height: 0; overflow-y: auto; }
html.square .st-try > .mk-foot.st-buy { grid-template-columns: 1fr; }
html.square #reward { position: fixed; }
/* the window scrolls its body (.wbody), never itself: overflow on the window would clip the steel frame (.win::before, inset -12px) */
html.square #card, html.square #tray { max-height: calc(100% - 8px); }
html.square #card > .wbody, html.square #tray > .wbody { overflow-y: auto; }
#world.using #login { display: none; }   /* the Use bar takes the top-left corner */


/* ---------- desktop layout = the OSRS fixed-mode client (html.desk, main.js fitDesk; Cass 2026-10-23 "pretty much exactly
   this, adapted for our UI elements"): one stone frame, interface 548 + chatbox 162 + orbs 160 at their cache positions
   (tools/bake ui.ts fx_* sprites), in OSRS px zoomed by --osrs (s = OSRS px per CSS px, ui.js deskScale: fractional, as
   RuneLite's Stretched mode, so the frame fills the window's height, or its width in a narrower window; pixelated). Left: the game view (#world, 512 x 334 at
   4,4), the chat parchment under it (#chatwrap, 519 x 142, our status line in its "Player name:" input line), the button
   strip along the bottom (All / Game / Clan, Live bait in the last slot, Cast as the red Report button). Right (fixed,
   249 wide): the minimap + compass with the orbs beside it, 7 tab stones, the side panel (the open tab, #panel) between
   the pillars, 7 more stones. Window space left over (--ex / --ey OSRS px) widens the game view + chat and lengthens the
   game view, side panel and pillars; the frame sits centred (--ox / --oy CSS px, --oxs / --oys the same in OSRS px). ---- */
#fx { display: none; }
html.desk { --ex: 0px; --ey: 0px; --ox: 0px; --oy: 0px; --oxs: 0px; --oys: 0px; }
html.desk body { background: #000; }
html.desk #app { display: block; padding: 0; }
html.desk #world { z-index: 4; position: fixed; left: calc(var(--ox) + 4px * var(--osrs)); top: calc(var(--oy) + 4px * var(--osrs));
  width: calc((512px + var(--ex)) * var(--osrs)); height: calc((334px + var(--ey)) * var(--osrs)); flex: none; }
html.desk #hud { display: contents; zoom: 1; }   /* zoom still passes down a display: contents box: each part zooms once, below */
html.desk #hud > * { position: fixed; z-index: 4; zoom: var(--osrs, 2); image-rendering: pixelated; }
html.desk #fx { display: block; position: fixed; left: var(--oxs); top: var(--oys); width: calc(765px + var(--ex)); height: calc(503px + var(--ey));
  zoom: var(--osrs, 2); z-index: 3; image-rendering: pixelated; pointer-events: none; }
#fx i, #fx .fx-r, #fx canvas, #fx button { position: absolute; display: block; }
#fx .fx-top { left: 0; top: 0; width: calc(717px + var(--ex)); height: 4px; background: var(--t-fx_top) 0 0 / 717px 4px repeat-x; }
#fx .fx-left { left: 0; top: 4px; width: 4px; height: calc(334px + var(--ey)); background: var(--t-fx_left) 0 0 / 4px 334px repeat-y; }
#fx .fx-r { left: calc(516px + var(--ex)); top: 0; width: 249px; height: calc(503px + var(--ey)); background: #000; }   /* black behind the minimap's open corners, as OSRS */
#fx .ui-fx_top_r { left: 201px; top: 0; }
#fx .ui-fx_mm_l { left: 0; top: 4px; } #fx .ui-fx_mm_r { left: 201px; top: 4px; } #fx .ui-fx_mm_bot { left: 0; top: 160px; }
#fx #fx-map { left: 54px; top: 9px; width: 145px; height: 151px; background: #000; }
#fx .ui-fx_mm { left: 29px; top: 4px; }
#fx #fx-compass { left: 30px; top: 6px; width: 29px; height: 29px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; background: #000; cursor: pointer; pointer-events: auto; }
#fx #fx-compass > i { left: -11px; top: -11px; transform: rotate(var(--cmp, 0deg)); }
#fx .ui-fx_tabs_top { left: 0; top: 167px; }
#fx .fx-pl { left: 0; top: 205px; width: 31px; height: calc(133px + var(--ey)); border-style: solid; border-width: 24px 0 24px; border-image: var(--t-fx_pillar_l) 24 0 24 fill / 24px 0 24px stretch; }
#fx .ui-fx_pillar_bl { left: 3px; top: calc(338px + var(--ey)); }
#fx .fx-pr { left: 221px; top: 205px; width: 28px; height: calc(261px + var(--ey)); border-style: solid; border-width: 24px 0 24px; border-image: var(--t-fx_pillar_r) 24 0 24 fill / 24px 0 24px stretch; }
#fx .fx-side { left: 31px; top: 205px; width: 190px; height: calc(261px + var(--ey)); box-sizing: border-box;
  border-style: solid; border-width: 0 0 24px; border-image: var(--t-fx_side) 0 0 24 fill / 0 0 24px stretch; }
#fx .ui-fx_tabs_bot { left: 3px; top: calc(466px + var(--ey)); }
#fx .fx-stones { position: absolute; left: 0; width: 249px; height: 36px; }
#fx .fx-stones.t { top: 168px; } #fx .fx-stones.b { top: calc(466px + var(--ey)); }
#fx .fx-stones button { top: 0; height: 36px; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; }
#fx .fx-stones button:not([data-fx]) { cursor: default; }
#fx .fx-stones button > i { top: 0; }
#fx .fx-stones button > .sel { display: none; }
#fx .fx-stones button[aria-selected="true"] > .sel { display: block; }
#fx .fx-stones button.mid > .sel { width: 33px; }
#fx .fx-stones button:disabled > .ic { opacity: .4; }
#fx .fx-stones button:hover:not(:disabled) > .ic, #fx #fx-compass:hover { filter: brightness(1.15); }
/* the chatbox: the parchment (stretched across the extra width), the log over its top, the status in the input line */
html.desk #chatwrap { left: var(--oxs); top: calc(var(--oys) + 338px + var(--ey)); width: calc(519px + var(--ex)); height: 142px; max-width: none;
  box-sizing: border-box; border: 6px solid transparent; border-image: var(--t-chat_background) 6 fill / 6px stretch; }
html.desk #chat { height: 109px; border: 0; border-image: none; background: none; margin: -1px 0 0 1px; padding: 0 0 0 2px; }
html.desk.saying #chat { height: 89px; }
html.desk #say { position: absolute; left: 1px; right: 0; top: 89px; height: 21px; padding: 2px 2px 0; }
html.desk.kit-scroll #chat.scroll::-webkit-scrollbar { width: 16px; }
html.desk.kit-scroll #chat.scroll::-webkit-scrollbar-track { background-size: 16px 100%; }
html.desk.kit-scroll #chat.scroll::-webkit-scrollbar-thumb { min-height: 20px; border-width: 5px 0; border-image-width: 5px 0; }
html.desk.kit-scroll #chat.scroll::-webkit-scrollbar-button:single-button { height: 16px; background-size: 16px 16px; }
html.desk #actions { display: contents; zoom: 1; }
html.desk #actions > * { position: fixed; zoom: var(--osrs, 2); z-index: 5; margin: 0; }
html.desk #line-status, html.desk #visitor-bar:not([hidden]) { left: calc(var(--oxs) + 7px); top: calc(var(--oys) + 338px + var(--ey) + 118px); width: calc(505px + var(--ex));
  height: 18px; max-height: none; padding: 1px 3px 0; box-sizing: border-box; border: 0; border-top: 1px solid #807660; border-image: none; background: none;
  text-align: left; color: #000; font: 16px/16px var(--p12); text-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.desk #line-status *, html.desk #visitor-bar * { text-shadow: none; }
html.desk #chatbar { left: var(--oxs); top: calc(var(--oys) + 480px + var(--ey)); width: calc(519px + var(--ex)); max-width: none; height: 23px; padding: 1px 0 0 5px;
  align-items: flex-start; box-sizing: border-box; border: 0 solid transparent; border-width: 0 4px; border-image: var(--t-chat_buttons) 0 4 fill / 0 4px repeat; }
html.desk #chatbar { padding-left: 1px; }
html.desk #chatbar button { zoom: .5; width: 112px; height: 44px; }
html.desk #chatbar button + button { margin-left: 12px; }
html.desk #chatbar [data-emotes] { display: none; }   /* Emotes: a tab stone here */
/* Cast = the red Report button (3057 / 3058 hover), Live bait (and Watch's Back) the filter button beside it */
html.desk #hud #cast, html.desk #hud #fish-here { left: calc(var(--oxs) + 437px + var(--ex)); top: calc(var(--oys) + 481px + var(--ey)); width: 79px; height: 22px; min-height: 0; max-width: none;
  padding: 0; border: 0; border-image: none; background: var(--t-report) 0 0 / 79px 22px no-repeat; color: #fff; font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; gap: 3px; }
html.desk #hud #cast:hover:not(:disabled), html.desk #hud #fish-here:hover { background-image: var(--t-report_hover); }
html.desk #cast:disabled { color: #9a8f8f; }
html.desk #cast.use { color: var(--item); }
html.desk #cast > :not(span) { zoom: .5; max-height: 36px; }
html.desk #cast > .spr:not([class*="ui2-"]) { zoom: 1; max-height: 18px; }
html.desk #hud #live, html.desk #hud #watch-back { left: calc(var(--oxs) + 375px + var(--ex)); top: calc(var(--oys) + 481px + var(--ey)); width: 56px; height: 22px; min-height: 0; max-width: none;
  padding: 0; border: 0; border-image: none; background: var(--t-chat_filter) 0 0 / 56px 22px no-repeat; color: #fff; font: 16px/16px var(--p11); text-shadow: 1px 1px 0 #000; }
html.desk #hud #live:hover:not(:disabled), html.desk #hud #watch-back:hover { background-image: var(--t-chat_filter_hover); }
html.desk #live:disabled { color: #9a8f8f; }
html.desk #tabs, html.desk #sq-emotes, html.desk #keep-word { display: none; }
/* the open tab in the side panel: its content straight on the stone, no window frame */
html.desk #panel { zoom: var(--ui, 1); left: calc(2 * (var(--oxs) + 547px + var(--ex))); top: calc(2 * (var(--oys) + 205px)); right: auto; bottom: auto; transform: none;
  width: 380px; height: calc(2 * (261px + var(--ey))); max-height: none; min-height: 0; padding: 40px 4px 6px; border: 0; border-image: none; background: none; box-sizing: border-box; }
html.desk #panel > .wt { height: 36px; padding: 6px 8px 0; }
html.desk #panel > .wdiv, html.desk #panel > .x, html.desk #panel::before, html.desk #panel::after { display: none; }
html.desk #hud #panel.win { border: 0; padding: 40px 4px 6px; background: none; }
html.desk #hud #panel.win.cpt { padding-top: 30px; }   /* docked: nothing to close */
html.desk #panel[data-tab="bucket"] .pbody { display: flex; flex-direction: column; }
/* Cass 2026-10-24: the empty Bucket, centred in the window: the bucket icon dimmed, a yellow line, the hint in the note orange */
#panel .bk-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; box-sizing: border-box; text-align: center; }
#panel .bk-empty .bk-ico { opacity: .45; margin-bottom: 4px; }
#panel .bk-empty .bk-t { margin: 0; color: var(--yellow); text-shadow: 1px 1px 0 #000; }
#panel .bk-empty .note { margin: 0; text-shadow: 1px 1px 0 #000; }
html.desk #panel[data-tab="bucket"] .bk-empty { flex: 1 1 auto; }
html.desk #panel[data-tab="bucket"] .inv + .note { order: -1; text-align: center; }   /* "The bucket is empty" on top, not under the slots */
/* the compact tabs (Fishdex, Rods, Spots, Settings) as OSRS side tabs: the 1x kit at 1 OSRS px a px, zoomed with the frame
   (--osrs), in the 190 x 261 side panel; denser than the phone's (mouse targets, not thumbs) */
html.desk #hud #panel.win.cpt { zoom: var(--osrs, 2); left: calc(var(--oxs) + 547px + var(--ex)); top: calc(var(--oys) + 205px);
  width: 190px; height: calc(261px + var(--ey)); padding: 19px 2px 3px; gap: 3px; }
html.desk #panel.cpt > .wt { height: 18px; padding: 3px 2px 0; }
html.desk #panel.cpt .btn { min-height: 24px; min-width: 0; padding: 0 4px; }
html.desk #panel.cpt .ctabs button { height: 24px; padding: 0 4px; }
html.desk #panel .hs-btns { display: none; }   /* Hiscores + Online: their own tab stones here */
html.desk #panel.cpt .cbox { padding: 2px 4px; }
html.desk #panel .dx-top { gap: 4px; }
/* Cass 2026-11-05: the 32 px scrollbar left 154 px for a 180 px grid, so the centred grid lost its first column off the
   left edge. Here: the chat's 16 px scrollbar and 34 px cells, 5 x 34 = 170 = the 186 px panel less the bar */
html.desk #panel .inv.dx { grid-template-columns: repeat(5, 34px); grid-auto-rows: 34px; justify-content: start; }
html.desk #panel .inv.dx > .slot { width: 34px; height: 34px; }
html.desk.kit-scroll #panel .dx-grid.scroll::-webkit-scrollbar { width: 16px; }
html.desk.kit-scroll #panel .dx-grid.scroll::-webkit-scrollbar-track { background-size: 16px 100%; }
html.desk.kit-scroll #panel .dx-grid.scroll::-webkit-scrollbar-thumb { min-height: 20px; border-width: 5px 0; border-image-width: 5px 0; }
html.desk.kit-scroll #panel .dx-grid.scroll::-webkit-scrollbar-button:single-button { height: 16px; background-size: 16px 16px; }
html.desk #panel .sh-stock { grid-template-columns: repeat(3, 56px); row-gap: 2px; }
html.desk #panel .rd-foot .btn { flex: 1 1 0; min-width: 0; }
html.desk #panel .rd-npcs { flex: 1 0 100%; margin: 0; }
html.desk #panel .cp-body:has(.sp-list) { overflow-y: auto; }
html.desk .cpt .qlist.sp-list { grid-template-columns: 1fr; }
html.desk .cpt .sp-list li:nth-child(odd) { box-shadow: var(--rule); }
html.desk .cpt .sp-list li:nth-last-child(-n + 2):nth-child(odd) { --rule: inset 0 -1px 0 rgba(0, 0, 0, .3); }
html.desk .cpt .sp-list li:last-child { --rule: 0 0 transparent; }
html.desk .cpt .sp-list .q { min-height: 17px; padding: 0 4px; }
html.desk #panel.cpt .vol { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: 14px 22px; column-gap: 4px; height: 36px; margin: 2px 0 0; }
html.desk #panel.cpt .vol .mute { grid-row: 1 / 3; width: 30px; height: 36px; }
html.desk #panel.cpt .vol .mute > .spr { zoom: .75; }
html.desk #panel.cpt .vol .vol-nm { align-self: end; }
html.desk #panel.cpt .slider { width: 144px; height: 22px; }
html.desk #panel.cpt .slider .track, html.desk #panel.cpt .slider .handle { top: 3px; }
html.desk #panel .set-cam-btn { left: 0; top: 0; width: 24px; height: 18px; }
html.desk #panel .set-fp-btn { left: 26px; top: 0; width: 28px; height: 18px; }
/* the orbs beside the minimap, as interface 160: Fishing level where OSRS has Hitpoints, Keep fishing (bait) where it has Run */
html.desk #orbs { position: fixed; display: block; left: calc(2 * (var(--oxs) + 516px + var(--ex))); top: calc(2 * (var(--oys) + 4px)); right: auto; width: 140px; height: 300px; pointer-events: none; z-index: 5; }
html.desk #orbs > * { position: absolute; pointer-events: auto; margin: 0; }
html.desk #orb-level { left: 0; top: 74px; width: 114px; height: 68px; }
html.desk #orb-level > .skill, html.desk #orb-level > .xpbar { display: none; }
#orb-level > .dorb { display: none; }
html.desk #orb-level > .dorb { display: block; position: absolute; inset: 0; }
html.desk #orb-level > .dorb > .ui2-orb_frame { position: absolute; left: 0; top: 0; }
html.desk #orb-level > .dorb > .ui2-orb_empty { position: absolute; left: 54px; top: 8px; }
html.desk #orb-level > .dorb > .oi { position: absolute; left: 64px; top: 18px; }
html.desk #orb-level > .dorb > b { position: absolute; left: 8px; top: 30px; width: 46px; text-align: center; color: #00ff00; font: 32px/28px var(--p11); text-shadow: 2px 2px 0 #000; }
html.desk #orb-bait { left: 20px; top: 206px; }
html.desk #xpdrops { right: 0; top: 4px; }

/* ---------- screenshot mode (freecam.js, Cass 2026-10-22): only the world and a small bar; tap the view to bring a hidden bar back ---------- */
html.freecam #hud, html.freecam #lock, html.freecam #world > :not(#gl):not(#fc), html.freecam #menu { display: none !important; }
/* your reveal in screenshot mode (freecam.js reveal): the game's own reveal effects over the free camera (the banner, the
   XP drop, the pop icon and sparkles in #labels); the game's tags and NPC icons stay off (freecam draws its own names) */
html.freecam.fc-rev #world > #labels:not(#gl):not(#fc), html.freecam.fc-rev #world > #xpdrops:not(#gl):not(#fc),
html.freecam.fc-rev #world > #banner:not(#gl):not(#fc) { display: block !important; }
html.freecam #labels > :not(.pop):not(.sparkle) { display: none !important; }
html.freecam #tip { z-index: 31; }
#fc { position: absolute; inset: 0; z-index: 30; touch-action: none; cursor: grab; }
#fc:active { cursor: grabbing; }
#fc[hidden], #fc-bar[hidden] { display: none; }
#fc-bar { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 12px); width: max-content; margin: 0 auto; display: flex; gap: 6px; opacity: .78; zoom: var(--ui, 1); cursor: default; }
/* freecam names (freecam.js placeNames): the player tags, scaled about the head point */
#fc-names { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#fc-names[hidden] { display: none; }
#fc-names .tag { transform-origin: 50% 100%; }
/* four buttons on a 390 px phone: tighter than a window's buttons; a narrower screen wraps them to two rows */
#fc-bar { max-width: calc(100% / var(--ui, 1) - 16px); flex-wrap: wrap; justify-content: center; }
#fc-bar { gap: 4px; }
#fc-bar .btn { padding: 0 2px; }
#fc-bar .btn[aria-pressed="false"] { color: var(--grey, #9f9f9f); }
/* Cast / Emotes: the HUD's bait icon and the Wave emote icon, so six buttons fit one row at 360 px */
#fc-bar .btn.ic { width: 64px; display: grid; place-items: center; }
#fc-bar .btn.ic > * { pointer-events: none; }
#fc-bar .btn.ic > .spr.em { zoom: .65; }   /* the emote icons are ~46 px tall at 1x; the button's inside is 32 */
/* a phone (or the square card): the words at the OSRS 1x size and narrower icon buttons, so all six fit one row at 360 px */
@media (max-width: 560px) {
  #fc-bar .btn { font-size: 16px; line-height: 16px; padding: 0 4px; }
  #fc-bar .btn.ic { width: 48px; }
}
#fc-bar .btn.ic:disabled > * { opacity: .45; }
#fc-bar .btn.ic.on { border-image-source: var(--t-btnd); }
#fc-bar .btn[hidden] { display: none; }
/* the emote picker: the emote tab's slots in a small stone box above the bar */
#fc-emotes { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 68px); max-width: calc(100% / var(--ui, 1) - 16px);
  margin: 0 auto; zoom: var(--ui, 1); display: grid; grid-template-columns: repeat(auto-fill, 48px); grid-auto-rows: 48px; justify-content: center;
  width: calc(48px * 7 + 12px); max-height: calc(48px * 3 + 12px); overflow-y: auto; padding: 0; cursor: default;
  border: 6px solid transparent; border-image: var(--t-btn) 9 / 18px repeat; background: var(--t-stone_dark) 0 0 / 176px 120px repeat, var(--stone-c); background-clip: padding-box; }
#fc-emotes[hidden] { display: none; }
/* the catch line while your reveal shows (the game's chat line, OSRS game colour on a shadow) */
#fc-cap { position: absolute; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 16px); zoom: var(--ui, 1); text-align: center; color: var(--white, #fff);
  font: 32px/36px var(--p12); text-shadow: 2px 2px 0 #000; pointer-events: none; }
#fc-cap[hidden] { display: none; }
/* Shutter / Rec (freecam.js, Cass 2026-10-24): words on a wide screen; on a phone the camera icon and a red dot, so all
   seven fit one row at 390 px (and at 360 with the tighter sizes below) */
#fc-bar .btn.ic2 > .spr, #fc-bar .btn.ic2 > .recic { display: none; }
#fc-bar .btn.ic2 > * { pointer-events: none; }
.recic { width: 16px; height: 16px; border-radius: 50%; background: var(--red, #f00); box-shadow: 2px 2px 0 #000; }
#fc-bar .btn.on > .recic { border-radius: 0; width: 14px; height: 14px; }   /* recording: the stop square */
#fc-bar .btn[data-fc="rec"].on { color: var(--red, #f00); border-image-source: var(--t-btnd); }
@media (max-width: 560px) {
  #fc-bar .btn.ic2 { width: 48px; display: grid; place-items: center; padding: 0; }
  #fc-bar .btn.ic2 > .lbl { display: none; }
  #fc-bar .btn.ic2 > .spr, #fc-bar .btn.ic2 > .recic { display: block; }
}
@media (max-width: 380px) {
  #fc-bar { gap: 2px; }
  #fc-bar .btn { padding: 0 3px; }
  #fc-bar .btn.ic, #fc-bar .btn.ic2 { width: 44px; }
  #fc-bar .btn.ic > .spr.em { zoom: .55; }
}
/* the REC chip (top-left; never in the clip: the clip is drawn from the WebGL canvas) and the "Clip ready" box */
#fc-rec { position: absolute; left: 8px; top: 8px; zoom: var(--ui, 1); display: flex; align-items: center; gap: 8px; padding: 2px 10px 2px 8px;
  background: rgba(0, 0, 0, .55); color: var(--white, #fff); font: 32px/36px var(--b12); text-shadow: 2px 2px 0 #000; pointer-events: none; }
#fc-rec[hidden], #fc-clip[hidden] { display: none; }
#fc-rec .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--red, #f00); box-shadow: 2px 2px 0 #000; }
#fc-rec.blink .dot { animation: fc-blink 1s steps(1, end) infinite; }
@keyframes fc-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #fc-rec .dot { animation: none !important; } }
#fc-clip { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 68px); width: max-content; max-width: calc(100% / var(--ui, 1) - 16px);
  margin: 0 auto; zoom: var(--ui, 1); padding: 6px 10px 10px; text-align: center; cursor: default; color: var(--text);
  border: 6px solid transparent; border-image: var(--t-btn) 9 / 18px repeat; background: var(--t-stone_dark) 0 0 / 176px 120px repeat, var(--stone-c); background-clip: padding-box; }
#fc-clip p { margin: 0 0 6px; font: 32px/36px var(--b12); color: var(--yellow, #ff0); text-shadow: 2px 2px 0 #000; }
#fc-clip .row { display: flex; gap: 6px; justify-content: center; }
#fc-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#fc-flash.go { animation: fc-flash .3s ease-out; }
@keyframes fc-flash { from { opacity: .85; } to { opacity: 0; } }
#panel .set-cam { margin-top: 8px; }
#panel .set-cam-row { display: flex; justify-content: center; gap: 8px; padding: 6px 4px; }
/* the Screenshot-mode camera (icon_camera, 22x18 at 1x): the settings window's top-left corner, mirroring the close
   (a 44 px tap target) */
#panel .set-cam-btn { position: absolute; left: -10px; top: -10px; width: 44px; height: 44px; padding: 0; border: 0; background: none;
  display: grid; place-items: center; cursor: pointer; z-index: 3; }
#panel .set-cam-btn:hover > .spr, #panel .set-cam-btn:focus-visible > .spr { filter: brightness(1.25); }
#panel .set-cam-btn:active > .spr { filter: brightness(.85); }
#panel .set-cam-btn .lbl { color: var(--text); font: 16px/16px var(--b12); }
/* first person (the Party Room only): the cache's eye beside the camera; lit while on */
#panel .set-fp-btn { position: absolute; left: 30px; top: -10px; width: 44px; height: 44px; padding: 0; border: 0; background: none;
  display: grid; place-items: center; cursor: pointer; z-index: 3; }
#panel .set-fp-btn[hidden] { display: none; }
#panel .set-fp-btn > .spr { filter: brightness(.8); }
#panel .set-fp-btn[aria-pressed="true"] > .spr, #panel .set-fp-btn:hover > .spr, #panel .set-fp-btn:focus-visible > .spr { filter: brightness(1.2); }
#panel .set-fp-btn .lbl { color: var(--text); font: 16px/16px var(--b12); }

/* the Profile (Cass 2026-10-22): the compact 1x kit; your fisher left, level + best catch right, the 13 legendaries
   (not caught = the Fishdex's dark silhouette), Share profile pinned under */
#profile.cpt { font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#profile.cpt > .x { right: -10px; top: -10px; width: 44px; height: 44px; }
#profile .pf-body { display: flex; flex-direction: column; gap: 6px; padding: 0 6px 8px; }
#profile .pf-top { display: flex; gap: 8px; align-items: stretch; }
#profile .pf-pvb { flex: 0 0 176px; min-width: 0; min-height: 0; height: 256px; }
#profile .pf-side { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#profile .pf-side p { margin: 0; }
#profile .pf-lvl { color: var(--text); font-family: var(--b12); padding-top: 4px; }
#profile .ptitle { margin: 6px 0 0; font: 16px/18px var(--b12); text-align: left; }
#profile .pf-best { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; text-align: center; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); color: var(--white); }
#profile .pf-best .w { color: var(--yellow); }
#profile .pf-sec { margin: 4px 0 0; font: 16px/18px var(--b12); }
#profile .pf-legend { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 40px; gap: 2px; padding: 4px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
#profile .pf-legend .slot { display: grid; place-items: center; width: auto; height: 40px; cursor: default; }
#profile .slot.miss.sil img { opacity: .55; filter: brightness(0) drop-shadow(1px 1px 0 #333); }
#profile .pf-foot { display: flex; justify-content: center; }
/* the player card window (Cass 2026-10-23): the card (square, 2026-10-24), Copy image / Download (/ Shuffle) under it */
#sharecard.cpt { font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#sharecard.cpt > .x { right: -10px; top: -10px; width: 44px; height: 44px; }
#sharecard .sc-body { display: flex; flex-direction: column; gap: 8px; padding: 0 6px 8px; min-height: 0; }
#sharecard .sc-pic { display: grid; place-items: center; aspect-ratio: 1; max-height: min(58vh, 400px); margin: 0 auto; width: 100%; max-width: min(58vh, 400px); background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
#sharecard .sc-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
#sharecard .sc-pick { display: flex; align-items: center; justify-content: center; gap: 8px; font: 16px/16px var(--b12); color: var(--text); }
#sharecard .sc-pick select { min-height: 44px; max-width: min(100%, 320px); font: 16px/16px var(--p12); color: var(--text); background: var(--stone-c); border: 2px solid #1e1a14; padding: 0 6px; }
#sharecard .sc-btns { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
#sharecard .sc-btns .btn { min-height: 44px; font: 16px/16px var(--b12); padding: 0 12px; }
/* [sc-pick] More: the pose strip (small finished cards, swipe across) and the angle buttons */
#sharecard .sc-more { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#sharecard .sc-more[hidden] { display: none; }
#sharecard .sc-strip { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 4px; -webkit-overflow-scrolling: touch; }
#sharecard .sc-cell { flex: 0 0 auto; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 3px; scroll-snap-align: start;
  background: rgba(0, 0, 0, .28); border: 2px solid #1e1a14; color: var(--text); font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; cursor: pointer; }
#sharecard .sc-cell.on { border-color: #ff981f; }
#sharecard .sc-thumb { width: 74px; height: 74px; display: block; background: rgba(0, 0, 0, .35); }
#sharecard .sc-thumb img { width: 100%; height: 100%; display: block; image-rendering: auto; }
#sharecard .sc-name { white-space: nowrap; }
#sharecard .sc-angle { display: flex; gap: 6px; justify-content: center; }
#sharecard .sc-angle .btn { min-height: 44px; font: 16px/16px var(--b12); padding: 0 12px; }
#sharecard .sc-angle .btn.on { color: #ff981f; }
/* More open: the big card gives up room so the strip, the angle and Copy / Download all fit on a phone */
#sharecard.sc-open .sc-pic { max-height: min(26vh, 400px); max-width: min(26vh, 400px); }
#sharecard.sc-open .sc-body { gap: 5px; overflow-y: auto; }
#sharecard.sc-open .sc-cell { width: 66px; }
#sharecard.sc-open .sc-thumb { width: 56px; height: 56px; }
#profile .pf-foot .btn, #panel .dx-share { min-height: 44px; font: 16px/16px var(--b12); padding: 0 12px; }
#panel .dx-share { display: block; margin: 6px 0 2px auto; }
/* pixel-font text at the stretched desktop scale (pxtext.js): antialiased coverage, thresholded at 50% by an SVG filter = the
   glyph pixels nearest-neighbour scaled like the frame art; the 1 OSRS px shadow drawn by the filter (#pxs), not text-shadow */
html.pxtext .pxt, html.pxtext .pxt * { -webkit-font-smoothing: antialiased; }
html.pxtext .pxt.pxs { filter: url(#pxs); }
html.pxtext .pxt.px0 { filter: url(#px); }
html.pxtext .pxt.pxs, html.pxtext .pxt.pxs * { text-shadow: none !important; }
html.desk #chatbar button > span, html.desk #chatbar .cs { text-shadow: 1px 1px 0 #000; }
/* the compact windows over the game view (shop, stall, makeover, signs, hiscores, profile: the 1x kit) at 1 OSRS px a kit px,
   zoomed with the frame like the side panel's compact tabs (were at --ui = half that); centred in the game view, scrolling inside it */
html.desk #world > .win.cpt { zoom: var(--osrs, 2); }
html.desk #makeover, html.desk #stall { left: calc(var(--oxs) + 8px); right: auto; top: calc(var(--oys) + 8px); margin: 0;
  width: calc(504px + var(--ex)); height: calc(326px + var(--ey)); }
html.desk #stall .pvb, html.desk #makeover .pvb { min-height: 120px; min-width: 0; }   /* the try-on fits the game view height */
html.desk:not(.wide) #stall .pvb { height: calc((326px + var(--ey, 0px)) * .45); min-height: 0; }   /* the half-size phone preview, in the game view's height */
/* club step 6 (drunk, drunk.js): the timer box (an OSRS-style buff timer: the cache Beer icon, drinks top left, time
   left under it) and the Wizard's mind bomb haze over your own view */
#drunk-buff { position: absolute; right: 12px; top: 12px; z-index: 3; width: 46px; height: 58px; background: rgba(62, 53, 41, .85); border: 2px solid #1e1a14; display: flex; align-items: flex-start; justify-content: center; padding-top: 2px; box-sizing: border-box; pointer-events: none; }
#drunk-buff[hidden], #drunk-haze[hidden] { display: none; }
#drunk-buff .db-n { position: absolute; left: 3px; top: 1px; color: #ff0; font: 16px/1 "OSRS p12_full", sans-serif; text-shadow: 1px 1px 0 #000; }
#drunk-buff .db-t { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; color: #fff; font: 16px/1 "OSRS p12_full", sans-serif; text-shadow: 1px 1px 0 #000; }
/* Wizard's mind bomb (polish pass): a pink-purple haze that drifts, and the 3D view (only the canvas) swims: a slow hue
   swing + a little blur + a lean and swell. The tint is laid on normally (not screen), so it reads in the purple room too. */
#drunk-haze { position: absolute; inset: -8%; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(255, 150, 225, .10) 0%, rgba(235, 95, 200, .26) 55%, rgba(150, 40, 175, .55) 100%);
  animation: drunk-haze 7s ease-in-out infinite alternate; }
@keyframes drunk-haze { 0% { opacity: .75; transform: translate(-3%, 1%) scale(1); } 50% { opacity: 1; transform: translate(2%, -2%) scale(1.05); } 100% { opacity: .85; transform: translate(3%, 2%) scale(1.02); } }
#gl.hazed { animation: drunk-swim 5.5s ease-in-out infinite alternate; }
@keyframes drunk-swim {
  0% { filter: hue-rotate(-28deg) saturate(1.45) blur(.6px); transform: scale(1.02) skewX(.5deg); }
  50% { filter: hue-rotate(18deg) saturate(1.6) blur(1px); transform: scale(1.03) skewY(-.4deg) rotate(.25deg); }
  100% { filter: hue-rotate(-10deg) saturate(1.3) blur(.5px); transform: scale(1.02) skewX(-.5deg); } }

/* ---------- first-time open screen (Cass 2026-11-03; main.js showIntro): the art as a square, the rest of the screen the same art
   blurred behind it; the art's stone panel (24.3% / 33.1%, 51.4% x 27.9% of the square) holds a yellow welcome line over the OSRS login button */
#intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #1b1c1a; overflow: hidden; }
#intro[hidden] { display: none; }
#intro::before { content: ''; position: absolute; inset: -40px; background: var(--intro-bg) center / cover; filter: blur(18px) brightness(.45); }
#intro .intro-sq { position: relative; width: min(100vw, 100dvh); aspect-ratio: 1; }
#intro-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.intro-box { position: absolute; left: 24.3%; top: 33.1%; width: 51.4%; height: 27.9%; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: default;
  container-type: inline-size; }   /* sizes below are in the panel's width (cqw), so both arts share them */
/* landscape screens: the 16:9 art (intro-wide.webp, 1672 x 941; its panel 35.2% / 32.1%, 29.7% x 29.2%), covering the screen
   (its wide brick walls take any crop) */
@media (min-aspect-ratio: 4/3) {
  #intro .intro-sq { width: max(100vw, calc(100dvh * 1672 / 941)); flex: none; aspect-ratio: 1672 / 941; }
  .intro-box { left: 35.2%; top: 32.1%; width: 29.7%; height: 29.2%; }
}
/* portrait screens: the 9:16 art (intro-tall.webp, 941 x 1672; its panel 22% / 39.3%, 57% x 17.6%), near-covering the screen
   (up to ~10% short, so the torches at its edges stay in; the blurred art fills the rest) */
@media (max-aspect-ratio: 3/4) {
  #intro .intro-sq { width: max(100vw, calc(100dvh * 941 / 1672 * .9)); flex: none; aspect-ratio: 941 / 1672; }
  .intro-box { left: 22%; top: 39.3%; width: 57%; height: 17.6%; }
}
#intro-title { margin: 0; font: 400 8.2cqw/1 var(--b12); color: var(--yellow); text-shadow: .6cqw .6cqw 0 #000; }
/* the OSRS login screen's button (cache sprite 500 "titlebutton", 147 x 41; ui.js cuts it into --t-title_button) */
#intro-go { margin-top: 7cqw; width: 58cqw; height: calc(58cqw * 41 / 147); border: 0; padding: 0; cursor: pointer; background: var(--t-title_button, #3b3328) center / 100% 100% no-repeat; image-rendering: pixelated;
  font: 400 7cqw/1 var(--b12); color: var(--white); text-shadow: .6cqw .6cqw 0 #000; }
#intro-go:hover, #intro-go:focus-visible { filter: brightness(1.2); outline: none; }
#intro-go:active { filter: brightness(.85); }
#intro.out { opacity: 0; transition: opacity .35s; pointer-events: none; }

/* Cass 2026-11-05: the Polystation group invite in the chatbox (unlinked Telegram players out of bait) */
#chat .joinbtn { font: inherit; line-height: 16px; color: #0000ff; background: none; border: 0; text-decoration: underline; cursor: pointer;
  display: inline-block; position: relative; z-index: 1; padding: 8px 6px; margin: -8px -6px; vertical-align: top;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }   /* hit zone 8px past the text each way, layout unchanged */

/* ---------- pets (pets.js, ~/smallfih-pets/PLAN.md): the pet orb, the pet card (#pet), the stall's Pets page, Lost posters ---------- */
/* the orb under Keep fishing: the out pet's face in the orb, its level where the run energy sits; the number by mood */
#orb-pet[hidden] { display: none; }
#orb-pet { margin-top: 2px; }
#orb-pet #pet-face { position: absolute; left: 54px; top: 8px; width: 52px; height: 52px; border-radius: 50%; background: #1c1812; image-rendering: pixelated; }
#orb-pet b { color: var(--green); }
#orb-pet[data-stage="grumpy"] b { color: var(--yellow); }
#orb-pet[data-stage="miserable"] b { color: var(--red); }
#orb-pet[data-stage="away"] b { color: var(--text); }
html.desk #orb-pet { left: 0; top: 140px; }
html.square #orb-pet { margin-top: 0; }
/* the card: the compact 1x kit as the profile */
#pet.cpt { font: 16px/16px var(--p12); text-shadow: 1px 1px 0 #000; }
#pet.cpt > .x { right: -10px; top: -10px; width: 44px; height: 44px; }
#pet .pt-body { display: flex; flex-direction: column; gap: 6px; padding: 8px 6px 8px; overflow-y: auto; min-height: 0; max-height: calc(var(--app-h, 100vh) / var(--ui, 1) - 64px); }
#pet .pt-top { display: flex; gap: 8px; align-items: stretch; }
#pet .pt-pvb, #stall .pt-thumb { background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
#pet .pt-pvb { flex: 0 0 auto; display: grid; place-items: center; width: 144px; height: 144px; }
#pet .pt-pvb canvas { width: 144px; height: 144px; image-rendering: pixelated; }
#pet .pt-side { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#pet .pt-side .kv { min-height: 20px; }
#pet .pt-kind { margin: 2px 0 2px; color: var(--white); }
#pet .pt-gold, #pet .pt-out { color: var(--yellow); font-style: normal; }
#pet .pt-time { margin: 4px 0 0; }
.pt-ok, .pt-happy { color: var(--done); }
.pt-warn, .pt-grumpy { color: var(--yellow); }
.pt-bad, .pt-miserable { color: var(--red); }
#pet .kv > b.pt-happy { color: var(--done); } #pet .kv > b.pt-grumpy { color: var(--yellow); } #pet .kv > b.pt-miserable { color: var(--red); }
/* the bars: the level orb's XP bar look (dark red, a black edge) */
.pt-bar { display: block; height: 8px; margin: 1px 2px 3px; background: #3a0b05; box-shadow: 0 0 0 2px #000; }
.pt-bar > span { display: block; height: 100%; background: #0dc10d; }
.pt-bar.grumpy > span { background: #e0c000; }
.pt-bar.miserable > span { background: #d01010; }
.pt-bar.xp > span { background: #2f8fe0; }
#pet .pt-sec, #stall .pt-sec { margin: 4px 0 0; font: 16px/18px var(--b12); }
#pet .pt-sec .dim, #stall .pt-sec .dim { font: 16px/16px var(--p12); display: inline-flex; align-items: center; gap: 2px; }
#pet .pt-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
#pet .pt-row .btn { min-height: 40px; flex: 1 1 0; max-width: 200px; }
#pet .pt-note { margin: 0; text-align: center; }
#pet ul, #stall .pt-list { list-style: none; margin: 0; padding: 0; }
#pet .qlist .q, #stall .pt-list .q { min-height: 32px; }
.pt-list button.q { width: 100%; border: 0; background: none; font: inherit; color: var(--text); text-shadow: inherit; cursor: pointer; text-align: left; }
.pt-list button.q:hover { background: rgba(255, 255, 255, .08); }
.pt-list li.here .q { color: var(--white); background: rgba(255, 255, 255, .1); }
/* the name prompt: OSRS's "Enter name" box, over the card */
#pet .pt-name { display: flex; flex-direction: column; gap: 4px; padding: 6px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px #000; color: var(--yellow); font-family: var(--b12); }
#pet .pt-name-in { display: flex; gap: 6px; }
#pet .pt-name input { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 0 6px; font: 16px/16px var(--p12); color: var(--white); background: #1c1812; border: 2px solid #000; }
/* the stall's Pets page */
#stall .pt-shop { display: flex; flex-direction: column; gap: 4px; }
#stall .pt-item { display: flex; gap: 8px; align-items: stretch; padding: 4px; background: rgba(0, 0, 0, .17); }
#stall .pt-item.off { opacity: .75; }
#stall .pt-item.off .pt-thumb { filter: grayscale(1) brightness(.6); }
#stall .pt-thumb { flex: 0 0 88px; width: 88px; height: 88px; image-rendering: pixelated; }
#stall .pt-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
#stall .pt-info .st-ex { margin: 0; }
#stall .pt-info .btn { margin-top: auto; align-self: flex-end; min-width: 96px; }
/* another player's pet: the fisher card window */
#card .pt-mini .kv { min-height: 28px; }
/* the profile's Lost posters: the chatbox parchment, black print */
/* one row that scrolls sideways, each poster one line: LOST, the name, kind + level */
.pt-posters { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.pt-poster { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 5px 8px; white-space: nowrap; color: #000; text-shadow: none;
  background: var(--t-chat_background) 0 0 / auto repeat, #c8b48a; box-shadow: inset 0 0 0 1px #5a4a2a, 1px 1px 0 #000; }
.pt-poster b { font: 16px/16px var(--b12); color: #800000; letter-spacing: 1px; }
.pt-poster .nm { color: #000080; font-family: var(--b12); }
/* the Pet Shop Boys' latest line in their shop window (main.js psbSayHtml): OSRS npc chat, the name maroon over a black
   line on the chatbox parchment, as #dialog */
#stall .psb-say { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 6px; padding: 6px 10px 8px;
  border: 6px solid transparent; border-image: var(--t-chat_background) 6 fill / 6px stretch; color: #000; text-shadow: none; text-align: center; font: 16px/18px var(--q8); }
#stall .psb-say .psb-who { color: #800000; }

/* Wrapped 2026 (wrapped.js, WRAPPED=1): full-screen story cards over the game, one stone card, OSRS text */
#wrapped { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8, 7, 5, .82); outline: none; touch-action: none; }
#wrapped .wr-card { position: relative; display: flex; flex-direction: column; align-items: stretch; width: min(calc(100vw - 16px), 480px);
  height: min(calc(100dvh - 16px), 820px); padding: 14px 14px 10px; color: var(--text); text-shadow: 2px 2px 0 #000; cursor: pointer; overflow: hidden; }
#wrapped .wr-pips { display: flex; gap: 4px; height: 6px; margin: 0 40px 0 0; }
#wrapped .wr-pips span { flex: 1; background: rgba(0, 0, 0, .55); }
#wrapped .wr-pips .done { background: var(--text); }
#wrapped .wr-pips .on { background: var(--yellow); }
#wrapped .wr-head { margin: 10px 0 0; font: 16px/16px var(--b12); color: var(--yellow); text-shadow: 1px 1px 0 #000; }
#wrapped .wr-x { position: absolute; top: 2px; right: 4px; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--text);
  font: 32px/32px var(--b12); cursor: pointer; text-shadow: 2px 2px 0 #000; }
#wrapped .wr-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
#wrapped .wr-body p { margin: 0; }
#wrapped .wr-k { font: 32px/32px var(--p12); color: var(--text); }
#wrapped .wr-n { font: 64px/64px var(--b12); color: var(--yellow); text-shadow: 4px 4px 0 #000; margin: 8px 0 !important; overflow-wrap: anywhere; }
#wrapped .wr-type { font-size: 48px; line-height: 52px; text-shadow: 3px 3px 0 #000; }
#wrapped .wr-t { font: 32px/34px var(--p12); color: var(--white); max-width: 100%; }
#wrapped .wr-t b { font-weight: 400; color: var(--yellow); }
#wrapped .wr-s { font: 16px/20px var(--p12); color: var(--text); text-shadow: 1px 1px 0 #000; max-width: 34ch; }
#wrapped .wr-fish { min-height: 96px; display: grid; place-items: center; margin: 6px 0; }
#wrapped .wr-photo { position: relative; width: min(100%, 360px, 40dvh); aspect-ratio: 1; border: 4px solid #000; background: #1b1712; }
#wrapped .wr-photo canvas { display: block; width: 100%; height: 100%; image-rendering: auto; }
#wrapped .wr-photo.wr-none { display: none; }
#wrapped .wr-pet { width: min(70%, 240px, 32dvh); border: 0; background: none; }
#wrapped .wr-pet canvas { image-rendering: pixelated; }
#wrapped .wr-wait { position: absolute; inset: auto 0 45%; font: 16px/16px var(--p12); color: var(--text); }
#wrapped .wr-legs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 360px; margin: 6px 0; }
#wrapped .wr-legs .slot { width: 40px; height: 36px; display: grid; place-items: center; }
#wrapped .wr-bar { position: relative; width: min(100%, 320px); height: 32px; margin: 8px 0; background: #3d0000; border: 2px solid #000; }
#wrapped .wr-bar span { position: absolute; inset: 0 auto 0 0; background: #00a000; }
#wrapped .wr-bar b { position: absolute; inset: 0; font: 400 16px/28px var(--p12); color: var(--white); text-shadow: 1px 1px 0 #000; }
#wrapped .wr-sum { flex: 0 1 auto; min-height: 0; max-height: calc(100% - 110px); aspect-ratio: 3 / 4; display: grid; place-items: center; }
#wrapped .wr-sum canvas { display: block; max-width: 100%; max-height: 100%; border: 2px solid #000; image-rendering: auto; }
#wrapped .wr-btns { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
#wrapped .wr-btns .btn { min-width: 120px; }
#wrapped .wr-hint { margin: 4px 0 0; text-align: center; font: 16px/16px var(--p12); color: var(--off); text-shadow: 1px 1px 0 #000; }
#wrapped .wr-hint[hidden] { display: none; }
