/* LEGENDS DIGITAL EXIT — extracted from renderer.tsx Locker Room ENTER.
   Original @keyframes, color separation and power-down animation preserved.
   No font or audio assets bundled. */
.legends-digital-exit-target {position: relative; overflow:hidden; transform-origin:50% 50%; backface-visibility:hidden;}
.legends-digital-exit-active {isolation:isolate;}
            /* =========================================================
               1950s ANAGLYPH COLOR SEPARATION
               ---------------------------------------------------------
               Keep the approved Standings tear exactly as-is, but pull
               RED and CYAN ghost copies directly from the locker-room art.
               The channels separate, cross, and snap back while the real
               image is being digitally torn apart.
               ========================================================= */
            .legends-digital-exit-active::before,
            .legends-digital-exit-active::after {
              content: "";
              position: absolute;
              inset: 0;
              z-index: 880;
              pointer-events: none;
              background-image: var(--legends-digital-bg);
              background-size: cover;
              background-position: center center;
              background-repeat: no-repeat;
              opacity: 0;
              will-change: transform, opacity, filter, clip-path;
            }

            .legends-digital-exit-active::before {
              filter:
                grayscale(1)
                sepia(1)
                saturate(12)
                hue-rotate(305deg)
                brightness(1.12)
                contrast(1.28);
              mix-blend-mode: screen;
              animation:
                openingAnaglyphRed
                760ms
                steps(1,end)
                both;
            }

            .legends-digital-exit-active::after {
              filter:
                grayscale(1)
                sepia(1)
                saturate(11)
                hue-rotate(118deg)
                brightness(1.04)
                contrast(1.24);
              mix-blend-mode: screen;
              animation:
                openingAnaglyphCyan
                760ms
                steps(1,end)
                both;
            }

            @keyframes openingAnaglyphRed {
              0% {
                opacity: 0;
                transform: translate3d(0,0,0);
                clip-path: inset(0);
              }
              7% {
                opacity: .26;
                transform: translate3d(-7px,0,0);
              }
              12% {
                opacity: .60;
                transform: translate3d(-13px,1px,0) skewX(-.28deg);
                clip-path: inset(7% 0 11% 0);
              }
              18% {
                opacity: .18;
                transform: translate3d(5px,-1px,0);
                clip-path: inset(39% 0 33% 0);
              }
              26% {
                opacity: .72;
                transform: translate3d(-16px,0,0) skewX(-.52deg);
                clip-path: inset(16% 0 46% 0);
              }
              34% {
                opacity: .32;
                transform: translate3d(-7px,0,0);
                clip-path: inset(51% 0 9% 0);
              }
              45% {
                opacity: .66;
                transform: translate3d(-12px,1px,0);
                clip-path: inset(2% 0 22% 0);
              }
              56% {
                opacity: .24;
                transform: translate3d(8px,0,0);
                clip-path: inset(27% 0 31% 0);
              }
              68% {
                opacity: .58;
                transform: translate3d(-9px,0,0);
                clip-path: inset(0);
              }
              82% {
                opacity: .30;
                transform: translate3d(-4px,0,0);
              }
              100% {
                opacity: 0;
                transform: translate3d(0,0,0);
                clip-path: inset(0);
              }
            }

            @keyframes openingAnaglyphCyan {
              0% {
                opacity: 0;
                transform: translate3d(0,0,0);
                clip-path: inset(0);
              }
              7% {
                opacity: .24;
                transform: translate3d(7px,0,0);
              }
              12% {
                opacity: .56;
                transform: translate3d(13px,-1px,0) skewX(.28deg);
                clip-path: inset(11% 0 7% 0);
              }
              18% {
                opacity: .16;
                transform: translate3d(-5px,1px,0);
                clip-path: inset(33% 0 39% 0);
              }
              26% {
                opacity: .68;
                transform: translate3d(16px,0,0) skewX(.52deg);
                clip-path: inset(46% 0 16% 0);
              }
              34% {
                opacity: .28;
                transform: translate3d(7px,0,0);
                clip-path: inset(9% 0 51% 0);
              }
              45% {
                opacity: .62;
                transform: translate3d(12px,-1px,0);
                clip-path: inset(22% 0 2% 0);
              }
              56% {
                opacity: .22;
                transform: translate3d(-8px,0,0);
                clip-path: inset(31% 0 27% 0);
              }
              68% {
                opacity: .54;
                transform: translate3d(9px,0,0);
                clip-path: inset(0);
              }
              82% {
                opacity: .28;
                transform: translate3d(4px,0,0);
              }
              100% {
                opacity: 0;
                transform: translate3d(0,0,0);
                clip-path: inset(0);
              }
            }

            /* =========================================================
               LOCKER ROOM ENTER — EXACT STANDINGS DIGITAL LANGUAGE
               ---------------------------------------------------------
               This is intentionally copied from StandingsScreen.tsx:
               same matrix tear geometry, RGB split, scan field, sweep,
               timing and Digital-glitch.mp3 signature.

               The only change is direction: Standings assembles IN;
               the locker-room screen runs that SAME animation in reverse
               so the ACTUAL opening image tears apart before power-off.
               ========================================================= */
            .legends-digital-exit-target {
              --standings-ui-scale: 1;
            }

            @keyframes openingStandingsMatrixUiIn {
              0% {
                opacity: 0;
                clip-path: inset(48% 0 48% 0);
                transform: scale(var(--standings-ui-scale)) translate3d(-22px,8px,0) skewX(-2deg);
                filter: brightness(2.6) contrast(1.9) saturate(.3) blur(2.8px)
                        drop-shadow(-9px 0 0 rgba(76,255,177,.30))
                        drop-shadow(9px 0 0 rgba(255,45,88,.18));
              }
              7% {
                opacity: .90;
                clip-path: inset(41% 0 46% 0);
                transform: scale(var(--standings-ui-scale)) translate3d(16px,-4px,0) skewX(1.4deg);
              }
              11% {
                opacity: .18;
                clip-path: inset(9% 0 73% 0);
                transform: scale(var(--standings-ui-scale)) translate3d(-10px,2px,0);
              }
              16% {
                opacity: .96;
                clip-path: inset(62% 0 8% 0);
                transform: scale(var(--standings-ui-scale)) translate3d(12px,0,0);
              }
              22% {
                opacity: .38;
                clip-path: inset(24% 0 52% 0);
                filter: brightness(2.1) contrast(1.75) saturate(.48) blur(1.5px)
                        drop-shadow(-7px 0 0 rgba(76,255,177,.36))
                        drop-shadow(7px 0 0 rgba(255,45,88,.24));
              }
              29% {
                opacity: 1;
                clip-path: inset(3% 0 61% 0);
                transform: scale(var(--standings-ui-scale)) translate3d(-7px,-1px,0);
              }
              36% {
                clip-path: inset(38% 0 13% 0);
                transform: scale(var(--standings-ui-scale)) translate3d(8px,1px,0) skewX(-.7deg);
              }
              44% {
                clip-path: inset(0);
                opacity: .70;
                transform: scale(var(--standings-ui-scale)) translate3d(-4px,0,0);
                filter: brightness(1.72) contrast(1.52) saturate(.72) blur(.75px)
                        drop-shadow(-5px 0 0 rgba(76,255,177,.28))
                        drop-shadow(5px 0 0 rgba(255,45,88,.18));
              }
              53% {
                opacity: 1;
                transform: scale(var(--standings-ui-scale)) translate3d(5px,0,0);
              }
              60% {
                opacity: .82;
                transform: scale(var(--standings-ui-scale)) translate3d(-3px,0,0);
              }
              68% {
                opacity: 1;
                transform: scale(var(--standings-ui-scale)) translate3d(2px,0,0);
                filter: brightness(1.18) contrast(1.16) saturate(.92) blur(.12px)
                        drop-shadow(-2px 0 0 rgba(76,255,177,.16))
                        drop-shadow(2px 0 0 rgba(255,45,88,.10));
              }
              82% {
                transform: scale(var(--standings-ui-scale)) translate3d(0,0,0);
                filter: brightness(1.04) contrast(1.06) saturate(.98);
              }
              100% {
                opacity: 1;
                clip-path: inset(0);
                transform: scale(var(--standings-ui-scale));
                filter: none;
              }
            }

            @keyframes openingStandingsMatrixBootField {
              0% {
                opacity: 0;
                transform: translateY(-26%) scaleY(.52);
              }
              10% { opacity: .92; }
              34% { opacity: .62; }
              72% { opacity: .24; }
              100% {
                opacity: 0;
                transform: translateY(42%) scaleY(1.12);
              }
            }

            @keyframes openingStandingsMatrixBootNoise {
              0%,100% {
                transform: translate3d(0,0,0);
                opacity: .16;
              }
              8% {
                transform: translate3d(-13px,0,0);
                opacity: .72;
              }
              10% {
                transform: translate3d(9px,0,0);
                opacity: .20;
              }
              18% {
                transform: translate3d(-5px,0,0);
                opacity: .58;
              }
              24% {
                transform: translate3d(11px,0,0);
                opacity: .18;
              }
              42% {
                transform: translate3d(-8px,0,0);
                opacity: .44;
              }
              64% {
                transform: translate3d(4px,0,0);
                opacity: .26;
              }
            }

            @keyframes openingStandingsMatrixSweep {
              0% {
                opacity: 0;
                transform: translateY(-18vh);
              }
              8% { opacity: 1; }
              78% { opacity: .48; }
              100% {
                opacity: 0;
                transform: translateY(118vh);
              }
            }

            /* The ACTUAL locker-room image/screen gets the Standings tear. */
            .legends-digital-exit-active {
              pointer-events: none;
              will-change: transform, opacity, clip-path, filter;
              animation:
                openingStandingsMatrixUiIn
                760ms
                steps(1,end)
                reverse
                both;
            }

            .legends-digital-matrix-boot {
              position: absolute;
              inset: 0;
              z-index: 900;
              pointer-events: none;
              overflow: hidden;
              mix-blend-mode: screen;
            }

            .legends-digital-matrix-boot::before {
              content: "";
              position: absolute;
              inset: -22% -4%;
              background-image:
                repeating-linear-gradient(
                  90deg,
                  transparent 0 42px,
                  rgba(70,255,166,.08) 43px,
                  rgba(70,255,166,.18) 44px,
                  transparent 45px 58px
                ),
                repeating-linear-gradient(
                  0deg,
                  rgba(143,255,202,0) 0 3px,
                  rgba(143,255,202,.12) 4px,
                  transparent 5px 8px
                ),
                linear-gradient(
                  180deg,
                  rgba(92,255,174,.02),
                  rgba(92,255,174,.16) 42%,
                  rgba(240,196,107,.10) 54%,
                  transparent 82%
                );
              filter: blur(.15px) contrast(1.35);
              animation:
                openingStandingsMatrixBootField
                780ms
                cubic-bezier(.15,.76,.22,1)
                both;
            }

            .legends-digital-matrix-boot::after {
              content: "";
              position: absolute;
              inset: 0;
              background:
                repeating-linear-gradient(
                  0deg,
                  transparent 0 15px,
                  rgba(255,255,255,.055) 16px,
                  transparent 17px 31px
                ),
                linear-gradient(
                  90deg,
                  transparent 0 9%,
                  rgba(61,255,163,.13) 10%,
                  transparent 11% 24%,
                  rgba(236,190,94,.11) 25%,
                  transparent 26% 68%,
                  rgba(255,54,90,.07) 69%,
                  transparent 70% 100%
                );
              animation:
                openingStandingsMatrixBootNoise
                620ms
                steps(1,end)
                both;
            }

            .legends-digital-matrix-sweep {
              position: absolute;
              z-index: 901;
              left: -2%;
              right: -2%;
              top: 0;
              height: 54px;
              pointer-events: none;
              opacity: 0;
              background:
                linear-gradient(
                  180deg,
                  transparent 0%,
                  rgba(88,255,172,.10) 24%,
                  rgba(123,255,192,.60) 47%,
                  rgba(255,255,255,.88) 50%,
                  rgba(224,175,79,.38) 53%,
                  rgba(255,45,88,.18) 57%,
                  transparent 100%
                );
              box-shadow:
                0 0 18px rgba(82,255,173,.22),
                0 0 40px rgba(226,177,83,.10);
              filter: blur(.15px);
              mix-blend-mode: screen;
              animation:
                openingStandingsMatrixSweep
                720ms
                cubic-bezier(.18,.78,.2,1)
                both;
            }

            /* EXACT power-button shutdown already used by Active League. */
            .legends-digital-powerdown-screen {
              position: fixed;
              inset: 0;
              z-index: 60000;
              overflow: hidden;
              pointer-events: all;
              background: rgba(0,0,0,0);
              backdrop-filter: brightness(1) saturate(1);
              -webkit-backdrop-filter: brightness(1) saturate(1);
              animation: legendsPowerDim 1.32s cubic-bezier(.22,.72,.12,1) forwards;
            }

            .legends-digital-powerdown-screen::before {
              content: '';
              position: absolute;
              inset: 0;
              background:
                radial-gradient(circle at 50% 48%, rgba(122,221,255,.14), transparent 24%),
                radial-gradient(circle at 50% 50%, transparent 0 38%, rgba(0,0,0,.38) 68%, rgba(0,0,0,.94) 100%);
              opacity: 0;
              animation: legendsPowerVignette 1.05s ease-out forwards;
            }

            .legends-powerdown-shutter {
              position: absolute;
              left: 0;
              width: 100%;
              height: 0;
              background: #000;
              box-shadow: 0 0 28px rgba(0,0,0,.96);
              animation: legendsPowerShutter .78s .40s cubic-bezier(.7,0,.2,1) forwards;
            }

            .legends-powerdown-shutter.top { top: 0; }
            .legends-powerdown-shutter.bottom { bottom: 0; }

            .legends-powerdown-beam {
              position: absolute;
              left: 50%;
              top: 50%;
              width: 112%;
              height: 3px;
              transform: translate(-50%,-50%) scaleX(.02);
              opacity: 0;
              background: linear-gradient(90deg, transparent, rgba(181,239,255,.92) 35%, #fff 50%, rgba(181,239,255,.92) 65%, transparent);
              box-shadow:
                0 0 8px rgba(186,239,255,.96),
                0 0 24px rgba(86,190,229,.78),
                0 0 54px rgba(54,136,178,.48);
              animation: legendsPowerBeam .55s .26s ease-out forwards;
            }

            .legends-powerdown-flash {
              position: absolute;
              inset: 0;
              background: rgba(183,237,255,.11);
              mix-blend-mode: screen;
              opacity: 0;
              animation: legendsPowerFlash .28s ease-out forwards;
            }

            @keyframes legendsPowerDim {
              0% {
                background: rgba(0,0,0,0);
                backdrop-filter: brightness(1) saturate(1);
                -webkit-backdrop-filter: brightness(1) saturate(1);
              }
              38% {
                background: rgba(0,0,0,.16);
                backdrop-filter: brightness(.72) saturate(.72);
                -webkit-backdrop-filter: brightness(.72) saturate(.72);
              }
              100% {
                background: #000;
                backdrop-filter: brightness(.05) saturate(0);
                -webkit-backdrop-filter: brightness(.05) saturate(0);
              }
            }

            @keyframes legendsPowerVignette {
              0% { opacity:0; transform:scale(1.04); }
              28% { opacity:.9; }
              100% { opacity:1; transform:scale(1); }
            }

            @keyframes legendsPowerShutter {
              0% { height:0; }
              100% { height:50.5%; }
            }

            @keyframes legendsPowerBeam {
              0% { opacity:0; transform:translate(-50%,-50%) scaleX(.02); }
              24% { opacity:1; transform:translate(-50%,-50%) scaleX(1); }
              72% { opacity:.94; transform:translate(-50%,-50%) scaleX(.62); }
              100% { opacity:0; transform:translate(-50%,-50%) scaleX(.03); }
            }

            @keyframes legendsPowerFlash {
              0% { opacity:0; }
              35% { opacity:1; }
              100% { opacity:0; }
            }


/* Power-down overlay needs to sit above any screen in the app. */
.legends-digital-powerdown-screen { z-index: 2147483600; }

/* Website adaptation: digital stage occupies full document */
.legends-site-stage{min-height:100vh;}
@media(prefers-reduced-motion:reduce){.legends-digital-exit-active{animation:none!important}.legends-digital-exit-active::before,.legends-digital-exit-active::after{animation:none!important}.legends-digital-matrix-boot,.legends-digital-matrix-sweep,.legends-digital-powerdown-screen{animation:none!important;display:none!important}}
