/* pay-morph (Indy 2026-10-24, r4): the doge is now the exact Twitter takeover doge (April 3 2023 web-app home logo,
   100x115 PNG, img/doge-twitter-2023.png), mirrored so his nose points into the pane. Text and controls are laid out
   as if he weren't there (no insets): the hint is centred on the pane and the frosted address field keeps the
   address readable over him.
   r3 notes:
   - The doge is the ONLY tap target for the full-page dance in this pane (plus the copy button); no "Click/Swipe for Doge".
   - The doge owns the pane's bottom-left: anchored to the pane's inner bottom-left corner, bleeding off the left and
     bottom edges and clipped by the pane's rounded corner, rising beside the QR's lower-left. Its box stops inside the
     QR tile's padding/quiet zone (never over modules; verified with zbarimg). It sits BEHIND the frosted address field
     (soft fade), and the address text + hint line are inset so they never sit over the doge.
   - Captions are spread so no corner/gutter reads empty: wow top-right, much coin left (above the doge),
     such receive + very generous down the right gutter.
   Geometry vars: --pl/--pb = distance from the view's edge to the pane's inner (padding) edge, --pr = inner radius,
   --dw = doge width, --dl/--db = bleed past the left/bottom edge. */
/* r6: the doge is bigger (desktop 140 -> 160px, mobile 150 -> 166px, <=380px 172px) so his ear just covers the QR tile's
   bottom-left white border (~18px of the 24-28px white margin; modules untouched, zbarimg-verified); his eyes still peek
   over the frosted address field. */
.doge-view { --pl: 13.6px; --pb: 11.2px; --pr: 21px; --dw: 160px; --dl: 44px; --db: 34px; }

.doge-view .doge-mascot.doge-mascot-btn {
  appearance: none; position: absolute; z-index: 2; top: auto; transform: none; filter: none;
  left: calc(-1 * var(--pl)); bottom: calc(-1 * var(--pb));
  width: calc(var(--dw) - var(--dl)); height: calc(var(--dw) * 115 / 100 - var(--db) + 10px);
  padding: 0; margin: 0; border: 0; background: none; overflow: hidden;
  border-radius: 0 0 0 var(--pr); pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.doge-view .doge-mascot-btn img {
  position: absolute; left: calc(-1 * var(--dl)); bottom: calc(-1 * var(--db)); display: block;
  width: var(--dw); height: auto; max-width: none;
  scale: -1 1;   /* mirrored: nose toward the pane centre */
  transform-origin: 50% 100%; transition: transform 160ms ease, filter 160ms ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, rgba(0, 0, 0, 0.45) 100%);
          mask-image: linear-gradient(to bottom, #000 55%, rgba(0, 0, 0, 0.45) 100%);
}
.doge-view .doge-mascot-btn:hover img { transform: translateY(-4px) rotate(2deg); }
.doge-view .doge-mascot-btn:active img { transform: translateY(1px) scale(0.98); }
.doge-view .doge-mascot-btn:focus { outline: none; }
.doge-view .doge-mascot-btn:focus-visible img {   /* outline would be clipped by the corner; a gold halo hugs the doge instead */
  filter: drop-shadow(0 0 1.5px var(--doge-gold)) drop-shadow(0 0 1.5px var(--doge-gold)) drop-shadow(0 0 2px var(--doge-gold));
}

/* the address field is frosted glass over the doge; nothing is inset for him */
.doge-view .doge-addr-row, .doge-view .doge-status { z-index: 3; }
.doge-view .doge-addr {
  background: rgba(255, 255, 255, 0.58); -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3); }
html[data-theme="dark"] .doge-view .doge-addr { background: rgba(30, 30, 34, 0.6); }
.doge-view .doge-addr:hover { background: rgba(255, 255, 255, 0.7); }
html[data-theme="dark"] .doge-view .doge-addr:hover { background: rgba(48, 48, 54, 0.7); }
.doge-view .doge-status { align-self: stretch; }

