/* ---------- Gus's Pawn & Cards: a website on Gus's tablet (src/scenes/pawn.js; art/areas/pawn/layout.json) ----------
   The tablet fills the screen: its bezel hugs the screen's edges, its screen holds the browser (Wanderer) and the site.
   The scene sets the tablet's own units inline on .tb, from its geometry: --sa is one art pixel of the tablet (a whole
   number of device pixels), --sw half of it, --B the bezel, and the heights of the status bar, the toolbar, the status
   line, the banner and the footer. Inside, --a, --g, --u and --fu are the tablet's (art pixel, world pixel, world pixel
   times the text size), so the site's pieces and anything the game draws in it (card pictures, slabs, the finder,
   twinkles) take its size. Gus's site keeps its own period palette. Everything here is the tablet at rest, open and
   awake; its flight and its waking are played by the scene's opener (transforms and opacity only). */
#panel.area-pawn { left: 0; top: 0; right: auto; bottom: auto; width: 100%; height: 100%; }
#panel.area-pawn > .x { display: none; } /* the browser's own close button, and the home button, put the tablet down */
#panel .tb, .modal-box.pw-alert {
  --cream: #fbf8f0; --paper: #f3ead2; --putty: #d9d1bf; --putty-dk: #9c937f; --putty-lt: #ece5d4;
  --wine: #94303f; --wine-dk: #5a1420; --wine-lt: #b4485a; --brass-sp: #fff2b0;
  --leaf: #5cb85a; --leaf-dk: #2f7a3a; --link: #1f4f9a; --dim: #6f6758; --pos: #2f7a3a; --neg: #b02a3a; --slate: #2b434d; --os: #121318; }
#panel .tb { position: absolute; inset: 0; pointer-events: none; --a: var(--sa); --g: var(--sw); --u: var(--sw); --fu: calc(var(--sw) * var(--fs));
  font-family: var(--font-ui); color: var(--ink); text-shadow: none; }
#panel .tb *, #panel .tb *::before, #panel .tb *::after { box-sizing: border-box; }

/* ---------- the tablet: its pieces, each at rest where the open tablet has it (the flight moves them from there) ---------- */
#panel .tb-dev { position: absolute; inset: 0; transform-origin: 50% 50%; }
#panel .tb-dev > * { position: absolute; transform-origin: 0 0; }
#panel .tb-bz { background: url(../../art/areas/pawn/bezel.png) 0 0 / calc(var(--sa) * 42) calc(var(--sa) * 42) no-repeat; image-rendering: pixelated; pointer-events: auto; }
#panel .tb-tl { left: 0; top: 0; width: var(--B); height: var(--B); }
#panel .tb-tr { left: calc(100% - var(--B)); top: 0; width: var(--B); height: var(--B); background-position: calc(var(--sa) * -33) 0; }
#panel .tb-bl { left: 0; top: calc(100% - var(--B)); width: var(--B); height: var(--B); background-position: 0 calc(var(--sa) * -33); }
#panel .tb-br { left: calc(100% - var(--B)); top: calc(100% - var(--B)); width: var(--B); height: var(--B); background-position: calc(var(--sa) * -33) calc(var(--sa) * -33); }
/* the edges repeat their texture along the screen's sides, so the bezel is the same thickness on every screen */
#panel .tb-t, #panel .tb-b { left: var(--B); width: calc(100% - 2 * var(--B)); height: var(--B); background-size: calc(var(--sa) * 24) var(--B); background-repeat: repeat-x; }
#panel .tb-l, #panel .tb-r { top: var(--B); width: var(--B); height: calc(100% - 2 * var(--B)); background-size: var(--B) calc(var(--sa) * 24); background-repeat: repeat-y; }
#panel .tb-t { top: 0; background-image: url(../../art/areas/pawn/bezel_t.png); }
#panel .tb-b { top: calc(100% - var(--B)); background-image: url(../../art/areas/pawn/bezel_b.png); }
#panel .tb-l { left: 0; background-image: url(../../art/areas/pawn/bezel_l.png); }
#panel .tb-r { left: calc(100% - var(--B)); background-image: url(../../art/areas/pawn/bezel_r.png); }
#panel .tb-cam { width: calc(var(--sa) * 2); height: calc(var(--sa) * 2); background: url(../../art/areas/pawn/cam.png) 0 0 / 100% 100%; image-rendering: pixelated; pointer-events: auto; }
#panel .tb .tb-home { width: calc(var(--sa) * 3); height: calc(var(--sa) * 3); margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; pointer-events: auto;
  background: url(../../art/areas/pawn/home.png) 0 0 / 100% 100%; image-rendering: pixelated; }
#panel .tb .tb-home::after { content: ''; position: absolute; inset: calc(var(--sa) * -3); } /* a finger's worth round the little button */
#panel .tb .tb-home:active { background-image: url(../../art/areas/pawn/home_dn.png); }
#panel .tb-stk { width: calc(var(--sa) * 13); height: calc(var(--sa) * 8); background: url(../../art/areas/pawn/sticker.png) 0 0 / 100% 100%; image-rendering: pixelated; pointer-events: auto; }
#panel .tb.portrait .tb-stk { transform: rotate(90deg); } /* down the left side of a portrait tablet: it turned with the tablet */
/* the desk sprite and its shadow ride over the pieces in the air (a box of 480 by 340, scaled to the tablet) */
#panel .tb-desk, #panel .tb-shadow { left: 0; top: 0; width: 480px; height: 340px; opacity: 0; image-rendering: pixelated; pointer-events: none; -webkit-user-drag: none; }
#panel .tb-shadow { width: 500px; height: 370px; }

/* ---------- the screen: the status bar, the browser's toolbar, the page, its status line; the splash and the glass ---------- */
#panel .tb-scr { left: var(--B); top: var(--B); width: calc(100% - 2 * var(--B)); height: calc(100% - 2 * var(--B)); display: flex; flex-direction: column; overflow: clip; pointer-events: none; }
/* the status bar: clear where the HUD's bars sit (the holes; the bars bring their strip of black, #stage.tb-dock) */
#panel .tb-os { flex: none; height: var(--osH); display: flex; pointer-events: none; }
#panel .tb-hole { flex: none; }
#panel .tb-os-mid { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: calc(var(--sa) * 3); background: var(--os); box-shadow: 0 0 0 1px var(--os);
  color: #c7cad6; font-size: calc(var(--fu) * 6); line-height: 1; white-space: nowrap; pointer-events: auto; }
#panel .tb-wifi, #panel .tb-batt { flex: none; height: calc(var(--sa) * 6); background: url(../../art/areas/pawn/os.png) 0 0 / calc(var(--sa) * 22) calc(var(--sa) * 6); image-rendering: pixelated; }
#panel .tb-wifi { width: calc(var(--sa) * 9); }
#panel .tb-batt { width: calc(var(--sa) * 12); background-position: calc(var(--sa) * -10) 0; }
/* the toolbar: back, forward, reload, home, the address, the throbber, close */
#panel .tb-bar { flex: none; height: var(--tbH); display: flex; align-items: center; gap: var(--sa); padding: 0 calc(var(--sa) * 2); pointer-events: auto;
  background: var(--putty) url(../../art/areas/pawn/grain.png) 0 0 / calc(var(--sa) * 24) calc(var(--sa) * 24); image-rendering: pixelated;
  box-shadow: inset 0 var(--sw) 0 #f4efe2, inset 0 calc(var(--sw) * -1) 0 var(--putty-dk); }
