/* pq-home-boot-v1 */
/* pq-home-boot-v2 / early no-flash gate */
html.pq-boot-pending,
html.pq-boot-pending body {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  background: #050705 !important;
}

html.pq-boot-pending body > *:not(#pqBootScreen) {
  visibility: hidden !important;
}


html.pq-boot-lock,
body.pq-boot-lock {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

#pqBootScreen,
#pqBootScreen * {
  box-sizing: border-box;
}

#pqBootScreen {
  position: fixed;
  inset: 0;
  z-index: 2147483000;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;

  overflow: hidden;
  overflow: clip;
  touch-action: none;

  padding:
    max(22px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));

  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(205, 255, 48, 0.07),
      transparent 44%
    ),
    #050705;

  color: #d9ff46;
  font-family:
    "PQ Source Code Pro",
    "Source Code Pro",
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;

  visibility: hidden;
  opacity: 0;
  pointer-events: none;

  transition:
    opacity 240ms ease,
    visibility 0s linear 240ms;
}

#pqBootScreen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  opacity: 0.11;

  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 3px,
      rgba(217, 255, 70, 0.12) 4px
    );
}

#pqBootScreen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background:
    linear-gradient(
      90deg,
      rgba(217, 255, 70, 0.045),
      transparent 18%,
      transparent 82%,
      rgba(217, 255, 70, 0.045)
    );
}

#pqBootScreen.pq-boot-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;

  transition:
    opacity 160ms ease,
    visibility 0s linear 0s;
}

#pqBootScreen.pq-boot-leaving {
  opacity: 0;
  pointer-events: none;
}

.pq-boot-panel {
  position: relative;
  z-index: 1;

  width: min(100%, 540px);
  min-width: 0;
  max-height: 100%;

  margin: auto;
}

.pq-boot-kicker {
  margin: 0 0 clamp(12px, 2.2vh, 18px);

  overflow-wrap: anywhere;

  color: rgba(217, 255, 70, 0.58);
  font-size: clamp(9px, 1.8vw, 11px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: clamp(0.09em, 0.4vw, 0.16em);
  text-transform: uppercase;
}

.pq-boot-title {
  max-width: 100%;
  margin: 0 0 clamp(20px, 4vh, 30px);

  overflow-wrap: anywhere;

  color: #efffc2;
  font-size: clamp(20px, 5.2vw, 34px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.pq-boot-progress-row {
  display: flex;
  align-items: flex-end;
  gap: clamp(10px, 2.5vw, 14px);

  min-width: 0;
}

.pq-boot-track {
  position: relative;
  flex: 1 1 auto;

  min-width: 0;
  height: 3px;

  overflow: hidden;

  background: rgba(217, 255, 70, 0.14);
}

#pqBootProgress {
  display: block;

  width: 0%;
  height: 100%;

  background: #d9ff46;

  box-shadow:
    0 0 9px rgba(217, 255, 70, 0.75),
    0 0 22px rgba(217, 255, 70, 0.28);

  transition: width 90ms linear;
}

#pqBootPercent {
  flex: 0 0 auto;

  min-width: 42px;

  color: #efffc2;
  font-size: clamp(10px, 2vw, 12px);
  font-weight: 600;
  line-height: 1;
  text-align: right;
}

#pqBootLog {
  min-height: clamp(64px, 12vh, 82px);
  margin-top: clamp(15px, 3vh, 21px);

  overflow: hidden;

  color: rgba(239, 255, 194, 0.62);
  font-size: clamp(9px, 1.8vw, 11px);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.035em;
}

.pq-boot-line {
  max-width: 100%;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  opacity: 0;
  transform: translateY(3px);

  animation: pqBootLineIn 180ms ease forwards;
}

.pq-boot-line::before {
  content: "> ";
  color: #d9ff46;
}

@keyframes pqBootLineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Телефоны */
@media (max-width: 600px) {
  #pqBootScreen {
    align-items: center;
  }

  .pq-boot-panel {
    width: 100%;
  }

  .pq-boot-title {
    max-width: 16em;
  }
}

/* Узкие телефоны */
@media (max-width: 360px) {
  #pqBootScreen {
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .pq-boot-kicker {
    letter-spacing: 0.08em;
  }

  #pqBootPercent {
    min-width: 36px;
  }
}

/* Телефон в landscape и низкие окна */
@media (orientation: landscape) and (max-height: 540px) {
  #pqBootScreen {
    align-items: center;

    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .pq-boot-panel {
    width: min(88vw, 620px);
  }

  .pq-boot-kicker {
    margin-bottom: 8px;
    font-size: 9px;
  }

  .pq-boot-title {
    margin-bottom: 14px;
    font-size: clamp(18px, 4.8vh, 25px);
  }

  #pqBootLog {
    min-height: 42px;
    margin-top: 10px;
    font-size: 9px;
    line-height: 1.4;
  }

  .pq-boot-line:nth-child(-n+1) {
    display: none;
  }
}

/* Планшеты и desktop */
@media (min-width: 900px) {
  .pq-boot-panel {
    width: min(62vw, 560px);
  }
}

/* Очень низкий экран */
@media (max-height: 390px) {
  .pq-boot-kicker {
    display: none;
  }

  .pq-boot-title {
    margin-bottom: 12px;
  }

  #pqBootLog {
    min-height: 30px;
    margin-top: 8px;
  }

  .pq-boot-line:nth-child(-n+2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #pqBootScreen,
  #pqBootProgress,
  .pq-boot-line {
    transition: none !important;
    animation: none !important;
  }

  .pq-boot-line {
    opacity: 1;
    transform: none;
  }
}
