/* docs/371 — A PLACE ON PAPER.

   His words (2026-09-28): "work on instances info screen, maybe create few examples. i thought it
   would look a little like a contract/map/quest on paper but idk."

   A place's own screen (screenRun in app.js) is drawn on a sheet of HIS parchment: the paper is
   cut from his map (art/instances_pictures/background.png) by build_place_pictures.py, toned in
   his own parchment colours, and shipped as `backgrounds.places_paper` — the client puts the
   path on `--paper`, so no path is typed here. Three drawings share this sheet ('contract', 'map'
   and 'notice'; `PAPER` in app.js picks one, the :7782 lab shows all three); 'plain' is the old
   dark windows and uses none of this file.

   ⛔ Nothing here draws a symbol (docs/260): the back arrow and the chevrons are HIS white PNGs,
   inked with a filter; everything else is borders, gradients, a torn edge and type.
   ⛔ The only motion is the sheet landing once when the screen is arrived at (and the stamp
   thumping onto it) — transform and opacity, and nothing under prefers-reduced-motion.
   ⚠️ The shared class names (.pager, .foeswin, .foeslist, .foes, .loot-win, .lootrow) are
   restyled ONLY inside .pp-sheet: the plain drawing and every other screen keep app.css's. */

/* ── the sheet's place on the screen: from under the header band to above the gold key ──
   `.keywrap` sits 88px above the nav and is 86 tall, so 180 leaves the key 6px of dark ground.
   It is never clipped: its shadow and the notice's rollers hang off it. */
.pp {
  position: absolute; left: 12px; right: 12px; top: calc(var(--band) + 5px); bottom: 180px; z-index: 3;
  --pp-ink: #2b1d12; --pp-ink2: rgba(43, 29, 18, .68); --pp-ink3: rgba(43, 29, 18, .44);
  --pp-rule: rgba(43, 29, 18, .26); --pp-tyrian: #66023c; --pp-light: #f1e3c2;
}
.pp::before {
  content: ''; position: absolute; left: 4px; right: 4px; top: 6px; bottom: 0; border-radius: 4px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .62), 0 4px 10px rgba(0, 0, 0, .5);
}

/* ── the paper: his parchment, darker toward its edges the way an old sheet browns, torn ───── */
.pp-sheet {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  padding: 8px 16px 12px; color: var(--pp-ink); text-align: left;
  background-color: #cfae86;
  background-image:
    radial-gradient(130% 95% at 50% 42%, rgba(255, 247, 228, .20) 0%, rgba(255, 247, 228, 0) 52%, rgba(96, 56, 20, .34) 100%),
    var(--paper, none);
  background-size: 100% 100%, cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(96, 56, 20, .28), inset 0 0 28px rgba(96, 56, 20, .38);
  /* a deckled edge: a few pixels in and out along every side, as a hand-torn sheet has */
  clip-path: polygon(0 2px, 6% 0, 13% 2px, 21% 1px, 30% 3px, 38% 0, 47% 2px, 55% 1px, 63% 3px, 72% 0, 80% 2px,
    88% 1px, 95% 3px, 100% 1px, calc(100% - 2px) 9%, 100% 18%, calc(100% - 1px) 27%, 100% 36%, calc(100% - 3px) 45%,
    100% 54%, calc(100% - 1px) 63%, 100% 72%, calc(100% - 2px) 81%, 100% 90%, calc(100% - 1px) 100%,
    93% calc(100% - 2px), 85% 100%, 77% calc(100% - 3px), 68% 100%, 60% calc(100% - 1px), 51% 100%,
    42% calc(100% - 2px), 34% 100%, 25% calc(100% - 3px), 17% 100%, 9% calc(100% - 1px), 0 100%,
    2px 91%, 0 82%, 1px 73%, 0 64%, 3px 55%, 0 46%, 1px 37%, 0 28%, 2px 19%, 0 10%);
}
.pp-sheet > * { flex: 0 0 auto; }

/* the way back, pinned to the sheet's corner in ink (his arrow, inked — not a drawn one) */
.pp-sheet .pp-back { position: absolute; right: 4px; top: 4px; left: auto; width: 44px; height: 44px; z-index: 2;
  display: grid; place-items: center; }
.pp-sheet .pp-back img { width: 18px; height: 22px; object-fit: contain; filter: brightness(0); opacity: .74; }

/* ── the heading ─────────────────────────────────────────────────────────────────────── */
.pp-eyebrow { margin: 6px 44px 0; text-align: center; font: 700 9px/1 var(--sans); letter-spacing: 2.6px;
  color: var(--pp-ink2); text-transform: uppercase; }