#panel .tb .tb-btn { flex: none; width: calc(var(--tbH) - var(--sa)); height: calc(var(--tbH) - var(--sa)); display: grid; place-items: center; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer; }
#panel .tb .tb-btn:hover:not(:disabled) { box-shadow: inset var(--sw) var(--sw) 0 #fff, inset calc(var(--sw) * -1) calc(var(--sw) * -1) 0 var(--putty-dk); }
#panel .tb .tb-btn:active:not(:disabled) { box-shadow: inset var(--sw) var(--sw) 0 var(--putty-dk), inset calc(var(--sw) * -1) calc(var(--sw) * -1) 0 #fff; }
#panel .tb .tb-btn:active:not(:disabled) .tb-i { translate: 0 var(--sw); }
#panel .tb .tb-btn:disabled { cursor: default; }
#panel .tb-i { display: block; width: calc(var(--sa) * 9); height: calc(var(--sa) * 9); flex: none; background: url(../../art/areas/pawn/tb.png) 0 0 / calc(var(--sa) * 72) calc(var(--sa) * 9); image-rendering: pixelated; }
#panel .tb-i.i-back_off { background-position-x: calc(var(--sa) * -9); } #panel .tb-i.i-fwd { background-position-x: calc(var(--sa) * -18); }
#panel .tb-i.i-fwd_off { background-position-x: calc(var(--sa) * -27); } #panel .tb-i.i-reload { background-position-x: calc(var(--sa) * -36); }
#panel .tb-i.i-home { background-position-x: calc(var(--sa) * -45); } #panel .tb-i.i-close { background-position-x: calc(var(--sa) * -54); }
#panel .tb-i.i-globe { background-position-x: calc(var(--sa) * -63); }
#panel .tb-addr { flex: 1; min-width: 0; height: calc(var(--sa) * 7); display: flex; align-items: center; gap: var(--sa); padding: 0 var(--sa); margin: 0 var(--sa);
  background: var(--cream); border: var(--sw) solid; border-color: var(--putty-dk) #fff #fff var(--putty-dk); color: var(--ink); font-size: calc(var(--fu) * 6.5); line-height: 1; white-space: nowrap; overflow: hidden; }
#panel .tb-fav { flex: none; width: calc(var(--sa) * 5); height: calc(var(--sa) * 5); background: url(../../art/areas/pawn/fav.png) 0 0 / 100% 100%; image-rendering: pixelated; }
#panel .tb-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
#panel .tb-throb { flex: none; width: calc(var(--sa) * 9); height: calc(var(--sa) * 7); overflow: hidden; }
#panel .tb-throb i { display: block; width: 800%; height: 100%; background: url(../../art/areas/pawn/throbber.png) 0 0 / 100% 100%; image-rendering: pixelated; }
/* the page itself; a blank sheet covers it while it loads (it slides down off the page, pawn.js loadAnims) */
#panel .tb-view { flex: 1; min-height: 0; position: relative; overflow: clip; pointer-events: auto; } /* (clip: focus never scrolls the page) */
#panel .tb-cover { position: absolute; inset: 0; z-index: 9; background: var(--cream); transform: translateY(100%); pointer-events: none; }
/* the status line: what the pointer is over, or the page loading with its progress bar */
#panel .tb-st { flex: none; height: var(--stH); display: flex; align-items: center; gap: calc(var(--sa) * 2); padding: 0 calc(var(--sa) * 2); pointer-events: auto;
  background: var(--putty); box-shadow: inset 0 var(--sw) 0 var(--putty-dk); color: #3a3632; font-size: calc(var(--fu) * 6); line-height: 1; }
#panel .tb-st-txt { flex: 1; min-width: 0; position: relative; height: 100%; display: flex; align-items: center; }
#panel .tb-st-txt > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
#panel .tb-st-load { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; opacity: 0; background: var(--putty); }
#panel .tb-prog { flex: none; width: calc(var(--sa) * 30); height: calc(var(--sa) * 4); padding: var(--sw); background: var(--cream); box-shadow: inset 0 0 0 var(--sw) var(--putty-dk); opacity: 0; }
#panel .tb-prog i { display: block; height: 100%; background: var(--leaf-dk); transform-origin: 0 50%; }
#panel .tb-hits { flex: none; display: flex; align-items: center; gap: var(--sa); white-space: nowrap; }
#panel .tb-zone { flex: none; align-self: stretch; display: flex; align-items: center; gap: var(--sa); padding-left: calc(var(--sa) * 2); box-shadow: inset var(--sw) 0 0 var(--putty-dk); }
/* the globe at half size, in whole device pixels (--gp), to fit the status line */
#panel .tb-zone .tb-i { width: calc(var(--gp) * 9); height: calc(var(--gp) * 9); background-size: calc(var(--gp) * 72) calc(var(--gp) * 9); background-position-x: calc(var(--gp) * -63); }
/* the splash Gus's logo shows on as the screen wakes, and the dark glass over everything (lit at rest) */
#panel .tb-splash { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; opacity: 0; pointer-events: none;
  background: var(--wine-dk) url(../../art/areas/pawn/splash_tile.png) 0 0 / calc(var(--sa) * 12) calc(var(--sa) * 12); image-rendering: pixelated; }
#panel .tb-logo { display: block; width: calc(var(--sa) * 112); height: calc(var(--sa) * 18); max-width: 100%; background: url(../../art/areas/pawn/logo.png) 0 0 / 100% 100%; image-rendering: pixelated; }
#panel .tb-glass { position: absolute; inset: 0; z-index: 21; opacity: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 0 34%, rgba(255, 255, 255, 0.045) 34% 41%, transparent 41% 45%, rgba(255, 255, 255, 0.03) 45% 48%, transparent 48%), #0d1016; }
/* nothing behind the tablet takes a click while it comes or goes: its frame and screen catch them (the controls wait) */
#panel.area-pawn:is(.arriving, .opening) :is(.tb-bz, .tb-cam, .tb-stk, .tb-os-mid, .tb-bar, .tb-view, .tb-st) { pointer-events: auto !important; }

/* ---------- the HUD's bars in the tablet's status bar (pawn.js dock) ---------- */
#stage.tb-dock #hud > :is(#topbar, #sysbar) { translate: var(--tb-dx, 0) var(--tb-dy, 0); }
#hud > .tb-strip { position: absolute; background: #121318; pointer-events: auto; } /* the status bar's black under each bar */

/* ---------- the site ---------- */
#panel .tb .pw-site { position: absolute; inset: 0; overflow: clip; background: #24432f url(../../art/areas/pawn/bg_tile.png) 0 0 / calc(var(--sa) * 12) calc(var(--sa) * 12); image-rendering: pixelated;
  font-size: calc(var(--fu) * 7); line-height: 1.2; color: var(--ink); text-align: left; }
#panel .tb .pw-site * { image-rendering: auto; }
#panel .tb .pw-site :is(.cardpic img, .sl img, .pw-ico, .pw-neon, .pw-sign, .pw-snap, .pw-photo, .pw-lamp, .pw-digits i, .gus-sprite, .pw-cam, .ck, .pw-burst, .pw-tab, .pw-btn) { image-rendering: pixelated; }
#panel .tb .pw-site :is(.pw-nav, .pw-main, .pw-im) { position: absolute; }
#panel .tb .pw-lnk { color: var(--link); text-decoration: underline; text-decoration-thickness: max(1px, calc(var(--g) * 0.5)); text-underline-offset: calc(var(--g) * 1.2);
  cursor: pointer; background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0; font: inherit; display: inline-flex; align-items: center; gap: var(--g); }
