/*
 * TAG Legal Desk v2.1, wp3_canteen: the blind box at the front of the Canteen (J139, J141), js\v21_box.js.
 * The crate is drawn here from simple shapes in the desk's glass look (the art tokens, so it follows Light, Dark and
 * the Canteen themes), with the tilt read from custom properties the script sets through the CSSOM (--bx-rx, --bx-ry,
 * --bx-mx, --bx-my), a shine that sweeps across it every few seconds, the odd sparkle drifting off it and the big
 * "50% OFF NOW" sticker. Only transform, opacity, filter and background position animate. Everything is still under
 * reduced motion, Calm, the quiet states, a day that matters and High contrast (the script also never starts a moment
 * then), hidden with data-quiet, and drawn by the system in forced colours. It also holds the two box colours'
 * moving looks (.v21-fx-opal_fire, .v21-fx-southern_lights, on the layers styles\v21_colours_fx.css lays out), the
 * golden akubra's colourway on Wren and the opal colourway of the Southern Cross frame. New class names start v21bx.
 */

/* ---------- welfare first (the core hides [data-v21="game"] too) ---------- */
:root[data-quiet="on"] .v21bx-front,
:root[data-quiet="on"] .v21bx-boosts,
:root[data-quiet="on"] .v21bx-burst { display: none !important; }

/* ---------- the top: the box, and the header beside it (under it on a narrow sheet) ---------- */
.v21bx-top { container-type: inline-size; min-width: 0; }
.v21bx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: stretch; }
@container (min-width: 760px) {
  .v21bx-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .v21bx-grid > .v21c-hero { grid-template-columns: minmax(0, 1fr); align-content: center; }
}

