/* The run's summary as a scene dialog on the run's table (src/scenes/summary.js; art/areas/summary/layout.json, drawn by
   tools/desk_art/area_summary.py): the receipt printer and its receipt at the right, what comes home at the left. Every
   picture is a stylesheet background (.sm-art). The receipt prints in thermal ink on rows of 6 art pixels; its text is
   10 world pixels at Text size 100% and grows with Text size, up to 115% (the rows do not grow). Where a line runs long,
   --fit steps it down (fit and shrink in src/scenes/summary.js). */
#modal.area .sm { position: absolute; inset: 0; pointer-events: none; }
#modal.area .sm-art { display: block; background: no-repeat 0 0 / 100% 100%; image-rendering: pixelated; }
#modal.area .sm-crumpled { background-image: url(../../art/areas/summary/crumpled.png); }
#modal.area .sm-tool { background-image: url(../../art/areas/summary/stamp_tool.png); }
#modal.area .sm-strip { background-image: url(../../art/areas/summary/strip.png); }
#modal.area .sm-end { background-image: url(../../art/areas/summary/strip_end.png); }
#modal.area .sm-printer { background-image: url(../../art/areas/summary/printer.png); }
#modal.area .sm-led { background-image: url(../../art/areas/summary/led_on.png); opacity: 0; }   /* lit only while it prints */
#modal.area .sm-wear { background-image: url(../../art/areas/summary/stamp_wear.png); }
#modal.area .sm-bagb { background-image: url(../../art/areas/summary/bag_back.png); }
#modal.area .sm-bagf { background-image: url(../../art/areas/summary/bag_front.png); }
#modal.area .sm-sticker { background-image: url(../../art/areas/summary/sticker.png); }
#modal.area .sm-slb { background-image: url(../../art/areas/summary/sleeve_back.png); }
#modal.area .sm-slf { background-image: url(../../art/areas/summary/sleeve.png); }
#modal.area .sm-memoart { background-image: url(../../art/areas/summary/memo.png); }
#modal.area .sm-tagart { background-image: url(../../art/areas/summary/tag.png); }
#modal.area .sm-homeart { background-image: url(../../art/areas/summary/home.png); }
/* the paper and its print show the rows fed so far (--cut: the rows still inside the printer, from the bottom) */
#modal.area .sm-feed { clip-path: inset(0 0 calc(var(--a) * var(--cut, 0)) 0); }
#modal.area .sm :is(p, b, span) { margin: 0; text-shadow: none; font-variant-ligatures: none; }

/* ---------- the stamp: the run's end in the ink's colour, the wear over it ---------- */
#modal.area .sm-green { --stamp: #1b6236; }
#modal.area .sm-red { --stamp: #8e1d24; }
#modal.area .sm-grey { --stamp: #45454f; }
#modal.area .sm-violet { --stamp: #4a2c82; }
#modal.area .sm-gold { --stamp: #8a6214; }
#modal.area .sm-green .sm-ink { background-image: url(../../art/areas/summary/stamp_green.png); }
#modal.area .sm-red .sm-ink { background-image: url(../../art/areas/summary/stamp_red.png); }
#modal.area .sm-grey .sm-ink { background-image: url(../../art/areas/summary/stamp_grey.png); }
#modal.area .sm-violet .sm-ink { background-image: url(../../art/areas/summary/stamp_violet.png); }
#modal.area .sm-gold .sm-ink { background-image: url(../../art/areas/summary/stamp_gold.png); }
#modal.area .sm-word { display: grid; place-items: center; overflow: hidden; white-space: nowrap; color: var(--stamp); opacity: 0.9; font-family: var(--font-px); font-weight: 400;
  font-size: calc(var(--g) * 16 * min(var(--fs), 1.15) * var(--fit, 1)); line-height: 1; letter-spacing: 0.04em; }

/* ---------- the receipt: thermal print, a row of 6 art px a line ---------- */
#modal.area .sm-print { color: #24232c; font-family: var(--font-ui); font-variant-numeric: tabular-nums; --rf: calc(var(--g) * 10 * min(var(--fs), 1.15)); }
/* A line's ink, capitals to descenders, is 0.9 em in either font, and the rows do not grow: Pipwick, which comes only in
   whole font pixels (src/fontsnap.js), takes the largest of them whose ink fits the row when the nearest would not. */