#panel .tb .pw-lnk:hover { color: var(--wine); }
#panel .tb .pw-lnk.on { color: var(--ink); text-decoration: none; font-weight: 700; }
#panel .tb .pw-dim { color: var(--dim); }
#panel .tb .pw-theme { color: #b4561c; font-weight: 700; white-space: nowrap; }
#panel .tb .pw-pos { color: var(--pos); font-weight: 700; }
#panel .tb .pw-neg { color: var(--neg); font-weight: 700; }
.pw-ico { display: inline-block; width: calc(var(--a) * 7); height: calc(var(--a) * 7); flex: none; vertical-align: middle; font-style: normal;
  background: url(../../art/areas/pawn/icons.png) 0 0 / calc(var(--a) * 128) calc(var(--a) * 7); image-rendering: pixelated; }
.pw-ico.i-tag { background-position-x: 0; } .pw-ico.i-offer { background-position-x: calc(var(--a) * -8); } .pw-ico.i-accept { background-position-x: calc(var(--a) * -16); }
.pw-ico.i-walk { background-position-x: calc(var(--a) * -24); } .pw-ico.i-loupe { background-position-x: calc(var(--a) * -32); } .pw-ico.i-box { background-position-x: calc(var(--a) * -40); }
.pw-ico.i-swap { background-position-x: calc(var(--a) * -48); } .pw-ico.i-pin { background-position-x: calc(var(--a) * -56); } .pw-ico.i-chat { background-position-x: calc(var(--a) * -64); }
.pw-ico.i-coin { background-position-x: calc(var(--a) * -72); } .pw-ico.i-prev { background-position-x: calc(var(--a) * -80); } .pw-ico.i-next { background-position-x: calc(var(--a) * -88); }
.pw-ico.i-online { background-position-x: calc(var(--a) * -96); } .pw-ico.i-mail { background-position-x: calc(var(--a) * -104); } .pw-ico.i-slab { background-position-x: calc(var(--a) * -112); }
.pw-ico.i-warn { background-position-x: calc(var(--a) * -120); }

/* the banner: Gus's sign, the neon OPEN sign (it blinks now and then), wall lamps and a snapshot of the shop */
#panel .tb .pw-banner { position: absolute; left: 0; top: 0; right: 0; height: var(--bnH); background: url(../../art/areas/pawn/banner_tile.png) 0 0 / calc(var(--sa) * 24) calc(var(--sa) * 18) repeat-x; }
#panel .tb .pw-banner > * { position: absolute; display: block; }
#panel .tb .pw-sign { left: 0; top: 0; width: calc(var(--sa) * 115); height: calc(var(--sa) * 18); background: url(../../art/areas/pawn/sign.png) 0 0 / 100% 100%; }
#panel .tb .pw-neon { top: calc(var(--sa) * 4); width: calc(var(--sa) * 24); height: calc(var(--sa) * 10); background: url(../../art/areas/pawn/neon.png) 0 0 / 200% 100%;
  animation: pwNeon 7s steps(1) calc(var(--ph, 0) * -1s) infinite; }
@keyframes pwNeon { 0%, 61%, 63%, 64%, 100% { background-position: 0 0; } 62%, 63.5% { background-position: 100% 0; } }
#panel .tb .pw-lamp { top: calc(var(--sa) * 2); width: calc(var(--sa) * 5); height: calc(var(--sa) * 6); background: url(../../art/areas/pawn/lamp.png) 0 0 / 100% 100%; }
#panel .tb .pw-snap { right: calc(var(--sa) * 8); top: 0; z-index: 1; width: calc(var(--sa) * 31); height: calc(var(--sa) * 19); background: url(../../art/areas/pawn/snap.png) 0 0 / 100% 100%; }
#panel .tb .pw-photo { position: absolute; left: var(--sa); top: calc(var(--sa) * 3); width: calc(var(--sa) * 28); height: calc(var(--sa) * 12); background: url(../../art/areas/pawn/photo.png) 0 0 / 100% 100%; }

/* the nav bar: tabs that join the page under them */
#panel .tb .pw-nav { display: flex; align-items: flex-end; gap: var(--a); padding-left: calc(var(--a) * 2); z-index: 3; overflow: clip; overflow-clip-margin: var(--a); } /* the tab on show joins the page below */
#panel .tb .pw-tab { flex: 0 1 auto; min-width: 0; height: calc(100% - var(--a) * 2); margin: 0; padding: var(--g) calc(var(--a) * 3) 0; display: flex; align-items: center; gap: calc(var(--g) * 2);
  border-style: solid; border-color: transparent; border-width: calc(var(--a) * 2) calc(var(--a) * 2) 0; border-radius: 0; box-shadow: none;
  border-image: url(../../art/areas/pawn/tab.png) 2 2 0 2 fill / calc(var(--a) * 2) calc(var(--a) * 2) 0 / 0 stretch;
  background: none; color: var(--ink); font-size: calc(var(--fu) * 7); font-weight: 700; line-height: 1; cursor: pointer; white-space: nowrap; overflow: hidden; }
/* a short screen: Gus's sign at half size heads the nav bar */
#panel .tb .pw-nav .pw-sign { position: static; flex: none; align-self: center; width: calc(var(--gp) * 115); height: calc(var(--gp) * 18); margin: 0 calc(var(--a) * 2) 0 0;
  background: url(../../art/areas/pawn/sign.png) 0 0 / 100% 100%; }
#panel .tb .pw-tab:hover { filter: brightness(1.06); }
#panel .tb .pw-tab.on { height: calc(100% + var(--a)); margin-bottom: calc(var(--a) * -1); border-image-source: url(../../art/areas/pawn/tab_on.png); cursor: default; }
#panel .tb .pw-tab .n { font-weight: 400; color: var(--wine-dk); }

/* the page: plain paper with an ink edge */
#panel .tb .pw-main { z-index: 2; background: var(--paper); box-shadow: 0 0 0 var(--a) var(--ink); display: flex; flex-direction: column; padding: calc(var(--g) * 3); gap: calc(var(--g) * 2); }
#panel .tb .pw-hbar { display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: calc(var(--g) * 2) calc(var(--g) * 4); min-height: var(--hb); flex: none; position: relative; z-index: 5; white-space: nowrap; }
#panel .tb .pw-hbar .grow { flex: 1; min-width: 0; }
#panel .tb .pw-hbar .shrink { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#panel .tb .pw-h { margin: 0; font-size: calc(var(--fu) * 8); font-weight: 700; line-height: 1; color: var(--wine); text-shadow: none; }
#panel .tb .pw-seg { display: flex; gap: calc(var(--g) * 3); align-items: baseline; flex: none; }
#panel .tb .pw-seg .pw-lnk.on::before { content: ''; display: inline-block; width: calc(var(--g) * 3); height: calc(var(--g) * 3); background: var(--wine); margin-right: var(--g); vertical-align: middle; }

/* the finder (finder.js draws it): a period form, a text box and two bevelled buttons */
#panel .tb .pw-site .finder { flex: 0 1 auto; min-width: 0; gap: calc(var(--g) * 2); font-size: calc(var(--fu) * 6.5); text-shadow: none; color: var(--ink); z-index: auto; position: static; }
#panel .tb .pw-site .f-search { flex: 0 1 calc(var(--g) * 64); min-width: calc(var(--g) * 30); height: calc(var(--g) * 13); padding: 0 calc(var(--g) * 2); gap: calc(var(--g) * 2); background: var(--cream);
  border: var(--g) solid; border-color: var(--putty-dk) #fff #fff var(--putty-dk); border-radius: 0; box-shadow: none; }
