/* ════════════════════════════════════════════════════════════════
   menu.css — боковое меню настроек
   Содержание:
   1. Контейнер меню (.menu-stack, .menu-wrap)
   2. Кнопки меню (база, иконки, hover)
   3. Гамбургер (.hamburger)
   4. Иконка настроек (шестерёнки, spark)
   5. Ховер-подложка кнопок (::before)
   6. Лейблы пунктов (.menu-item-label)
   7. Состояние меню (open / hover)
   8. Иконка темы (.theme-icon-svg, sun / moon / stars)
   9. Лучи темы (.theme-icon::before, rays)
   10. Анимация нажатия (.press-once)
   11. Keyframes
   ════════════════════════════════════════════════════════════════ */

/* ── 1. Контейнер меню ── */

.menu-stack {
  position: fixed;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  z-index: 20000;
}

.menu-wrap {
  position: relative;
  width: 42px;
  background-color: var(--color-section2);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  padding: 20px 12px;
  overflow: hidden;
  border-radius: 32px;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
  border: 1px solid rgb(255 255 255 / 45%);
  box-shadow: 0 12px 40px rgb(15 23 42 / 12%), inset 0 1px 0 rgb(255 255 255 / 55%);
}

.menu-wrap:hover {
  width: 220px;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}

/* ── 2. Кнопки меню ── */

/* ── 2.1 База ── */

.reload-button,
.save-button,
.load-button,
.server-games-button,
.rules-button,
.theme-button {
  position: relative;
  color: var(--color-menu-icon);
  left: 0px;
  margin: 6px 0px 0px auto;
  font-size: 30px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: color var(--menu-hover-duration, 0.48s) var(--menu-hover-ease, ease), background-color var(--menu-hover-duration, 0.48s) var(--menu-hover-ease, ease);
}

.theme-button {
  margin: 25px 0px 0px auto;
}

.reload-button:hover,
.save-button:hover,
.load-button:hover,
.server-games-button:hover,
.rules-button:hover,
.hamburger:hover:not(.open) {
  background-color: transparent;
  color: var(--color-menu-icon-hover);
}

.theme-button:hover {
  background-color: transparent;
  color: var(--color-settings-active);
}

/* ── 2.2 Иконки ── */

.reload-icon,
.save-icon,
.load-icon,
.server-games-icon,
.rules-icon,
.theme-icon,
.settings-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  right: 0;
  left: auto;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  transform-origin: center center;
  transition: color var(--menu-hover-duration, 0.48s) var(--menu-hover-ease, ease);
}

.reload-button i,
.save-button i,
.load-button i,
.server-games-button i,
.rules-button i,
.theme-button i,
.hamburger i {
  margin: 0;
  line-height: 1;
}

.save-button .fa-file-arrow-down,
.load-button .fa-file-arrow-up {
  font-size: calc(1em - 2px);
}

.save-button .fa-cloud-arrow-down,
.server-games-button .fa-cloud-arrow-up {
  font-size: calc(1em - 4px);
}

.rules-button i,
.rules-button .fa-book {
  font-size: calc(1em - 4px);
}

/* ── 3. Гамбургер ── */

.hamburger {
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  transform: scale(1);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  z-index: 10001;
  left: 0px;
  margin: 0px 0px 25px auto;
  color: var(--color-menu-icon);
  font-size: 30px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background-color var(--menu-hover-duration, 0.48s) var(--menu-hover-ease, ease), color var(--menu-hover-duration, 0.48s) var(--menu-hover-ease, ease);
}

.hamburger:active {
  transform: scale(1);
}

/* ── 4. Иконка настроек (шестерёнки) ── */

.settings-icon i,
.settings-icon__cog {
  margin: 0;
  line-height: 1;
  transform-origin: center center;
}

.settings-icon__cog {
  position: absolute;
  display: block;
}