/* captions */
.doge-view .dw-wow      { left: auto; right: -0.25rem; top: 14px;  font-size: 19px; transform: rotate(11deg); }
/* r5: 2 left (much coin, very generous: fills the space above the corner doge) + 2 right (wow, such receive) */
.doge-view .dw-coin     { left: -0.25rem; right: auto; top: 58px;  transform: rotate(-8deg); }
.doge-view .dw-receive  { right: -0.2rem; left: auto; top: 150px; transform: rotate(-6deg); }
.doge-view .dw-generous { left: -0.3rem; right: auto; top: 128px; transform: rotate(7deg); }   /* r6: -8px, clear of the bigger doge */

@media (max-width: 640px) {
  .doge-view { --pl: 12px; --pb: 19.2px; --pr: 31px; --dw: 166px; --dl: 46px; --db: 20px; }
  /* the sheet's .contact-card clips (overflow:hidden), which cut the doge at the card edge; let him reach the sheet corner */
  .contact-pane.pay-pane:has(.doge-view:not([hidden])) .contact-card { overflow: visible; }
  .doge-view .dw-wow      { right: 0.1rem; top: 22px; font-size: 21px; }
  .doge-view .dw-coin     { left: 0.1rem; top: 92px; }
  .doge-view .dw-receive  { right: 0.15rem; top: 182px; }
  .doge-view .dw-generous { left: 0.1rem; right: auto; top: 168px; }
}
@media (max-width: 380px) {
  .doge-view { --dw: 172px; --dl: 40px; --db: 22px; }
  .doge-view .dw-wow      { top: 12px; }
  .doge-view .dw-coin     { top: 66px; }
  .doge-view .dw-receive  { top: 140px; }
  .doge-view .dw-generous { top: 124px; }
}
/* r6 (Indy 2026-10-24): the official Dogecoin coin (Dogecoin Core repo, src/qt/res/icons/dogecoin.png, MIT; downscaled
   only) fills the right gutter between "wow" and "such receive", sliding off the pane's right edge. .doge-coin-clip
   reaches exactly to the pane's outer right edge (--cr = view edge to pane edge) and clips there, so the coin is cut
   by the pane edge. Decorative: behind the captions, no pointer events. */
.doge-view { --cr: 12.2px; --cw: 60px; --cv: 38px; --ct: 66px; }
.doge-view .doge-coin-clip {
  position: absolute; z-index: 0; pointer-events: none; overflow: hidden;
  right: calc(-1 * var(--cr)); top: calc(var(--ct) - 8px); width: calc(var(--cv) + 8px); height: calc(var(--cw) + 16px);
}
.doge-view .doge-coin-deco {
  position: absolute; left: 8px; top: 8px; width: var(--cw); height: var(--cw); max-width: none; display: block;
  transform: rotate(-14deg); opacity: 0.9;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.22));
}
html[data-theme="dark"] .doge-view .doge-coin-deco { opacity: 0.85; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45)); }
@media (max-width: 640px) { .doge-view { --cr: 13px; --cw: 64px; --cv: 40px; --ct: 82px; } }
@media (max-width: 380px) { .doge-view { --cw: 54px; --cv: 34px; --ct: 72px; } }

@media (max-width: 365px) { .doge-view { --dw: 164px; } }   /* r6: narrower QR tile on the smallest phones; keep the overlap a smidge */
@media (prefers-reduced-motion: reduce) {
  .doge-view .doge-mascot-btn img { transition: none; }
  .doge-view .doge-mascot-btn:hover img, .doge-view .doge-mascot-btn:active img { transform: none; }
}

/* r6: with hugging pills, the short Dogecoin address left the doge's face uncovered on phones (his eyes no longer
   peeked over the field). Phones down to 366px show the full address at 11.5px instead, so the centred pill is wide
   enough to sit across his muzzle again; the smallest phones keep the short start…end form. */
