.card-proof-dialog {
  --gold:#edbd6e; --vellum:#f6e6c8;
  width:min(510px,100%); max-width:100%; max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);
  margin:auto; padding:0; border:0; color:var(--vellum); background:transparent; overflow:auto; overscroll-behavior:contain;
  scrollbar-width:thin; scrollbar-color:#867052 transparent;
}
.card-proof-dialog::backdrop {
  background:radial-gradient(ellipse at 50% 44%,#29241bd9,#111611ee 72%); backdrop-filter:blur(3px);
}
.change-sheet {
  --print-width:clamp(194px,27dvh,246px);
  display:grid; justify-items:center; gap:18px; isolation:isolate; padding:18px 22px 22px; text-align:center;
}
.change-heading { display:flex; align-items:center; justify-content:center; gap:12px; }
.change-heading h2 { display:flex; align-items:center; gap:9px; font:700 clamp(27px,3.6dvh,37px)/1 var(--font-display); }
#card-choice-title:focus { outline:none; }
.card[aria-haspopup="dialog"] { -webkit-tap-highlight-color:transparent; }
.change-sheet.choice-text { display:flex; flex-direction:column; align-items:center; gap:14px; }
.choice-text :is(.change-heading,.change-caption) { align-self:center; }
.choice-text .change-caption p { margin:0 0 6px; color:var(--vellum); font:500 18px/1.35 var(--font-body); }
.change-heading .icon { width:.74em; height:.74em; color:var(--gold); stroke-width:2.4; }
.change-count { color:#e5c48c; font:600 16px var(--font-body); font-variant-numeric:tabular-nums; }
.change-count:empty { display:none; }
.change-stage { position:relative; width:var(--print-width); }
.change-stage::before {
  content:""; position:absolute; pointer-events:none; inset:-10% -41%; z-index:-1;
  background:repeating-conic-gradient(from 13deg,#dfad655e 0 .6deg,transparent .7deg 8deg,#dfad6530 8.3deg 8.8deg,transparent 9deg 15deg);
  mask-image:radial-gradient(ellipse closest-side,#000 52%,transparent 99%);
}
.change-print { position:relative; width:100%; aspect-ratio:2 / 3; }
.change-original,.change-result { position:absolute; inset:0; pointer-events:none; }
#card-choice .change-print { aspect-ratio:auto; }
#card-choice .change-result { position:relative; container-type:inline-size; }
.change-original { visibility:hidden; }
:root .card-proof-dialog .ink-card { width:100%; height:100%; margin:0; text-align:center; }
:root .card-proof-dialog .ink-card .cname { font-size:clamp(23px,3.3dvh,30px); }
:root .card-proof-dialog .ink-card.name-long .cname { font-size:clamp(21px,3dvh,27px); }
:root .card-proof-dialog .ink-card .cdesc { font-size:clamp(18px,2.35dvh,21px); line-height:1.2; }
:root .card-proof-dialog .ink-card.text-long .cdesc { font-size:clamp(16px,2.1dvh,19px); }
:root .card-proof-dialog .ink-card .ctype { font-size:13px; }
.change-result .ink-card.up { outline:1px solid #e5bb76; box-shadow:0 0 0 3px #453923,0 6px 26px #000a; }
.final-reveal .change-stage::before {
  inset:-18% -47%;
  background:repeating-conic-gradient(from 9deg,#edba686e 0 .65deg,transparent .8deg 5.8deg,#f0d59055 6deg 6.35deg,transparent 6.6deg 12deg);
}
.final-reveal .change-heading h2 { color:#ffe5a4; }
.change-caption .evolution-path { color:#d7c7aa; }
.change-result mark {
  color:#352610; background:#efc46d; padding:0 .13em; font-weight:700;
  box-shadow:inset 0 -2px #8e601e; border-radius:1px;
}
:root .card-proof-dialog .ink-card .changed-cost { background:#f1cb79; color:#392915; border-color:#845c2b; }
.change-caption { display:grid; justify-items:center; align-content:center; gap:10px; width:min(100%,350px); }
.change-caption p { margin:0; }
.change-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
.change-actions .btn { min-height:44px; }
.change-comparison,.change-terms dl { margin:0; font:500 17px/1.3 var(--font-body); }
.change-comparison { display:grid; gap:4px; }
.change-comparison dt,.change-comparison dd { display:inline; margin:0; }
.change-comparison dt { margin-right:7px; color:#c8b28b; font-weight:600; }
.change-comparison dd { color:#f1e4cb; }
.change-comparison b { color:var(--gold); }
.change-terms { max-width:100%; color:#ded3bc; font:500 16px/1.25 var(--font-body); }
.change-terms summary { width:max-content; max-width:100%; margin:auto; padding:5px; cursor:pointer; }
.change-terms dl { margin:4px 0 2px; padding:9px 12px; border-left:2px solid #b29562; text-align:left; background:#191d17; }
.change-terms dl>div+div { margin-top:6px; } .change-terms dt { color:#efce93; font-weight:600; } .change-terms dd { margin:0; }
.btn.change-next {
  min-height:44px; min-width:120px; justify-content:center; padding:7px 24px; border:1px solid #b2905c; border-radius:2px;
  background:#eed7a8; color:#372b1c; box-shadow:inset 0 0 0 2px #f7e4c1,inset 0 0 0 3px #a5885b; font:700 21px/1.15 var(--font-display);
}
.btn.change-next:is(:hover,:focus-visible) { color:#261d11; background:#ffe8b9; }
.change-strike { display:none; }
@media (prefers-reduced-motion:no-preference) {
  :where(#card-change) .change-print { animation:print-lift 760ms cubic-bezier(.2,.72,.25,1) both; }
  .change-original { animation:first-impression 950ms both; }
  [data-kind="upgrade"] .change-result { animation:second-impression 950ms both; }
  .change-strike {
    display:block; position:absolute; left:-5%; width:110%; height:6px; pointer-events:none;
    background:linear-gradient(90deg,transparent,#e9b962 19%,#fff0bb 48%,#cf914b 82%,transparent);
    box-shadow:0 0 12px #e4a750; transform:skewY(-8deg); animation:ink-stroke 950ms both;
  }
  [data-kind="upgrade"] .change-stage::before { animation:gild-rays 1050ms ease-out both; }
  [data-kind="remove"] .change-print { animation:withdraw-print 600ms ease-out both; }
  .deck-receipt { animation:receipt-in 260ms ease-out both; }
  .deck-receipt[data-kind="remove"] .receipt-print { animation:withdraw-print 520ms ease-out; }
}
@keyframes print-lift {
  from { transform:translateY(16px) rotate(-4deg) scale(.94); } 55% { transform:translateY(-3px) rotate(1deg); } to { transform:none; }
}
@keyframes first-impression { 0%,90% { visibility:visible; } 100% { visibility:hidden; } }
@keyframes second-impression {
  0%,22% { clip-path:polygon(-10% 119%,110% 106%,110% 119%,-10% 119%); }
  84%,100% { clip-path:polygon(-10% -9%,110% -22%,110% 119%,-10% 119%); }
}
@keyframes ink-stroke { 0%,22% { top:108%; opacity:0; } 31% { opacity:1; } 77% { opacity:.9; } 84%,100% { top:-15%; opacity:0; } }
@keyframes gild-rays { 0%,20% { opacity:.12; transform:scale(.88); } 57% { opacity:1; } 100% { opacity:.7; transform:scale(1); } }
@keyframes withdraw-print { from { transform:translateY(-12px) rotate(6deg); opacity:.45; } to { transform:none; opacity:1; } }
@keyframes receipt-in { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

#deck-notice {
  position:fixed; z-index:46; top:max(60px,calc(env(safe-area-inset-top) + 48px)); left:50%; transform:translateX(-50%);
  max-width:calc(100vw - 20px); pointer-events:none;
}
.deck-receipt {
  display:flex; align-items:center; gap:11px; padding:6px 16px 6px 8px; border:1px solid #92734c; border-radius:2px; color:#d6bc92;
  background:#23251ef5; box-shadow:0 4px 12px #111a; text-align:left; pointer-events:auto; cursor:pointer;
  font:500 14px/1.12 var(--font-body);
}
.deck-receipt b { display:block; color:#f3dfbd; font:700 21px/1.1 var(--font-display); }
.receipt-print {
  display:block; flex:none; width:43px; height:53px; border:2px solid var(--card-accent); transform:rotate(-4deg);
  background:var(--card-ink) var(--card-image) var(--art-x) var(--art-y)/var(--art-width,400%) 600% no-repeat;
}
@media (orientation:landscape) and (max-height:540px) {
  .card-proof-dialog { width:min(610px,100%); }
  .change-sheet { --print-width:clamp(142px,53dvh,210px); grid-template-columns:auto minmax(0,245px); justify-content:center; align-items:center; gap:10px 26px; padding:12px 24px; }
  .change-stage { grid-column:1; grid-row:1 / 3; } .change-heading { grid-column:2; align-self:end; } .change-caption { grid-column:2; align-self:start; }
  :root .card-proof-dialog .ink-card .cname { font-size:21px; } :root .card-proof-dialog .ink-card.name-long .cname { font-size:19px; }
  :root .card-proof-dialog .ink-card .cdesc { font-size:16px; } :root .card-proof-dialog .ink-card.text-long .cdesc { font-size:14px; }
  #deck-notice { top:max(8px,env(safe-area-inset-top)); }
}
@media (orientation:portrait) and (max-height:650px) {
  .change-sheet { --print-width:194px; padding:10px 17px; gap:12px; }
}
