.app-popup {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease-in, visibility 0.25s;
}

.app-popup.app-visible {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s ease-out, visibility 0.35s;
}

.app-popup.app-closing {
  opacity: 0;
  visibility: hidden;
}

.app-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1;
}

.app-box {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.35s ease-out, opacity 0.35s ease-out;
}

.app-visible .app-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.app-closing .app-box {
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 0.2s ease-in, opacity 0.2s ease-in;
}

.app-box img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 500px;
  margin: 0 auto;
}

.app-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.app-close:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
}

.app-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .app-popup,
  .app-popup.app-visible,
  .app-box,
  .app-visible .app-box,
  .app-closing .app-box,
  .app-close {
    transition: none;
  }
}

@media (max-width: 480px) {
  .app-box {
    max-width: 95vw;
  }
  .app-box img {
    max-width: 100%;
  }
}