#panel .tb .pw-site .f-search:focus-within { box-shadow: 0 0 0 var(--g) var(--link); }
#panel .tb .pw-site .f-search input { width: 100%; min-width: 0; font-family: var(--font-ui); font-size: calc(var(--fu) * 6.5); line-height: 1; color: var(--ink); }
#panel .tb .pw-site .f-search input::placeholder { color: #8a8170; }
#panel .tb .pw-site .f-mag { width: calc(var(--g) * 4.5); height: calc(var(--g) * 4.5); border-width: var(--g); margin: 0 var(--g) var(--g) 0; }
#panel .tb .pw-site .f-btn { height: calc(var(--g) * 13); padding: 0 calc(var(--g) * 3); gap: calc(var(--g) * 1.5); font-family: var(--font-ui); font-size: calc(var(--fu) * 6.5); font-weight: 700; line-height: 1;
  color: var(--ink); text-shadow: none; background: var(--putty-lt); border: var(--g) solid; border-color: #fff var(--putty-dk) var(--putty-dk) #fff; border-radius: 0; }
#panel .tb .pw-site .f-btn:hover { background: #f6f1e4; }
#panel .tb .pw-site .f-btn.open, #panel .tb .pw-site .f-btn:active { border-color: var(--putty-dk) #fff #fff var(--putty-dk); background: var(--putty); }
#panel .tb .pw-site .f-btn.on { background: #fff1b8; }
#panel .tb .pw-site .f-btn b { background: var(--wine); color: #fff6ec; border-radius: 0; padding: 0 var(--g); font-size: calc(var(--fu) * 6); }
#panel .tb .pw-site .f-dir { min-width: calc(var(--g) * 11); padding: 0 calc(var(--g) * 1.5); }
#panel .tb .pw-site .f-count { font-size: calc(var(--fu) * 6); color: var(--dim); opacity: 1; }
#panel .tb .pw-site .f-count.on { color: var(--wine); }
/* its menus drop over the page as a paper sheet */
#panel .tb .pw-site .f-pop { top: calc(var(--hb) + var(--g) * 2); left: 0; right: 0; width: auto; max-height: calc(var(--main-h, 100%) - var(--hb)); overflow: auto; gap: calc(var(--g) * 3); padding: calc(var(--g) * 4);
  color: var(--ink); text-shadow: none; background: var(--cream); border: var(--g) solid var(--ink); border-radius: 0; box-shadow: calc(var(--a) * 2) calc(var(--a) * 2) 0 rgba(20, 16, 12, 0.35); animation: none; }
#panel .tb .pw-site .f-pop-sort { left: auto; width: min(100%, calc(var(--g) * 130)); }
#panel .tb .pw-site .f-row { gap: calc(var(--g) * 3); }
#panel .tb .pw-site .f-lbl { flex-basis: calc(var(--g) * 30); padding-top: var(--g); font-size: calc(var(--fu) * 6); color: var(--wine-dk); }
#panel .tb .pw-site .f-chips { gap: calc(var(--g) * 1.5) calc(var(--g) * 2); }
#panel .tb .pw-site .chip { line-height: calc(var(--g) * 9.5); padding: 0 calc(var(--g) * 2.5); font-size: calc(var(--fu) * 6); text-shadow: none; color: var(--ink);
  background: var(--putty-lt); border: var(--g) solid var(--putty-dk); border-radius: 0; }
#panel .tb .pw-site .chip:hover { background: #fff6d0; }
#panel .tb .pw-site .chip.on { background: #fff1b8; border-color: var(--ink); }
#panel .tb .pw-site .chip em { color: var(--dim); opacity: 1; }
#panel .tb .pw-site .chip.wide { border-radius: 0; }
#panel .tb .pw-site .f-foot { padding-top: calc(var(--g) * 2); border-top: var(--g) dotted var(--putty-dk); }
#panel .tb .pw-site .f-foot > span, #panel .tb .pw-site .f-foot .mini { font-size: calc(var(--fu) * 6); }

/* the pager: Page 1 of 3 between two arrows */
#panel .tb .pw-pager { display: flex; align-items: center; gap: calc(var(--g) * 2); font-size: calc(var(--fu) * 6.5); flex: none; }
#panel .tb .pw-pager .pg-btn { width: calc(var(--a) * 7); height: calc(var(--a) * 7); margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; display: grid; place-items: center; cursor: pointer; }
#panel .tb .pw-pager .pg-btn:disabled { opacity: 0.3; cursor: default; }
#panel .tb .pw-pager .pg-btn:active:not(:disabled) { transform: translateY(var(--g)); }

/* bevelled buttons: 8×8 skins as border images (slice 2); the labels are DOM */
.pw-btn { --skin: url(../../art/areas/pawn/btn_paper.png); --skin-dn: url(../../art/areas/pawn/btn_paper_dn.png);
  display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--g) * 2); min-height: calc(var(--a) * 9); margin: 0; padding: 0 calc(var(--g) * 3);
  border: calc(var(--a) * 2) solid transparent; border-image: var(--skin) 2 fill / calc(var(--a) * 2) stretch; border-radius: 0; image-rendering: pixelated;
  background: none; box-shadow: none; color: var(--ink); text-shadow: none; font-family: var(--font-ui); font-size: calc(var(--fu) * 7); font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer; }
.pw-btn:active:not(:disabled) { border-image-source: var(--skin-dn); padding-top: var(--g); }
.pw-btn.green { --skin: url(../../art/areas/pawn/btn_green.png); --skin-dn: url(../../art/areas/pawn/btn_green_dn.png); }
.pw-btn.gold { --skin: url(../../art/areas/pawn/btn_gold.png); --skin-dn: url(../../art/areas/pawn/btn_gold_dn.png); }
.pw-btn.wine { --skin: url(../../art/areas/pawn/btn_wine.png); --skin-dn: url(../../art/areas/pawn/btn_wine_dn.png); color: #fff6ec; }
.pw-btn:disabled, .pw-btn.poor { --skin: url(../../art/areas/pawn/btn_off.png); --skin-dn: url(../../art/areas/pawn/btn_off.png); color: #7a746a; }
.pw-btn:disabled { cursor: default; }
.pw-btn.wide { width: 100%; }
/* one picked card can sell at once beside the offer button, in the same line of the chat */
#panel .tb .pw-sale { display: flex; gap: calc(var(--g) * 2); }
#panel .tb .pw-sale .pw-btn { flex: 1; min-width: 0; font-size: calc(var(--fu) * 7 * var(--fit, 1)); }
.pw-btn .pw-ico { margin-left: calc(var(--g) * -1); }

/* card pictures (ui.thumb's card art) and slabs from the vault, at the sizes the scene works out (whole device pixels) */
#panel .tb .pw-site .cardpic { display: block; width: 100%; height: 100%; border-radius: 0; overflow: visible; box-shadow: none; }
#panel .tb .pw-site .cardpic .card-img { display: block; width: 100%; height: 100%; }
#panel .tb .pw-slab.sl-box { display: block; height: var(--slab-h); width: var(--slab-w); margin: 0 auto; }

/* your items: tiles of a picture with a tick box, its copies and its finish, its name and an estimate */
#panel .tb .pw-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), auto); align-content: space-evenly;
  gap: calc(var(--g) * 2) calc(var(--g) * 3); }
#panel .tb .pw-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--g); min-width: 0; margin: 0; padding: calc(var(--g) * 1.5) 0 var(--g);
  background: none; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; color: inherit; font: inherit; text-shadow: none; }
#panel .tb .pw-item:hover { background: rgba(255, 214, 107, 0.28); }
#panel .tb .pw-item .ph { position: relative; height: var(--pic-h); width: var(--pic-w); flex: none; display: flex; align-items: flex-end; }
#panel .tb .pw-item.is-slab .ph { width: var(--slab-w); }
#panel .tb .pw-item .ck { position: absolute; right: calc(var(--g) * -5); top: calc(var(--g) * -3); width: calc(var(--a) * 5); height: calc(var(--a) * 5); z-index: 2;
  background: url(../../art/areas/pawn/checks.png) 0 0 / 200% 100%; }
