/* First-claim celebrations (js/screens/first-claim-fx.js), the lobby's animation chips and the 3D cinematic's canvas shell.
   The 2D battle overlays that used to live here were removed with their component: battles play the 3D cinematics only.
   Every moving part animates transform or opacity only, so the vignette runs on the compositor. */

/* First confirmed claim after a question: original little-world vignettes. */
.first-claim-fx { position: fixed; inset: 0; z-index: 8990; display: grid; place-items: center; pointer-events: none; overflow: hidden; color: #f8f2ff; animation: claim-life 3.2s linear both; }
.first-claim-scrim { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 52%, color-mix(in srgb,var(--claim-colour) 26%,#160d24),#160d24 72%); }
.first-claim-card { position: relative; width: min(92vw, 760px, 135vh); aspect-ratio: 640 / 460; isolation: isolate; }
.first-claim-art { display: block; position: absolute; left: 0; top: 5%; width: 100%; height: auto; overflow: visible; }
.first-claim-art .avatar { filter: none !important; box-shadow: none; }
/* The character is inked like the land, flag and sparkles around it (it had no outline, so it looked pasted on, worst on the TV). */
/* Widths are in the avatar's own units (about 3 px on screen, 2 px on the compact card). No vector-effect: a
   non-scaling stroke has to be redrawn at every scale, which keeps the character's drop and cheer on the main thread. */
.first-claim-art .avatar-body > * { stroke: #1a0d2b !important; stroke-width: 1.1px !important; stroke-linejoin: round; paint-order: stroke fill; }
.first-claim-fx.is-compact .first-claim-art .avatar-body > * { stroke-width: 2.2px !important; }
.first-claim-halo { position: absolute; inset: 20% 12% 0; z-index: -1; background: repeating-conic-gradient(from 7deg, #ffffff07 0 9deg, transparent 9deg 25deg); border-radius: 50%; mask-image: radial-gradient(black,transparent 70%); animation: claim-halo 3.2s ease-out both; }
.first-claim-copy { position: absolute; top: 0; left: 4%; right: 4%; text-align: center; display: grid; gap: 4px; font-family: var(--ad-font-display,system-ui); animation: claim-title .42s cubic-bezier(.2,1.45,.4,1) .9s both; }
.first-claim-copy span { font-family: Bangers,var(--ad-font-display,system-ui); font-size: clamp(32px,6vw,65px); letter-spacing: .05em; color: #fff2ac; text-shadow: 3px 4px 0 #21112f; rotate: -3deg; }
.first-claim-copy strong { font-size: clamp(16px,2.5vw,25px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.first-claim-dismiss { position: absolute; right: 2px; top: 0; pointer-events: auto; border: 1px solid #ffffff26; border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; color: #fff; background: #251538cc; font: 26px/1 system-ui; cursor: pointer; }
.first-claim-dismiss:focus-visible { outline: 3px solid #fff2ac; outline-offset: 3px; }
.claim-land { transform-origin: 320px 300px; animation: claim-grow .85s cubic-bezier(.2,1.3,.4,1) .15s both; }
.claim-colour-spread { transform-origin: 320px 278px; animation: claim-fill .35s ease-out .92s both; }
.claim-ground-shadow { transform-origin: 320px 369px; animation: claim-shadow .85s ease-out .15s both; }
.claim-actor { transform-origin: 320px 272px; animation: claim-drop 1.1s linear both; }
.claim-actor-hop { transform-origin: 320px 272px; animation: claim-cheer .85s ease-in-out 1.65s both; }
.claim-pennant { transform-origin: 418px 281px; animation: claim-plant .45s cubic-bezier(.22,1.5,.4,1) 1.08s both; }
.claim-flag-cloth { transform-origin: 420px 184px; animation: claim-flutter .42s ease-in-out 1.35s 4 alternate; }
.claim-ripple { opacity: 0; transform-origin: 320px 316px; animation: claim-ripple .65s ease-out .96s both; }
.claim-spark { opacity: 0; transform-origin: 320px 283px; animation: claim-spark .75s cubic-bezier(.15,.65,.5,1) calc(1.02s + var(--i) * .018s) both; }
.claim-orbit { transform-origin: 320px 280px; animation: claim-orbit 2.6s ease-out .1s both; }
.claim-seed { opacity: 0; transform-origin: 410px 276px; animation: claim-seed .75s linear .12s both; }
.claim-stem { transform-origin: 412px 284px; animation: claim-stem .6s ease-out .85s both; }
.claim-leaves { transform-origin: 418px 222px; animation: claim-leaf .45s cubic-bezier(.2,1.5,.4,1) 1.12s both; }
.claim-bloom { transform-origin: 414px 154px; animation: claim-bloom .55s cubic-bezier(.2,1.6,.4,1) 1.35s both; }
@keyframes claim-bloom { 0% { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.15) rotate(8deg); } 100% { transform: none; } }
/* Pocket Planet: the planet pops in, the colour washes over it from the top, the moon's orbit turns round the planet. */
.claim-planet .claim-land { transform-origin: 320px 330px; }
.claim-planet .claim-colour-spread { transform-origin: 320px 268px; }
.claim-planet .claim-orbit { transform-origin: 320px 330px; }
.claim-sprout .claim-pennant { animation-delay: 1.27s; }
.claim-sprout .claim-actor { animation-name: claim-sprint; animation-duration: 1.2s; }
.claim-sprout .claim-land { animation-delay: .65s; animation-duration: .55s; }
.claim-capsule { transform-origin: 320px 263px; animation: claim-delivery 1.1s linear both; }
.claim-door { transform-origin: 320px 263px; }
.claim-door.left { opacity: 0; animation: claim-door-left 1s ease-in 1.05s both; }
.claim-door.right { opacity: 0; animation: claim-door-right 1s ease-in 1.05s both; }
.claim-capsule-lid { opacity: 0; transform-origin: 320px 123px; animation: claim-lid .75s ease-out 1.04s both; }
.claim-parcel .claim-actor { animation: claim-unbox .5s cubic-bezier(.2,1.4,.4,1) 1.16s both; }
.claim-parcel .claim-pennant { animation-delay: 1.4s; }
.claim-parcel .claim-land { animation-delay: .72s; animation-duration: .38s; }
.first-claim-fx.is-compact { display: block; overflow: visible; }
.first-claim-fx.is-compact .first-claim-scrim { display: none; }
.first-claim-fx.is-compact .first-claim-card { position: absolute; right: 14px; top: 76px; width: 260px; border-radius: 22px; background: #211330f5; box-shadow: 0 8px 30px #0005; border: 1px solid #ffffff24; }
.first-claim-fx.is-compact .first-claim-art { top: 9%; }
.first-claim-fx.is-compact .first-claim-copy { top: 10px; }
.first-claim-fx.is-compact .first-claim-copy span { font-size: 25px; }
.first-claim-fx.is-compact .first-claim-copy strong { font-size: 13px; }
.first-claim-fx.is-compact .first-claim-dismiss { top: -10px; right: -8px; width: 30px; height: 30px; font-size: 22px; }
@media(max-width:600px) { .first-claim-fx:not(.is-compact) .first-claim-art .avatar-body > * { stroke-width: 1.75px !important; } .first-claim-fx.is-compact .first-claim-art .avatar-body > * { stroke-width: 3px !important; } .first-claim-fx:not(.is-compact) .first-claim-art { width: 135%; left: -17.5%; top: 3%; } .first-claim-fx:not(.is-compact) .first-claim-card { aspect-ratio: 640 / 560; } .first-claim-fx.is-compact .first-claim-card { width: 190px; right: 12px; top: 70px; } .first-claim-fx.is-compact .first-claim-copy span { font-size: 21px; } .first-claim-fx.is-compact .first-claim-copy strong { font-size: 11px; } }
@keyframes claim-life { 0% { opacity: 0; } 5%,85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes claim-halo { from { scale: .6; rotate: -12deg; opacity: 0; } 40% { opacity: 1; } to { scale: 1.12; rotate: 8deg; } }
@keyframes claim-title { from { opacity: 0; transform: translateY(12px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes claim-grow { 0% { transform: translateY(30px) scale(.05); } 63% { transform: translateY(-10px) scale(1.06,.92); } 82% { transform: scale(.98,1.04); } 100% { transform: none; } }
@keyframes claim-fill { from { transform: scale(.05); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes claim-shadow { from { transform: scale(.1); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes claim-drop { 0%,20% { transform: translate(-22px,-210px) rotate(-18deg) scale(.8); opacity: 0; } 35% { opacity: 1; } 76% { transform: translate(0,0) rotate(0) scale(.94,1.08); } 84% { transform: scale(1.17,.8); } 94% { transform: translateY(-14px) scale(.97,1.04); } 100% { transform: none; opacity: 1; } }
@keyframes claim-cheer { 0%,100% { transform: none; } 12% { transform: scale(1.1,.88); } 30% { transform: translateY(-38px) rotate(-8deg) scale(.94,1.07); } 46% { transform: scale(1.12,.87); } 65% { transform: translateY(-19px) rotate(6deg); } 82% { transform: scale(1.04,.96); } }
@keyframes claim-plant { from { opacity: 0; transform: translateY(-65px) rotate(12deg) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes claim-flutter { from { transform: skewY(-4deg) scaleX(.96); } to { transform: skewY(5deg) scaleX(1); } }
@keyframes claim-ripple { from { opacity: .9; transform: scale(.35); } to { opacity: 0; transform: scale(1.5); } }
@keyframes claim-spark { 0% { opacity: 0; transform: scale(.3); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx),var(--dy)) rotate(90deg) scale(.5); } }
@keyframes claim-orbit { 0% { opacity: 0; transform: rotate(-60deg) scale(.3); } 35% { opacity: .8; transform: rotate(10deg) scale(1.07); } 65% { transform: rotate(-6deg) scale(.97); } 100% { opacity: .55; transform: none; } }
@keyframes claim-seed { 0% { opacity: 1; transform: translate(-155px,-74px) rotate(-100deg); } 48% { transform: translate(-70px,-130px) rotate(40deg); } 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.2); } }
@keyframes claim-stem { from { transform: scale(.4, 0); } to { transform: none; } }
@keyframes claim-leaf { from { transform: scale(.01) rotate(25deg); } to { transform: none; } }
@keyframes claim-sprint { 0%,8% { opacity: 0; transform: translateX(-260px) rotate(-14deg); } 18% { opacity: 1; } 35% { transform: translate(-140px,-12px) rotate(12deg); } 55% { transform: translate(-65px,-65px) rotate(-8deg); } 78% { transform: translate(0,-8px) scale(.94,1.08); } 86% { transform: scale(1.14,.82); } 100% { transform: none; opacity: 1; } }
@keyframes claim-delivery { 0% { opacity: 0; transform: translate(180px,-200px) rotate(24deg); } 18% { opacity: 1; } 65% { transform: translate(20px,-55px) rotate(-10deg); } 84% { transform: scale(1.12,.88); } 100% { opacity: 1; transform: none; } }
/* The capsule's doors swing open, then fall away and fade so the tile is clear. */
@keyframes claim-door-left { 0% { transform: none; opacity: 1; } 45% { transform: translate(-68px,33px) rotate(-34deg); opacity: 1; } 100% { transform: translate(-120px,90px) rotate(-85deg); opacity: 0; } }
@keyframes claim-door-right { 0% { transform: none; opacity: 1; } 45% { transform: translate(68px,33px) rotate(34deg); opacity: 1; } 100% { transform: translate(120px,90px) rotate(85deg); opacity: 0; } }
@keyframes claim-lid { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(180px,-45px) rotate(65deg); } }
@keyframes claim-unbox { from { opacity: 0; transform: translateY(74px) scale(.3); } to { opacity: 1; transform: none; } }
@media(prefers-reduced-motion:reduce) { .first-claim-fx * { animation: none !important; } }

/* Lobby picker: text chips beside the colour, shape and accessory rows. */
/* Older layers pin .identity-choice to a square with !important, so the chip has to answer in kind. */
.fx-choice-row .identity-choice.fx-choice { width: auto !important; min-width: 0 !important; flex: 0 0 auto !important; padding: 0 12px; font: 600 13px var(--ad-font-ui); color: var(--ad-ink); white-space: nowrap; }
.fx-choice-row .identity-choice.fx-choice.is-none { color: var(--ad-muted); }

/* ───── 3D cinematics (Clash3dFx in battle-screens.js, js/fx3d/clash-engine.js) ─────
   Three stacked canvases fill the screen: the 2D comic backdrop, the 3D scene, then the 2D effects and callouts.
   Cuts in once the scene is ready, fades out after the winner's pose. Tap anywhere to skip. */
@font-face { font-family: "Bangers"; src: url("../fonts/Bangers-Regular.woff2") format("woff2"); font-display: swap; }
.clash3d { position: fixed; inset: 0; z-index: 9000; background: #120A1F; opacity: 0; pointer-events: none; transition: opacity .25s ease-out; cursor: pointer; }
.clash3d.is-play { opacity: 1; pointer-events: auto; transition-duration: 0s; }
.clash3d.is-out { opacity: 0; transition-duration: .4s; }
.clash3d canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