/* a place's whole name, never an ellipsis: the longer names are set smaller (`paperTitle`), and a
   narrower phone takes a size off each */
.pp-title { margin: 3px 38px 0; text-align: center; font: 400 26px/1.12 var(--serif); color: var(--pp-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.pp-title.long { font-size: 23px; line-height: 1.27; }
.pp-title.longer { font-size: 20px; line-height: 1.46; letter-spacing: 0; }
@media (max-width: 374px) {
  .pp-title { font-size: 24px; }
  .pp-title.long { font-size: 21px; line-height: 1.39; }
  .pp-title.longer { font-size: 18.5px; line-height: 1.58; }
}
.pp-pre { margin: 3px 4px 0; text-align: center; font: 400 12.5px/1.3 var(--serif); color: var(--pp-ink2); }
.pp-pre::after { content: ''; display: block; height: 0; margin: 7px auto 0; width: 62%;
  border-top: 1px solid var(--pp-rule); border-bottom: 1px solid var(--pp-rule); padding-top: 2px; }

/* ── the pager: his chevrons, inked onto the paper ─────────────────────────────────────── */
.pp-sheet .pager { height: 48px; margin: 6px 0 2px; }
.pp-sheet .pager .chev { top: 2px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 248, 232, .16); border: 1.5px solid rgba(43, 29, 18, .52); }
.pp-sheet .pager .chev.less { left: 0; } .pp-sheet .pager .chev.more { right: 0; }
.pp-sheet .pager .chev img { left: 11px; top: 11px; width: 19px; height: 19px; filter: brightness(0); opacity: .74; }
.pp-sheet .pager .chev[disabled] { opacity: .28; }
.pp-sheet .pager b { left: 48px; right: 48px; top: 1px; color: var(--pp-ink); font-size: 23px; }
.pp-sheet .pager small { left: 48px; right: 48px; top: 32px; color: var(--pp-ink2); font-size: 9px; letter-spacing: 1.8px; }

/* ── a section heading: small capitals on a ruled line, what it is on the right ──────────── */
.pp-sheet h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0; padding: 0 0 4px;
  border-bottom: 1px solid var(--pp-rule); font: 700 9.5px/1.1 var(--sans); letter-spacing: 1.9px; color: var(--pp-ink);
  text-transform: uppercase; white-space: nowrap; }
.pp-sheet h3 i { font-style: normal; font-weight: 600; letter-spacing: 1.1px; color: var(--pp-ink2); overflow: hidden;
  text-overflow: ellipsis; }

/* ── the bodies: the list takes the space between the heading and the payment, and scrolls
   inside itself (docs/321), so neither moves when the gate does ──────────────────────────── */
.pp-sheet .foeswin { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: 6px; }
/* ⭐ a list longer than its space fades out at its foot, so the last line that shows says there is
   more under it (a gate holds up to seven names); a short list has nothing in that band to fade */