#panel .tb .pw-item.ticked .ck { background-position: 100% 0; }
/* a slab prints its grade at the top right, so its tick box sits at the bottom right */
#panel .tb .pw-item.is-slab .ck { top: auto; bottom: calc(var(--g) * -3); }
#panel .tb .pw-item.all { cursor: default; }
#panel .tb .pw-item.all .ph > :is(.cardpic, .pw-slab) { opacity: 0.45; }
#panel .tb .pw-item.all:hover { background: none; }
#panel .tb .pw-item .qty { position: absolute; right: calc(var(--g) * -3); bottom: calc(var(--g) * -2); z-index: 2; padding: 0 calc(var(--g) * 2); background: var(--ink); color: #f5fdf0;
  font-size: calc(var(--fu) * 6); font-weight: 700; line-height: 1.25; border-radius: calc(var(--g) * 2); }
.pw-fxc { position: absolute; left: calc(var(--g) * -3); bottom: calc(var(--g) * 5); z-index: 2; padding: 0 calc(var(--g) * 1.5); font-family: var(--font-ui); font-size: calc(var(--fu) * 5.5); font-weight: 700; line-height: 1.25;
  font-style: normal; color: var(--ink); background: var(--fc); border: var(--g) solid var(--ink); border-radius: calc(var(--g) * 2); white-space: nowrap; }
#panel .tb .pw-item .pw-nm { max-width: 100%; display: flex; align-items: center; gap: var(--g); font-size: calc(var(--fu) * 6.5); line-height: 1.15; color: var(--link);
  text-decoration: underline; text-underline-offset: var(--g); white-space: nowrap; overflow: hidden; }
#panel .tb .pw-item .pw-nm span { overflow: hidden; text-overflow: ellipsis; }
#panel .tb .pw-item .est { font-size: calc(var(--fu) * 6 * var(--fit, 1)); line-height: 1.25; color: var(--ink); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: clip; } /* (a sliver over would show an ellipsis; fitText steps down past a pixel) */
/* the rarity pip (--rc, --rk: the rarity's colours, set from config.js): a circle for Commons and Uncommons, a diamond
   for Rares and Super Rares, a ringed diamond for Ultra Rares and up, a Grail's in every colour */
#panel .tb .pw-site .pip { flex: none; width: calc(var(--g) * 4); height: calc(var(--g) * 4); border: var(--g) solid var(--ink); border-radius: 50%; background: var(--rc, #c8c8bc); }
#panel .tb .pw-site .pip:is(.r-rare, .r-super, .r-ultra, .r-secret, .r-grail) { border-radius: 0; transform: rotate(45deg) scale(0.85); }
#panel .tb .pw-site .pip:is(.r-ultra, .r-secret, .r-grail) { box-shadow: 0 0 0 calc(var(--g) * 0.5) var(--rk); }
#panel .tb .pw-site .pip.r-grail { background: conic-gradient(#ff6b7a, #ffd66b, #99ff6d, #6dd6ff, #c58bff, #ff6b7a); }
#panel .tb .pw-empty { flex: 1; display: grid; place-content: center; text-align: center; gap: calc(var(--g) * 3); color: var(--dim); font-size: calc(var(--fu) * 7); }
#panel .tb .pw-empty b { color: var(--ink); font-size: calc(var(--fu) * 8); }

/* the deal: your lot laid out large, and how Gus haggles */
#panel .tb .pw-lotbig { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), auto); justify-content: center; align-content: center; gap: calc(var(--g) * 4) calc(var(--g) * 5); }
#panel .tb .pw-lotbig figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--g); min-width: 0; max-width: calc(var(--pic-w) + var(--g) * 16); }
#panel .tb .pw-lotbig figure > .cardpic { height: var(--pic-h); width: var(--pic-w); flex: none; }
#panel .tb .pw-lotbig figure > .pw-slab { margin-top: calc(var(--pic-h) - var(--slab-h)); }
#panel .tb .pw-lotbig figcaption { font-size: calc(var(--fu) * 6.5); text-align: center; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel .tb .pw-note { margin: 0; font-size: calc(var(--fu) * 6.5 * var(--fit, 1)); line-height: 1.25; color: #4a443b; flex: none; overflow: hidden; }
#panel .tb .pw-note b { color: var(--ink); }

/* Gus's case: a gallery of listings and the one you are looking at (beside them, or over them on a narrow page) */
#panel .tb .pw-case { flex: 1; min-height: 0; display: flex; gap: calc(var(--g) * 5); }
#panel .tb .pw-case.row { flex-direction: column; gap: calc(var(--g) * 3); }
#panel .tb .pw-gal { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), auto); align-content: space-evenly; gap: calc(var(--g) * 2); }
#panel .tb .pw-lst { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--g); margin: 0; padding: calc(var(--g) * 2) 0 var(--g); min-width: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; font: inherit; color: inherit; text-shadow: none; }
#panel .tb .pw-lst:hover { background: rgba(255, 214, 107, 0.28); }
#panel .tb .pw-lst.on { background: #fff6d0; box-shadow: inset 0 0 0 var(--g) #c48a2a; }
#panel .tb .pw-lst .pic { position: relative; display: block; height: var(--pic-h); width: var(--pic-w); flex: none; }
#panel .tb .pw-lst .pr { font-size: calc(var(--fu) * 6.5); font-weight: 700; line-height: 1; white-space: nowrap; }
#panel .tb .pw-newtag { position: absolute; left: calc(var(--g) * -2); top: calc(var(--g) * -2); z-index: 2; padding: calc(var(--g) * 0.5) calc(var(--g) * 1.5) 0; background: #c8323f; color: #fff6ec;
  font-size: calc(var(--g) * 5); font-weight: 700; line-height: 1.1; font-style: normal; box-shadow: 0 0 0 var(--g) var(--ink); pointer-events: none; letter-spacing: 0.04em; }
#panel .tb .pw-burst { position: absolute; right: calc(var(--bx, calc(var(--a) * 9)) * -1); top: calc(var(--a) * -4); z-index: 2; width: calc(var(--a) * 17); height: calc(var(--a) * 9); display: grid; place-items: center;
  background: url(../../art/areas/pawn/burst.png) 0 0 / 100% 100%; font-size: calc(var(--g) * 6); font-weight: 700; line-height: 1; font-style: normal; color: #b02a3a;
  padding-top: calc(var(--g) * 0.5); animation: pwBurst 1.2s steps(1) infinite; pointer-events: none; }
@keyframes pwBurst { 50% { transform: rotate(-8deg); } }
#panel .tb .pw-detail { flex: none; display: flex; flex-direction: column; align-items: center; gap: calc(var(--g) * 1.5); text-align: center; min-width: 0; min-height: 0;
  background: var(--cream); box-shadow: inset 0 0 0 var(--g) var(--putty-dk); padding: calc(var(--g) * 4) calc(var(--g) * 3); }
