html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  color: #444;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: opacity 0.5s ease;
}

.splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  min-width: 320px;
  max-width: 480px;
}

.splash-logo {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.splash-subtitle {
  font-size: 14px;
  color: #666;
  margin-bottom: 2rem;
}

.splash-progress {
  width: 100%;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.splash-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.splash-status {
  font-size: 13px;
  color: #888;
  min-height: 20px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.splash-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #667eea;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

.splash-error {
  color: #d32f2f;
  background: #ffebee;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 13px;
}

.splash-retry {
  margin-top: 1rem;
  padding: 10px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.splash-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.splash-retry:active {
  transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
  .splash {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  }
  
  .splash-content {
    background: rgba(30, 30, 30, 0.95);
  }
  
  .splash-title {
    color: #fff;
  }
  
  .splash-subtitle {
    color: #aaa;
  }
  
  .splash-status {
    color: #999;
  }
  
  .splash-progress {
    background: #333;
  }
}

@media (max-width: 768px) {
  .splash-content {
    min-width: 280px;
    padding: 1.5rem;
  }
  
  .splash-logo {
    font-size: 36px;
  }
  
  .splash-title {
    font-size: 20px;
  }
}

#out {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