.settings-icon__cog--main {
  left: 50%;
  top: 50%;
  font-size: 1em;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.settings-icon__cog--small {
  left: 0px;
  top: 4px;
  font-size: 16px;
  color: #d4a84a;
  opacity: 0.9;
  z-index: 1;
  -webkit-text-stroke: 0.7px rgb(138 100 16 / 55%);
  paint-order: stroke fill;
  animation: settingsMenuCogSpin 4.2s linear infinite reverse;
}

.hamburger.open .settings-icon__cog--main {
  animation: none;
  -webkit-text-stroke: .6px rgb(110 78 10 / 88%);
  paint-order: stroke fill;
}

.hamburger.open .settings-icon__cog--small {
  animation-duration: 2.8s;
  -webkit-text-stroke: 1.1px rgb(110 78 10 / 80%);
  text-shadow: 0 0 2px rgb(110 78 10 / 40%);
}

.settings-icon.press-once .settings-icon__cog--main {
  animation: settingsGearPressMain 0.42s ease;
  -webkit-text-stroke: 1.45px rgb(110 78 10 / 88%);
  paint-order: stroke fill;
}

.settings-icon.press-once .settings-icon__cog--small {
  animation: settingsGearPressSmall 0.42s ease;
  -webkit-text-stroke: 1.1px rgb(110 78 10 / 80%);
  paint-order: stroke fill;
  text-shadow: 0 0 2px rgb(110 78 10 / 50%);
}

/* ── 5. Ховер-подложка кнопок ── */

.hamburger::before,
.reload-button::before,
.save-button::before,
.load-button::before,
.server-games-button::before,
.rules-button::before {
  content: "";
  position: absolute;
  top: var(--menu-item-hover-inset-y, 3px);
  right: var(--menu-item-hover-inset-right, 4px);
  bottom: var(--menu-item-hover-inset-y, 3px);
  left: var(--menu-item-hover-inset-right, 4px);
  margin: -3px;
  border-radius: 999px;
  background: transparent;
  transition: background-color var(--menu-hover-duration, 0.48s) var(--menu-hover-ease, ease);
  z-index: -1;
}

.menu-wrap:hover .hamburger::before,
.menu-wrap:hover .reload-button::before,
.menu-wrap:hover .save-button::before,
.menu-wrap:hover .load-button::before,
.menu-wrap:hover .server-games-button::before,
.menu-wrap:hover .rules-button::before {
  left: var(--menu-item-hover-inset-x, 8px);
  right: -5px;
}

.hamburger:hover::before,
.menu-wrap:hover .hamburger:hover::before,
.menu-wrap:hover .reload-button:hover::before,
.menu-wrap:hover .save-button:hover::before,
.menu-wrap:hover .load-button:hover::before,
.menu-wrap:hover .server-games-button:hover::before,
.menu-wrap:hover .rules-button:hover::before {
  background-color: var(--color-menu-item-hover-bg);
}

/* ── 6. Лейблы пунктов ── */

.menu-item-label {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--color-menu-label);
  position: absolute;
  top: 50%;
  right: 50px;
  display: inline-block;
  width: max-content;
  max-width: 160px;
  padding: 0;
  transform: translateY(-50%);
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.28s ease, color var(--menu-hover-duration, 0.48s) var(--menu-hover-ease, ease);
}