/* ---------- the box's own card ---------- */
.v21bx-front { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; gap: 10px; padding: 16px 18px 20px; border-radius: var(--r-card, 20px); text-align: center; min-width: 0; }
.v21bx-front::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60% 55% at 50% 28%, color-mix(in srgb, var(--flora-wattle, #D9A21B) 20%, transparent), transparent 72%); }
.v21bx-stage { position: relative; width: min(100%, 400px); height: 236px; display: grid; place-items: center; }
.v21bx-scene { position: relative; width: 210px; height: 220px; display: grid; place-items: center; perspective: 720px; touch-action: manipulation; }
.v21bx-glow { position: absolute; left: 50%; top: 55%; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--flora-wattle, #D9A21B) 50%, transparent), transparent); opacity: .5; animation: v21bx-breathe 3.6s ease-in-out infinite alternate; }
.v21bx-floor { position: absolute; left: 50%; bottom: 8px; width: 156px; height: 18px; margin-left: -78px; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(0,0,0,.26), transparent); }

/* The crate: a lid with a bow over a glossy body with a ribbon. Tilted by the pointer (the script caps it at 12 deg). */
.v21bx-crate { --bx-rx: 0deg; --bx-ry: 0deg; --bx-mx: 50%; --bx-my: 30%; --bx-w: var(--flora-wattle, #D9A21B); --bx-wd: var(--flora-wattle-deep, #A87A0C); --bx-r: var(--flora-waratah, #A8203F);
  position: relative; width: 172px; height: 156px; margin-top: 30px; transform-style: preserve-3d; transform: rotateX(var(--bx-rx)) rotateY(var(--bx-ry));
  transition: transform 110ms linear; animation: v21bx-float 4.8s ease-in-out infinite alternate; }
.v21bx-crate.is-easing { transition: transform 650ms cubic-bezier(.2,.8,.2,1); }
.v21bx-crate i { display: block; }
.v21bx-body { position: absolute; left: 0; right: 0; bottom: 0; height: 114px; overflow: hidden; border-radius: 14px 14px 20px 20px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--bx-w) 62%, #FFFFFF) 0%, var(--bx-w) 40%, color-mix(in srgb, var(--bx-wd) 82%, #000000) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -10px 18px rgba(0,0,0,.18), 0 18px 26px -12px rgba(0,0,0,.5); }
.v21bx-rib { position: absolute; left: 50%; top: 0; bottom: 0; width: 26px; margin-left: -13px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bx-r) 78%, #000000), var(--bx-r) 30%, color-mix(in srgb, var(--bx-r) 66%, #FFFFFF) 50%, var(--bx-r) 70%, color-mix(in srgb, var(--bx-r) 78%, #000000)); }
.v21bx-q { position: absolute; left: 50%; top: 54%; width: 52px; height: 52px; margin: -26px 0 0 -26px; display: grid; place-items: center; border-radius: 50%;
  font-size: 1.875rem; line-height: 1; font-weight: 800; color: color-mix(in srgb, var(--bx-wd) 60%, #000000); background: color-mix(in srgb, #FFFFFF 88%, var(--bx-w));
  box-shadow: 0 2px 6px rgba(0,0,0,.25), inset 0 -2px 0 rgba(0,0,0,.08); transition: opacity 200ms ease; }
.v21bx-gloss { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(42% 52% at var(--bx-mx) var(--bx-my), rgba(255,255,255,.5), transparent 72%); }
.v21bx-shine { position: absolute; top: -25%; bottom: -25%; left: -50%; width: 42%; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.7) 50%, transparent); transform: translateX(0) skewX(-14deg); animation: v21bx-shine 4.8s ease-in-out infinite; }
.v21bx-lid { position: absolute; left: -9px; right: -9px; top: 14px; height: 34px; z-index: 2; border-radius: 12px; transform-origin: 18% 100%;
  background: linear-gradient(175deg, color-mix(in srgb, var(--bx-w) 55%, #FFFFFF), var(--bx-w) 55%, color-mix(in srgb, var(--bx-wd) 88%, #000000));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 6px 10px -4px rgba(0,0,0,.35); }
.v21bx-lid::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 28px; margin-left: -14px; background: linear-gradient(90deg, color-mix(in srgb, var(--bx-r) 78%, #000000), var(--bx-r) 35%, color-mix(in srgb, var(--bx-r) 62%, #FFFFFF) 50%, var(--bx-r) 65%, color-mix(in srgb, var(--bx-r) 78%, #000000)); }
.v21bx-bow { position: absolute; top: -24px; left: 50%; width: 42px; height: 30px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--bx-r) 55%, #FFFFFF) 0 18%, var(--bx-r) 46%, color-mix(in srgb, var(--bx-r) 70%, #000000) 100%); box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.v21bx-bow-l { margin-left: -44px; transform: rotate(-20deg); transform-origin: 100% 100%; }
.v21bx-bow-r { margin-left: 2px; transform: rotate(20deg); transform-origin: 0 100%; }
.v21bx-knot { position: absolute; left: 50%; top: -14px; width: 20px; height: 20px; margin-left: -10px; border-radius: 7px; background: color-mix(in srgb, var(--bx-r) 88%, #000000); box-shadow: inset 0 2px 0 rgba(255,255,255,.35); }

/* Open: the lid sits lifted, light spills from inside, the question mark has gone. */
.v21bx-crate.is-open .v21bx-lid { transform: translate(-10px, -28px) rotate(-16deg); }
.v21bx-crate.is-open .v21bx-q { opacity: 0; }
.v21bx-crate.is-open .v21bx-body::after { content: ""; position: absolute; left: 8%; right: 8%; top: -18px; height: 60px; pointer-events: none; background: radial-gradient(closest-side, rgba(255,255,255,.85), transparent); }
.v21bx-scene[data-reveal="rare"] .v21bx-glow { opacity: .85; background: radial-gradient(closest-side, color-mix(in srgb, var(--info) 55%, transparent), transparent); }
.v21bx-scene[data-reveal="very_rare"] .v21bx-glow { opacity: .95; background: radial-gradient(closest-side, color-mix(in srgb, var(--fauna-galah-pink, #D9798F) 60%, transparent), transparent); }
.v21bx-scene[data-reveal="legendary"] .v21bx-glow { opacity: 1; width: 300px; height: 300px; margin: -150px 0 0 -150px; background: radial-gradient(closest-side, color-mix(in srgb, var(--flora-wattle, #D9A21B) 75%, var(--flora-wild-white, #FFFFFF)), transparent); }
/* A found glow breathes brighter than the idle one (the idle breath animates opacity, which beats a plain opacity). */
.v21bx-scene:is([data-reveal="rare"], [data-reveal="very_rare"], [data-reveal="legendary"]) .v21bx-glow { animation-name: v21bx-breathe-hi; }

/* The reveal, paced by rarity: a quick lid pop; a brighter pop; a shake then a pop with a glow; a longer build. */
.v21bx-crate.is-fresh .v21bx-lid { animation: v21bx-pop .35s cubic-bezier(.2,1.4,.4,1) both; }
.v21bx-crate.is-fresh[data-reveal="uncommon"] .v21bx-lid { animation-duration: .5s; }
.v21bx-crate.is-fresh[data-reveal="uncommon"] .v21bx-body { animation: v21bx-bright .6s ease-out both; }
.v21bx-crate.is-fresh[data-reveal="rare"] { animation: v21bx-shake .45s ease-in-out both; }
.v21bx-crate.is-fresh[data-reveal="rare"] .v21bx-lid { animation: v21bx-pop .55s cubic-bezier(.2,1.4,.4,1) .4s both; }
.v21bx-crate.is-fresh:is([data-reveal="very_rare"], [data-reveal="legendary"]) { animation: v21bx-shake .3s ease-in-out 3 both; }
.v21bx-crate.is-fresh:is([data-reveal="very_rare"], [data-reveal="legendary"]) .v21bx-lid { animation: v21bx-pop .7s cubic-bezier(.2,1.5,.4,1) .85s both; }
.v21bx-crate.is-fresh:is([data-reveal="very_rare"], [data-reveal="legendary"]) .v21bx-body { animation: v21bx-bright 1.2s ease-out .8s both; }

/* ---------- the sparkles ---------- */
.v21bx-sparks { position: absolute; inset: 0; pointer-events: none; }
.v21bx-spark { position: absolute; left: var(--sx, 50%); top: var(--sy, 40%); width: 12px; height: 12px; margin: -6px 0 0 -6px; opacity: 0;
  background: radial-gradient(circle, var(--flora-wild-white, #FFFFFF) 0 20%, var(--flora-wattle, #D9A21B) 46%, transparent 72%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: v21bx-spark 1.5s ease-out forwards; }
.v21bx-spark.is-big { width: 18px; height: 18px; margin: -9px 0 0 -9px; }

/* ---------- the big moment: a light burst and a ring of sparks (very rare and legendary) ---------- */
.v21bx-burst { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.v21bx-burst i { display: block; }
.v21bx-flash { position: absolute; left: 50%; top: 48%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, var(--flora-wild-white, #FFFFFF) 0%, color-mix(in srgb, var(--flora-wattle, #D9A21B) 80%, transparent) 40%, transparent 70%); animation: v21bx-flash 1.1s cubic-bezier(.2,.8,.2,1) forwards; }
.v21bx-bp { position: absolute; left: 50%; top: 48%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, var(--flora-wild-white, #FFFFFF) 0 25%, var(--flora-wattle, #D9A21B) 55%, transparent 76%); animation: v21bx-bp 1.4s cubic-bezier(.16,.84,.3,1) forwards; animation-delay: var(--bd, 0ms); }
.v21bx-burst[data-rarity="legendary"] .v21bx-bp:nth-child(odd) { background: radial-gradient(circle, var(--flora-wild-white, #FFFFFF) 0 25%, var(--flora-wild-violet, #A77BFF) 55%, transparent 76%); }
.v21bx-burst[data-rarity="legendary"] .v21bx-bp:nth-child(3n) { background: radial-gradient(circle, var(--flora-wild-white, #FFFFFF) 0 25%, var(--fauna-lori-green, #2FD08A) 55%, transparent 76%); }
/* The legendary alone: a second, later wave of light, wider than the first, and a golden rim round the card while it plays. */
.v21bx-burst[data-rarity="legendary"]::after { content: ""; position: absolute; left: 50%; top: 48%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, var(--flora-wild-white, #FFFFFF) 0%, color-mix(in srgb, var(--flora-wild-violet, #A77BFF) 70%, transparent) 38%, color-mix(in srgb, var(--fauna-lori-green, #2FD08A) 45%, transparent) 55%, transparent 72%);
  animation: v21bx-flash2 1.3s cubic-bezier(.2,.8,.2,1) .5s forwards; }
.v21bx-front:has(.v21bx-burst[data-rarity="legendary"]) { box-shadow: 0 0 0 3px var(--flora-wattle, #D9A21B), 0 0 40px color-mix(in srgb, var(--flora-wattle, #D9A21B) 50%, transparent); }

/* ---------- the sticker: "50% OFF NOW", 80 struck through, 40 Leaf Tokens ---------- */
.v21bx-sticker { position: absolute; right: 0; top: 4px; z-index: 3; display: grid; align-content: center; justify-items: center; gap: 2px; width: 126px; height: 126px; padding: 14px; text-align: center; color: var(--brand-ink, #FFFFFF);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--flora-waratah, #A8203F) 72%, #FFFFFF), var(--flora-waratah, #A8203F) 55%, color-mix(in srgb, var(--flora-waratah, #A8203F) 80%, #000000));
  clip-path: polygon(50.0% 0.0%, 60.9% 9.4%, 75.0% 6.7%, 79.7% 20.3%, 93.3% 25.0%, 90.6% 39.1%, 100.0% 50.0%, 90.6% 60.9%, 93.3% 75.0%, 79.7% 79.7%, 75.0% 93.3%, 60.9% 90.6%, 50.0% 100.0%, 39.1% 90.6%, 25.0% 93.3%, 20.3% 79.7%, 6.7% 75.0%, 9.4% 60.9%, 0.0% 50.0%, 9.4% 39.1%, 6.7% 25.0%, 20.3% 20.3%, 25.0% 6.7%, 39.1% 9.4%);
  transform: rotate(-12deg); animation: v21bx-wobble 2.6s ease-in-out infinite; }
.v21bx-st-big { font-size: 1.0625rem; line-height: 1.0625rem; font-weight: 900; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.v21bx-st-line { display: grid; justify-items: center; font-size: .75rem; line-height: .875rem; font-weight: 700; }
.v21bx-sticker.is-bare .v21bx-st-big { font-size: 1.1875rem; line-height: 1.25rem; }
.v21bx-st-was { opacity: .9; text-decoration-thickness: 2px; }
.v21bx-st-now { font-weight: 900; }

/* ---------- the words and the buttons ---------- */
.v21bx-info { display: grid; justify-items: center; gap: 8px; width: 100%; max-width: 540px; min-width: 0; }
.v21bx-title { margin: 0; font-size: 1.375rem; line-height: 1.75rem; font-weight: 700; color: var(--ink); }
.v21bx-sub { margin: 0; color: var(--ink-2); }
.v21bx-acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.v21bx-acts .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.v21bx-acts .btn-primary { min-height: 44px; padding-left: 22px; padding-right: 22px; font-size: 1rem; }
/* The first press's question (.v21bx-ask; .v21bx-q is only the crate's "?" disc). */
.v21bx-ask, .v21bx-tree, .v21bx-note { margin: 0; flex-basis: 100%; }
.v21bx-ask { font-weight: 600; color: var(--ink); }
.v21bx-price { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.v21bx-err { margin: 0; font-weight: 600; color: var(--danger); }
.v21bx-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 16px; }
.v21bx-count { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.v21bx-inside { display: grid; justify-items: center; gap: 6px; }
.v21bx-odds { display: grid; gap: 6px; padding: 10px 14px; border-radius: 14px; text-align: left; background: var(--glass-1); box-shadow: inset 0 0 0 1px var(--glass-rim); }
.v21bx-odds[hidden] { display: none; }
.v21bx-odds-list { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.v21bx-honest { margin: 0; }
.v21bx-front :is(button, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- the reveal ---------- */
.v21bx-reveal { display: grid; justify-items: center; gap: 6px; width: 100%; padding: 12px 14px; border-radius: 16px; background: var(--glass-1); box-shadow: inset 0 0 0 1px var(--glass-rim); }
.v21bx-rarity { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .75rem; line-height: 1.25rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: var(--solid-2); box-shadow: inset 0 0 0 1px var(--glass-rim); }
.v21bx-rarity[data-rarity="uncommon"] { box-shadow: inset 0 0 0 2px var(--accent); }
.v21bx-rarity[data-rarity="rare"] { background: color-mix(in srgb, var(--info) 14%, var(--solid)); box-shadow: inset 0 0 0 2px var(--info); }
.v21bx-rarity[data-rarity="very_rare"] { background: color-mix(in srgb, var(--fauna-galah-pink, #D9798F) 22%, var(--solid)); box-shadow: inset 0 0 0 2px var(--fauna-galah-pink, #D9798F); }
.v21bx-rarity[data-rarity="legendary"] { background: color-mix(in srgb, var(--flora-wattle, #D9A21B) 32%, var(--solid)); box-shadow: inset 0 0 0 2px var(--flora-wattle-deep, #A87A0C); }
.v21bx-won { margin: 0; font-size: 1.125rem; line-height: 1.5rem; font-weight: 700; color: var(--ink); }
.v21bx-after { margin: 0; }
.v21bx-swatch { position: relative; display: inline-block; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; }
.v21bx-swatch > .v21cs-stage { border-radius: 50%; }
.v21bx-reveal.is-fresh { animation: v21bx-in .4s var(--ease-out, ease) .1s both; }
.v21bx-reveal.is-fresh[data-rarity="uncommon"] { animation-delay: .3s; }
.v21bx-reveal.is-fresh[data-rarity="rare"] { animation-delay: .75s; box-shadow: inset 0 0 0 2px var(--info), 0 0 22px color-mix(in srgb, var(--info) 35%, transparent); }
.v21bx-reveal.is-fresh:is([data-rarity="very_rare"], [data-rarity="legendary"]) { animation-duration: .6s; animation-delay: 1.3s; box-shadow: inset 0 0 0 2px var(--flora-wattle-deep, #A87A0C), 0 0 30px color-mix(in srgb, var(--flora-wattle, #D9A21B) 45%, transparent); }

/* ---------- the Boosts line ---------- */
.v21bx-boosts { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; }
.v21bx-boosts p { margin: 0; font-weight: 600; }
.v21bx-boosts-ico { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--brand-text); background: var(--brand-soft); }

/* ---------- Owned: the box finds, with a rare shine ---------- */
.v21bx-find .v21c-win::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%); background-size: 250% 100%; background-repeat: no-repeat; background-position: 130% 0;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--flora-wattle, #D9A21B) 75%, transparent); animation: v21bx-findshine 3.8s ease-in-out infinite; }
.v21bx-rtag { color: var(--ink); background: color-mix(in srgb, var(--flora-wattle, #D9A21B) 22%, var(--solid)); }

/* ---------- the keyframes (transform, opacity, filter and background position only) ---------- */
@keyframes v21bx-float { from { translate: 0 0; } to { translate: 0 -6px; } }
@keyframes v21bx-breathe { from { opacity: .35; transform: scale(.92); } to { opacity: .7; transform: scale(1.05); } }
@keyframes v21bx-breathe-hi { from { opacity: .7; transform: scale(.96); } to { opacity: 1; transform: scale(1.08); } }
@keyframes v21bx-shine { 0%, 58% { opacity: 0; transform: translateX(0) skewX(-14deg); } 62% { opacity: 1; } 86% { opacity: 1; transform: translateX(420%) skewX(-14deg); } 90%, 100% { opacity: 0; transform: translateX(420%) skewX(-14deg); } }
@keyframes v21bx-spark { 0% { opacity: 0; transform: translate(0, 0) scale(.3) rotate(0deg); } 20% { opacity: 1; transform: translate(calc(var(--dx, 0px) * .2), calc(var(--dy, -30px) * .2)) scale(1) rotate(30deg); } 100% { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, -30px)) scale(.4) rotate(90deg); } }
@keyframes v21bx-wobble { 0%, 100% { transform: rotate(-12deg) scale(1); } 50% { transform: rotate(-7deg) scale(1.04); } }
@keyframes v21bx-pop { 0% { transform: none; } 100% { transform: translate(-10px, -28px) rotate(-16deg); } }
@keyframes v21bx-shake { 0%, 100% { transform: rotateX(var(--bx-rx)) rotateY(var(--bx-ry)); } 25% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } 75% { transform: rotate(-3deg); } }
@keyframes v21bx-bright { 0% { filter: brightness(1); } 35% { filter: brightness(1.45) saturate(1.2); } 100% { filter: brightness(1); } }
@keyframes v21bx-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes v21bx-flash { 0% { opacity: .95; transform: scale(.2); } 100% { opacity: 0; transform: scale(6); } }
@keyframes v21bx-flash2 { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(9); } }
@keyframes v21bx-bp { 0% { opacity: 1; transform: rotate(var(--ba, 0deg)) translateY(0) scale(.5); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--ba, 0deg)) translateY(calc(var(--br, 80px) * -1)) scale(1); } }
@keyframes v21bx-findshine { 0%, 50% { background-position: 130% 0; } 100% { background-position: -30% 0; } }

/* ---------- still: reduced motion, Calm, the quiet states, the days that matter and High contrast ---------- */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) :is(.v21bx-front, .v21bx-find) :is(*, *::before, *::after) { animation: none !important; transition: none !important; }
  :root:not([data-motion="full"]) :is(.v21bx-shine, .v21bx-sparks, .v21bx-burst, .v21bx-gloss) { display: none !important; }
  :root:not([data-motion="full"]) .v21bx-crate { transform: none !important; translate: none !important; }
}
:root:is([data-motion="reduced"], [data-calm="on"], [data-quiet="on"], [data-day-matters], [data-theme="high_contrast"]) :is(.v21bx-front, .v21bx-find) :is(*, *::before, *::after),
.v21bx-front[data-still="true"] :is(*, *::before, *::after) { animation: none !important; transition: none !important; }
:root:is([data-motion="reduced"], [data-calm="on"], [data-quiet="on"], [data-day-matters], [data-theme="high_contrast"]) :is(.v21bx-shine, .v21bx-sparks, .v21bx-burst, .v21bx-gloss),
.v21bx-front[data-still="true"] :is(.v21bx-shine, .v21bx-sparks, .v21bx-burst, .v21bx-gloss) { display: none !important; }
:root:is([data-motion="reduced"], [data-calm="on"], [data-quiet="on"], [data-day-matters], [data-theme="high_contrast"]) .v21bx-crate,
.v21bx-front[data-still="true"] .v21bx-crate { transform: none !important; translate: none !important; }

/* ---------- High contrast: white ground, black lines, black words ---------- */
:root[data-theme="high_contrast"] :is(.v21bx-front, .v21bx-reveal, .v21bx-odds, .v21bx-boosts) { background: #FFFFFF; box-shadow: inset 0 0 0 2px #000000; }
:root[data-theme="high_contrast"] .v21bx-front::before, :root[data-theme="high_contrast"] :is(.v21bx-glow, .v21bx-floor) { display: none; }
:root[data-theme="high_contrast"] :is(.v21bx-body, .v21bx-lid) { background: #FFFFFF; box-shadow: inset 0 0 0 3px #000000; }
:root[data-theme="high_contrast"] :is(.v21bx-rib, .v21bx-knot, .v21bx-bow), :root[data-theme="high_contrast"] .v21bx-lid::before { background: #000000; box-shadow: none; }
:root[data-theme="high_contrast"] .v21bx-q { color: #000000; background: #FFFFFF; box-shadow: inset 0 0 0 2px #000000; }
:root[data-theme="high_contrast"] .v21bx-sticker { clip-path: none; border-radius: 50%; color: #000000; background: #FFFFFF; box-shadow: inset 0 0 0 3px #000000; transform: rotate(-12deg); }
:root[data-theme="high_contrast"] .v21bx-st-big { text-shadow: none; }
:root[data-theme="high_contrast"] .v21bx-rarity, :root[data-theme="high_contrast"] .v21bx-rtag { color: #000000; background: #FFFFFF; box-shadow: inset 0 0 0 2px #000000; }
:root[data-theme="high_contrast"] .v21bx-find .v21c-win::after { display: none; }
:root[data-theme="high_contrast"] .v21bx-err { color: #9A0000; }

/* ---------- forced colours: the system draws it ---------- */
@media (forced-colors: active) {
  .v21bx-glow, .v21bx-floor, .v21bx-gloss, .v21bx-shine, .v21bx-sparks, .v21bx-burst, .v21bx-front::before, .v21bx-find .v21c-win::after { display: none !important; }
  .v21bx-body, .v21bx-lid, .v21bx-q, .v21bx-sticker { forced-color-adjust: none; color: CanvasText; background: Canvas; border: 2px solid CanvasText; box-shadow: none; }
  .v21bx-rib, .v21bx-knot, .v21bx-bow, .v21bx-lid::before { forced-color-adjust: none; background: CanvasText; }
  .v21bx-sticker { clip-path: none; border-radius: 50%; animation: none; }
  .v21bx-rarity, .v21bx-rtag, .v21bx-reveal, .v21bx-odds { border: 1px solid CanvasText; }
}

/* ---------- narrow sheets: the crate moves a little left so the sticker sits beside it, not over it; nothing scrolls sideways ---------- */
@container (max-width: 420px) {
  .v21bx-stage { height: 222px; }
  .v21bx-scene, .v21bx-burst { translate: -28px 0; }
  .v21bx-sticker { width: 112px; height: 112px; right: -6px; top: 0; padding: 14px; }
  .v21bx-st-big { font-size: .9375rem; line-height: 1rem; }
  .v21bx-st-line { font-size: .6875rem; line-height: .8125rem; }
  .v21bx-sticker.is-bare .v21bx-st-big { font-size: 1rem; line-height: 1.0625rem; }
}

/* =====================================================================================================================
 * The two box colours (J139), on the effect layers of styles\v21_colours_fx.css (l1 the band, l2 the glow and the first
 * particles, l3 and l4 more for a legendary one). Their plain colours (the palette's light, dark and hc values) show
 * whenever everything is still: the still rules there take every layer away.
 * ================================================================================================================== */

/* Opal Fire (rare): a fire opal's red, orange and gold flowing round, a light sweeping across, a green flash now and then */
.v21-fx-opal_fire { --fx1: #5C1206; --fx2: #FF6A2A; --fx3: #FFD24D; --fx4: #FFFFFF; --fxg: #FF7A3A; --fxs: #7CFFB0; }
.v21-fx-opal_fire > .v21-fx-l1 { background-image: linear-gradient(100deg, #5C1206, #D2361A 16%, #FF6A2A 32%, #FFD24D 46%, #7CFFB0 54%, #FF6A2A 68%, #B01E1E 84%, #5C1206); background-size: 250% 100%; animation: v21fx-flow 6s linear infinite; }
.v21-fxs-round.v21-fx-opal_fire > .v21-fx-l1 { background-image: conic-gradient(from 20deg, #5C1206, #D2361A, #FF6A2A, #FFD24D, #7CFFB0, #FF6A2A, #B01E1E, #5C1206); background-size: auto; animation: v21fx-spin 9s linear infinite; }
.v21-fxs-strip.v21-fx-opal_fire > .v21-fx-l1 { background-image: linear-gradient(180deg, #5C1206, #D2361A 16%, #FF6A2A 32%, #FFD24D 46%, #7CFFB0 54%, #FF6A2A 68%, #5C1206); background-size: 100% 250%; animation: v21fx-flowy 6s linear infinite; }
.v21-fx-opal_fire > .v21-fx-l1::after { background: linear-gradient(100deg, transparent 38%, rgba(255,255,255,.8) 50%, transparent 62%); transform: translateX(-100%); animation: v21fx-sweep 4.8s cubic-bezier(.45,.05,.35,1) infinite; }
.v21-fxs-round.v21-fx-opal_fire > .v21-fx-l1::after { background: conic-gradient(transparent 0 64%, rgba(255,255,255,.8) 72%, transparent 80%); transform: none; animation: v21fx-spin 4.8s linear infinite; }
.v21-fx-opal_fire > .v21-fx-l2::before { box-shadow: 0 0 var(--fx-halo) 2px color-mix(in srgb, #FF6A2A 55%, transparent); animation: v21fx-breathe 3.4s ease-in-out infinite; }
.v21-fxs-box.v21-fx-opal_fire > .v21-fx-l2::before { box-shadow: inset 0 0 18px 2px color-mix(in srgb, #FF6A2A 45%, transparent); }
.v21-fx-opal_fire > .v21-fx-l2::after {
  background-image: var(--fx-star), var(--fx-star), var(--fx-star);
  background-repeat: no-repeat; background-size: 9px 9px, 7px 7px, 8px 8px; background-position: 14% 12%, 90% 44%, 36% 94%;
  filter: drop-shadow(0 0 2px #7CFFB0) drop-shadow(0 0 3px #FF6A2A) drop-shadow(0 0 .5px rgba(40,20,10,.5));
  opacity: 0; animation: v21fx-twinkle 2.6s ease-in-out infinite, v21fx-hop3 7.8s steps(1) infinite;
}

/* Southern Lights (legendary): slow curtains of green and violet light, a soft glow, and stars in the fourth layer */
.v21-fx-southern_lights { --fx1: #1FD17A; --fx2: #2BB5A0; --fx3: #A77BFF; --fx4: #F2FFF8; --fxg: #46E8A0; --fxs: #D9C6FF; }
/* Unlike the shelf's Aurora Australis: a rose crown over the curtains (the real aurora australis has a red top), and stars. */
.v21-fx-southern_lights { --fxr: #FF5C8A; }
.v21-fx-southern_lights > .v21-fx-l1 { background-image: linear-gradient(180deg, color-mix(in srgb, var(--fxr) 72%, transparent) 0, color-mix(in srgb, var(--fxr) 28%, transparent) 22%, transparent 40%), linear-gradient(90deg, var(--fx1), var(--fx2) 25%, var(--fx3) 50%, var(--fx2) 75%, var(--fx1)); background-size: 100% 100%, 300% 100%; animation: v21fx-flow 14s ease-in-out infinite alternate; }
.v21-fxs-round.v21-fx-southern_lights > .v21-fx-l1 { background-image: radial-gradient(closest-side, transparent 58%, color-mix(in srgb, var(--fxr) 55%, transparent) 72%, transparent 88%), conic-gradient(var(--fx1), var(--fx2), var(--fx3), var(--fxr), var(--fx3), var(--fx2), var(--fx1)); background-size: auto; animation: v21fx-spin 16s linear infinite; }
.v21-fx-southern_lights > .v21-fx-l2::before { box-shadow: 0 0 var(--fx-halo) 2px color-mix(in srgb, var(--fxg) 55%, transparent); animation: v21fx-breathe 6s ease-in-out infinite; }
.v21-fxs-box.v21-fx-southern_lights > .v21-fx-l2::before { box-shadow: inset 0 0 22px 3px color-mix(in srgb, var(--fxg) 42%, transparent); }
.v21-fx-southern_lights > .v21-fx-l2::after, .v21-fx-southern_lights > .v21-fx-l3::before {
  background-image: linear-gradient(100deg, transparent 10%, color-mix(in srgb, var(--fx1) 70%, transparent) 30%, transparent 45%, color-mix(in srgb, var(--fx3) 62%, transparent) 65%, transparent 85%);
  background-size: 200% 100%; filter: blur(5px); opacity: .8;
  animation: v21fx-wave 9s ease-in-out infinite alternate, v21fx-flow 16s linear infinite;
}
.v21-fx-southern_lights > .v21-fx-l3::before { background-image: linear-gradient(80deg, transparent 20%, color-mix(in srgb, var(--fx3) 58%, transparent) 40%, transparent 55%, color-mix(in srgb, var(--fx1) 55%, transparent) 75%, transparent 90%); animation-duration: 7s, 18s; animation-direction: alternate-reverse, normal; }
.v21-fxs-round.v21-fx-southern_lights > .v21-fx-l2::after, .v21-fxs-round.v21-fx-southern_lights > .v21-fx-l3::before { border-radius: 50%; -webkit-mask: radial-gradient(closest-side, transparent 55%, #000 68%, transparent); mask: radial-gradient(closest-side, transparent 55%, #000 68%, transparent); animation: v21fx-spin 12s linear infinite; filter: blur(2px); }
.v21-fxs-round.v21-fx-southern_lights > .v21-fx-l3::before { animation-direction: reverse; animation-duration: 15s; }
.v21-fxs-box.v21-fx-southern_lights > .v21-fx-l2::after, .v21-fxs-box.v21-fx-southern_lights > .v21-fx-l3::before { inset: 0 0 auto 0; height: 60%; opacity: .5; }
.v21-fx-southern_lights > .v21-fx-l4::before {
  background-image: var(--fx-star), var(--fx-star), var(--fx-star);
  background-repeat: no-repeat; background-size: 5px 5px, 4px 4px, 6px 6px; background-position: 18% 22%, 80% 10%, 62% 86%;
  filter: drop-shadow(0 0 2px var(--fxs)) drop-shadow(0 0 .5px rgba(20,20,60,.6)); opacity: 0; animation: v21fx-twinkle 3.2s ease-in-out .4s infinite;
}
.v21-fxs-round.v21-fx-southern_lights > .v21-fx-l4 { -webkit-mask: radial-gradient(closest-side, transparent 58%, #000 63%); mask: radial-gradient(closest-side, transparent 58%, #000 63%); }
.v21-fx-southern_lights.v21-fxn::after { background-image: linear-gradient(90deg, var(--fx1), var(--fx2), var(--fx3), var(--fxr), var(--fx3), var(--fx2), var(--fx1)); animation: v21fx-flow 8s linear infinite; }

/* ---------- the golden akubra on Wren (the bush hat in gold) and the opal Southern Cross frame ---------- */
.art-wren[data-wr-cw~="bushhat-golden"] { --wr-bushhat-a: var(--metal-gold, #C9A227); --wr-bushhat-b: var(--flora-wattle-deep, #A87A0C); }
.crit-frm [data-cw="opal"] { --frm-ring: color-mix(in oklab, var(--fauna-lori-green, #3FA66B) 50%, var(--fauna-kooka-blue, #3C7EB8)); --frm-night: color-mix(in oklab, var(--fauna-eye, #1B1B1B) 70%, var(--fauna-kooka-blue, #3C7EB8)); --frm-star: var(--fauna-galah-pink, #D9798F); }

/* Integrator (29 Sep 2026): the sheet body is the core's grid with an automatic column, sized by its widest child, so the
   one row tab bar pushed the whole Canteen past the sheet's right edge on a wide screen. Scoped to the Canteen's sheet. */
.v21bx-sheet .sheet-b { grid-template-columns: minmax(0, 1fr); }
.v21bx-sheet .v21c-body { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.v21bx-sheet .v21c-shelfbar { min-width: 0; }
.v21bx-sheet .v21c-tabs { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
