/* level character — pure CSS 3D */
.hero-stage { position: relative; height: 290px; perspective: 900px; perspective-origin: 50% 35%; cursor: grab; touch-action: pan-y; user-select: none; overflow: hidden; }
.hero-stage:active { cursor: grabbing; }
.hero-stage .hero-spin { position: absolute; inset: 0; transform-style: preserve-3d; }
.hero-stage .hero-fig { position: absolute; left: 50%; top: 62px; width: 0; height: 0; transform-style: preserve-3d; }
.hero-stage .hf-body { position: absolute; left: -23px; top: 0; width: 46px; height: 230px; transform-style: preserve-3d; transform-origin: 23px 170px; }
.hero-stage .hf-head { position: absolute; left: 0; top: 0; width: 46px; height: 44px; transform-style: preserve-3d; transform-origin: 23px 44px; }
.hero-stage .hf-arm, .hero-stage .hf-leg { position: absolute; transform-style: preserve-3d; width: 18px; height: 60px; }
.hero-stage .hf-arm { top: 48px; transform-origin: 9px 4px; } .hero-stage .hf-arm.l { left: -21px; } .hero-stage .hf-arm.r { left: 49px; }
.hero-stage .hf-leg { top: 108px; width: 22px; transform-origin: 11px 2px; } .hero-stage .hf-leg.l { left: 0; } .hero-stage .hf-leg.r { left: 24px; }
.hero-stage .hf-shadow { position: absolute; left: -46px; top: 168px; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent); transform: rotateX(90deg); }
/* cuboid */
.hero-stage .cb { position: absolute; width: var(--w); height: var(--h); transform-style: preserve-3d; }
.hero-stage .cb > i { position: absolute; display: block; background: var(--c); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.hero-stage .cb, .hero-stage .hf-body, .hero-stage .hf-head, .hero-stage .hf-arm, .hero-stage .hf-leg { will-change: transform; }
.hero-stage .cb > .f, .hero-stage .cb > .b { width: var(--w); height: var(--h); }
.hero-stage .cb > .f { transform: translateZ(calc(var(--d) / 2)); }
.hero-stage .cb > .b { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); filter: brightness(.68); }
.hero-stage .cb > .l, .hero-stage .cb > .r { width: var(--d); height: var(--h); left: calc((var(--w) - var(--d)) / 2); filter: brightness(.8); }
.hero-stage .cb > .l { transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }
.hero-stage .cb > .r { transform: rotateY(90deg) translateZ(calc(var(--w) / 2)); }
.hero-stage .cb > .t, .hero-stage .cb > .u { width: var(--w); height: var(--d); top: calc((var(--h) - var(--d)) / 2); }
.hero-stage .cb > .t { transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); filter: brightness(1.12); }
.hero-stage .cb > .u { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2)); filter: brightness(.55); }
.hero-stage .cb > .f s { position: absolute; display: block; text-decoration: none; }
/* face */
.hero-stage .eye { width: 6px; height: 7px; border-radius: 3px; background: #1d1d1f; top: 17px; left: 11px; }
.hero-stage .eye.r { left: auto; right: 11px; }
.hero-stage .eye.sad { height: 4px; top: 19px; border-radius: 0 0 4px 4px; transform: rotate(-12deg); } .hero-stage .eye.sad.r { transform: rotate(12deg); }
.hero-stage .eye.joy { background: none; border: 2.5px solid #1d1d1f; border-bottom: 0; border-radius: 6px 6px 0 0; width: 8px; height: 5px; top: 17px; }
.hero-stage .eye.x { background: none; width: auto; height: auto; font: 700 10px/1 monospace; color: #1d1d1f; top: 14px; left: 9px; }
.hero-stage .eye.x.r { left: auto; right: 9px; }
.hero-stage .mouth { left: 50%; top: 30px; width: 14px; margin-left: -7px; }
.hero-stage .mouth.smile { height: 6px; border: 2.5px solid #6b2b22; border-top: 0; border-radius: 0 0 10px 10px; }
.hero-stage .mouth.grin { height: 8px; background: #6b2b22; border-radius: 0 0 10px 10px; width: 18px; margin-left: -9px; box-shadow: inset 0 3px 0 #fff; }
.hero-stage .mouth.open { height: 10px; width: 14px; background: #6b2b22; border-radius: 4px 4px 12px 12px; top: 28px; box-shadow: inset 0 -3px 0 #e06b6b; }
.hero-stage .mouth.frown { height: 6px; border: 2.5px solid #6b2b22; border-bottom: 0; border-radius: 10px 10px 0 0; top: 32px; }
.hero-stage .mouth.line { height: 2.5px; background: #6b2b22; top: 32px; width: 12px; margin-left: -6px; }
.hero-stage .mouth.wavy { height: 5px; top: 31px; border-top: 2.5px dotted #6b2b22; }
.hero-stage .mouth.smirk { height: 3px; background: #6b2b22; top: 31px; width: 12px; transform: rotate(-10deg); border-radius: 2px; }
.hero-stage .blush { width: 7px; height: 4px; border-radius: 50%; background: rgba(230, 110, 110, .35); top: 26px; left: 4px; } .hero-stage .blush.r { left: auto; right: 4px; }
.hero-stage .tear { width: 4px; height: 6px; background: #6fb6ff; border-radius: 50% 50% 50% 50% / 70% 70% 40% 40%; top: 24px; left: 12px; animation: tear 1.8s infinite; }
@keyframes tear { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }
.hero-stage .blindfold { left: -1px; right: -1px; top: 13px; height: 11px; background: #2b2b2b; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset; }
.hero-stage .blindfold::after { content: ''; position: absolute; right: -6px; top: 3px; width: 8px; height: 12px; background: #2b2b2b; transform: rotate(25deg); }
.hero-stage .glasses { left: 7px; right: 7px; top: 14px; height: 10px; border: 2px solid #222; border-radius: 3px; background: rgba(255,255,255,.18); }
.hero-stage .glasses::after { content: ''; position: absolute; left: 50%; top: -2px; width: 2px; height: 10px; background: #222; margin-left: -1px; }
.hero-stage .shades { left: 5px; right: 5px; top: 14px; height: 9px; background: linear-gradient(180deg, #111, #333); border-radius: 2px 2px 6px 6px; }
.hero-stage .headband { left: -1px; right: -1px; top: 4px; height: 6px; background: #e74c3c; }
.hero-stage .headset { position: absolute; left: -4px; top: -6px; width: 54px; height: 30px; border: 4px solid #222; border-bottom: 0; border-radius: 30px 30px 0 0; transform: translateZ(2px); }
.hero-stage .headset::after { content: ''; position: absolute; left: -2px; top: 26px; width: 18px; height: 3px; background: #222; transform: rotate(35deg); transform-origin: left; }
.hero-stage .crown3d { position: absolute; left: 5px; top: -24px; width: 36px; height: 18px; background: linear-gradient(#ffe27a, #d4a62a); clip-path: polygon(0 100%, 0 20%, 20% 60%, 35% 0, 50% 55%, 65% 0, 80% 60%, 100% 20%, 100% 100%); filter: drop-shadow(0 0 6px rgba(255, 210, 80, .8)); animation: crown 2s ease-in-out infinite; }
@keyframes crown { 50% { transform: translateY(-3px); } }
.hero-stage .patch { width: 12px; height: 10px; background: #a58b5a; top: 12px; left: 8px; transform: rotate(-8deg); outline: 1px dashed #5b4a2b; }
.hero-stage .patch.p2 { left: 30px; top: 38px; width: 10px; height: 8px; background: #6c7a5a; transform: rotate(10deg); }
.hero-stage .tie { left: 50%; margin-left: -4px; top: 0; width: 8px; height: 40px; background: #c0392b; clip-path: polygon(20% 0, 80% 0, 70% 15%, 100% 85%, 50% 100%, 0 85%, 30% 15%); }
.hero-stage .tie.gold { background: linear-gradient(#ffe27a, #c8951f); }
.hero-stage .lapel { left: 6px; top: 0; width: 14px; height: 26px; background: rgba(0,0,0,.25); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.hero-stage .lapel.r { left: auto; right: 6px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.hero-stage .dollar { left: 50%; top: 18px; margin-left: -8px; font: 800 22px/1 Georgia, serif; color: #fff7d1; text-shadow: 0 0 6px rgba(255,255,255,.6); }
.hero-stage .book { left: -6px; top: 6px; width: 26px; height: 18px; background: #2e6fd6; border-radius: 2px; box-shadow: inset 3px 0 0 #1b4a99; }
.hero-stage .chip { left: -10px; top: 0; width: 30px; height: 30px; border-radius: 50%; background: #c0392b; border: 3px dashed #fff; font: 800 6px/24px Inter, sans-serif; color: #fff; text-align: center; }
.hero-stage .watch { left: 2px; top: -6px; width: 12px; height: 5px; background: linear-gradient(90deg, #ffe27a, #c8951f); border-radius: 2px; }
/* weather / money / sparkles around the figure */
.hero-stage .hf-cloud { position: absolute; left: 50%; top: 2px; width: 96px; height: 40px; margin-left: -48px; animation: cloud 4s ease-in-out infinite; }
.hero-stage .hf-cloud i { position: absolute; background: #6b7280; border-radius: 50%; }
.hero-stage .hf-cloud i:nth-child(1) { left: 6px; top: 12px; width: 40px; height: 26px; } .hero-stage .hf-cloud i:nth-child(2) { left: 28px; top: 0; width: 44px; height: 36px; } .hero-stage .hf-cloud i:nth-child(3) { left: 56px; top: 12px; width: 36px; height: 24px; }
.hero-stage .hf-cloud b { position: absolute; top: 36px; width: 2px; height: 10px; background: #6fb6ff; animation: rain .8s linear infinite; }
.hero-stage .hf-cloud b:nth-of-type(1) { left: 26px; } .hero-stage .hf-cloud b:nth-of-type(2) { left: 48px; animation-delay: .3s; } .hero-stage .hf-cloud b:nth-of-type(3) { left: 70px; animation-delay: .55s; }
@keyframes rain { from { transform: translateY(0); opacity: 1; } to { transform: translateY(30px); opacity: 0; } }
@keyframes cloud { 50% { transform: translateX(6px); } }
.hero-stage .hf-money, .hero-stage .hf-spark { position: absolute; inset: 0; pointer-events: none; }
.hero-stage .hf-money i { position: absolute; top: -20px; font: 800 18px/1 Georgia, serif; color: #2fbf71; text-shadow: 0 0 4px rgba(47,191,113,.6); animation: money 2.6s linear infinite; font-style: normal; }
@keyframes money { from { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(300px) rotate(260deg); opacity: .2; } }
.hero-stage .hf-spark i { position: absolute; color: #ffe27a; font-style: normal; font-size: 14px; animation: spark 1.6s ease-in-out infinite; }
@keyframes spark { 0%, 100% { transform: scale(.4); opacity: 0; } 50% { transform: scale(1.2); opacity: 1; } }
/* animations */
.hero-stage .anim-idle .hf-body { animation: bob 2.4s ease-in-out infinite; }
.hero-stage .anim-idle .hf-arm.l { animation: swing 2.4s ease-in-out infinite; } .hero-stage .anim-idle .hf-arm.r { animation: swing 2.4s ease-in-out infinite reverse; }
@keyframes bob { 50% { transform: translateY(3px); } }
@keyframes swing { 0%, 100% { transform: rotateX(10deg); } 50% { transform: rotateX(-10deg); } }
.hero-stage .anim-slump .hf-body { animation: slump 4s ease-in-out infinite; } .hero-stage .anim-slump .hf-head { transform: rotateX(18deg); }
.hero-stage .anim-slump .hf-arm.l, .hero-stage .anim-slump .hf-arm.r { transform: rotateZ(3deg); }
@keyframes slump { 0%, 100% { transform: rotateX(8deg) rotateZ(-2deg); } 50% { transform: rotateX(10deg) rotateZ(2deg) translateY(3px); } }
.hero-stage .anim-stumble .hf-body { animation: stumble 2.2s ease-in-out infinite; } .hero-stage .anim-stumble .hf-arm { transform: rotateX(-75deg); }
.hero-stage .anim-stumble .hf-leg.l { animation: swing 1.1s ease-in-out infinite; } .hero-stage .anim-stumble .hf-leg.r { animation: swing 1.1s ease-in-out infinite reverse; }
@keyframes stumble { 0%, 100% { transform: rotateZ(-6deg) translateX(-6px); } 50% { transform: rotateZ(6deg) translateX(6px); } }
.hero-stage .anim-twitch .hf-body { animation: twitch .35s steps(2) infinite; } .hero-stage .anim-twitch .hf-arm.r { transform: rotateX(-60deg); }
@keyframes twitch { 0% { transform: translate(-1px, 0) rotateZ(-1deg); } 100% { transform: translate(1px, -1px) rotateZ(1deg); } }
.hero-stage .anim-cool .hf-body { animation: cool 3s ease-in-out infinite; } .hero-stage .anim-cool .hf-arm.r { animation: swing 3s ease-in-out infinite; }
.hero-stage .anim-cool .hf-arm.l { transform: rotateZ(-8deg); }
@keyframes cool { 0%, 100% { transform: rotateX(-3deg); } 50% { transform: rotateX(-3deg) translateY(2px); } }
.hero-stage .anim-happy .hf-body { animation: hop 1s ease-in-out infinite; } .hero-stage .anim-happy .hf-arm.r { animation: wave .5s ease-in-out infinite alternate; transform-origin: 9px 4px; }
@keyframes hop { 50% { transform: translateY(-8px); } }
@keyframes wave { from { transform: rotateZ(-150deg); } to { transform: rotateZ(-110deg); } }
.hero-stage .anim-dance .hf-body { animation: dance .8s ease-in-out infinite; }
.hero-stage .anim-dance .hf-arm.l { animation: armsup .4s ease-in-out infinite alternate; } .hero-stage .anim-dance .hf-arm.r { animation: armsupR .4s ease-in-out infinite alternate-reverse; }
.hero-stage .anim-dance .hf-leg.l { animation: swing .4s ease-in-out infinite; } .hero-stage .anim-dance .hf-leg.r { animation: swing .4s ease-in-out infinite reverse; }
@keyframes dance { 0%, 100% { transform: translateY(0) rotateZ(-4deg); } 50% { transform: translateY(-14px) rotateZ(4deg); } }
@keyframes armsup { from { transform: rotateZ(160deg); } to { transform: rotateZ(120deg); } }
@keyframes armsupR { from { transform: rotateZ(-160deg); } to { transform: rotateZ(-120deg); } }
.hero-stage .anim-dance .hf-arm.r { transform-origin: 9px 4px; }
@media (prefers-reduced-motion: reduce) { .hero-fig *, .hf-money i, .hf-spark i, .hf-cloud { animation: none !important; } }
/* ---- v17: rewards of the investor / risk-manager branches and the mood of the character */
.hero-stage .hp { position: absolute; left: 50%; top: 232px; width: 0; height: 0; transform-style: preserve-3d; }
.hero-stage .hp .cb > .f s { position: absolute; display: block; }
.hero-stage .hp .win { left: 12px; top: 12px; width: 16px; height: 14px; background: #7cc3ff; box-shadow: inset 0 0 0 2px #fff8; }
.hero-stage .hp .win.w2 { left: auto; right: 12px; }
.hero-stage .hp .door { left: 50%; bottom: 0; width: 16px; height: 26px; margin-left: -8px; background: #7a4a25; border-radius: 3px 3px 0 0; }
.hero-stage .hp .roof { position: absolute; height: 34px; background: linear-gradient(#c0392b, #8e2a20); clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: translateZ(1px); }
.hero-stage .hp .roof.gold { background: linear-gradient(#ffe27a, #c8951f); height: 26px; }
.hero-stage .hp.mansion .house-u { }
.hero-stage .hp .lamp { right: 2px; top: 5px; width: 6px; height: 4px; background: #fff3b0; border-radius: 2px; }
.hero-stage .hp .glass { left: 4px; right: 4px; top: 3px; bottom: 3px; background: #9fd3ff99; border-radius: 3px; }
.hero-stage .hp .pig-eye { left: 9px; top: 6px; width: 3px; height: 3px; background: #222; border-radius: 50%; } .hero-stage .hp .pig-eye.r { left: auto; right: 9px; }
.hero-stage .hp .pig-slot { position: absolute; left: -6px; top: -30px; width: 12px; height: 2px; background: #a0526c; transform: translateZ(2px); }
.hero-stage .hp .case-lock { left: 50%; top: 4px; width: 6px; height: 4px; margin-left: -3px; background: #f2c94c; }
.hero-stage .hp .case-handle { position: absolute; left: -7px; top: -27px; width: 14px; height: 8px; border: 3px solid #5a3519; border-bottom: 0; border-radius: 6px 6px 0 0; }
.hero-stage .hp .palm { position: absolute; left: 0; top: -120px; width: 0; height: 120px; }
.hero-stage .hp .palm i { position: absolute; left: -5px; top: 20px; width: 10px; height: 100px; background: repeating-linear-gradient(#9b6a3c 0 8px, #7f5530 8px 11px); border-radius: 4px; transform: rotate(6deg); }
.hero-stage .hp .palm b { position: absolute; left: -2px; top: 14px; width: 60px; height: 14px; background: #2f9e57; border-radius: 0 50% 0 50%; transform-origin: 0 50%; }
.hero-stage .hp .palm b:nth-of-type(2) { transform: rotate(-150deg); } .hero-stage .hp .palm b:nth-of-type(1) { transform: rotate(-20deg); }
.hero-stage .hp .palm b:nth-of-type(3) { transform: rotate(-70deg); width: 50px; } .hero-stage .hp .palm b:nth-of-type(4) { transform: rotate(-110deg); width: 52px; background: #27864a; }
.hero-stage .vest { left: 3px; top: 6px; width: 14px; height: 54px; background: repeating-linear-gradient(#f39c12 0 10px, #e8eef5 10px 14px); opacity: .95; }
.hero-stage .vest.r { left: auto; right: 3px; }
.hero-stage .hf-umbrella { position: absolute; left: 50%; top: 2px; width: 120px; height: 60px; margin-left: -72px; transform: translateZ(10px); }
.hero-stage .hf-umbrella i { position: absolute; inset: 0 0 auto 0; height: 38px; border-radius: 60px 60px 0 0; background: repeating-conic-gradient(from 270deg at 50% 100%, #2f6fd6 0 30deg, #e8eef5 30deg 60deg); }
.hero-stage .hf-umbrella.gold i { background: repeating-conic-gradient(from 270deg at 50% 100%, #e7b93a 0 30deg, #fff3c4 30deg 60deg); }
.hero-stage .hf-umbrella b { position: absolute; left: 59px; top: 36px; width: 3px; height: 124px; background: #444; border-radius: 2px; }
.hero-stage .hf-umbrella ~ .hf-cloud b { animation-name: rain-short; }
@keyframes rain-short { from { transform: translateY(0); opacity: 1; } to { transform: translateY(10px); opacity: 0; } }
.hero-stage .hf-cloud.storm i { background: #4b5160; }
.hero-stage .hf-cloud u { position: absolute; left: 42px; top: 30px; text-decoration: none; font-size: 18px; color: #ffd84d; animation: bolt 2.4s steps(1) infinite; }
@keyframes bolt { 0%, 70%, 100% { opacity: 0; } 72%, 78% { opacity: 1; } }
.hero-stage .hf-aura { position: absolute; left: 50%; top: 214px; width: 120px; height: 40px; margin-left: -60px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 216, 77, .55), transparent); animation: aura 2s ease-in-out infinite; pointer-events: none; }
@keyframes aura { 50% { transform: scale(1.15); opacity: .7; } }
.hero-stage .anim-proud .hf-body { animation: bob 3s ease-in-out infinite; } .hero-stage .anim-proud .hf-head { transform: rotateX(-10deg); }
.hero-stage .anim-proud .hf-arm.l { transform: rotateZ(28deg); } .hero-stage .anim-proud .hf-arm.r { transform: rotateZ(-28deg); }
