.event-widget-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1400;
  width: min(430px, calc(100vw - 24px));
  pointer-events: none;
}

.event-widget-card {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  border-radius: 14px;
  padding: 10px;
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(4px);
  transform: translateY(0);
  animation: none;
}

.event-widget-root.is-fresh .event-widget-card {
  animation: eventWidgetIn 380ms ease-out;
}

.event-widget-root.is-warning .event-widget-card {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 16px 32px rgba(245, 158, 11, 0.24);
}

.event-widget-root.is-ongoing .event-widget-card {
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow: 0 16px 32px rgba(34, 197, 94, 0.24);
}

.event-widget-glow {
  position: absolute;
  top: -45px;
  right: -55px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.35), rgba(96, 165, 250, 0) 70%);
  pointer-events: none;
}

.event-widget-root.is-warning .event-widget-glow {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.38), rgba(245, 158, 11, 0) 70%);
}

.event-widget-root.is-ongoing .event-widget-glow {
  background: radial-gradient(circle, rgba(34, 197, 94, 0.35), rgba(34, 197, 94, 0) 70%);
}

.event-widget-compact {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.4);
  transition: background-color 160ms ease, transform 160ms ease;
}

.event-widget-compact:hover {
  background: rgba(30, 41, 59, 0.58);
  transform: translateY(-1px);
}

.event-widget-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.9);
  animation: eventPulseBlue 1.8s infinite;
}

.event-widget-root.is-warning .event-widget-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.9);
  animation: eventPulseWarning 1.35s infinite;
}

.event-widget-root.is-ongoing .event-widget-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.9);
  animation: eventPulseOngoing 1.05s infinite;
}

.event-widget-compact-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.event-widget-compact-title {
  font-size: 14px;
  line-height: 1.25;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-widget-compact-time {
  font-size: 13px;
  line-height: 1.2;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.event-widget-toggle {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(2, 6, 23, 0.65);
  color: #e2e8f0;
  border-radius: 8px;
  height: 30px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.event-widget-toggle:hover {
  border-color: rgba(191, 219, 254, 0.7);
  background: rgba(15, 23, 42, 0.92);
}

.event-widget-details {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.55);
  animation: eventExpandIn 220ms ease-out;
}

.event-widget-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-widget-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  width: fit-content;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.25);
}

.event-widget-root.is-warning .event-widget-badge {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.25);
}

.event-widget-root.is-ongoing .event-widget-badge {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.25);
}

.event-widget-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.event-widget-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  color: #f8fafc;
}

.event-widget-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #e2e8f0;
}

.event-widget-peak {
  margin: 4px 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  font-size: 13px;
  color: #bae6fd;
}

.event-widget-times {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
}

@media (max-width: 768px) {
  .event-widget-root {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 12px;
    z-index: 990;
  }

  .event-widget-card {
    padding: 8px;
  }

  .event-widget-compact {
    grid-template-columns: auto 1fr auto;
  }

  .event-widget-compact-time {
    display: none;
  }

  .event-widget-title {
    font-size: 15px;
  }

  body.menu-open .event-widget-root {
    display: none;
  }
}

@keyframes eventWidgetIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes eventExpandIn {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes eventPulseBlue {
  0% {
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.9);
  }
  70% {
    box-shadow: 0 0 0 11px rgba(96, 165, 250, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);
  }
}

@keyframes eventPulseWarning {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.9);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

@keyframes eventPulseOngoing {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.95);
  }
  70% {
    box-shadow: 0 0 0 13px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}
