body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #121212;
  color: inherit;
}

body.dark {
  background-color: #121212;
  color: #fff;
}

body.light {
  background-color: #f4f4f5;
  color: #121212;
}

.loader {
  --background: linear-gradient(135deg, #23C4F8, #275EFE);
  --shadow: rgba(39, 94, 254, 0.28);
  --text: #6C7486;
  --page: rgba(255, 255, 255, 0.36);
  --page-fold: rgba(255, 255, 255, 0.52);
  --duration: 3s;
  width: 200px;
  height: 140px;
  position: flex;
}

.loader-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #121212;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader:before, .loader:after {
  --r: -6deg;
  content: "";
  position: absolute;
  bottom: 8px;
  width: 120px;
  top: 80%;
  box-shadow: 0 16px 12px var(--shadow);
  transform: rotate(var(--r));
}

.loader:before {
  left: 4px;
}

.loader:after {
  --r: 6deg;
  right: 4px;
}

.loader div {
  width: 100%;
  height: 100%;
  border-radius: 13px;
  position: relative;
  z-index: 1;
  perspective: 600px;
  box-shadow: 0 4px 6px var(--shadow);
  background-image: var(--background);
}

.loader div ul {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.loader div ul li {
  --r: 180deg;
  --o: 0;
  --c: var(--page);
  position: absolute;
  top: 10px;
  left: 10px;
  transform-origin: 100% 50%;
  color: var(--c);
  opacity: var(--o);
  transform: rotateY(var(--r));
  -webkit-animation: var(--duration) ease infinite;
  animation: var(--duration) ease infinite;
}

.loader div ul li:nth-child(2) {
  --c: var(--page-fold);
  -webkit-animation-name: page-2;
  animation-name: page-2;
}

.loader div ul li:nth-child(3) {
  --c: var(--page-fold);
  -webkit-animation-name: page-3;
  animation-name: page-3;
}

.loader div ul li:nth-child(4) {
  --c: var(--page-fold);
  -webkit-animation-name: page-4;
  animation-name: page-4;
}

.loader div ul li:nth-child(5) {
  --c: var(--page-fold);
  -webkit-animation-name: page-5;
  animation-name: page-5;
}

.loader div ul li svg {
  width: 90px;
  height: 120px;
  display: block;
}

.loader div ul li:first-child {
  --r: 0deg;
  --o: 1;
}

.loader div ul li:last-child {
  --o: 1;
}

.loader span {
  display: block;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 20px;
  text-align: center;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  color: var(--text);
}

.loader-container.hide {
  opacity: 0;
  visibility: hidden;
}

.menu {
  padding: 0.5rem 0;
  background-color: inherit;
  color: inherit;
  position: fixed;        
  bottom: 0;              
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around; 
  border-radius: 15px 15px 0 0;  
  box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
  z-index: 1000;
}

.link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: color 0.3s, fill 0.3s;
  width: 100px;
  height: 70px;
  border-radius: 12px;
  position: relative;
  font-size: 14px;
  text-align: center;
}

.link:hover {
  color: inherit;
}

.link:hover .link-icon svg {
  fill: inherit;
}

.link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #7A37DE;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.link:hover::before {
  opacity: 1;
}

.link-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
}

.link-icon svg {
  fill: inherit;
  transition: fill 0.3s;
  width: 28px;
  height: 28px;
}

.link-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes page-2 {
  0% {
    transform: rotateY(180deg);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  35%, 100% {
    opacity: 0;
  }

  50%, 100% {
    transform: rotateY(0deg);
  }
}

@keyframes page-3 {
  15% {
    transform: rotateY(180deg);
    opacity: 0;
  }

  35% {
    opacity: 1;
  }

  50%, 100% {
    opacity: 0;
  }

  65%, 100% {
    transform: rotateY(0deg);
  }
}

@keyframes page-4 {
  30% {
    transform: rotateY(180deg);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  65%, 100% {
    opacity: 0;
  }

  80%, 100% {
    transform: rotateY(0deg);
  }
}

@keyframes page-5 {
  45% {
    transform: rotateY(180deg);
    opacity: 0;
  }

  65% {
    opacity: 1;
  }

  80%, 100% {
    opacity: 0;
  }

  95%, 100% {
    transform: rotateY(0deg);
  }
}

.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  cursor: pointer;
}

.menu-icon span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: inherit;
  border-radius: 2px;
  transition: 0.3s;
}

.switch {
  display: block;
  position: relative;
  width: 3.5em;
  height: 2em;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #505050; 
  transition: 0.4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.4em;
  width: 1.4em;
  border-radius: 50%;
  left: 0.3em;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(40deg,#ff0080,#ff8c00 70%);
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #888;      /* Более тёмный серый при включении */
}

input:checked + .slider:before {
  left: calc(100% - 1.7em);
  background: #fff;
  box-shadow: inset -3px -2px 5px -2px #8983f7, inset -10px -4px 0 0 #a3dafb;
}

@media screen and (max-width: 500px){
  .top-header {
    padding: 0 0.5rem;
  }
  .switch {
    width: 3em;
    height: 1.7em;
  }
  .slider:before {
    height: 1.2em;
    width: 1.2em;
    left: 0.25em;
  }
  input:checked + .slider:before {
    left: calc(100% - 1.45em);
  }
}

.cmd-container {
  max-width: 420px;
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: calc(100vh - 130px);
  overflow-y: auto;
  padding: 1rem;
  padding-top: 35px;
  box-sizing: border-box;
}

.cmd-container::-webkit-scrollbar { width: 6px; }
.cmd-container::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.12);
  border-radius: 3px;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 15px;
  background: #1f1f1f;
  border-radius: 12px;
  width: 100%;
  box-sizing: border-box;
  flex: 0 0 auto;
  height: auto;
  min-height: unset;
  transition: transform 0.2s, box-shadow 0.2s;
}

.header-card {
  background: #2a2a2a;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
}

.header-card h2 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}

.header-card h1 {
  margin: 5px 0 0 0;
  font-size: 14px;
  color: #ccc;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.function-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #2b2b2b;
}

.func-icon {
  font-size: 28px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #444;
  flex-shrink: 0;
}

.func-text h2 {
  margin: 0;
  font-size: 16px;
  color: #fff;
}

.func-text h1 {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: #ccc;
  line-height: 1.2;
}
