#worldRandomEventPage[hidden] {
  display: none !important;
}

#worldRandomEventPage {
  position: fixed;
  z-index: 20000;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  color: #f4f1e8;
  background: #090b0a;
}

.random-world-event {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
}

.random-world-event__background {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  user-select: none;
}

.random-world-event__shade {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 3, 3, .12) 0%, transparent 42%, rgba(2, 3, 3, .28) 66%, rgba(2, 3, 3, .9) 100%),
    linear-gradient(90deg, rgba(3, 5, 4, .2), transparent 34%, transparent 68%, rgba(3, 5, 4, .12));
}

.random-world-event__content {
  position: absolute;
  right: clamp(14px, 3vw, 52px);
  bottom: clamp(14px, 3.4vh, 42px);
  left: clamp(14px, 3vw, 52px);
  display: grid;
  gap: clamp(12px, 2vh, 22px);
  width: min(1160px, calc(100% - clamp(28px, 6vw, 104px)));
  margin-inline: auto;
}

.random-world-event__copy {
  width: min(820px, 100%);
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid color-mix(in srgb, var(--accent, #a6cb65) 55%, transparent);
  border-radius: 14px;
  background: rgba(5, 8, 6, .86);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
  backdrop-filter: blur(9px);
}

.random-world-event__speaker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong, #d9ef9f);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.random-world-event__copy h1 {
  margin: 0 0 7px;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  line-height: 1.1;
}

.random-world-event__copy p {
  max-width: 76ch;
  margin: 0;
  color: #e4e4dc;
  font-size: clamp(.92rem, 1.45vw, 1.08rem);
  line-height: 1.48;
}

.random-world-event__choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 10px;
}

.random-world-event__choice {
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent, #a6cb65) 66%, #fff 8%);
  border-radius: 10px;
  color: #f4f5ef;
  background: rgba(8, 13, 9, .92);
  box-shadow: 0 9px 25px rgba(0, 0, 0, .38);
  font: inherit;
  font-weight: 750;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.random-world-event__choice:not(:disabled):hover,
.random-world-event__choice:not(:disabled):focus-visible {
  border-color: var(--accent-strong, #d9ef9f);
  background: color-mix(in srgb, var(--accent, #a6cb65) 25%, rgba(8, 13, 9, .96));
  transform: translateY(-2px);
  outline: none;
}

.random-world-event__choice--danger {
  border-color: rgba(217, 104, 88, .8);
}

.random-world-event__choice:disabled {
  cursor: not-allowed;
  filter: grayscale(.5);
  opacity: .43;
}

body.random-world-event-active {
  overflow: hidden !important;
}

body.random-world-event-active .game-quick-menu-root,
body.random-world-event-active .patreon-float,
body.random-world-event-active .support-button,
body.random-world-event-active .patreon-button,
body.random-world-event-active .critical-warnings,
body.random-world-event-active .mobile-sidebar-controls,
body.random-world-event-active #lootToastRegion,
body.random-world-event-active #locationScenePatreonButton {
  display: none !important;
}

.world-map-event-marker {
  position: absolute;
  z-index: 9;
  right: auto;
  bottom: 20%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(30px, 3vw, 42px);
  aspect-ratio: 1;
  border: 2px solid #f7eaa8;
  border-radius: 50%;
  color: #19170f;
  background: #e9d675;
  box-shadow: 0 0 0 5px rgba(233, 214, 117, .16), 0 5px 16px rgba(0, 0, 0, .62);
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
  translate: -50% 0;
  animation: random-world-event-pulse 1.5s ease-in-out infinite;
}

.world-map-location.has-random-event {
  z-index: 7;
}

.world-map-location.has-random-event .world-map-location__label {
  border-color: #e9d675;
}


@keyframes random-world-event-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(233, 214, 117, .14), 0 5px 16px rgba(0, 0, 0, .62); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(233, 214, 117, 0), 0 5px 18px rgba(0, 0, 0, .7); }
}

.combat-image--bandit-group {
  display: flex !important;
  align-items: flex-end;
  justify-content: center;
  width: min(100%, 390px) !important;
  height: min(94%, 405px) !important;
  overflow: visible !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

.combat-image--bandit-group .combat-image__raster {
  width: 56%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, .72));
  transform: scaleX(-1);
}

.combat-image--bandit-group .combat-image__raster + .combat-image__raster {
  margin-left: -17%;
}

@media (max-width: 760px) {
  .random-world-event__background { object-position: center center; }
  .random-world-event__content { bottom: 10px; }
  .random-world-event__copy { max-height: 34dvh; overflow: auto; }
  .random-world-event__choices { grid-template-columns: 1fr; max-height: 34dvh; overflow: auto; }
  .random-world-event__choice { min-height: 46px; padding: 10px 12px; }
  .world-map-event-marker { bottom: 18%; }
}

@media (prefers-reduced-motion: reduce) {
  .world-map-event-marker { animation: none; }
  .random-world-event__choice { transition: none; }
}