.pp-sheet .foeslist { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; padding-top: 2px; padding-bottom: 10px;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 22px), rgba(0, 0, 0, .12));
  mask-image: linear-gradient(180deg, #000 calc(100% - 22px), rgba(0, 0, 0, .12)); }
.pp-sheet .foeslist::-webkit-scrollbar { display: none; }
.pp-sheet .foes { width: 100%; height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 2px;
  color: var(--pp-ink); text-align: left; }
.pp-sheet .foes + .foes { border-top: 1px dashed rgba(43, 29, 18, .2); }
.pp-sheet .foes .ico { width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 40%, #4a3522, #25190f); border: 1.5px solid rgba(43, 29, 18, .75);
  box-shadow: 0 0 0 2px rgba(255, 244, 220, .28); display: grid; place-items: center; }
.pp-sheet .foes .ico img { width: 28px; height: 28px; object-fit: contain; border-radius: 0; }
.pp-sheet .foes b { flex: 0 1 auto; min-width: 0; font: 400 16px/1.1 var(--serif); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: var(--pp-ink); }
.pp-sheet .foes b em { margin-left: 5px; font: 700 12px var(--sans); font-style: normal; color: var(--pp-ink2); }
/* the dotted leader between a name and its level, as a ledger or a menu sets one */
.pp-sheet .foes s { flex: 1 1 auto; min-width: 10px; align-self: flex-end; margin: 0 2px 15px; text-decoration: none;
  border-bottom: 2px dotted rgba(43, 29, 18, .34); }
.pp-sheet .foes small { flex: none; font: 600 11px var(--mono); color: var(--pp-ink2); }
.pp-tap { margin: 6px 0 2px; text-align: center; font: 700 7.5px/1.3 var(--sans); letter-spacing: 1.2px;
  color: var(--pp-ink3); text-transform: uppercase; }

/* ── the payment: every gate's keys and the relic, then FINISH IT apart ────────────────── */
.pp-sheet .loot-win { margin-top: 8px; }
.pp-sheet .lootrow { display: flex; align-items: center; gap: 12px; height: 58px; padding-top: 6px; }
.pp-sheet .lootrow .ico { width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 40%, #4a3522, #25190f); border: 1.5px solid rgba(43, 29, 18, .8);
  box-shadow: 0 0 0 2px rgba(255, 244, 220, .3), 0 2px 5px rgba(43, 29, 18, .4); display: grid; place-items: center; }
.pp-sheet .lootrow .ico img { width: 34px; height: 34px; object-fit: contain; }
.pp-sheet .lootrow .lootrun { margin-left: auto; padding-left: 14px; border-left: 1.5px solid var(--pp-rule);
  display: grid; place-items: center; gap: 1px; }
.pp-sheet .lootrow .lootrun img { width: 40px; height: 40px; filter: drop-shadow(0 1px 1px rgba(43, 29, 18, .45)); }
.pp-sheet .lootrow .lootrun em { font: 700 7.5px var(--sans); font-style: normal; letter-spacing: 1.3px; color: var(--pp-ink); }
/* docs/399: the day's first clear, after FINISH IT, in the same column */
.pp-sheet .lootrow .lootday { margin-left: 0; }
.pp-sheet .lootrow .lootday .fck img { width: 34px; height: 34px; filter: drop-shadow(0 1px 1px rgba(43, 29, 18, .45)); }
.pp-sheet .lootrow .lootday .fck b { color: var(--pp-ink); font-size: 12px; }

/* ── (A) the contract's line to sign — PLAY, under the sheet, is the signing ───────────── */
.pp-sign { display: flex; align-items: flex-end; gap: 8px; height: 20px; margin-top: 6px; }
.pp-sign span { font: 400 13px/1 var(--serif); color: var(--pp-ink2); }
.pp-sign i { flex: 1 1 auto; height: 0; margin-bottom: 2px; border-bottom: 1.5px solid rgba(43, 29, 18, .55); }
.pp-sign em { font: 700 8px/1 var(--sans); font-style: normal; letter-spacing: 1.5px; color: var(--pp-ink2); }

/* ── (B) the map: his picture of the place printed on the sheet, the route over it ──────── */
.pp-plate { position: relative; height: 150px; margin: 8px -2px 0; overflow: hidden; background: #c3a076;
  border: 1.5px solid rgba(43, 29, 18, .62);
  box-shadow: 0 0 0 3px rgba(255, 244, 220, .22), 0 0 0 4.5px rgba(43, 29, 18, .34); }
.pp-plate > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: multiply; filter: sepia(.28) saturate(.85) contrast(1.04); }
.pp-plate::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 22px rgba(60, 34, 12, .45); }
.pp-route { position: absolute; inset: 0; z-index: 1; }
.pp-route svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pp-route polyline { fill: none; stroke: rgba(30, 18, 8, .9); stroke-width: 2.5px; stroke-dasharray: 7 6;
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pp-route polyline.halo { stroke: rgba(255, 240, 210, .72); stroke-width: 6px; stroke-dasharray: none; }
.pp-route .stop { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; }
.pp-route .stop::before { content: ''; position: absolute; left: 7px; top: 7px; width: 30px; height: 30px; border-radius: 50%;
  background: #efe0c0; border: 2px solid var(--pp-ink); box-shadow: 0 2px 5px rgba(0, 0, 0, .45); }
.pp-route .stop b { position: relative; font: 400 16px/1 var(--serif); color: var(--pp-ink); }
.pp-route .stop.on::before { background: var(--pp-tyrian); border-color: var(--pp-light);
  box-shadow: 0 0 0 2px var(--pp-ink), 0 3px 9px rgba(0, 0, 0, .6); transform: scale(1.14); }
.pp-route .stop.on b { color: var(--pp-light); }
.pp-map .foeswin { margin-top: 10px; }

/* ── (C) the notice: WANTED, a likeness per name, the reward — between two rollers ──────── */
.pp-notice { top: calc(var(--band) + 9px); }
.pp-notice .pp-sheet { top: 9px; bottom: 9px; left: 3px; right: 3px; padding-top: 14px; padding-bottom: 14px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 2px) 12%, 100% 25%, calc(100% - 1px) 38%, 100% 51%, calc(100% - 2px) 64%,
    100% 77%, calc(100% - 1px) 89%, 100% 100%, 0 100%, 1px 88%, 0 76%, 2px 63%, 0 50%, 1px 37%, 0 24%, 2px 12%); }
