/* Approved motion 18 and card/inspector rules from game.css, scoped for the town. */
.pack-surface { --c-light: #D6C68C; --c-water: #5D7E95; --c-darkness: #4B4050; --c-fire: #9C4C3A; --c-nature: #5E7A46;
  --notch: polygon(.3em 0, calc(100% - .3em) 0, 100% .3em, 100% calc(100% - .3em), calc(100% - .3em) 100%, .3em 100%, 0 calc(100% - .3em), 0 .3em); }
.ov.pack-surface { position: absolute; inset: 0; pointer-events: none; z-index: 50; }
.ov.pack-surface > * { position: absolute; }
.ov.pack-surface > .card { position: absolute; }
.ov.pack-surface[data-opening] { pointer-events: auto; }
.pack-surface .panel { inset: auto; translate: none; z-index: auto; width: auto; }
.pack-surface .plate { height: auto; padding: 0; background: none; box-shadow: none; clip-path: none; font: inherit; }
.pack-surface .dim { inset: 0; background: #120D09; opacity: 0; }
.ov.pack-surface .pack { z-index: 2; }
.pack-surface .card { position: relative; width: var(--w); height: calc(var(--w) * 1.4); flex: none; font-size: calc(var(--w) / 10); }
.pack-surface .face, .pack-surface .back { position: absolute; inset: 0; clip-path: var(--notch); }
.pack-surface .face { --bg: var(--civ); background: var(--bg); box-shadow: inset 0 0 0 .2em var(--g-ink); padding: .5em; }
.pack-surface .face.multi { --bg: linear-gradient(135deg, var(--civ) 0 50%, var(--civ2) 50% 100%); }
.pack-surface .civ-light { --civ: var(--c-light); }
.pack-surface .civ-water { --civ: var(--c-water); }
.pack-surface .civ-darkness { --civ: var(--c-darkness); }
.pack-surface .civ-fire { --civ: var(--c-fire); }
.pack-surface .civ-nature { --civ: var(--c-nature); }
.pack-surface .panel { position: relative; height: 100%; background: var(--parch); box-shadow: inset 0 0 0 .12em var(--g-ink); display: grid; grid-template-rows: 1.8em minmax(0, 1fr) 1.7em; gap: .25em; padding: .3em; color: var(--g-ink); overflow: hidden; }
.pack-surface .panel.spell, .pack-surface .panel.gear, .pack-surface .panel.castle { background: var(--parch-2); }
.pack-surface .plate { display: flex; align-items: center; gap: .3em; min-width: 0; }
.pack-surface .gem { flex: none; width: 1.9em; height: 1.9em; display: grid; place-items: center; font: 600 1.25em/1 var(--f-ui); color: var(--g-ink); margin: -.2em 0 0 -.2em;
  background: radial-gradient(circle at 35% 30%, #F2E1AA, #B89552 58%, #6E5427); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.pack-surface .name { font: 1em/1.1 var(--f-jp); white-space: nowrap; overflow: hidden; min-width: 0; }
.pack-surface .sm .name { display: none; }
.pack-surface .evo { margin-left: auto; font: .8em/1 var(--f-jp); font-style: normal; background: var(--g-ink); color: var(--gold); padding: .2em .3em; }
.pack-surface .art { position: relative; background: var(--g-ink); box-shadow: 0 0 0 .12em var(--g-ink); overflow: hidden; }
.pack-surface .art canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.pack-surface .art canvas[data-fallback] { filter: saturate(.6) sepia(.22) contrast(.95); }
.pack-surface .spell .art { clip-path: polygon(10% 0, 90% 0, 100% 14%, 100% 100%, 0 100%, 0 14%); }
.pack-surface .gear .art { clip-path: polygon(14% 0, 86% 0, 100% 50%, 86% 100%, 14% 100%, 0 50%); }
.pack-surface .foot { display: flex; align-items: center; gap: .3em; font: 600 1.15em/1 var(--f-ui); min-width: 0; }
.pack-surface .foot .pow { margin-left: auto; font-variant-numeric: tabular-nums; }
.pack-surface .kw { font: 600 .8em/1 var(--f-ui); background: var(--g-ink); color: var(--gold); padding: .18em .3em; white-space: nowrap; }
.pack-surface .tag { font: .85em/1 var(--f-jp); color: var(--ox); }
.pack-surface .back { display: grid; place-items: center; }
.pack-surface .back i { display: grid; place-items: center; }
.pack-surface .back b { font: 2.1em/1 var(--f-display); color: var(--gold); }
.bk-1 .pack-surface .back { background: repeating-linear-gradient(45deg, #5D2222 0 .2em, #6B2B2B .2em .4em); box-shadow: inset 0 0 0 .2em var(--g-ink), inset 0 0 0 .42em var(--gold), inset 0 0 0 .6em var(--ox-2); }
.bk-1 .pack-surface .back i { width: 3.2em; height: 3.2em; rotate: 45deg; box-shadow: 0 0 0 .22em var(--gold), 0 0 0 .4em var(--g-ink); background: var(--ox-2); }
.bk-1 .pack-surface .back b { rotate: -45deg; }
.bk-2 .pack-surface .back { background: radial-gradient(circle, rgba(201,164,90,.5) 0 .12em, transparent .14em) 0 0 / 1em 1em, #24324A; box-shadow: inset 0 0 0 .2em var(--g-ink), inset 0 0 0 .4em var(--gold-lo), inset 0 0 0 .52em var(--g-ink), inset 0 0 0 .72em #1A2436; }
.bk-2 .pack-surface .back i { width: 3.1em; height: 3.6em; border-radius: 0 0 1.55em 1.55em; background: var(--ox); box-shadow: 0 0 0 .2em var(--gold), 0 0 0 .36em var(--g-ink); }
.bk-3 .pack-surface .back { background: repeating-linear-gradient(0deg, rgba(201,164,90,.26) 0 .08em, transparent .08em .7em), var(--forest); box-shadow: inset 0 0 0 .2em var(--g-ink), inset 0 0 0 .32em var(--gold), inset 0 0 0 .9em var(--forest), inset 0 0 0 1em var(--gold-lo); }
.bk-3 .pack-surface .back i { width: 3.4em; height: 3.4em; border-radius: 50%; background: #24382C; box-shadow: 0 0 0 .2em var(--gold), 0 0 0 .5em var(--forest), 0 0 0 .62em var(--gold-lo); }
.bk-3 .pack-surface .back b { font-size: 1.8em; }
.bk-4 .pack-surface .back { background: conic-gradient(from 45deg, #5A3E26 0 25%, #47301F 0 50%, #5A3E26 0 75%, #47301F 0) 0 0 / 1.1em 1.1em; box-shadow: inset 0 0 0 .2em var(--g-ink), inset 0 0 0 .45em #A8894F, inset 0 0 0 .55em var(--g-ink); }
.bk-4 .pack-surface .back i { width: 3.2em; height: 3.2em; rotate: 45deg; background: #3A2716; box-shadow: 0 0 0 .18em #A8894F, 0 0 0 .5em #3A2716, 0 0 0 .62em #A8894F; }
.bk-4 .pack-surface .back b { rotate: -45deg; }
.pack-surface .prompt-box { display: grid; gap: 8px; justify-items: center; padding: 12px; background: rgba(22,16,11,.94); box-shadow: 0 0 0 2px var(--gold-lo); font: 14px var(--f-jp); color: var(--cream); }
.pack-surface .prompt-box .acts { display: flex; gap: 10px; }
.pack-surface .prompt-box span { font: 600 12px var(--f-ui); padding: 7px 14px; background: var(--gold); color: var(--g-ink); }
.pack-surface .prompt-box span + span { background: transparent; color: var(--parch); box-shadow: inset 0 0 0 1px var(--gold-lo); }
.pack-surface .pack { width: 180px; height: 252px; background: linear-gradient(var(--parch), var(--parch-2)); box-shadow: inset 0 0 0 3px var(--g-ink), inset 0 0 0 7px var(--ox), inset 0 0 0 9px var(--gold); }
.pack-surface .pack .p-top { position: absolute; left: 0; right: 0; top: 0; height: 46px; background: var(--ox); box-shadow: inset 0 0 0 3px var(--g-ink);
  clip-path: polygon(0 0, 100% 0, 100% 80%, 92% 100%, 84% 80%, 76% 100%, 68% 80%, 60% 100%, 52% 80%, 44% 100%, 36% 80%, 28% 100%, 20% 80%, 12% 100%, 4% 80%, 0 100%); }
.pack-surface .pack .p-body { position: absolute; inset: 70px 16px 18px; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; }
.pack-surface .pack .p-set { font: 46px/1 var(--f-display); color: var(--ox); font-weight: 400; }
.pack-surface .pack .p-name { font: 18px var(--f-jp); color: var(--g-ink); }
.pack-surface .pack .p-meta { font: 11px var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: #6E604D; }
.pack-surface .pack .wax { position: absolute; left: 50%; top: 34px; width: 34px; height: 34px; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #A54A3C, #7A2A22 60%, #4F1814); box-shadow: 0 0 0 2px #4F1814; }
.pack-surface .rar { translate: -50% 0; font: 600 12px var(--f-ui); letter-spacing: .1em; color: var(--gold); }
/* Draft real wrappers: one silhouette, a 2 px print grid, crimped seals and the original tear timing. */
.pack-surface .pack .p-top { z-index: 2; border-bottom: 2px dashed var(--gold-lo); }
.pack-surface .pack .p-top::before, .pack-surface .pack::after { content: ''; position: absolute; left: 3px; right: 3px; height: 10px; z-index: 3; background: repeating-linear-gradient(90deg, var(--gold-lo) 0 2px, var(--parch-2) 2px 4px); border-block: 2px solid var(--g-ink); }
.pack-surface .pack .p-top::before { top: 3px; }
.pack-surface .pack::after { bottom: 3px; }
.pack-surface .pack .wax { z-index: 4; }
.pack-surface .real-pack .p-body { visibility: hidden; }
.pack-surface .real-pack .p-print { position: absolute; inset: 46px 6px 6px; overflow: hidden; }
.pack-surface .real-pack .p-print-top { position: absolute; inset: 6px 6px 0; overflow: hidden; }
.pack-surface .real-pack canvas { display: block; width: 168px; height: 240px; image-rendering: pixelated; }
.pack-surface .real-pack .p-print canvas { margin-top: -40px; }
.pack-surface .logo-pack .p-set { display: none; }
.pack-surface .logo-pack .p-logo { display: block; width: 148px; height: 35px; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--g-ink); }
.pack-thumb { position: relative; display: block; flex: 0 0 30px; width: 30px; height: 42px; }
.pack-thumb .pack { position: absolute; inset: 0; transform: scale(.1666667); transform-origin: top left; }
.shelf-claim-row .pack-thumb + span { flex: 1; }
.shelf-claims:has(.pack-thumb) { max-height: 46px; }
.pack-surface .sheen { position: absolute; top: -20%; bottom: -20%; width: 30%; left: 0; background: linear-gradient(90deg, transparent, rgba(232,232,222,.75), transparent); rotate: 18deg; }
.pack-surface .inspect { inset: 0; display: grid; place-items: center; background: rgba(18, 13, 9, .82); pointer-events: auto; cursor: pointer; }
.pack-surface .insp { width: min(96%, 524px); display: grid; grid-template-columns: 316px minmax(0, 1fr); gap: 10px; padding: 10px; background: var(--parch); color: var(--g-ink); box-shadow: 0 0 0 2px var(--g-ink), 0 0 0 5px var(--gold-lo); }
.pack-surface .insp img { width: 316px; height: auto; display: block; box-shadow: 0 0 0 2px var(--g-ink); cursor: zoom-in; }
.pack-surface .insp h3 { margin: 0; font: 15px/1.25 var(--f-jp); font-weight: 400; }
.pack-surface .insp .meta { font: 10px/1.35 var(--f-ui); letter-spacing: .06em; color: #6E604D; margin: 3px 0 8px; text-transform: uppercase; }
.pack-surface .insp .lbls { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pack-surface .insp .lbls span { font: 600 10px/1 var(--f-ui); letter-spacing: .06em; padding: 4px 6px; background: var(--g-ink); color: var(--gold); }
.pack-surface .insp h4 { margin: 8px 0 4px; font: 600 10px var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ox); }
.pack-surface .insp ul { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.45; }
.pack-surface .insp code { font: 10px/1.4 ui-monospace, monospace; color: #5A4C3A; display: block; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; background: rgba(42,33,25,.06); padding: 6px; }
.pack-surface .scan-zoom { background: rgba(18, 13, 9, .94); cursor: zoom-out; z-index: 60; }
.pack-surface .scan-zoom img { width: min(96%, 520px); height: auto; display: block; box-shadow: 0 0 0 2px var(--g-ink), 0 0 0 5px var(--gold-lo); }
.pack-surface .prompt-box { pointer-events: auto; z-index: 56; }
.pack-surface .pack-again { width: 420px; }
.pack-surface .prompt-box .pb-t { text-align: center; line-height: 1.35; }
.pack-surface .prompt-box .acts { flex-wrap: wrap; justify-content: center; }
.pack-surface .prompt-box span, .pack-surface .origin .acts span, .pack-surface .tset .acts span { cursor: pointer; font: 600 12px var(--f-ui); padding: 7px 14px; background: var(--gold); color: var(--g-ink); }
.pack-surface .prompt-box span.off { filter: saturate(.2) brightness(.7); cursor: default; }
.pack-surface .prompt-box > div:not(.acts):not(.pb-t) { font: 11px var(--f-ui); letter-spacing: .08em; color: var(--gold); }

