/* ==========================
   ROOT ПАРАМЕТРЫ (МОЖНО МЕНЯТЬ)
========================== */

:root {
  /* Высота кнопки PLAY ERRORS */
  --play-errors-top: 10%;

  /* Размер кнопки PLAY ERRORS */
  --play-errors-size: 80px;
}

/* ==========================
   БАЗА
========================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000;
  overflow: hidden;
}

/* ==========================
   СТРАНИЦА
========================== */

.page {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-image: url("bg-main.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ==========================
   ХЕДЕР СЛЕВА
========================== */

.header-bar {
  position: absolute;
  top: 18px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 20;
}

.header-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.header-title {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 30px;
  letter-spacing: 1px;
  color: #000;
  text-shadow: none;
}

/* ==========================
   ИКОНКИ СПРАВА
========================== */

.top-right-icons {
  position: absolute;
  top: 18px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20;
}

.icon-button {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border: none;
  padding: 6px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out,
    background 0.12s ease-out;
}

.icon-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.icon-button:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 0 1px #000, 0 6px 14px rgba(0, 0, 0, 0.35);
}

.icon-button:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 0 0 1px #000, 0 2px 6px rgba(0, 0, 0, 0.7) inset;
}

/* ==========================
   ОСНОВНАЯ ОБЛАСТЬ
========================== */

.main-area {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ==========================
   КНОПКА PLAY ERRORS
========================== */

.play-errors-wrapper {
  position: absolute;
  left: 48%;
  top: var(--play-errors-top);
  transform: translate(-50%, -50%);
  z-index: 6;
}

.play-errors-btn {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.play-errors-btn img {
  width: var(--play-errors-size);
  height: auto;
  max-width: 50vw;
  display: block;

  /* судорожное дрожание */
  animation: anim-play-jitter 0.18s infinite steps(2, end);

  transition:
    transform 0.12s ease-out,
    filter 0.12s ease-out;
}

.play-errors-btn:hover img {
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.7));
}

.play-errors-btn:active img {
  transform: translateY(1px) scale(0.96);
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.9));
}

/* ==========================
   ОСНОВНОЙ ЛОГОТИП
========================== */

.main-logo-wrapper {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.main-logo {
  width: 650px;
  max-width: 600vw;
  height: auto;
  image-rendering: auto;
}

/* ==========================
   СЛОЙ ОШИБОК
========================== */

.error-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 10;
}

.error-icon {
  position: absolute;
  width: 140px;
  height: auto;
  max-width: 18vw;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

/* ==========================
   АНИМАЦИИ ОШИБОК
========================== */

.anim-orbit {
  animation: orbit 3.2s linear infinite;
}

@keyframes orbit {
  0%   { transform: translate(-10px, -10px) rotate(0deg); }
  25%  { transform: translate(20px, -40px) rotate(90deg); }
  50%  { transform: translate(50px, 20px) rotate(180deg); }
  75%  { transform: translate(-10px, 40px) rotate(270deg); }
  100% { transform: translate(-10px, -10px) rotate(360deg); }
}

.anim-bounce-vert {
  animation: bounce-vert 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes bounce-vert {
  0%   { transform: translateY(0); }
  20%  { transform: translateY(-40px); }
  40%  { transform: translateY(28px); }
  60%  { transform: translateY(-18px); }
  80%  { transform: translateY(10px); }
  100% { transform: translateY(0); }
}

.anim-zigzag {
  animation: zigzag 1.6s steps(4, end) infinite alternate;
}

@keyframes zigzag {
  0%   { transform: translate(-40px, -30px) rotate(-6deg); }
  25%  { transform: translate(40px, -10px) rotate(4deg); }
  50%  { transform: translate(-30px, 20px) rotate(-10deg); }
  75%  { transform: translate(25px, 40px) rotate(8deg); }
  100% { transform: translate(-10px, -20px) rotate(-4deg); }
}

.anim-jitter {
  animation: jitter 0.22s linear infinite;
}

@keyframes jitter {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-4px, 2px) rotate(-1deg); }
  50%  { transform: translate(2px, -3px) rotate(1deg); }
  75%  { transform: translate(-2px, 3px) rotate(0.5deg); }
  100% { transform: translate(0, 0); }
}

.anim-chaos {
  animation: chaos-move 2.7s linear infinite;
}

@keyframes chaos-move {
  0%   { transform: translate(-10px, 0) scale(0.9) rotate(-6deg); }
  20%  { transform: translate(30px, -30px) scale(1.1) rotate(3deg); }
  40%  { transform: translate(-50px, 10px) scale(1.05) rotate(-12deg); }
  60%  { transform: translate(10px, 40px) scale(1.15) rotate(8deg); }
  80%  { transform: translate(40px, -10px) scale(0.95) rotate(-3deg); }
  100% { transform: translate(-5px, 5px) scale(1) rotate(0deg); }
}

/* ==========================
   АНИМАЦИЯ PLAY-КНОПКИ
========================== */

@keyframes anim-play-jitter {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-2px, 1px) rotate(-1deg); }
  50%  { transform: translate(3px, -2px) rotate(1deg); }
  75%  { transform: translate(-1px, 2px) rotate(-0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* ==========================
   МОБИЛЬНАЯ АДАПТАЦИЯ
========================== */

@media (max-width: 768px) {
  .header-title {
    font-size: 40px;
  }

  .header-logo {
    width: 40px;
    height: 40px;
  }

  .main-logo {
    width: 210px;
  }

  .play-errors-btn img {
    width: calc(var(--play-errors-size) * 0.7);
  }

  .error-icon {
    width: 100px;
  }
}
