/* Critical error and loading screens. */
.critical-error {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.critical-error h2 {
  color: #ff6b9d;
  margin-bottom: 20px;
  font-size: 28px;
}
.critical-error-message {
  max-width: 520px;
  margin-bottom: 30px;
  line-height: 1.5;
  font-size: 16px;
  color: #b8c1ec;
  text-align: center;
}
.critical-error-message p {
  margin: 0 0 12px;
  max-width: 520px;
  line-height: 1.5;
  font-size: 16px;
  color: #b8c1ec;
}
.critical-error-message p:last-child {
  margin-bottom: 0;
}
.critical-error-message hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 16px auto;
  max-width: 320px;
}
.critical-error p {
  max-width: 520px;
  margin-bottom: 30px;
  line-height: 1.5;
  font-size: 16px;
  color: #b8c1ec;
}
.critical-error button {
  background: linear-gradient(90deg, #ff6b9d 0%, #ff8e53 100%);
  color: #fff;
  border: none;
  padding: 12px 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}
.critical-error button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}
.critical-error button:active {
  transform: translateY(0);
}
.critical-error .error-id {
  margin-top: 20px;
  font-size: 12px;
  color: #666;
  font-family: monospace;
}

/* Завантаження: splash (WebP/PNG) + спінер */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #1b1028;
  transition: opacity 0.5s ease;
}

.app-splash__picture {
  position: absolute;
  inset: 0;
  margin: 0;
  display: block;
  overflow: hidden;
}

.app-splash__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.loading-overlay__footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  padding: min(8vh, 64px) 16px;
  box-sizing: border-box;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ff6b9d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.loading-text {
  color: #f6e8de;
  font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}
