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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f4f6;
  color: #1a1a2e;
  min-height: 100vh;
  padding: 24px;
}

header {
  margin-bottom: 24px;
}

header h1 {
  font-size: 20px;
  font-weight: 700;
}

header p {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(335px, 1fr));
  gap: 16px;
  align-items: start;
}

.state {
  text-align: center;
  padding: 60px 24px;
  color: #888;
  font-size: 14px;
}

.state--error {
  color: #e53e3e;
}

.ad-card {
  width: 100%;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: height 0.2s ease;
}

.ad-card--fallback {
  height: 200px;
}

.ad-card iframe { display: block; border: none; width: 100%; height: 100%; }
  display: block;
  border: none;
  width: 100%;
  height: 100%;
}

.ad-card__loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
}

.ad-card__fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #1877f2;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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