#panel .tb .pw-detail.row { flex-direction: row; align-items: center; text-align: left; gap: calc(var(--g) * 5); padding: calc(var(--g) * 3) calc(var(--g) * 4); }
#panel .tb .pw-detail .pic { position: relative; display: block; height: var(--pic-h); width: var(--pic-w); flex: none; }
#panel .tb .pw-dtxt { display: flex; flex-direction: column; align-items: inherit; gap: calc(var(--g) * 1.5); min-width: 0; max-width: 100%; }
#panel .tb .pw-detail .nm2 { flex: none; font-size: calc(var(--fu) * 8); font-weight: 700; line-height: 1.35; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel .tb .pw-detail .pw-sub { font-size: calc(var(--fu) * 6.5); line-height: 1.15; }
.pw-chip { display: inline-block; padding: 0 calc(var(--g) * 2); border: var(--g) solid var(--ink); border-radius: calc(var(--g) * 2); background: var(--fc, #eee); font-weight: 700; font-size: 0.92em; color: var(--ink); }

/* the feedback page: his stars, the ladder, your record */
/* the Feedback page's print and spacing grow by --k on a large page (the scene's after(): as large as still fits) */
#panel .tb .pw-main.pg-fb { --g: calc(var(--sw) * var(--k, 1)); --fu: calc(var(--sw) * var(--fs) * var(--k, 1)); }
#panel .tb .pw-fb-top { display: flex; align-items: center; gap: calc(var(--g) * 6); flex: none; flex-wrap: wrap; }
#panel .tb :is(.pw-bigstars, .pw-stars) { display: flex; flex: none; }
#panel .tb :is(.pw-bigstars, .pw-stars) i { display: block; background: url(../../art/areas/pawn/stars.png) 0 0 / 300% 100%; image-rendering: pixelated; }
#panel .tb .pw-bigstars i { width: calc(var(--a) * 11); height: calc(var(--a) * 11); margin-right: calc(var(--a) * -1); }
#panel .tb .pw-stars i { width: calc(var(--a) * 7); height: calc(var(--a) * 7); margin-right: calc(var(--a) * -1); background-image: url(../../art/areas/pawn/stars_s.png); }
#panel .tb :is(.pw-bigstars, .pw-stars) i:last-child { margin-right: 0; }
#panel .tb :is(.pw-bigstars, .pw-stars) i.pw-half { background-position: 50% 0; }
#panel .tb :is(.pw-bigstars, .pw-stars) i.pw-none { background-position: 100% 0; }
#panel .tb .pw-fb-top .lvl { flex: 1; display: flex; flex-direction: column; gap: calc(var(--g) * 2); font-size: calc(var(--fu) * 6.5); min-width: calc(var(--g) * 120); }
#panel .tb .pw-fb-top .lvl b { font-size: calc(var(--fu) * 8); text-wrap: balance; }
#panel .tb .pw-meter { display: block; width: min(100%, calc(var(--g) * 160)); height: calc(var(--g) * 6); background: var(--cream); box-shadow: inset 0 0 0 var(--g) var(--ink); padding: var(--g); }
#panel .tb .pw-meter i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--leaf) 0 calc(var(--g) * 4), var(--leaf-dk) 0 calc(var(--g) * 5)); }
#panel .tb .pw-ladder { border-collapse: collapse; width: 100%; margin: auto 0; font-size: calc(var(--fu) * 6.5); line-height: 1.2; }
#panel .tb .pw-ladder th { text-align: left; font-weight: 700; color: var(--wine-dk); border-bottom: var(--g) solid var(--ink); padding: 0 calc(var(--g) * 3) var(--g); }
#panel .tb .pw-ladder td { padding: calc(var(--g) * 0.5) calc(var(--g) * 3); border-bottom: calc(var(--g) * 0.5) dotted var(--putty-dk); }
#panel .tb .pw-ladder tr.now td { background: #fff1b8; font-weight: 700; }
#panel .tb .pw-ladder tr.next td { background: #e2f2d6; }
#panel .tb .pw-ladder td:first-child { white-space: nowrap; }
#panel .tb .pw-record { display: grid; grid-template-columns: repeat(var(--rec), minmax(0, 1fr)); gap: calc(var(--g) * 3); flex: none; }
#panel .tb .pw-record span { display: flex; flex-direction: column; align-items: center; gap: var(--g); padding: calc(var(--g) * 2) var(--g); background: var(--cream);
  box-shadow: inset 0 0 0 var(--g) var(--putty-dk); font-size: calc(var(--fu) * 6); color: var(--dim); white-space: nowrap; min-width: 0; overflow: hidden; }
#panel .tb .pw-record b { font-size: calc(var(--fu) * 8.5); font-weight: 700; line-height: 1; color: var(--ink); }

/* the page asleep (drawn ahead under the desk, or in the air): its styles and layout wait until it shows */
#panel .tb.asleep .tb-view { content-visibility: hidden; }

/* the want list: a slip per rarity Gus finds (the card you asked for, or an empty frame) and what he is doing about it */
#panel .tb .pw-wants { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: calc(var(--g) * 4); }
#panel .tb .pw-want { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--cream); box-shadow: inset 0 0 0 var(--g) var(--putty-dk); }
#panel .tb .pw-want.found { background: #eef6e2; box-shadow: inset 0 0 0 var(--g) var(--leaf-dk); }
#panel .tb .pw-wh { flex: none; display: flex; align-items: center; gap: calc(var(--g) * 2); padding: calc(var(--g) * 2) calc(var(--g) * 3) calc(var(--g) * 1.5); margin: 0 var(--g);
  border-bottom: var(--g) dotted var(--putty-dk); font-size: calc(var(--fu) * 7); line-height: 1.1; white-space: nowrap; overflow: hidden; }
#panel .tb .pw-wh b { color: var(--wine); }
#panel .tb .pw-wh .pw-dim { margin-left: auto; font-size: calc(var(--fu) * 6); line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#panel .tb .pw-wb { flex: 1; min-height: 0; display: flex; align-items: center; gap: calc(var(--g) * 5); padding: calc(var(--g) * 3) calc(var(--g) * 4); }
#panel .tb .pw-wb .pic { position: relative; flex: none; display: block; height: var(--pic-h); width: var(--pic-w); }
#panel .tb .pw-wq { display: grid; place-items: center; width: 100%; height: 100%; border: var(--g) dashed var(--putty-dk); background: rgba(255, 255, 255, 0.45);
  color: var(--putty-dk); font-size: min(calc(var(--fu) * 20), calc(var(--pic-h) * 0.4)); font-style: normal; font-weight: 700; line-height: 1; }