.menu-wrap:hover .hamburger,
.menu-wrap:hover .reload-button,
.menu-wrap:hover .save-button,
.menu-wrap:hover .load-button,
.menu-wrap:hover .server-games-button,
.menu-wrap:hover .rules-button,
.menu-wrap:hover .theme-button {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.menu-wrap:hover .menu-item-label {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.28s ease 0.1s, color var(--menu-hover-duration, 0.48s) var(--menu-hover-ease, ease);
}

.menu-wrap:hover .hamburger:hover .menu-item-label,
.menu-wrap:hover .reload-button:hover .menu-item-label,
.menu-wrap:hover .save-button:hover .menu-item-label,
.menu-wrap:hover .load-button:hover .menu-item-label,
.menu-wrap:hover .server-games-button:hover .menu-item-label,
.menu-wrap:hover .rules-button:hover .menu-item-label {
  color: var(--color-menu-label-hover);
}

.menu-wrap:hover .theme-button:hover .menu-item-label {
  color: var(--color-settings-active);
}

/* ── 7. Состояние меню (open / hover) ── */

.hamburger.open,
.hamburger.open:hover,
.menu-wrap:hover .hamburger.open,
.menu-wrap:hover .hamburger.open:hover,
.hamburger.open .settings-icon,
.hamburger.open .settings-icon__cog--main {
  color: var(--color-settings-active);
}

.hamburger.open .settings-icon__cog--small {
  color: var(--color-gold);
}





/* ── 8. Иконка темы ── */

/* ── 8.1 SVG-иконка и контейнер смены ── */

.theme-icon-svg {
  display: block;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  margin: 0;
  margin-left: 2px;
  opacity: 1;
  color: inherit;
  transform-origin: center center;
  will-change: transform, opacity;
  overflow: hidden;
}

.theme-icon.is-swapping {
  display: grid;
  place-items: center;
  overflow: visible;
  pointer-events: none;
}

.theme-icon.is-swapping .theme-icon-svg {
  grid-area: 1 / 1;
}

.theme-icon.is-swapping .theme-icon-exit {
  animation: themeIconSet 0.55s cubic-bezier(0.4, 0, 0.55, 0.2) forwards;
  z-index: 1;
}

.theme-icon.is-swapping .theme-icon-enter {
  animation: themeIconRise 0.55s cubic-bezier(0.22, 1.1, 0.36, 1) forwards;
  z-index: 2;
}

/* ── 8.2 Варианты svg (sun / dusk / moon) ── */

.theme-icon-svg--sun {
  color: var(--color-settings-active);
}

.theme-icon-svg--dusk {
  color: #9a7a2e;
}

.theme-icon-svg--moon {
  color: #6f84b8;
}

.theme-icon-stars {
  fill: #d4a017;
}

/* ── 8.3 Moon: луна и звёзды по своему расписанию ── */

/* Moon: container stays put — moon and stars move on their own schedule */
.theme-icon.is-swapping .theme-icon-exit.theme-icon-svg--moon,
.theme-icon.is-swapping .theme-icon-enter.theme-icon-svg--moon {
  animation: none;
  opacity: 1;
  transform: none;
}

.theme-icon-exit.theme-icon-svg--moon .theme-icon-moon,
.theme-icon-enter.theme-icon-svg--moon .theme-icon-moon {
  transform-box: fill-box;
  transform-origin: center;
}

/* Exit: moon sets first, then stars */
.theme-icon-exit.theme-icon-svg--moon .theme-icon-moon {
  animation: themeMoonSet 0.5s cubic-bezier(0.4, 0, 0.55, 0.2) forwards;
}

.theme-icon-exit.theme-icon-svg--moon .theme-icon-stars path {
  animation: themeStarSet 0.42s cubic-bezier(0.4, 0, 0.55, 0.2) forwards;
}

.theme-icon-exit.theme-icon-svg--moon .theme-icon-stars path:nth-child(1) {
  animation-delay: 0.28s;
}

.theme-icon-exit.theme-icon-svg--moon .theme-icon-stars path:nth-child(2) {
  animation-delay: 0.34s;
}

.theme-icon-exit.theme-icon-svg--moon .theme-icon-stars path:nth-child(3) {
  animation-delay: 0.4s;
}

/* Enter: stars rise first, then moon */
.theme-icon-enter.theme-icon-svg--moon .theme-icon-moon {
  animation: themeMoonRise 0.55s cubic-bezier(0.22, 1.1, 0.36, 1) 0.32s both;
}

.theme-icon-enter.theme-icon-svg--moon .theme-icon-stars path {
  animation: themeStarRise 0.48s cubic-bezier(0.22, 1.1, 0.36, 1) both;
}

.theme-icon-enter.theme-icon-svg--moon .theme-icon-stars path:nth-child(1) {
  animation-delay: 0s;
}

.theme-icon-enter.theme-icon-svg--moon .theme-icon-stars path:nth-child(2) {
  animation-delay: 0.07s;
}

.theme-icon-enter.theme-icon-svg--moon .theme-icon-stars path:nth-child(3) {
  animation-delay: 0.14s;
}

.theme-icon-svg--moon:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-stars path {
  transform-box: fill-box;
  transform-origin: center;
  animation: themeStarIdleTwinkle 2.6s ease-in-out infinite;
}

.theme-icon-svg--moon:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-stars path:nth-child(2) {
  animation-delay: 0.7s;
  animation-duration: 3.1s;
}

.theme-icon-svg--moon:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-stars path:nth-child(3) {
  animation-delay: 1.4s;
  animation-duration: 2.3s;
}

/* ── 8.4 Sun: лучи ── */

.theme-icon-exit.theme-icon-svg--sun .theme-icon-sun-rays,
.theme-icon-enter.theme-icon-svg--sun .theme-icon-sun-rays {
  transform-origin: 16px 16px;
  transform-box: view-box;
}

.theme-icon-exit.theme-icon-svg--sun .theme-icon-sun-rays {
  animation: themeSunSpinOut 0.55s cubic-bezier(0.35, 0.05, 0.5, 0.2) forwards;
}

.theme-icon-enter.theme-icon-svg--sun .theme-icon-sun-rays {
  animation: themeSunSpinIn 0.55s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.theme-icon-exit.theme-icon-svg--sun .theme-icon-sun-rays line,
.theme-icon-enter.theme-icon-svg--sun .theme-icon-sun-rays line {
  transform-box: view-box;
  transform-origin: 16px 16px;
  animation: themeSunRaySwap 0.45s ease-in-out infinite;
}

.theme-icon.is-swapping .theme-icon-svg--sun .theme-icon-sun-rays line:nth-child(1) { animation-delay: 0s; }
.theme-icon.is-swapping .theme-icon-svg--sun .theme-icon-sun-rays line:nth-child(2) { animation-delay: 0.03s; }
.theme-icon.is-swapping .theme-icon-svg--sun .theme-icon-sun-rays line:nth-child(3) { animation-delay: 0.06s; }
.theme-icon.is-swapping .theme-icon-svg--sun .theme-icon-sun-rays line:nth-child(4) { animation-delay: 0.09s; }
.theme-icon.is-swapping .theme-icon-svg--sun .theme-icon-sun-rays line:nth-child(5) { animation-delay: 0.12s; }
.theme-icon.is-swapping .theme-icon-svg--sun .theme-icon-sun-rays line:nth-child(6) { animation-delay: 0.15s; }
.theme-icon.is-swapping .theme-icon-svg--sun .theme-icon-sun-rays line:nth-child(7) { animation-delay: 0.18s; }
.theme-icon.is-swapping .theme-icon-svg--sun .theme-icon-sun-rays line:nth-child(8) { animation-delay: 0.21s; }

.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line {
  transform-box: view-box;
  transform-origin: 16px 16px;
  animation: themeSunRaysIdle 2.6s ease-in-out infinite;
}

.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line:nth-child(1) { animation-delay: 0s; }
.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line:nth-child(2) { animation-delay: 0.3s; }
.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line:nth-child(3) { animation-delay: 0.6s; }
.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line:nth-child(4) { animation-delay: 0.9s; }
.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line:nth-child(5) { animation-delay: 1.2s; }
.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line:nth-child(6) { animation-delay: 1.5s; }
.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line:nth-child(7) { animation-delay: 1.8s; }
.theme-icon-svg--sun:not(.theme-icon-exit):not(.theme-icon-enter) .theme-icon-sun-rays line:nth-child(8) { animation-delay: 2.1s; }

/* ── 8.5 Stars: позиции и анимации звёзд ── */

.theme-icon-exit .theme-icon-stars path,
.theme-icon-enter .theme-icon-stars path {
  transform-box: fill-box;
  transform-origin: center;
}

.theme-icon-exit .theme-icon-stars path:nth-child(1),
.theme-icon-enter .theme-icon-stars path:nth-child(1) {
  --star-x: -9px;
  --star-y: -10px;
}

.theme-icon-exit .theme-icon-stars path:nth-child(2),
.theme-icon-enter .theme-icon-stars path:nth-child(2) {
  --star-x: 8px;
  --star-y: -6px;
}

.theme-icon-exit .theme-icon-stars path:nth-child(3),
.theme-icon-enter .theme-icon-stars path:nth-child(3) {
  --star-x: -7px;
  --star-y: 9px;
}

.theme-icon-exit .theme-icon-stars path {
  animation:
    themeStarFade 0.48s cubic-bezier(0.4, 0, 0.6, 0.2) forwards,
    themeStarTwinkle 0.22s ease-in-out 2;
}

.theme-icon-exit .theme-icon-stars path:nth-child(1) {
  animation-delay: 0s, 0s;
}

.theme-icon-exit .theme-icon-stars path:nth-child(2) {
  animation-delay: 0.07s, 0.05s;
}

.theme-icon-exit .theme-icon-stars path:nth-child(3) {
  animation-delay: 0.14s, 0.1s;
}

.theme-icon-enter .theme-icon-stars path {
  animation:
    themeStarPop 0.5s cubic-bezier(0.2, 1.15, 0.3, 1) both,
    themeStarTwinkle 0.24s ease-in-out 2;
}

.theme-icon-enter .theme-icon-stars path:nth-child(1) {
  animation-delay: 0.02s, 0.12s;
}

.theme-icon-enter .theme-icon-stars path:nth-child(2) {
  animation-delay: 0.1s, 0.18s;
}

.theme-icon-enter .theme-icon-stars path:nth-child(3) {
  animation-delay: 0.18s, 0.24s;
}

/* ── 9. Лучи темы (пульс вокруг иконки) ── */

.theme-icon::before,
.theme-icon.rays::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(50% + 1px);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgb(224 168 40 / 55%) 52%, transparent 62%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: pulseRays 1.8s cubic-bezier(0.2, 0.9, 0.4, 1) infinite;
  z-index: -1;
  pointer-events: none;
}

.theme-icon.rays::before {
  background: radial-gradient(circle, rgb(120 150 220 / 58%) 52%, transparent 62%);
}

.theme-icon.swap-burst::before {
  animation: themeSwapBurst 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 1;
}

.theme-icon.is-swapping::before,
.theme-icon.theme-icon--no-pulse::before {
  display: none;
}

/* ── 10. Анимация нажатия ── */

.press-once {
  animation: press 0.4s ease;
}

/* ── 11. Keyframes ── */

@keyframes settingsGearPressMain {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }

  40% {
    transform: translate(-50%, -50%) scale(0.86) rotate(55deg);
  }

  100% {
    transform: translate(-50%, -50%) scale(1) rotate(120deg);
  }
}

