/* Red danger flash when mouse moves to top */
#edge-top-flash {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  pointer-events: none;
  background: radial-gradient(
    ellipse 120% 45% at 50% 0%,
    rgba(255, 0, 0, 0.55) 0%,
    rgba(180, 0, 0, 0.28) 35%,
    transparent 72%
  );
  opacity: 0;
}

#edge-top-flash.edge-top-flash--pulse {
  animation: edge-top-flash-pulse 0.45s ease-out 3;
}

@keyframes edge-top-flash-pulse {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  40% {
    opacity: 0.35;
  }
  55% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

html.edge-top-danger::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  pointer-events: none;
  box-shadow: inset 0 0 0 4px rgba(255, 40, 40, 0.85);
  animation: edge-top-border-blink 0.35s ease-in-out 6;
}

@keyframes edge-top-border-blink {
  0%,
  100% {
    box-shadow: inset 0 0 0 4px rgba(255, 40, 40, 0.2);
  }
  50% {
    box-shadow: inset 0 0 0 6px rgba(255, 0, 0, 0.95);
  }
}

#edge-top-popups-root {
  position: fixed;
  inset: 0;
  z-index: 2147483648;
  pointer-events: none;
  overflow: visible;
}

/* Top alert cards */
.edge-top-alert {
  position: absolute;
  top: 10px;
  width: min(272px, 44vw);
  transform: translateX(-50%) translateY(-28px) scale(0.88);
  opacity: 0;
  pointer-events: auto;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #ff2b2b;
  background: linear-gradient(165deg, #1a0000 0%, #3d0000 40%, #120000 100%);
  box-shadow:
    0 0 0 1px rgba(255, 80, 80, 0.5),
    0 0 24px rgba(255, 0, 0, 0.55),
    0 18px 40px rgba(0, 0, 0, 0.5);
  animation: edge-top-card-glow 1.2s ease-in-out infinite;
  animation-delay: var(--edge-stagger, 0s);
  transition:
    transform 0.32s cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity 0.25s ease;
}

.edge-top-alert--win {
  border-radius: 8px;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.edge-top-alert--mac {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.edge-top-alert--in {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}

.edge-top-alert--out {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px) scale(0.94);
}

@keyframes edge-top-card-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 80, 80, 0.5),
      0 0 18px rgba(255, 0, 0, 0.45),
      0 18px 40px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 120, 120, 0.9),
      0 0 32px rgba(255, 0, 0, 0.85),
      0 18px 40px rgba(0, 0, 0, 0.55);
  }
}

.edge-top-alert__chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #b00000, #ff1a1a 50%, #8b0000);
  border-bottom: 1px solid rgba(255, 120, 120, 0.5);
}

.edge-top-alert__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  animation: edge-top-dot-blink 0.5s step-end infinite;
}

@keyframes edge-top-dot-blink {
  50% {
    opacity: 0.2;
  }
}

.edge-top-alert__brand {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.edge-top-alert__badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #1a0000;
  background: #ffeb3b;
  padding: 3px 7px;
  border-radius: 4px;
  animation: edge-top-badge-shake 0.4s ease-in-out infinite;
}

@keyframes edge-top-badge-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

.edge-top-alert__body {
  padding: 14px 14px 10px;
  text-align: center;
  color: #ffe8e8;
}

.edge-top-alert__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ff4444;
  text-shadow: 0 0 12px rgba(255, 0, 0, 0.8);
  animation: edge-top-title-flash 0.55s ease-in-out infinite;
}

@keyframes edge-top-title-flash {
  0%,
  100% {
    color: #ff4444;
  }
  50% {
    color: #fff;
  }
}

.edge-top-alert__msg {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #ffc9c9;
}

.edge-top-alert__support {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #ffaaaa;
}

.edge-top-alert__phone {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 0, 0, 0.35);
  border: 1px solid rgba(255, 120, 120, 0.6);
}

.edge-top-alert__phone:hover {
  background: rgba(255, 40, 40, 0.55);
}

.edge-top-alert__ok {
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #e60000, #990000);
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.45);
  font-family: inherit;
}

.edge-top-alert__ok:hover {
  filter: brightness(1.08);
}

.edge-top-alert__ok:active {
  transform: scale(0.98);
}
