.theme-magic {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  font-family: Nunito, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.theme-magic__toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  color: #fff9e6;
  font-weight: 900;
  line-height: 1;
  background: #19c8b9;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 6px 0 #11a89b, 0 14px 28px rgba(61, 52, 40, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.theme-magic__toggle:hover,
.theme-magic__toggle:focus {
  color: #fff9e6;
  background: #3dd4c6;
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #11a89b, 0 18px 34px rgba(61, 52, 40, 0.22);
}

.theme-magic__spark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #725d42;
  background: #f5c31c;
  border-radius: 50%;
}

.theme-magic__panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  width: min(340px, calc(100vw - 34px));
  padding: 14px;
  color: #794f27;
  background: rgba(255, 249, 230, 0.96);
  border: 2px solid rgba(114, 93, 66, 0.16);
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(61, 52, 40, 0.2);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.theme-magic.is-open .theme-magic__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-magic__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #725d42;
  font-size: 16px;
  font-weight: 900;
}

.theme-magic__choices {
  display: grid;
  gap: 8px;
}

.theme-magic__choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: #fffdf1;
  border: 2px solid rgba(114, 93, 66, 0.14);
  border-radius: 16px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.theme-magic__choice:hover,
.theme-magic__choice:focus {
  background: #e6f9f6;
  border-color: rgba(25, 200, 185, 0.62);
  outline: none;
  transform: translateX(-2px);
}

.theme-magic__choice.is-active {
  background: #e6f9f6;
  border-color: #19c8b9;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.theme-magic__token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #725d42;
  font-weight: 900;
  background: #f5c31c;
  border-radius: 12px;
}

.theme-magic__name {
  display: block;
  color: #725d42;
  font-size: 14px;
  font-weight: 900;
}

.theme-magic__description {
  display: block;
  margin-top: 2px;
  color: #7c5734;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.theme-magic__burst {
  position: fixed;
  inset: 0;
  z-index: 1199;
  display: grid;
  place-items: center;
  color: #fff9e6;
  font-size: clamp(28px, 7vw, 72px);
  font-weight: 900;
  text-shadow: 0 4px 0 rgba(64, 47, 27, 0.28);
  background: radial-gradient(circle, rgba(25, 200, 185, 0.42), rgba(245, 195, 28, 0.22) 42%, rgba(255, 249, 230, 0));
  opacity: 0;
  pointer-events: none;
}

.theme-magic__burst.is-active {
  animation: theme-magic-burst 780ms ease both;
}

@keyframes theme-magic-burst {
  0% {
    opacity: 0;
    transform: scale(0.86);
  }

  28% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@media (max-width: 767px) {
  .theme-magic {
    right: 14px;
    bottom: 14px;
  }

  .theme-magic__toggle {
    min-height: 42px;
    padding: 0 14px;
    font-size: 13px;
  }

  .theme-magic__panel {
    bottom: 54px;
  }
}