@media (max-width: 480px) and (min-width: 366px) {
  .doge-view .doge-addr { font-size: 11.5px; letter-spacing: -0.02em; }
  .doge-view .doge-addr-full { display: inline; }
  .doge-view .doge-addr-short { display: none; }
}

/* r9 (Indy 2026-10-24): the right-edge coin is a real 3D coin turning slowly on its Y axis.
   Front + back faces use the official Dogecoin coin art (Dogecoin Core repo dogecoin.png, cropped to the coin only).
   The rim is 11 stacked gold discs spread over the coin thickness (--ct3), so it shows a solid gold edge when it turns
   edge-on. A sheen and a shade layer on each face shift with the angle (same 5.6s timeline) for soft specular lighting.
   Size: --cd coin diameter; the clip still ends exactly at the pane's outer right edge, and at most ~20% of the coin
   (--cpast) sits past it. doge-coin.js only lets it run while the pane is open, the Dogecoin view is shown and it is
   on screen. Reduced motion: a static coin, slightly angled. */
.doge-view { --cd: 44px; --cpast: 0.2; --cy: 74px; --ct3: 3.6px; --cspin: 5.6s; }
@media (max-width: 640px) { .doge-view { --cd: 48px; --cy: 90px; --ct3: 3.9px; } }
@media (max-width: 380px) { .doge-view { --cd: 42px; --cy: 78px; --ct3: 3.4px; } }
.doge-view .doge-coin-clip {
  right: calc(-1 * var(--cr)); top: calc(var(--cy) - 10px);
  width: calc(var(--cd) * (1 - var(--cpast)) + 12px); height: calc(var(--cd) + 20px);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.22));
}
html[data-theme="dark"] .doge-view .doge-coin-clip { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.doge-coin3d { position: absolute; left: 12px; top: 10px; width: var(--cd); height: var(--cd); display: block;
  perspective: calc(var(--cd) * 6); transform: rotate(-9deg); }
.dc-spin { position: absolute; inset: 0; display: block; transform-style: preserve-3d;
  animation: dc-spin var(--cspin) linear infinite; }
.dc-edge { position: absolute; inset: 0; display: block; transform-style: preserve-3d; }
.dc-disc { position: absolute; inset: 1.5%; display: block; border-radius: 50%;
  transform: translateZ(calc((var(--i) / 10 - 0.5) * var(--ct3)));
  background: #9d8730; box-shadow: inset 0 0 0 1px rgba(90, 70, 10, 0.35);
  animation: dc-rim var(--cspin) linear infinite; }
.dc-face { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: 50%;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.dc-front { transform: translateZ(calc(var(--ct3) / 2 + 0.05px)); }
.dc-back  { transform: rotateY(180deg) translateZ(calc(var(--ct3) / 2 + 0.05px)); }
.dc-face img { display: block; width: 100%; height: 100%; max-width: none; }
.dc-sheen { position: absolute; inset: 0; display: block; border-radius: 50%; pointer-events: none;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 250, 225, 0.55) 48%, rgba(255, 250, 225, 0.12) 56%, transparent 68%) no-repeat;
  background-size: 320% 100%; }
