:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fb;
  color: #171923;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(93, 95, 239, 0.10), transparent 34%),
    radial-gradient(circle at 85% 80%, rgba(23, 154, 112, 0.09), transparent 38%),
    #f6f7fb;
}

button { font: inherit; }

.page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card, .cookie-card {
  width: min(92vw, 460px);
  border: 1px solid rgba(22, 27, 45, 0.10);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(20, 26, 45, 0.15);
  padding: 28px;
  text-align: center;
}

.logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: #eaf8f2;
  color: #147c58;
  font-size: 28px;
  font-weight: 800;
}

h1, h2 { margin: 0 0 12px; line-height: 1.15; }
p { margin: 0 0 22px; color: #596075; line-height: 1.55; }
small { display: block; margin-top: 16px; color: #858ca0; line-height: 1.4; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.44);
  backdrop-filter: blur(8px);
}

.modal.hidden { display: none; }
.cookie-icon { font-size: 42px; margin-bottom: 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.primary, .secondary, .stop {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 750;
  transition: transform 120ms ease, filter 120ms ease, opacity 180ms ease;
}

.primary { background: #4f46e5; color: white; }
.secondary { background: #eef0f6; color: #252a3b; border-color: #dfe3ee; }
button:active { transform: scale(0.98); }
button:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }

.scare {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  overflow: hidden;
  background: #000;
  cursor: default;
  isolation: isolate;
}

/* “armed” makes the fullscreen request possible while keeping the image hidden
   until the audio actually starts playing. */
.scare.armed,
.scare.active { display: block; }

.scare img {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  filter: contrast(1.35) saturate(0.72);
  transform: scale(.58);
  user-select: none;
  -webkit-user-drag: none;
}

.scare.active img {
  opacity: 1;
  animation: lunge 260ms cubic-bezier(.12,.92,.18,1) both,
             tremble 78ms linear 260ms infinite;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, transparent 22%, rgba(0,0,0,.24) 59%, rgba(0,0,0,.86) 100%);
}

.scare.active .vignette { opacity: 1; }

.stop {
  position: absolute;
  z-index: 3;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 0 16px;
  background: rgba(255,255,255,.94);
  color: #111827;
  border-color: rgba(255,255,255,.5);
  opacity: 0;
  pointer-events: none;
}

.stop.show:not(:disabled) {
  opacity: 1;
  pointer-events: auto;
}

@keyframes lunge {
  from { transform: scale(.52); filter: blur(7px) contrast(1.7); }
  to { transform: scale(1.14); filter: blur(0) contrast(1.35); }
}

@keyframes tremble {
  0% { transform: translate(0, 0) scale(1.14); }
  20% { transform: translate(-1.4%, .8%) scale(1.15); }
  40% { transform: translate(1.1%, -1.3%) scale(1.14); }
  60% { transform: translate(-.7%, 1.2%) scale(1.15); }
  80% { transform: translate(1.2%, .4%) scale(1.14); }
  100% { transform: translate(0, 0) scale(1.14); }
}

@media (prefers-reduced-motion: reduce) {
  .scare.active img { animation: none; transform: scale(1.04); }
}

@media (max-width: 520px) {
  .card, .cookie-card { padding: 22px; border-radius: 18px; }
  .actions { grid-template-columns: 1fr; }
  .scare img { object-fit: cover; }
}