#panel .tb .pw-wt { flex: 1; min-width: 0; max-height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--g) * 2); overflow: hidden; }
#panel .tb .pw-wt .nm2 { max-width: 100%; font-size: calc(var(--fu) * 8 * var(--fit, 1)); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
#panel .tb .pw-wt .pw-sub { font-size: calc(var(--fu) * 6.5 * var(--fit, 1)); line-height: 1.2; }
#panel .tb .pw-wt .pw-wm { flex: none; display: flex; align-items: center; gap: calc(var(--g) * 3); width: min(100%, calc(var(--g) * 160)); }
#panel .tb .pw-wt .pw-wm .pw-meter { flex: 1; min-width: 0; }
#panel .tb .pw-wt .pw-wm .pw-sub { flex: none; color: var(--dim); white-space: nowrap; }
#panel .tb .pw-wt .pw-row { justify-content: flex-start; font-size: calc(var(--fu) * 6.5 * var(--fit, 1)); }
#panel .tb .pw-newtag.pw-fortag { background: var(--leaf-dk); }
#panel .tb .pw-newtag.pw-wanttag { background: var(--slate); }
#panel .tb .pw-newtag.pw-hottag { background: #d9822b; }
/* Gus's hot list: a row across the want slips, its cards side by side */
/* its forms (fitHunt): pictures, one line a card (.hc on the page, .compact on the list), or folded away */
#panel .tb .pw-wants.hunting { grid-template-rows: repeat(var(--rows), minmax(0, 1fr)) auto; --pic-h: var(--pic-hu); --pic-w: var(--pic-wu); }
#panel .tb .pw-wants.hunting.hc { --pic-h: var(--pic-hc); --pic-w: var(--pic-wc); }
#panel .tb .pw-wants.hunting.folded { grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); --pic-h: var(--pic-hf); --pic-w: var(--pic-wf); }
#panel .tb .pw-wants.folded .pw-hunt { display: none; }
#panel .tb .pw-want.pw-hunt { grid-column: 1 / -1; background: #fbf1d8; overflow: hidden; height: var(--hh); }
#panel .tb .pw-wants.hc .pw-hunt, #panel .tb .pw-hunt.compact { height: var(--hhc); }
#panel .tb .pw-hb { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: calc(var(--g) * 4); align-items: center; padding: calc(var(--g) * 1.5) calc(var(--g) * 4) calc(var(--g) * 2); }
#panel .tb .pw-hf { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: var(--g); padding: var(--g) 0; background: none; border: 0; font: inherit; color: inherit; }
#panel .tb button.pw-hf { cursor: pointer; }
#panel .tb button.pw-hf:hover { background: rgba(255, 214, 107, 0.28); }
#panel .tb .pw-hf .pic { position: relative; display: block; height: var(--pic-h); width: var(--pic-w); }
#panel .tb .pw-hf.sold .pic > :first-child { opacity: 0.55; }
#panel .tb .pw-ht { min-width: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--g); }
#panel .tb .pw-hb.side .pw-hf { flex-direction: row; justify-content: center; gap: calc(var(--g) * 3); }
#panel .tb .pw-hb.side .pw-ht { align-items: flex-start; }
#panel .tb .pw-hn { display: flex; align-items: center; justify-content: center; gap: var(--g); max-width: 100%; font-size: calc(var(--fu) * 6.5); font-weight: 700; line-height: 1.2; }
#panel .tb .pw-hn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel .tb .pw-hf .pw-sub { max-width: 100%; font-size: calc(var(--fu) * 6); line-height: 1.2; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .tb .pw-short { display: none; flex: none; margin-left: var(--g); color: var(--dim); }
#panel .tb .pw-wants.hc .pw-hunt .pic, #panel .tb .pw-hunt.compact .pic, #panel .tb .pw-wants.hc .pw-ht > .pw-sub, #panel .tb .pw-hunt.compact .pw-ht > .pw-sub { display: none; }
#panel .tb .pw-wants.hc .pw-short, #panel .tb .pw-hunt.compact .pw-short { display: inline; }
#panel .tb .pw-wants.hc .pw-hf, #panel .tb .pw-hunt.compact .pw-hf { padding: 0; }

/* the chat window: Gus on his webcam, who he is and his mood, what he says, and your choices. Beside the page (col) the
   webcam sits over his line; across the page's foot the choices take the right (row), or the foot below (stack). */
#panel .tb .pw-im { z-index: 2; display: flex; flex-direction: column; background: var(--paper); box-shadow: 0 0 0 var(--a) var(--ink), calc(var(--a) * 2) calc(var(--a) * 2) 0 rgba(20, 16, 12, 0.45); }
#panel .tb .pw-imbar { flex: none; height: calc(var(--a) * 8); display: flex; align-items: center; gap: calc(var(--g) * 2); padding: 0 calc(var(--g) * 2);
  background: linear-gradient(var(--wine-lt) 0 var(--a), var(--wine) var(--a) calc(100% - var(--a)), var(--wine-dk) 0); color: #fff6ec;
  font-size: calc(var(--fu) * 6.5); font-weight: 700; line-height: 1; white-space: nowrap; overflow: hidden; }
#panel .tb .pw-imbar .pw-ico { margin: calc(var(--g) * -1) 0; }
#panel .tb .pw-imbody { flex: 1; min-height: 0; display: grid; gap: calc(var(--a) * 2); padding: calc(var(--a) * 2); }
#panel .tb .pw-im.col .pw-imbody { grid-template: "cam who" var(--cam) "line line" minmax(0, 1fr) "act act" auto / var(--cam) minmax(0, 1fr); }
#panel .tb .pw-im.row .pw-imbody { grid-template: "cam who act" auto "cam line act" minmax(0, 1fr) / var(--cam) minmax(0, 1fr) var(--aw); }
#panel .tb .pw-im.stack .pw-imbody { grid-template: "cam who" auto "cam line" minmax(0, 1fr) "act act" auto / var(--cam) minmax(0, 1fr); }
#panel .tb .pw-cam { grid-area: cam; position: relative; width: var(--cam); height: var(--cam); overflow: hidden; box-shadow: 0 0 0 var(--a) var(--ink);
  background: url(../../art/areas/pawn/cam_bg.png) 0 0 / 100% 100%; }
#panel .tb .pw-cam .live { position: absolute; left: calc(var(--g) * 2); top: calc(var(--g) * 2); z-index: 2; display: flex; align-items: center; gap: var(--g);
  font-size: calc(var(--fu) * 5); font-weight: 700; line-height: 1; color: #fff; background: rgba(20, 16, 12, 0.55); padding: var(--g) calc(var(--g) * 1.5); }
#panel .tb .pw-cam .live::before { content: ''; width: calc(var(--g) * 3); height: calc(var(--g) * 3); border-radius: 50%; background: #f16373; animation: pwRec 1.2s steps(1) calc(var(--ph, 0) * -1s) infinite; }
@keyframes pwRec { 50% { opacity: 0.2; } }
#panel .tb .pw-cam .scan { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: repeating-linear-gradient(transparent 0 var(--a), rgba(255, 255, 255, 0.04) var(--a) calc(var(--a) * 2)); }
/* Gus's pose strips (css/scenes.css .gus-sprite): one frame fills the webcam, one picture pixel a whole number of device pixels */
#panel .tb .pw-cam .gus { position: absolute; inset: 0; --s: var(--cg, var(--gp)); pointer-events: none; }
#panel .tb .pw-who { grid-area: who; display: flex; flex-direction: column; justify-content: center; gap: var(--g); min-width: 0; }
#panel .tb .pw-im.col .pw-who { justify-content: flex-start; padding-top: var(--g); }
#panel .tb .pw-who .who { display: flex; align-items: center; flex-wrap: wrap; gap: calc(var(--g) * 1.5); font-size: calc(var(--fu) * 7); font-weight: 700; line-height: 1; }
#panel .tb .pw-who .dot { width: calc(var(--g) * 3); height: calc(var(--g) * 3); border-radius: 50%; background: #3fbf6a; box-shadow: 0 0 0 var(--g) var(--ink); flex: none; }
#panel .tb .pw-who .mood { font-size: calc(var(--fu) * 5.5); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
#panel .tb .pw-line { grid-area: line; position: relative; min-height: 0; margin: 0; overflow: hidden; font-size: calc(var(--fu) * 6.5); line-height: 1.22; cursor: pointer; pointer-events: auto; }
#panel .tb .pw-line .fx-more { color: var(--wine); }
#panel .tb .pw-act { grid-area: act; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--g) * 2); justify-content: flex-end; font-size: calc(var(--fu) * 6.5); }
#panel .tb .pw-row { display: flex; align-items: center; flex-wrap: wrap; gap: calc(var(--g) * 2) calc(var(--g) * 3); justify-content: space-between; }
#panel .tb .pw-lbl { font-size: calc(var(--fu) * 6); color: var(--dim); }
#panel .tb .pw-lot { display: grid; grid-template-columns: repeat(6, var(--pic-w)); justify-content: space-between; }
#panel .tb .pw-slot { position: relative; display: block; width: var(--pic-w); height: var(--pic-h); margin: 0; padding: 0; background: rgba(255, 255, 255, 0.35); border: var(--g) dashed var(--putty-dk);
  border-radius: 0; box-shadow: none; cursor: default; }