.pp-notice::before { top: 12px; bottom: 6px; }
.pp-notice .pp-back { top: 8px; }
/* a roller is the same paper, rolled: his parchment under a cylinder's light */
.pp-roll { position: absolute; left: -3px; right: -3px; height: 19px; border-radius: 10px; z-index: 2; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(58, 34, 14, .85) 0%, rgba(120, 80, 40, .35) 26%, rgba(255, 240, 205, .38) 46%,
      rgba(120, 80, 40, .25) 68%, rgba(52, 30, 12, .9) 100%),
    var(--paper, none);
  background-color: #b8915f; background-size: 100% 100%, 240px auto; background-position: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .5); }
.pp-roll::before, .pp-roll::after { content: ''; position: absolute; top: 2px; bottom: 2px; width: 8px; border-radius: 4px;
  background: linear-gradient(180deg, #3a2410, #7a5431 45%, #2a190b); }
.pp-roll::before { left: -3px; } .pp-roll::after { right: -3px; }
.pp-roll.top { top: 0; } .pp-roll.bot { bottom: 0; }
.pp-wanted { margin: 8px 40px 0; text-align: center; font: 400 42px/1 var(--serif); letter-spacing: 7px; color: var(--pp-ink);
  padding-left: 7px; }
.pp-where { margin: 2px 8px 0; text-align: center; font: 700 9.5px/1.2 var(--sans); letter-spacing: 2.4px;
  color: var(--pp-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-where::before, .pp-where::after { content: ''; display: inline-block; width: 22px; height: 0; vertical-align: middle;
  border-top: 1px solid var(--pp-ink3); margin: 0 8px 2px; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 8px; padding-top: 5px; }
.pp-sheet .pp-card { height: auto; min-height: 62px; display: grid; grid-template-columns: 50px minmax(0, 1fr);
  grid-template-rows: 1fr auto 1fr; column-gap: 8px; align-items: center; padding: 5px 6px 5px 5px;
  border: 1px solid rgba(43, 29, 18, .34); background: rgba(255, 246, 226, .14); }
.pp-sheet .pp-card + .pp-card { border-top: 1px solid rgba(43, 29, 18, .34); }
.pp-sheet .pp-card .ico { grid-row: 1 / 4; width: 50px; height: 50px; border-radius: 2px;
  background: radial-gradient(circle at 50% 38%, #4f3924, #20160d); border: 2px solid var(--pp-ink);
  box-shadow: 0 0 0 2px rgba(255, 244, 220, .3); }
.pp-sheet .pp-card .ico img { width: 40px; height: 40px; }
.pp-sheet .pp-card b { grid-row: 2; font-size: 14px; line-height: 1.12; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pp-sheet .pp-card small { grid-row: 3; align-self: start; font-size: 10px; margin-top: 2px; }

/* ── above his level: the level it opens at, stamped at the sheet's foot in his Tyrian — across
   the contract's signature line, on a line of its own on the others — so it covers no name, no
   gate and nothing to hold (the first cut's top corner covered the title) ──────────────────── */
.pp-stamp { flex: none; display: block; margin: 0 2px -3px 0; pointer-events: none; white-space: nowrap;
  padding: 3px 7px 2px; border: 3px double rgba(102, 2, 60, .82); border-radius: 5px;
  color: rgba(102, 2, 60, .88); font: 700 10.5px/1.1 var(--sans); letter-spacing: 1.5px; mix-blend-mode: multiply;
  transform: rotate(-4deg); }
.pp-foot { display: flex; justify-content: flex-end; align-items: flex-end; height: 22px; margin-top: 4px; }

/* ── the sheet lands, once, when the screen is arrived at (never on a gate turned) ───────── */
.pp.pp-in { animation: ppIn .34s cubic-bezier(.2, .8, .3, 1) both; }
.pp.pp-in .pp-stamp { animation: ppStamp .3s .3s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes ppIn {
  from { opacity: 0; transform: translateY(14px) rotate(-.7deg); }
  to { opacity: 1; transform: none; }
}
@keyframes ppStamp {
  from { opacity: 0; transform: rotate(-4deg) scale(1.7); }
  to { opacity: 1; transform: rotate(-4deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .pp.pp-in, .pp.pp-in .pp-stamp { animation: none; }
}

/* ── a shorter phone (his is ~840; 800 is the next common one): the ornaments give way first,
   the list of bodies keeps its space ──────────────────────────────────────────────────── */
@media (max-height: 820px) {
  .pp-pre { display: none; }
  .pp-plate { height: 128px; }
  .pp-sign { height: 16px; margin-top: 4px; }
  .pp-wanted { font-size: 36px; }
}
