
@layer components {
  .dm-fun-plasma-ball {
    --size: 350px;
    --base-color: #222222;
    --switch-size: calc(var(--size) * 37 / 350);
    position: relative;
    margin: 0 auto;
    width: var(--size);
    height: var(--size);
    box-sizing: border-box;

    * {
      box-sizing: border-box;
    }

    .base {
      position: absolute;
      background: var(--base-color);
      width: calc(var(--size) * 6 / 7);
      height: calc(var(--size) * 4 / 7);
      margin: calc(var(--size) * 48 / 350) auto;
      /* z-index: -2; */
      top: calc(var(--size) * 286 / 350);
      left: calc(var(--size) * 25 / 350);
    }
    .base:before {
      position: absolute;
      top: calc(var(--size) * -44 / 350);
      width: calc(var(--size) * 300 / 350);
      height: calc(var(--size) * 80 / 350);
      border-radius: 100%;
      content: "";
      background: radial-gradient(#222 20%, #353535);
      background: conic-gradient(from 167deg, #666666, #232323, #232323, #666666);
      border: 2px solid #597481;
      box-sizing: border-box;
      left: 0;
      z-index: 0;
    }
    .base:after {
      position: absolute;
      left: calc(var(--size) * -35 / 350);
      bottom: calc(var(--size) * -65 / 350);
      width: calc(var(--size) * 370 / 350);
      height: calc(var(--size) * 110 / 350);
      border-radius: 30% 30% 50% 50%;
      content: "";
      background: var(--base-color);
      z-index: -1;
    }
    .base div {
      background: var(--base-color);
      height: calc(var(--size) * 100 / 350);
      margin-top: calc(var(--size) * 48 / 350);
      float: left;
      margin-left: calc(var(--size) * -53 / 350);
      width: 63%;
      transform: rotate(-85deg);
      z-index: -1;
      position: relative;
    }
    .base div + div {
      margin-top: calc(var(--size) * -99 / 350);
      margin-left: calc(var(--size) * 164 / 350);
      transform: rotate(85deg);
    }
    .base span {
      position: absolute;
      left: calc(var(--size) * -51 / 350);
      bottom: calc(var(--size) * -4 / 350);
      width: calc(var(--size) * 402 / 350);
      height: calc(var(--size) * 160 / 350);
      border-radius: 0% 0% 80% 80%;
      content: "";
      background: #242f3400;
      z-index: 0;
      border: 2px solid transparent;
      border-bottom-color: #435761;
    }
    input.switcher {
      width: calc(var(--size) * 48 / 350);
      height: calc(var(--size) * 48 / 350);
      opacity: 0;
      position: absolute;
      z-index: 3333;
      margin: 0;
      cursor: pointer;
      outline: none;
      border-radius: calc(var(--size) * 50 / 350) !important;
      top: calc(var(--size) * 425 / 350);
      left: calc(var(--size) * 151 / 350);
    }
    .glassball {
      position: relative;
      overflow: hidden;
      margin: 0 auto;
      width: 100%;
      height: 100%;
      border-radius: 100%;
      background-color: rgb(255 255 255 / 0.15);
      top: 0%;
      box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2),
        inset 0px 10px 30px 5px rgba(255, 255, 255, 1);
      position: absolute;
    }
    .glassball:after {
      background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0) 70%
      );
      border-radius: 50%;
      box-shadow: inset 0 20px 30px rgb(255 255 255 / 30%);
      content: "";
      height: 96%;
      left: 2%;
      position: absolute;
      width: 96%;
      top: 2%;
      z-index: 1;
    }
    .glassball:hover {
      cursor: grab;
    }
    .glassball:before {
      position: absolute;
      left: 48%;
      top: 50%;
      width: 0px;
      height: 0px;
      background: radial-gradient(circle closest-side, #9c27b0, transparent);
      transform: translate(-45%, -48%);
      transition: width 0.2s ease, height 0.2s ease;
      animation: spark 5ms ease 0s infinite alternate;
      border: 8px dotted #24e6ff;
      filter: blur(15px);
      border-radius: 100%;
      z-index: 2;
      font-size: 10em;
      color: #d6faff;
      text-align: center;
      line-height: 1;
      content: "s";
      display: none;
      opacity: 0.75;
    }
    .glassball:hover:before {
      width: calc(var(--size) * 120 / 350);
      height: calc(var(--size) * 150 / 350);
    }
    input.switcher:checked + .glassball:before,
    input.switcher:checked + .glassball:after {
      display: block;
    }
    input.switcher:checked + .glassball:after {
      width: 97%;
      height: 97%;
      left: 1.5%;
      top: 1.5%;
    }
    input.switcher:checked + .glassball:hover:after {
      animation: rotation 3s ease 0s infinite alternate;
      background: radial-gradient(
        ellipse at center,
        #ffffff7d 0%,
        #54ecff94 10%,
        transparent 100%
      );
      filter: brightness(1.75);
      opacity: 0.5;
    }
    input.switcher:checked + .glassball {
      transform: translate3d(0, 0, 0);
      backface-visibility: hidden;
      perspective: calc(var(--size) * 1000 / 350);
      background: radial-gradient(
        circle,
        #ff5affb8 0%,
        #ff5affb8 20%,
        #5493d2a8 70%,
        #5493d2a8 100%
      );
      animation: innerlight 5s linear 0s infinite,
        shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
      transition: background 0.4s ease 0s;
      box-shadow: 0 0 15px 5px #5493d2a8;
      border: 1px solid transparent;
    }
    
    .switch {
      background: #1b1b1b;
      width: var(--switch-size);
      height: var(--switch-size);
      position: absolute;
      left: calc(50% - var(--switch-size) / 2);
      top: calc(var(--size) * 430 / 350);
      border: 3px solid #4e4e4e;
      z-index: 5;
      border-radius: 100%;
      box-shadow: 0 0 10px 0px #000000, 0 0 5px 1px #2d2d2d, 0 0 3px 1px #000 inset;
    }
    .switch::before {
      content: "";
      position: absolute;
      width: calc(var(--switch-size) * 16 / 37);
      height: calc(var(--switch-size) * 16 / 37);
      bottom: calc(var(--switch-size) * 6 / 37);
      border: calc(var(--switch-size) * 3 / 37) solid #4e4e4e;
      border-top-color: transparent;
      border-radius: 100%;
      left: calc(var(--switch-size) * 5.5 / 37);
    }
    .switch::after {
      content: "";
      position: absolute;
      width: calc(var(--switch-size) * 3 / 37);
      height: calc(var(--switch-size) * 9 / 37);
      bottom: calc(var(--switch-size) * 14 / 37);
      left: calc(var(--switch-size) * 11.5 / 37);
      background: #4e4e4e;
    }
    input:checked + div + div + .switch {
      background: linear-gradient(to bottom, #171717, #404040);
      color: #fff;
      box-shadow: 0 0 10px 0px #03a9f4, 0 0 5px 1px #03a9f4;
      border-color: #222222d1;
    }
    input:checked + div + div + .switch:before {
      border-color: transparent #03a9f4 #03a9f4 #03a9f4;
    }
    input:checked + div + div + .switch:after {
      background: #03a9f4;
    }
    .electrode {
      width: calc(var(--size) * 16 / 350);
      height: calc(var(--size) * 140 / 350);
      bottom: calc(var(--size) * 20 / 350);
      left: calc(50% - 0.5em);
      position: absolute;
      overflow: visible;
    }
    .electrode:not(.hide-electrode) {
      background: linear-gradient(75deg, #3a3a3a 20%, #2d2d2d);
      border-bottom: 1px solid #657882;
      border-radius: 0 0 6px 5px;
    }
    .electrode:before {
      position: absolute;
      left: calc(var(--size) * -16 / 350);
      top: calc(var(--size) * -40 / 350);
      width: calc(var(--size) * 48 / 350);
      height: calc(var(--size) * 48 / 350);
      border-radius: 100%;
      content: "";
      background: radial-gradient(at top left, #4a4949 20%, #2d2d2d);
      border: 1px solid #758e99;
      box-sizing: border-box;
    }
    .electrode:not(.hide-electrode):after {
      position: absolute;
      left: calc(var(--size) * -3 / 350);
      bottom: calc(var(--size) * -11 / 350);
      width: calc(var(--size) * 22 / 350);
      height: calc(var(--size) * 16 / 350);
      border-radius: calc(var(--size) * 140 / 350) / calc(var(--size) * 50 / 350);
      content: "";
      background: linear-gradient(-263deg, #191919 20%, #0a0a0a);
      z-index: -1;
    }
    input.switcher:checked + .glassball .electrode:after {
      background: linear-gradient(-263deg, #3a3a3a 20%, #2d2d2d);
    }
    input.switcher:checked + .glassball .electrode:before {
      background: radial-gradient(
        ellipse farthest-corner at calc(var(--size) * 30 / 350) calc(var(--size) * 30 / 350),
        #999,
        #e449ff,
        #e449ff,
        #9763ff,
        #62edff,
        #fff
      );
      box-shadow: 0 0 10px 2px #e449ffb3, 0 0 10px 2px #fff,
        0 0 50px -10px #fff inset;
      border-color: #ffffff94;
    }
    input.switcher + .glassball .rays {
      display: none;
    }
    input.switcher:checked + .glassball .rays {
      display: block;
      float: left;
      width: 100%;
      height: 100%;
      position: absolute;
    }
    .ray {
      width: calc(var(--size) * 160 / 350);
      height: calc(var(--size) * 32 / 350);
      position: absolute;
      bottom: calc(var(--size) * 144 / 350);
      filter: drop-shadow(0px 0px 7px #9660f7) drop-shadow(0px 0px 2px #fff);
    }
    .ray:before {
      content: "";
      width: calc(var(--size) * 8 / 350);
      height: calc(var(--size) * 7.2 / 350);
      border: 2px dashed #03a9f4;
      position: absolute;
      border-width: 3px 3px 1px 1px;
      transform: rotate(87deg);
      top: calc(var(--size) * 4.8 / 350);
      left: calc(var(--size) * 3 / 350);
      border-radius: 10px 5px 8px 7px;
      filter: blur(2px);
      box-shadow: 0 0 10px -1px black;
    }
    .ray:after {
      content: "s";
      float: left;
      width: calc(var(--size) * 32 / 350);
      height: calc(var(--size) * 96 / 350);
      margin-top: calc(var(--size) * 20 / 350);
      margin-left: 0px;
      animation: blink 1s linear 0s infinite alternate;
      background: radial-gradient(circle closest-side, #9c27b0, transparent);
      transform: translate(-45%, -48%);
      transition: width 0.2s ease, height 0.2s ease;
      border: calc(var(--size) * 8 / 350) dotted #24e6ff;
      filter: blur(5px);
      border-radius: 100%;
      z-index: 2;
      font-size: calc(var(--size) * 64 / 350);
      color: #d6faff;
      text-align: center;
      line-height: 1;
    }
    .ray span {
      width: calc(var(--size) * 64 / 350);
      height: calc(var(--size) * 16 / 350);
      border: solid calc(var(--size) * 4 / 350) #000;
      border-radius: 238%/50px 50px 0 0;
      position: absolute;
      top: calc(var(--size) * 8 / 350);
      left: 0;
      border-color: #6bbdff transparent transparent transparent;
    }
    
    .ray span + span {
      left: 30%;
      transform: rotate(180deg);
      top: calc(var(--size) * 2.4 / 350);
    }
    .ray span + span + span {
      left: 60%;
      transform: rotate(0deg);
      top: calc(var(--size) * 8 / 350);
    }
    
    .ray span:last-of-type:before {
      content: "";
      float: right;
      width: calc(var(--size) * 8 / 350);
      height: calc(var(--size) * 8 / 350);
      background: #d1eefb;
      border-radius: 100%;
      box-shadow: 0 0 4px 3px #fff;
      filter: blur(1px);
      margin-top: calc(var(--size) * -2 / 350);
      left: calc(var(--size) * 3 / 350);
      position: relative;
    }
    .ray.bigwave span:last-of-type:before {
      content: "";
      float: left;
      width: calc(var(--size) * 8 / 350);
      height: calc(var(--size) * 8 / 350);
      background: #d1eefb;
      border-radius: 100%;
      box-shadow: 0 0 4px 3px #fff;
      filter: blur(1px);
      margin-top: calc(var(--size) * -3 / 350);
      left: calc(var(--size) * -2 / 350);
      position: relative;
    }
    .ray.bigwave span {
      width: 55%;
      border-width: calc(var(--size) * 4 / 350);
    }
    .ray.bigwave span + span {
      width: 60%;
      left: 40%;
      border-width: calc(var(--size) * 5 / 350);
      margin-left: calc(var(--size) * 4 / 350);
      margin-top: calc(var(--size) * 2 / 350);
    }
    
    .rays + .rays {
      transform: rotate(180deg);
    }
    .rays + .rays + .rays {
      transform: rotate(90deg);
    }
    .rays + .rays + .rays + .rays {
      transform: rotate(270deg);
    }
    .rays + .rays + .rays + .rays + .rays {
      transform: skew(-187deg, 0deg) scale(0.675) rotate(0deg);
      display: none;
      animation: touchray1 2.5s ease 0.1s infinite alternate;
    }
    .rays + .rays + .rays + .rays + .rays + .rays {
      transform: skew(-140deg, -40deg) scale(0.675) rotate(180deg);
      display: none;
      animation: touchray2 1s ease 0.25s infinite;
    }
    input.switcher:checked
      + .glassball:hover
      .rays
      + .rays
      + .rays
      + .rays
      + .rays {
      display: block;
    }
    
    .rays + .rays + .rays + .rays + .rays .ray {
      width: calc(var(--size) * 136 / 350);
      animation: ray1 0.5s linear 0s infinite alternate;
    }
    .rays + .rays + .rays + .rays + .rays .ray span {
      border-top-width: calc(var(--size) * 8 / 350);
    }
    
    .ray:nth-of-type(1) {
      animation: ray1 0.5s linear 0s infinite;
    }
    .ray:nth-of-type(2) {
      animation: ray1 0.75s linear 0s infinite alternate;
    }
    .ray:nth-of-type(3) {
      animation: ray1 0.65s linear 0s infinite reverse;
    }
    .ray:nth-of-type(4) {
      animation: ray1 0.95s linear 0s infinite alternate;
    }
    .ray:nth-of-type(5) {
      animation: ray1 0.85s linear 0s infinite reverse;
    }
    
    .rays + .rays .ray:nth-of-type(1) {
      animation-duration: 1.55s;
    }
    .rays + .rays .ray:nth-of-type(2) {
      animation-duration: 1.75s;
    }
    .rays + .rays .ray:nth-of-type(3) {
      animation-duration: 0.65s;
    }
    .rays + .rays .ray:nth-of-type(4) {
      animation-duration: 1.85s;
    }
    .rays + .rays .ray:nth-of-type(5) {
      animation-duration: 1.6s;
    }
    
    .rays + .rays + .rays .ray:nth-of-type(1) {
      animation-duration: 1.15s;
    }
    .rays + .rays + .rays .ray:nth-of-type(2) {
      animation-duration: 1.5s;
    }
    .rays + .rays + .rays .ray:nth-of-type(3) {
      animation-duration: 1.35s;
    }
    .rays + .rays + .rays .ray:nth-of-type(4) {
      animation-duration: 1s;
    }
    .rays + .rays + .rays .ray:nth-of-type(5) {
      animation-duration: 1.25s;
    }
    
    .rays + .rays + .rays + .rays .ray:nth-of-type(1) {
      animation-duration: 1.05s;
    }
    .rays + .rays + .rays + .rays .ray:nth-of-type(2) {
      animation-duration: 1.35s;
    }
    .rays + .rays + .rays + .rays .ray:nth-of-type(3) {
      animation-duration: 1.25s;
    }
    .rays + .rays + .rays + .rays .ray:nth-of-type(4) {
      animation-duration: 1.15s;
    }
    .rays + .rays + .rays + .rays .ray:nth-of-type(5) {
      animation-duration: 1.45s;
    }
    
    .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(1) {
      animation-duration: 0.85s;
    }
    .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(2) {
      animation-duration: 0.95s;
    }
    .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(3) {
      animation-duration: 0.75s;
    }
    
    .rays + .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(1) {
      animation-duration: 1.1s;
    }
    .rays + .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(2) {
      animation-duration: 1.25s;
    }
    .rays + .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(3) {
      animation-duration: 1.35s;
    }
    
  }

  @keyframes rotation {
    50% {
      transform: rotate(360deg);
    }
  }
  @keyframes blink {
    0% {
      background: radial-gradient(circle closest-side, #ff5affb8, #5493d2a8);
      transform: translate(-50%, -50%) scale(0.75) rotate(6deg);
    }
    50% {
      background: radial-gradient(circle closest-side, #5493d2a8, #ff5affb8);
      transform: translate(-50%, -50%) scale(0.5) rotate(2deg);
    }
    100% {
      background: radial-gradient(circle closest-side, #ffffffa8, #5493d2a8);
      transform: translate(-50%, -50%) scale(0.35) rotate(11deg);
    }
  }
  @keyframes innerlight {
    0% {
      background-size: 105% 105%;
      background-position: center center;
      box-shadow: 0 0 15px 5px #5493d2a8;
    }
    25% {
      box-shadow: 0 0 15px 5px #ff5aff30;
    }
    50% {
      background-size: 85% 85%;
      background-position: center center;
      box-shadow: 0 0 15px 5px #5493d2a8;
    }
    75% {
      box-shadow: 0 0 15px 5px #ff5aff30;
    }
    100% {
      background-size: 105% 105%;
      background-position: center center;
      box-shadow: 0 0 15px 5px #5493d2a8;
    }
  }
  @keyframes touchray1 {
    0% {
      transform: skew(-187deg, 0deg) scale(0.675) rotate(0deg);
    }
    50% {
      transform: skew(-185deg, 2deg) scale(0.525) rotate(180deg);
      opacity: 1;
    }
    51% {
      opacity: 0;
    }
    52% {
      opacity: 1;
    }
    100% {
      transform: skew(-188deg, -2deg) scale(0.625) rotate(360deg);
    }
  }
  @keyframes touchray2 {
    0% {
      transform: skew(-140deg, -40deg) scale(0.675) rotate(140deg);
    }
    50% {
      transform: skew(-143deg, -42deg) scale(0.525) rotate(0deg);
      opacity: 1;
    }
    51% {
      opacity: 0;
    }
    52% {
      opacity: 1;
    }
    100% {
      transform: skew(-145deg, -38deg) scale(0.625) rotate(210deg);
    }
  }
  @keyframes spark {
    0% {
      background: radial-gradient(circle closest-side, #ff5affb8, #5493d2a8);
      transform: translate(-50%, -50%) scale(0.75) rotate(0deg);
    }
    50% {
      background: radial-gradient(circle closest-side, #5493d2a8, #ff5affb8);
      transform: translate(-50%, -50%) scale(0.5) rotate(180deg);
    }
    100% {
      background: radial-gradient(circle closest-side, #ffffffa8, #5493d2a8);
      transform: translate(-50%, -50%) scale(1) rotate(360deg);
    }
  }
  @keyframes ray1 {
    0% {
      opacity: 0;
      transform: rotate(0deg) translate(0px, 0px);
    }
    12% {
      opacity: 1;
      transform: rotate(22deg) translate(0px, calc(var(--size) * -35 / 350));
      filter: brightness(1.75);
    }
    25% {
      opacity: 0;
      transform: rotate(45deg) translate(calc(var(--size) * -33 / 350), calc(var(--size) * -69 / 350));
    }
    37% {
      opacity: 1;
      transform: rotate(67deg) translate(calc(var(--size) * -64 / 350), calc(var(--size) * -86 / 350));
      filter: brightness(1.15);
    }
    50% {
      opacity: 0;
      transform: rotate(90deg) translate(calc(var(--size) * -108 / 350), calc(var(--size) * -93 / 350));
    }
    62% {
      opacity: 1;
      transform: rotate(112deg) translate(calc(var(--size) * -140 / 350), calc(var(--size) * -90 / 350));
      filter: brightness(1.25);
    }
    75% {
      opacity: 0;
      transform: rotate(135deg) translate(calc(var(--size) * -169 / 350), calc(var(--size) * -69 / 350));
    }
    87% {
      opacity: 1;
      transform: rotate(157deg) translate(calc(var(--size) * -185 / 350), calc(var(--size) * -36 / 350));
      filter: brightness(1.75);
    }
    100% {
      opacity: 0;
      transform: rotate(180deg) translate(calc(var(--size) * -192 / 350), calc(var(--size) * 6 / 350));
    }
  }
} 