.dc-face::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(40, 28, 0, 1); opacity: 0; pointer-events: none; }
.dc-front .dc-sheen { animation: dc-sheen-f var(--cspin) linear infinite; }
.dc-back  .dc-sheen { animation: dc-sheen-b var(--cspin) linear infinite; }
.dc-front::after { animation: dc-shade-f var(--cspin) linear infinite; }
.dc-back::after  { animation: dc-shade-b var(--cspin) linear infinite; }
@keyframes dc-spin { from { transform: rotateX(8deg) rotateY(0deg); } to { transform: rotateX(8deg) rotateY(-360deg); } }
@keyframes dc-rim { 0%, 50%, 100% { background-color: #8c7628; } 25% { background-color: #e2c55a; } 75% { background-color: #6f5c1c; } }
@keyframes dc-sheen-f { 0% { background-position: 50% 0; } 25% { background-position: 100% 0; } 50% { background-position: 50% 0; } 75% { background-position: 0% 0; } 100% { background-position: 50% 0; } }
@keyframes dc-sheen-b { 0% { background-position: 50% 0; } 25% { background-position: 0% 0; } 50% { background-position: 50% 0; } 75% { background-position: 100% 0; } 100% { background-position: 50% 0; } }
@keyframes dc-shade-f { 0%, 100% { opacity: 0; } 25%, 75% { opacity: 0.42; } }
@keyframes dc-shade-b { 0%, 50%, 100% { opacity: 0.42; } 50% { opacity: 0; } }
.doge-coin3d:not(.is-running) .dc-spin, .doge-coin3d:not(.is-running) .dc-disc,
.doge-coin3d:not(.is-running) .dc-sheen, .doge-coin3d:not(.is-running) .dc-face::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .dc-spin, .dc-disc, .dc-sheen, .dc-face::after { animation: none !important; }
  .dc-spin { transform: rotateX(8deg) rotateY(-32deg); }
  .dc-disc { background-color: #a88f34; }
  .dc-front .dc-sheen { background-position: 70% 0; }
  .dc-front::after { opacity: 0.12; }
}
/* r10 (Indy 2026-10-24): the coin now matches Indy's style reference (reference only, not shipped): a solid warm-gold
   coin drawn by hand in img/doge-coin-d.svg (radial-gradient face, inset ring, embossed white Ð), a thick amber rim
   (16% of the diameter deep, so ~8-10% shows at the tilt, 15 stacked discs, darker toward the lower right) and soft matte light. No more full spin: it
   rests at a 3/4 tilt and gently rocks rotateY -22° to -38° (rim on the right, like the reference) with a 3px bob, 5s ease-in-out, so the face always shows.
   Reduced motion: static at the 3/4 tilt. */
.doge-view { --ct3: calc(var(--cd) * 0.16); --crock: 5s; }
.doge-coin3d { transform: none; }
.dc-disc { transform: translateZ(calc((var(--i) / 14 - 0.5) * var(--ct3))); }
.dc-spin { animation: dc-rock var(--crock) ease-in-out infinite; }
.dc-disc { inset: 0.5%; animation: none; background: linear-gradient(135deg, #E7AE2E 0%, #C98B17 45%, #8F5E0C 100%);
  box-shadow: inset 0 0 0 0.5px rgba(110, 70, 5, 0.45); }
.dc-disc[style*="--i:0"] { background: #7f530a; }
.dc-front .dc-sheen { animation: dc-sheen-rock var(--crock) ease-in-out infinite;
  background: radial-gradient(circle at 34% 28%, rgba(255, 250, 230, 0.32), rgba(255, 250, 230, 0) 55%) no-repeat;
  background-size: 130% 130%; background-position: 40% 40%; }
.dc-back .dc-sheen { animation: none; background: none; }
.dc-front::after, .dc-back::after { animation: none; opacity: 0; }
@keyframes dc-rock {
  0%, 100% { transform: translateY(0) rotateX(14deg) rotateY(-22deg); }
  50%      { transform: translateY(-5px) rotateX(14deg) rotateY(-38deg); }
}
@keyframes dc-sheen-rock { 0%, 100% { background-position: 35% 40%; } 50% { background-position: 60% 40%; } }
@media (prefers-reduced-motion: reduce) {
  .dc-spin { transform: rotateX(14deg) rotateY(-30deg); }
  .dc-disc { background: linear-gradient(135deg, #E7AE2E 0%, #C98B17 45%, #8F5E0C 100%); }
  .dc-disc[style*="--i:0"] { background: #7f530a; }
  .dc-front .dc-sheen { background-position: 45% 40%; }
}

/* r11 (Indy 2026-10-24): the coin is scaled with intent, like the big corner doge: ~2.5x (112px at desktop, 116px on
   phones), filling the right gutter between "wow" and "such receive". It is cut by the pane edge only because it is
   too big to fit (~25-30% of it sits past the edge). It tucks a few px under the QR tile's white padding (the tile sits
   above it) but never reaches the QR modules. Rocking, reduced-motion still state and the closed/offscreen pause are
   unchanged. "wow" moves up and "such receive" moves down to give it room. */
.doge-view { --cd: 112px; --cpast: 0.3; --cy: 42px; }
@media (max-width: 640px) { .doge-view { --cd: 116px; --cy: 52px; } }
@media (max-width: 380px) { .doge-view { --cd: 100px; --cy: 44px; } }
.doge-view .coin-qr-tile { position: relative; z-index: 1; }
.doge-view .doge-coin-clip { filter: drop-shadow(0 5px 8px rgba(60, 40, 0, 0.22)) drop-shadow(0 1px 1.5px rgba(60, 40, 0, 0.18)); }
html[data-theme="dark"] .doge-view .doge-coin-clip { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }
.doge-view .dw-wow     { top: 2px; }
.doge-view .dw-receive { top: 166px; }
@media (max-width: 640px) {
  .doge-view .dw-wow     { top: 12px; }
  .doge-view .dw-receive { top: 190px; }
}
@media (max-width: 380px) {
  .doge-view .dw-wow     { top: 4px; }
  .doge-view .dw-receive { top: 160px; }
}

/* after39 (Indy 5:23 PM PT 2026-10-24): "shorten the doge coin address only to the point where the text bubble it sits
   inside of covers the doge nose". The centred pill shows a middle-ellipsis address cut so its left edge just covers the
   tip of the doge's (mirrored) nose and his eyes still peek over it. Counts are visible characters, ellipsis excluded,
   measured against the nose tip (image px 22,47 of the 100x115 PNG, mirrored); "under" = how far the pill's left edge
   sits left of the tip:
     >640px   (11px):    8 + 7  = 15  DQozcD1Q…QMLN5Ed        1.7px (1920/1280/768)
     481-640  (13px):    9 + 9  = 18  DQozcD1Qb…qXQMLN5Ed     2.6px
     391-480  (11.5px): 11 + 10 = 21  DQozcD1QbZT…tqXQMLN5Ed  3.1px (401-480), up to ~7px at 391
     381-390  (11.5px): 10 + 10 = 20  DQozcD1QbZ…tqXQMLN5Ed   3.7px at 390 (19 chars would be 0.35px), 8px at 381
     366-380  (11.5px):  7 + 7  = 14  DQozcD1…QMLN5Ed         1.8px at 375
   <=365px keeps the old short form. The copy button, tap-to-copy (data-doge-addr), aria-label and title all carry the
   full 34-character address; the QR is untouched. */
.doge-view .doge-addr .doge-addr-full, .doge-view .doge-addr .doge-addr-short, .doge-view .doge-addr .doge-addr-cut { display: none; }
.doge-view .doge-addr .doge-addr-cut--d { display: inline; }
@media (max-width: 640px) {
  .doge-view .doge-addr .doge-addr-cut--d { display: none; }
  .doge-view .doge-addr .doge-addr-cut--t { display: inline; }
}
@media (max-width: 480px) {
  .doge-view .doge-addr .doge-addr-cut--t { display: none; }
  .doge-view .doge-addr .doge-addr-cut--l { display: inline; }
}
@media (max-width: 390px) {
  .doge-view .doge-addr .doge-addr-cut--l { display: none; }
  .doge-view .doge-addr .doge-addr-cut--m { display: inline; }
}
@media (max-width: 380px) {
  .doge-view .doge-addr .doge-addr-cut--m { display: none; }
  .doge-view .doge-addr .doge-addr-cut--s { display: inline; }
}
@media (max-width: 365px) {
  .doge-view .doge-addr .doge-addr-cut--s { display: none; }
  .doge-view .doge-addr .doge-addr-short { display: inline; }
}
