* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(139, 92, 246, 0.1);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

*:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #0f172a;
    color: #f1f5f9;
  }
}

@media (prefers-color-scheme: light) {
  body {
    background-color: #ffffff;
    color: #1e293b;
  }
}

.no-js #root {
  opacity: 0;
}

#app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#app-loading .loading-content {
  color: #fff;
  text-align: center;
}

#app-loading h1 {
  margin-bottom: 1rem;
  font-size: 2rem;
  font-weight: 600;
}

.noscript-message {
  padding: 2rem;
  font-family: system-ui, sans-serif;
  text-align: center;
}

.cookie-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9998;
  transform: translateY(100%);
  padding: 0.9rem 0.9rem calc(0.9rem + env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease-in-out;
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-banner-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 76rem;
  margin: 0 auto;
}

.cookie-banner p {
  flex: 1;
  min-width: 0;
  color: #f1f5f9;
  font-size: 0.95rem;
  line-height: 1.65;
}

.cookie-banner-link {
  color: #a78bfa;
  text-decoration: underline;
}

.cookie-banner-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-btn {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border-radius: 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-btn-accept {
  color: #fff;
  background: #8b5cf6;
}

.cookie-btn-accept:hover {
  background: #7c3aed;
}

.cookie-btn-decline {
  color: #f1f5f9;
  background: transparent;
  border: 1px solid #475569;
}

.cookie-btn-decline:hover {
  background: rgba(71, 85, 105, 0.2);
}

.cookie-btn-manage {
  color: #f1f5f9;
  background: transparent;
  border: 1px solid #475569;
  text-decoration: none;
}

.cookie-btn-manage:hover {
  background: rgba(71, 85, 105, 0.2);
  color: #cbd5e1;
}

@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-buttons {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }
}

.ad-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  margin: 1rem 0;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 0.5rem;
}

ins.adsbygoogle {
  display: block;
  min-height: 250px;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}
