:root {
  --bg-color: #f8fafc;
  --pattern-color: #e2e8f0;
  --card-bg: #ffffff;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text-main: #1e293b;
  --text-muted: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Красивый точечный паттерн на фоне */
body {
  background-color: var(--bg-color);
  background-image: radial-gradient(var(--pattern-color) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding: 20px;
  overflow-x: hidden;
}

/* Контейнер с эффектом размытия */
.app-container {
  background: var(--card-bg);
  padding: 35px 25px;
  border-radius: 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 10;
  transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.blurred {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.screen { display: none; }
.screen.active { display: block; animation: slideUp 0.4s ease-out; }

.logo-icon {
  font-size: 40px;
  margin-bottom: 10px;
  display: inline-block;
  animation: pulse 2s infinite;
}

h1 { font-size: 22px; line-height: 1.3; margin-bottom: 12px; font-weight: 800; }
h1 span { color: var(--accent); }
h2 { font-size: 20px; margin-bottom: 20px; }

p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }

/* Кнопки */
.main-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.main-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.main-btn:active { transform: translateY(1px); }

.secondary-btn {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  margin-bottom: 15px;
}

.secondary-btn:hover { background: rgba(59, 130, 246, 0.05); }

/* Сканер */
.scanner-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 250px;
  margin: 0 auto 25px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent);
  background: #000;
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.3);
}

video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.scan-line {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: #60a5fa;
  box-shadow: 0 0 15px #60a5fa, 0 0 30px #60a5fa;
  animation: scanAnim 2s infinite linear;
}

/* Результат */
.result-circle {
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 6px solid var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 25px;
  font-weight: 800;
  color: var(--accent);
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1), 0 0 20px rgba(59, 130, 246, 0.2);
}

#result-percent { font-size: 46px; }

.nearby-box {
  margin-top: 25px;
  background: #f1f5f9;
  padding: 20px;
  border-radius: 16px;
}

.highlight-text { color: var(--accent); font-weight: 800; font-size: 20px; margin-top: 12px; margin-bottom: 0; }

/* Плашка Cookie */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  background: #ffffff;
  width: calc(100% - 40px);
  max-width: 500px;
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  z-index: 9999;

  transform: translate(-50%, 150%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-banner.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

.cookie-content {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.cookie-icon { font-size: 24px; }
.cookie-content p { font-size: 12px; margin: 0; line-height: 1.4; color: var(--text-main); }

.cookie-btn {
  background: var(--text-main);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.cookie-btn:hover { background: #000; }

/* Анимации */
@keyframes scanAnim { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* Мобильная адаптация */
@media (max-width: 480px) {
  body { padding: 10px; }
  .app-container { padding: 25px 20px; }
  h1 { font-size: 20px; }
  .result-circle { width: 120px; height: 120px; }
  #result-percent { font-size: 38px; }
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
  }
  .cookie-content {
    justify-content: center;
    text-align: center;
    flex-direction: column;
  }
  .cookie-btn { width: 100%; padding: 12px; }
}