#story-event-dialog-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 22, 0.42);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10050;
}

#story-event-dialog-overlay.hidden {
  display: none;
}

/* ── card ── */
#story-event-dialog-window {
  position: relative;
  width: min(86%, 300px);
  max-height: 85vh;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.18);
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
}

#story-event-dialog-window.positive {
  background: linear-gradient(160deg, rgba(120,20,70,0.97), rgba(80,10,50,0.95));
  border-color: rgba(236,72,153,0.45);
}

#story-event-dialog-window.negative {
  background: linear-gradient(160deg, rgba(100,10,10,0.97), rgba(60,6,6,0.95));
  border-color: rgba(248,113,113,0.5);
}

#story-event-dialog-window.neutral {
  background: linear-gradient(180deg, rgba(28,25,23,0.96), rgba(24,24,27,0.94));
  border-color: rgba(255,255,255,0.12);
}

/* ── glow ── */
#story-event-dialog-glow {
  position: absolute;
  top: -18%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 44%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(236,72,153,0.28), rgba(236,72,153,0.0) 70%);
  pointer-events: none;
}

#story-event-dialog-window.negative #story-event-dialog-glow {
  background: radial-gradient(circle, rgba(248,113,113,0.30), rgba(248,113,113,0.0) 70%);
}

#story-event-dialog-window.neutral #story-event-dialog-glow {
  background: radial-gradient(circle, rgba(255,255,255,0.10), rgba(255,255,255,0.0) 70%);
}

#story-event-dialog-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(16,18,31,0.78);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

#story-event-dialog-window.negative #story-event-dialog-badge {
  background: rgba(48,10,10,0.84);
  border-color: rgba(248,113,113,0.32);
}

#story-event-dialog-window.neutral #story-event-dialog-badge {
  background: rgba(34,34,40,0.82);
  border-color: rgba(255,255,255,0.12);
}

#story-event-dialog-badge.has-icon #story-event-dialog-emoji {
  display: none;
}

#story-event-dialog-badge.has-icon #story-event-dialog-icon {
  display: block;
}

#story-event-dialog-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: none;
}

/* ── image banner ── */
#story-event-dialog-media-wrap {
  position: relative;
  width: 100%;
  height: 130px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}

#story-event-dialog-media-wrap.is-fallback {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.18), rgba(255,255,255,0) 52%),
    linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
}

#story-event-dialog-window.negative #story-event-dialog-media-wrap.is-fallback {
  background:
    radial-gradient(circle at top left, rgba(248,113,113,0.22), rgba(248,113,113,0) 52%),
    linear-gradient(160deg, rgba(127,29,29,0.38), rgba(69,10,10,0.18));
}

#story-event-dialog-window.neutral #story-event-dialog-media-wrap.is-fallback {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.12), rgba(255,255,255,0) 52%),
    linear-gradient(160deg, rgba(63,63,70,0.36), rgba(39,39,42,0.22));
}

#story-event-dialog-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#story-event-dialog-media-wrap.is-fallback #story-event-dialog-media {
  object-fit: contain;
  padding: 18px;
  box-sizing: border-box;
}

#story-event-dialog-emoji {
  font-size: 20px;
  line-height: 1;
}

/* ── text body ── */
#story-event-dialog-body {
  padding: 18px 14px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
}

/* title = event type label (small, muted) */
#story-event-dialog-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

/* subtitle = hero content (quest name, description) */
#story-event-dialog-subtitle {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  white-space: pre-wrap;
  margin-top: 2px;
}

/* ── footer ── */
#story-event-dialog-footer {
  padding: 10px 14px 14px 14px;
}

#story-event-dialog-close-btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  background: #22c55e;
  color: #fff;
  white-space: nowrap;
}

#story-event-dialog-window.negative #story-event-dialog-close-btn {
  background: #ef4444;
}