#panel .tb .pw-slot.full { border: 0; background: none; cursor: pointer; }
#panel .tb .pw-slot.full:hover::after { content: '\00d7'; position: absolute; right: calc(var(--g) * -2); top: calc(var(--g) * -3); width: calc(var(--g) * 8); height: calc(var(--g) * 8); z-index: 3;
  display: grid; place-items: center; background: var(--wine); color: #fff; font-size: calc(var(--g) * 7); font-weight: 700; line-height: 1; border-radius: 50%; box-shadow: 0 0 0 var(--g) var(--ink); }
#panel .tb .pw-slot > :is(.cardpic, .pw-slab) { width: 100%; height: 100%; }
#panel .tb .pw-slot > .pw-slab.sl-box { --slab-h: 100%; --slab-w: auto; aspect-ratio: 22 / 32; }
#panel .tb .pw-price-row { display: flex; align-items: center; gap: calc(var(--g) * 2); white-space: nowrap; }
#panel .tb .pw-price { font-size: min(calc(var(--fu) * 10), calc(var(--g) * 13)); font-weight: 700; line-height: 1; color: var(--ink); }
#panel .tb .pw-price.pw-pos { color: var(--pos); }
#panel .tb .pw-price-row .push { margin-left: auto; }
#panel .tb .pw-pips { display: flex; gap: calc(var(--g) * 1.5); margin-left: auto; align-items: center; font-size: calc(var(--fu) * 6); white-space: nowrap; }
#panel .tb .pw-pips i { width: calc(var(--g) * 5); height: calc(var(--g) * 5); border: var(--g) solid var(--ink); background: var(--cream); }
#panel .tb .pw-pips i.on { background: var(--wine); }
#panel .tb .pw-askrow { display: flex; align-items: center; gap: calc(var(--g) * 2); }
#panel .tb .pw-askrow input[type=range] { flex: 1; min-width: 0; height: calc(var(--g) * 10); margin: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
#panel .tb .pw-askrow input[type=range]::-webkit-slider-runnable-track { height: calc(var(--g) * 4); background: var(--putty); border: var(--g) solid; border-color: var(--putty-dk) #fff #fff var(--putty-dk); }
#panel .tb .pw-askrow input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: calc(var(--g) * 6); height: calc(var(--g) * 10); margin-top: calc(var(--g) * -4);
  background: #ffd66b; border: var(--g) solid var(--ink); box-shadow: inset var(--g) var(--g) 0 var(--brass-sp), inset calc(var(--g) * -1) calc(var(--g) * -1) 0 #c48a2a; }
#panel .tb .pw-askrow input[type=range]::-moz-range-track { height: calc(var(--g) * 4); background: var(--putty); border: var(--g) solid var(--putty-dk); }
#panel .tb .pw-askrow input[type=range]::-moz-range-thumb { width: calc(var(--g) * 6); height: calc(var(--g) * 10); background: #ffd66b; border: var(--g) solid var(--ink); border-radius: 0; }
#panel .tb .pw-msg { font-size: calc(var(--fu) * 6.5); line-height: 1.25; }
#panel .tb .pw-bulk { font-size: calc(var(--fu) * 6); display: flex; align-items: center; gap: calc(var(--g) * 2); white-space: nowrap; overflow: hidden; }
#panel .tb .pw-bulk .pw-lnk { overflow: hidden; text-overflow: ellipsis; display: block; }

/* the footer: a hit counter and the period's viewing advice */
#panel .tb .pw-foot { position: absolute; left: 0; right: 0; bottom: 0; height: var(--ftH); display: flex; align-items: center; justify-content: space-between; gap: calc(var(--a) * 4);
  padding: 0 calc(var(--a) * 3); color: #e9f2df; font-size: calc(var(--fu) * 6); line-height: 1; white-space: nowrap; overflow: hidden; }
#panel .tb .pw-counter { display: flex; align-items: center; gap: calc(var(--g) * 3); }
#panel .tb .pw-digits { display: flex; box-shadow: 0 0 0 var(--g) var(--ink); }
#panel .tb .pw-digits i { width: calc(var(--a) * 5); height: calc(var(--a) * 6); background: url(../../art/areas/pawn/digits.png) calc(var(--d) * var(--a) * -5) 0 / calc(var(--a) * 50) 100%; }

/* a finger on a touch screen: room round the small controls */
#panel .tb.touch .pw-btn { min-height: max(calc(var(--a) * 9), 40px); }
#panel .tb.touch .pw-pager .pg-btn { width: max(calc(var(--a) * 7), 36px); height: max(calc(var(--a) * 7), 36px); }
#panel .tb.touch .pw-lnk { padding: 6px 0; }
#panel .tb.touch .pw-askrow input[type=range] { height: 36px; }

/* ---------- Gus's questions: the browser's alert box (ui.confirm with this scene's frame), at the tablet's size ---------- */
#modal:has(> .pw-alert) { background: rgba(18, 22, 28, 0.35); }
.modal-box.pw-alert { --a: var(--tb-sa, calc(var(--pu) * 2.5)); --g: calc(var(--a) / 2); --fu: calc(var(--g) * var(--fs)); padding: 0; max-width: none; max-height: none; overflow: visible;
  border-radius: 0; background: none; box-shadow: none; text-shadow: none; translate: 0 calc(var(--a) * -8); animation: pwAlert 0.12s steps(2, end) both; }
@keyframes pwAlert { from { opacity: 0; } }
.pw-dlg { width: min(calc(var(--a) * 140), calc(100vw - var(--a) * 8)); background: var(--putty); color: var(--ink); font-family: var(--font-ui); box-shadow: 0 0 0 var(--a) var(--ink), calc(var(--a) * 2) calc(var(--a) * 2) 0 rgba(20, 16, 12, 0.5); }
.pw-dlg-bar { height: calc(var(--a) * 7); display: flex; align-items: center; gap: calc(var(--g) * 2); padding: 0 calc(var(--g) * 3);
  background: linear-gradient(#5f8088 0 var(--a), var(--slate) var(--a) calc(100% - var(--a)), #16222b 0); color: #f5fdf0; font-size: calc(var(--fu) * 6.5); font-weight: 700; line-height: 1; white-space: nowrap; overflow: hidden; }
.pw-dlg-ico { width: calc(var(--a) * 5); height: calc(var(--a) * 6); background: url(../../art/areas/pawn/throbber.png) calc(var(--a) * -2) calc(var(--a) * -1) / calc(var(--a) * 72) calc(var(--a) * 7); image-rendering: pixelated; flex: none; }
.pw-dlg-body { display: flex; gap: calc(var(--g) * 5); padding: calc(var(--g) * 5) calc(var(--g) * 6) calc(var(--g) * 3); font-size: calc(var(--fu) * 7); line-height: 1.3; }
.pw-dlg-body p { margin: 0; }
/* a figure in his question stands out in his wine, not the game's gold (which is for its dark dialogs) */
#modal > .modal-box.pw-alert .pw-dlg-body p :is(b, strong):not([class]) { color: var(--wine); }
.pw-dlg-body .pw-ico { margin-top: var(--g); }
.pw-dlg-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: calc(var(--g) * 4); padding: 0 calc(var(--g) * 6) calc(var(--g) * 5); }

/* Motion Off: the sign, the REC light, the NEW! burst and the alert hold still */
body.calm #panel .tb :is(.pw-neon, .pw-burst), body.calm #panel .tb .pw-cam .live::before, body.calm .modal-box.pw-alert { animation: none; }