#modal.area .sm-print > * { font-size: max(var(--fq), min(round(nearest, calc(var(--rf) * var(--fit, 1)), var(--fq)), round(down, calc(var(--a) * 5.4), var(--fq))));
  line-height: calc(var(--a) * 6); white-space: nowrap; }
#modal.area .sm-run { white-space: normal !important; text-align: center; color: #45444f; overflow: hidden; line-height: calc(var(--a) * 6.5) !important; }
#modal.area .sm-run b { color: #24232c; font-weight: 700; }
#modal.area .sm-row { display: flex; justify-content: space-between; align-items: center; gap: calc(var(--a) * 2); overflow: hidden; }
#modal.area .sm-row span { color: #45444f; }
#modal.area .sm-row b { font-weight: 700; }
#modal.area :is(.sm-cap, .sm-xp, .sm-con b, .sm-next b, .sm-xpn) { font-weight: 700; letter-spacing: 0.02em; }
#modal.area .sm-xp { overflow: hidden; }
/* a day: its bar stands on the printed baseline (what it earned), its rent a dotted mark across it */
#modal.area .sm-bar::before, #modal.area .sm-bar::after { content: ""; position: absolute; left: 0; right: 0; }
#modal.area .sm-bar::before { bottom: 0; height: calc(var(--a) * var(--e)); background: #45444f; }
#modal.area .sm-bar.sm-short::before { background: #73727d; }
#modal.area .sm-bar::after { bottom: calc(var(--a) * var(--r)); height: var(--g); background: repeating-linear-gradient(90deg, #24232c 0 var(--g), transparent var(--g) calc(var(--g) * 2)); }
/* the XP bar: the printed frame is in the paper; the fill is a thermal dither, the numbers over it */
#modal.area .sm-fill { background: repeating-conic-gradient(#a2a1aa 0 25%, transparent 0 50%) 0 0 / calc(var(--a) * 2) calc(var(--a) * 2); }
#modal.area .sm-xpn { display: grid; place-items: center; overflow: hidden; line-height: 1 !important; }
#modal.area :is(.sm-next, .sm-con) { display: flex; align-items: center; gap: calc(var(--a) * 2); overflow: hidden; }
/* a reward shows whole or not at all: what does not fit goes, and +N counts it (areas.js fitRow) */
#modal.area .sm-chip { display: inline-flex; align-items: center; gap: var(--a); flex: none; color: #45444f; }
#modal.area .sm-rest { font-weight: 700; }
#modal.area .sm-cico { width: calc(var(--a) * 6); height: calc(var(--a) * 6); margin: 0; background-size: 100% 100%; flex: none; }
#modal.area .sm-tick { font-weight: 700; }

