: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, .tap-to-start {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 750;
  transition: transform 120ms ease, filter 120ms ease, opacity 160ms ease;
}

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

/*
  The player stays laid out behind the page while muted so YouTube can prepare
  it before the user clicks. It only moves above the page when armed.
*/
.scare {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow: hidden;
  background: #000;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.scare.armed,
.scare.active {
  z-index: 9999;
  opacity: 1;
  pointer-events: auto;
}

.video-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.fallback-image,
.video-layer,
.interaction-shield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fallback-image {
  z-index: 2;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  opacity: 1;
  transition: opacity 30ms linear;
}

.video-layer {
  z-index: 3;
  opacity: 0;
  transition: opacity 30ms linear;
}

.scare.active .video-layer { opacity: 1; }
.scare.active .fallback-image { opacity: 0; }

#player-mount,
#youtube-player,
#youtube-player iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 200px;
  min-height: 200px;
  border: 0;
  background: #000;
}

/* Taps and clicks never reach the YouTube iframe, so they cannot pause it. */
#youtube-player,
#youtube-player iframe {
  pointer-events: none !important;
}

.interaction-shield {
  z-index: 8;
  pointer-events: auto;
  touch-action: none;
  cursor: default;
  background: transparent;
}

.tap-to-start {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-width: min(82vw, 260px);
  padding: 0 20px;
  background: rgba(255, 255, 255, .96);
  color: #111827;
  border-color: rgba(255, 255, 255, .55);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

.tap-to-start:active { transform: translateX(-50%) scale(.98); }

.control-strip {
  position: relative;
  z-index: 20;
  flex: 0 0 0;
  height: 0;
  overflow: hidden;
  display: grid;
  place-items: center end;
  padding: 0 max(12px, env(safe-area-inset-right));
  background: #000;
  transition: flex-basis 160ms ease, height 160ms ease, padding 160ms ease;
}

.scare.can-stop .control-strip {
  flex-basis: 56px;
  height: 56px;
  padding-top: 6px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.stop {
  min-height: 42px;
  padding: 0 16px;
  background: rgba(255,255,255,.96);
  color: #111827;
  border-color: rgba(255,255,255,.5);
  opacity: 0;
  pointer-events: none;
}

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

@media (max-width: 520px) {
  .card, .cookie-card { padding: 22px; border-radius: 18px; }
  .actions { grid-template-columns: 1fr; }
  .scare.can-stop .control-strip { flex-basis: 52px; height: 52px; }
}