@keyframes settingsGearPressSmall {
  0% {
    transform: scale(1) rotate(0deg);
  }

  40% {
    transform: scale(0.9) rotate(-40deg);
  }

  100% {
    transform: scale(1) rotate(-90deg);
  }
}

@keyframes settingsGearIdle {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes settingsMenuCogSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseRays {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.5;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }
}

@keyframes themeSwapBurst {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.9;
  }

  45% {
    transform: translate(-50%, -50%) scale(1.7);
    opacity: 0.4;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* Celestial set — sinks below the horizon */
@keyframes themeIconSet {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(26px) rotate(-40deg) scale(0.5);
  }
}

/* Celestial rise — climbs from below the horizon */
@keyframes themeIconRise {
  0% {
    opacity: 0;
    transform: translateY(26px) rotate(40deg) scale(0.5);
  }

  70% {
    opacity: 1;
    transform: translateY(-3px) rotate(-5deg) scale(1.1);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes themeMoonSet {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(22px) rotate(-35deg) scale(0.55);
  }
}

@keyframes themeMoonRise {
  0% {
    opacity: 0;
    transform: translateY(22px) rotate(35deg) scale(0.55);
  }

  70% {
    opacity: 1;
    transform: translateY(-2px) rotate(-4deg) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes themeStarRise {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.35);
  }

  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.15);
  }

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