/* ---------- what comes home ---------- */
#modal.area .sm-pack { display: block; image-rendering: pixelated; -webkit-user-drag: none; user-select: none; }
#modal.area .sm-packb { filter: brightness(0.8); }
#modal.area .sm-stk { display: grid; place-items: center; white-space: nowrap; color: #a8262b; font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--g) * 10 * min(var(--fs), 1.15)); line-height: 1; }
/* the sleeves: the back, the card, the sleeve's shine over it, NEW on its corner; the label under it */
#modal.area .sm-sleeves { display: contents; }
#modal.area .sm-sleeves [hidden] { display: none !important; }
#modal.area .sm-sleeve-pager { display: flex; align-items: center; justify-content: center; gap: calc(var(--g) * 4); }
#modal.area .sm-sleeve-pager :is(.sm-pg, .sm-pgn) { color: #f1e7cd; }
#modal.area .sm-card { overflow: hidden; }
#modal.area .sm-card .cardpic { border-radius: 0; }
#modal.area .sm-card .card-img { display: block; width: calc(var(--a) * 32); height: calc(var(--a) * 44); image-rendering: pixelated; }
#modal.area :is(.sm-new, .sm-label) { display: grid; place-items: center; white-space: nowrap; font-family: var(--font-ui); font-weight: 700; line-height: 1; }
#modal.area .sm-new { color: #fff4e6; font-size: calc(var(--g) * 9 * min(var(--fs), 1.15)); background: url(../../art/areas/summary/new.png) no-repeat 0 0 / 100% 100%; image-rendering: pixelated; }
#modal.area .sm-label { background: url(../../art/areas/summary/label.png) no-repeat 0 0 / 100% 100%; image-rendering: pixelated; }
#modal.area .sm-label span { display: grid; place-items: center; color: #2a2530; font-size: calc(var(--g) * 10 * min(var(--fs), 1.15)); }
/* the memo: the notes a paragraph each, in its ink (a page at a time when they run long) */
#modal.area .sm-mtext { overflow: hidden; color: #2b2d52; font-family: var(--font-ui); font-size: calc(var(--fu) * 10 * var(--fit, 1)); line-height: 1.2; }
#modal.area .sm-mtext p { font-size: inherit; line-height: inherit; }
#modal.area .sm-mtext b { font-weight: 700; }
#modal.area .sm-mtext .dim { color: #5d5f80; opacity: 1; }
#modal.area .sm-mtext .unlock-line { color: #8e1d24; font-weight: 700; }
#modal.area .sm-mtext .pos { color: #1b6236; }
#modal.area .sm-mtext.sm-paged { height: calc(var(--a) * (var(--h) - 6)); }
#modal.area .sm-pager { display: flex; align-items: center; justify-content: flex-end; gap: calc(var(--g) * 2); }
#modal.area .sm-pager[hidden] { display: none; }
#modal.area .sm-pg { display: grid; place-items: center; width: calc(var(--g) * 10); height: calc(var(--a) * 6); padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  color: #2b2d52; font-size: calc(var(--g) * 7); line-height: 1; }
#modal.area .sm-pg:hover:not(:disabled) { color: #8e1d24; }
#modal.area .sm-pg:disabled { opacity: 0.3; }
#modal.area .sm-pgn { font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--g) * 8); color: #2b2d52; font-variant-numeric: tabular-nums; }
/* the achievements' tags, and the rest on the felt */
#modal.area .sm-ttext { display: flex; align-items: center; overflow: hidden; color: #3a2e1c; font-family: var(--font-ui); font-size: calc(var(--fu) * 10 * var(--fit, 1)); line-height: 1.2; }
#modal.area :is(.sm-more, .sm-felt) { display: grid; place-items: center; text-align: center; color: #f1e7cd; font-family: var(--font-ui); text-shadow: 0 var(--g) 0 rgba(20, 30, 22, 0.55); }
#modal.area .sm-more { white-space: nowrap; font-weight: 700; font-size: calc(var(--g) * 10 * min(var(--fs), 1.15)); line-height: 1; }
#modal.area .sm-felt { overflow: hidden; font-size: calc(var(--fu) * 10 * var(--fit, 1)); line-height: 1.2; }
/* Back home: a brass plate; pressed, its face sinks a pixel */
#modal.area .sm-home { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer; overflow: visible; font: inherit; }
#modal.area .sm-home:hover .sm-homeart { filter: brightness(1.06); }
#modal.area .sm-home:active .sm-homeart { background-image: url(../../art/areas/summary/home_dn.png); }
#modal.area .sm-home:active :is(.sm-hmain, .sm-hsub) { translate: 0 var(--a); }
#modal.area .sm-home:focus-visible { outline: var(--g) dashed #fff2b0; outline-offset: var(--g); }
#modal.area :is(.sm-hmain, .sm-hsub) { display: flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1; }
#modal.area .sm-hmain { color: #4a2a0e; font-family: var(--font-px); font-size: calc(var(--g) * 16 * min(var(--fs), 1.15)); }
#modal.area .sm-hsub { color: #5c3a14; font-family: var(--font-ui); font-size: calc(var(--g) * 10 * min(var(--fs), 1.15)); }
#modal.area .sm-hmain .hk { font-family: var(--font-ui); font-size: calc(var(--g) * 7); --u: var(--g); margin-right: calc(var(--g) * 4); }
