html,
body {
  --loader-brand: #ff1028;
  --loader-brand-soft: #fff0f2;
  margin: 0;
  padding: 0;
  position: fixed;
  width: 100%;
  height: 100% !important;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  touch-action: none;
  background-color: #ffffff;
}

flt-root,
flt-glass-pane,
.flutter-view,
#flutter-container {
  height: 100% !important;
  width: 100%;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

canvas {
  display: block;
  touch-action: none !important;
  overscroll-behavior: none !important;
}

#early-loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--loader-brand-soft);
  border-top-color: var(--loader-brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

#debug-log-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 0, 0, 0.4);
  /* Полупрозрачный черный */
  color: #00ff00;
  /* Зеленый шрифт (лучше читается на черном, чем белый) */
  font-family: monospace;
  font-size: 10px;
  line-height: 1.2;
  z-index: 999999;
  /* Поверх всего */
  pointer-events: none;
  /* Пропускает клики сквозь себя! */
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  /* Новое сверху */
  align-items: flex-start;
  padding: 10px;
  box-sizing: border-box;
  /* display: none; */
}

#debug-log-overlay.hidden {
  display: none !important;
}

.log-entry {
  margin-bottom: 2px;
  background: rgba(0, 0, 0, 0.2);
  width: 100%;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.spinner-container {
  display: flex;
  flex-direction: column;
  /* ВАЖНО — вертикально */
  position: fixed;
  z-index: 99999;
  justify-content: center;
  align-items: center;

  height: 100vh;
  width: 100vw;

  opacity: 1;
  box-sizing: border-box;
  padding: 24px;
  background: #ffffff;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.loader-card {
  display: flex;
  width: min(360px, calc(100vw - 48px));
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  padding: 30px 28px 24px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 28px;
  background: linear-gradient(160deg, #ffffff 52%, var(--loader-brand-soft));
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.10);
}

.loader-logo-shell {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  overflow: hidden;
  border: 5px solid #ffffff;
  border-radius: 24px;
  background: var(--loader-brand-soft);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--loader-brand) 22%, transparent);
}

#loader-brand-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#loader-brand-name {
  margin-top: 18px;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.loader-caption {
  margin-top: 5px;
  color: #6b7280;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

.loader-progress {
  width: 100%;
  height: 7px;
  margin-top: 30px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
}

#loader-progress-value {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--loader-brand);
  transition: width 0.16s ease-out;
}

.loader-status {
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin-top: 10px;
  color: #6b7280;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
}



#vk-login-container {
  position: fixed;
  inset: 0;

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

  background: white;
  z-index: 999999;
  text-align: center;
}

#vk-inner-container {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  max-width: 400px !important;
}

#vk-login-container>* {

  margin-left: auto !important;
  margin-right: auto !important;
  width: 40vw;
}

/* 💣 ломаем их absolute/inline дичь */
#vk-login-container * {
  max-width: 100%;
  box-sizing: border-box;
}

/* iframe — обязательно */
#vk-login-container iframe {
  display: block;
  width: 100% !important;
  margin: 0 auto !important;
}


/* кнопка отмены */
.vk-cancel-btn {
  width: 100%;
  padding: 8px;

  border: none;
  border-radius: 8px;

  background: #f1f1f1;
  cursor: pointer;
  font-size: 16px;
  margin-top: 20px;
  height: 44px;
  font-family: -apple-system, system-ui, "Helvetica Neue", Roboto, sans-serif;

  transition: background 0.2s;
}

.vk-cancel-btn:hover {
  background: #e0e0e0;
}


.center {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

.contain {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stretch {
  display: block;
  width: 100%;
  height: 100%;
}

.cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bottom {
  position: absolute;
  bottom: 0;
  left: 50%;
  -ms-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
}

.bottomLeft {
  position: absolute;
  bottom: 0;
  left: 0;
}

.bottomRight {
  position: absolute;
  bottom: 0;
  right: 0;
}

#lottie-animation {
  width: 35vw;
  height: 35vw;
  clip-path: circle(40.2597405% at 50% 50%);
}

/* Если экран шире, чем выше (landscape) */
@media (orientation: landscape) {
  #lottie-animation {
    width: 15vh;
    height: 15vh;
    clip-path: circle(40.2597405% at 50% 50%);
  }
}

.spinner-container.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner-container.light {
  background-color: #ffffff;
}

.spinner-container.light #loader-text {
  color: #000000;
}

.spinner-container.dark {
  background-color: #111827;
}

.spinner-container.dark #loader-text {
  color: #ffffff;
}

#loader-text {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;

  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  color: var(--loader-brand);
}

#loader-text.light {
  color: var(--loader-brand);
}

#loader-text.dark {
  color: var(--loader-brand);
}

.spinner-container.dark .loader-card {
  border-color: rgba(255, 255, 255, 0.10);
  background: linear-gradient(160deg, #1f2937 52%, color-mix(in srgb, var(--loader-brand) 18%, #111827));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.spinner-container.dark #loader-brand-name {
  color: #ffffff;
}

.spinner-container.dark .loader-caption,
.spinner-container.dark .loader-status {
  color: #cbd5e1;
}

.spinner-container.dark .loader-progress {
  background: rgba(255, 255, 255, 0.14);
}

.loading-image {
  width: 40vw;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.add-overlay-button-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Рекламный оверлей — по умолчанию скрыт */
#ad-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 1.0);
}

/* контейнер внутри оверлея */
.ad-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#close-ad-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 32px;
  color: rgb(55, 55, 55);
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: none;
}

/* Таймер закрытия (скрыт по умолчанию) */
#close-timer {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(#9f9f9faa 0deg, #E2E2E2AA 0deg);
  display: none;
  /* show/hide логикой в js */
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  color: rgb(74, 74, 74);
  text-align: center;
  z-index: 10000;
}

#add-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* счетчик в таймере */
#countdown-text {
  display: block;
  line-height: 48px;
}

/* контент рекламы (по центру) */
.ad-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* небольшой safeguard — если какой-то внешний стиль делает body overflow hidden */
body.no-scroll {
  overflow: hidden !important;
}