@keyframes themeStarSet {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(16px) scale(0.35);
  }
}

@keyframes themeStarPop {
  0% {
    opacity: 0;
    transform: translate(var(--star-x, 0), var(--star-y, 0)) scale(0) rotate(-80deg);
  }

  55% {
    opacity: 1;
    transform: translate(calc(var(--star-x, 0) * 0.15), calc(var(--star-y, 0) * 0.15)) scale(1.45) rotate(18deg);
  }

  78% {
    opacity: 1;
    transform: translate(0, 0) scale(0.88) rotate(-8deg);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
}

@keyframes themeStarFade {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }

  40% {
    opacity: 1;
    transform: translate(calc(var(--star-x, 0) * 0.35), calc(var(--star-y, 0) * 0.35)) scale(1.2) rotate(25deg);
  }

  100% {
    opacity: 0;
    transform: translate(var(--star-x, 0), var(--star-y, 0)) scale(0) rotate(110deg);
  }
}

@keyframes themeStarTwinkle {
  0%,
  100% {
    opacity: 1;
  }

  35% {
    opacity: 0.35;
  }

  65% {
    opacity: 1;
  }
}

@keyframes themeSunSpinOut {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(110deg);
  }
}

@keyframes themeSunSpinIn {
  0% {
    transform: rotate(-110deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@keyframes themeSunRaySwap {
  0%,
  100% {
    transform: scale(0.94);
    stroke-width: 2.1;
    opacity: 0.85;
  }

  50% {
    transform: scale(1.1);
    stroke-width: 2.5;
    opacity: 1;
  }
}

@keyframes themeSunRaysIdle {
  0%,
  100% {
    transform: scale(0.97);
    opacity: 0.82;
  }

  50% {
    transform: scale(1.07);
    opacity: 1;
  }
}

@keyframes themeStarIdleTwinkle {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }

  40% {
    opacity: 1;
    transform: scale(1.18);
  }

  70% {
    opacity: 0.55;
    transform: scale(0.92);
  }
}

@keyframes press {
  0% {
    transform: translateY(-50%) scale(1);
  }

  50% {
    transform: translateY(-50%) scale(0.85);
  }

  100% {
    transform: translateY(-50%) scale(1);
  }
}
