/* Realms of Arkovia - Shared Story Dungeon Detail Command Center
   Presentation only. Story state, required keys, unlock order, sessions,
   rewards, combat, inventory, routes, and RoA Bot authority remain unchanged. */

body.roa-story-dungeon-detail-page {
  min-height: 100dvh;
  overflow: hidden;
  color: #d9d0c2;
  background:
    linear-gradient(rgba(3, 2, 6, 0.7), rgba(3, 2, 6, 0.95)),
    radial-gradient(circle at 27% 18%, rgba(135, 48, 165, 0.25), transparent 35rem),
    radial-gradient(circle at 76% 70%, rgba(216, 184, 107, 0.08), transparent 29rem),
    url('/roa-ui/backgrounds/violet-catacombs.webp') center / cover fixed,
    #050307;
}

body.roa-story-dungeon-detail-page::before {
  opacity: 0.24;
  background:
    linear-gradient(rgba(216, 184, 107, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 184, 107, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-shell {
  display: grid;
  align-content: start;
  gap: 10px;
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding:
    calc(var(--roa-header-h) + 11px)
    14px
    calc(var(--roa-dock-h) + 17px);
  overflow-x: hidden;
  overflow-y: auto;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-shell > * {
  min-width: 0;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-topbar,
body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command,
body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable {
  margin: 0;
  border: 14px solid transparent;
  border-image: var(--roa-frame-panel) 55 fill / 14px / 0 stretch;
  border-radius: 0;
  background: rgba(5, 4, 7, 0.94);
  box-shadow:
    0 11px 30px rgba(0, 0, 0, 0.56),
    inset 0 0 34px rgba(86, 31, 103, 0.07);
  box-sizing: border-box;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 5px 12px;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #d8c79d;
  font-family: var(--roa-title-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-back:hover,
body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-back:focus-visible {
  color: #f0dda8;
  text-shadow: 0 0 10px rgba(216, 184, 107, 0.28);
  outline: none;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-context {
  color: #877e72;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  min-height: calc(
    100dvh
    - var(--roa-header-h)
    - var(--roa-dock-h)
    - 92px
  );
  padding: 0;
  overflow: hidden;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border-right: 1px solid rgba(216, 184, 107, 0.14);
  background:
    radial-gradient(circle at 50% 42%, rgba(119, 41, 145, 0.2), transparent 61%),
    linear-gradient(145deg, rgba(15, 9, 18, 0.96), rgba(5, 4, 7, 0.99));
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-visual::before {
  content: "";
  position: absolute;
  inset: 16px;
  pointer-events: none;
  border: 1px solid rgba(216, 184, 107, 0.08);
  background:
    linear-gradient(135deg, rgba(216, 184, 107, 0.035), transparent 28%),
    linear-gradient(315deg, rgba(135, 49, 164, 0.06), transparent 31%);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-cover {
  position: relative;
  z-index: 1;
  width: min(100%, 740px);
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  border: 12px solid transparent;
  border-image: var(--roa-frame-panel) 55 fill / 12px / 0 stretch;
  border-radius: 0;
  background:
    radial-gradient(circle at center, rgba(110, 39, 133, 0.24), transparent 64%),
    rgba(3, 2, 5, 0.98);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.62),
    0 0 30px rgba(112, 39, 136, 0.13);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-cover-glow {
  position: absolute;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(162, 68, 190, 0.22), transparent 61%);
  filter: blur(18px);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-artwork {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter:
    saturate(0.86)
    brightness(0.88)
    contrast(1.05);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-cover-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(3, 2, 5, 0.08) 35%, rgba(3, 2, 5, 0.88)),
    linear-gradient(90deg, rgba(3, 2, 5, 0.3), transparent 24%, transparent 76%, rgba(3, 2, 5, 0.3));
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  color: #d7c8a3;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid rgba(216, 184, 107, 0.28);
  background: rgba(5, 4, 7, 0.84);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.58);
}




body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-brief {
  display: grid;
  align-content: center;
  gap: 13px;
  min-width: 0;
  margin: 0;
  padding: 24px 26px;
  background:
    linear-gradient(145deg, rgba(12, 8, 15, 0.96), rgba(5, 4, 7, 0.99)),
    radial-gradient(circle at 80% 18%, rgba(128, 43, 154, 0.1), transparent 27rem);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-heading {
  display: grid;
  gap: 7px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(216, 184, 107, 0.15);
}

body.roa-story-dungeon-detail-page .eyebrow {
  margin: 0;
  color: #c77bd6;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-heading h1 {
  margin: 0;
  color: var(--roa-gold-bright);
  font-family: var(--roa-title-font);
  font-size: clamp(2.1rem, 3.45vw, 4.2rem);
  font-weight: 600;
  line-height: 0.98;
  text-shadow:
    0 3px 4px #000,
    0 0 22px rgba(216, 184, 107, 0.16);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-premise {
  max-width: 920px;
  margin: 0;
  color: #b3aa9d;
  font-size: clamp(0.82rem, 1vw, 1rem);
  line-height: 1.58;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-intelligence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-intel-card {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 94px;
  padding: 12px 14px;
  border: 11px solid transparent;
  border-image: var(--roa-frame-panel) 55 fill / 11px / 0 stretch;
  background: rgba(7, 5, 9, 0.94);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-intel-card span {
  color: #8f877b;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-intel-card strong {
  overflow: hidden;
  color: #e1d0a6;
  font-family: var(--roa-title-font);
  font-size: clamp(0.96rem, 1.2vw, 1.25rem);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-intel-card small {
  color: #827a70;
  font-size: 0.6rem;
  line-height: 1.35;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-lock {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 11px 13px;
  color: #cabaa3;
  border: 1px solid rgba(190, 104, 213, 0.24);
  background:
    linear-gradient(90deg, rgba(103, 34, 123, 0.17), rgba(10, 7, 12, 0.9));
  box-shadow: inset 0 0 20px rgba(109, 37, 131, 0.06);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-lock-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #c584d5;
  border: 1px solid rgba(197, 132, 213, 0.27);
  border-radius: 50%;
  background: rgba(118, 38, 139, 0.12);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-lock strong {
  color: #dccaa4;
  font-family: var(--roa-title-font);
  font-size: 0.78rem;
  font-weight: 600;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-lock p {
  margin: 3px 0 0;
  color: #a89d90;
  font-size: 0.69rem;
  line-height: 1.42;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.78fr);
  align-items: center;
  gap: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(216, 184, 107, 0.15);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-actions header {
  display: grid;
  gap: 4px;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-actions h2 {
  margin: 0;
  color: #dfcfa6;
  font-family: var(--roa-title-font);
  font-size: clamp(1.05rem, 1.4vw, 1.4rem);
  font-weight: 600;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-actions header > p:last-child {
  max-width: 620px;
  margin: 0;
  color: #8f877b;
  font-size: 0.64rem;
  line-height: 1.42;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

body.roa-story-dungeon-detail-page .button,
body.roa-story-dungeon-detail-page button {
  appearance: none !important;
  display: inline-grid !important;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 46px !important;
  padding: 7px 14px !important;
  color: #decda0 !important;
  font-family: var(--roa-title-font);
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  border: 0 !important;
  border-image: none !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: url('/roa-ui/frames/button-plain.png') !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  box-shadow: none !important;
  filter:
    saturate(0.78)
    brightness(0.91)
    drop-shadow(0 4px 6px rgba(0, 0, 0, 0.56));
  transform: none !important;
}

body.roa-story-dungeon-detail-page .storybook-primary-action {
  color: #f0dda8 !important;
  background-image: url('/roa-ui/frames/button-active.png') !important;
  filter:
    saturate(0.94)
    brightness(1)
    drop-shadow(0 0 8px rgba(155, 57, 202, 0.3));
}

body.roa-story-dungeon-detail-page .button:hover,
body.roa-story-dungeon-detail-page .button:focus-visible,
body.roa-story-dungeon-detail-page button:hover,
body.roa-story-dungeon-detail-page button:focus-visible {
  color: #fff0c4 !important;
  background-image: url('/roa-ui/frames/button-active.png') !important;
  outline: 1px solid rgba(209, 132, 237, 0.44);
  outline-offset: -3px;
  filter:
    saturate(1)
    brightness(1.05)
    drop-shadow(0 0 9px rgba(157, 57, 205, 0.36));
}

body.roa-story-dungeon-detail-page button:disabled {
  cursor: not-allowed;
  opacity: 0.47;
  outline: none;
  filter:
    grayscale(0.48)
    saturate(0.45)
    brightness(0.68);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command.completed {
  box-shadow:
    0 0 0 1px rgba(216, 184, 107, 0.16),
    0 11px 30px rgba(0, 0, 0, 0.56);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command.active {
  box-shadow:
    0 0 0 1px rgba(201, 119, 230, 0.34),
    0 0 24px rgba(130, 47, 158, 0.17),
    0 11px 30px rgba(0, 0, 0, 0.56);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command.unlocked {
  box-shadow:
    0 0 0 1px rgba(104, 146, 169, 0.2),
    0 11px 30px rgba(0, 0, 0, 0.56);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command.locked .roa-story-dungeon-detail-artwork {
  filter:
    grayscale(0.44)
    saturate(0.48)
    brightness(0.65);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command.locked .roa-story-dungeon-detail-status-badge {
  color: #a99fae;
  border-color: rgba(174, 123, 188, 0.22);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 260px;
  padding: 22px 28px;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  color: #c884d7;
  font-size: 1.65rem;
  border: 1px solid rgba(199, 123, 214, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(133, 46, 158, 0.2), transparent 72%);
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable h1 {
  margin: 4px 0 7px;
  color: var(--roa-gold-bright);
  font-family: var(--roa-title-font);
  font-size: clamp(1.7rem, 2.6vw, 3rem);
  font-weight: 600;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable p:not(.eyebrow) {
  max-width: 780px;
  margin: 0 0 14px;
  color: #a99f92;
  font-size: 0.78rem;
  line-height: 1.5;
}

body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable .button {
  width: min(100%, 250px);
}

@media (max-width: 1450px), (max-height: 820px) {
  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-shell {
    gap: 8px;
    padding-top: calc(var(--roa-header-h) + 9px);
    padding-bottom: calc(var(--roa-dock-h) + 12px);
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-topbar,
  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command,
  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable {
    border-width: 12px;
    border-image-width: 12px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-topbar {
    min-height: 46px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command {
    grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
    min-height: calc(
      100dvh
      - var(--roa-header-h)
      - var(--roa-dock-h)
      - 72px
    );
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-visual {
    padding: 12px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-cover {
    border-width: 10px;
    border-image-width: 10px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-brief {
    gap: 9px;
    padding: 15px 18px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-heading {
    gap: 5px;
    padding-bottom: 9px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-heading h1 {
    font-size: clamp(1.75rem, 2.7vw, 3rem);
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-premise {
    font-size: 0.76rem;
    line-height: 1.45;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-intel-card {
    min-height: 78px;
    padding: 8px 11px;
    border-width: 9px;
    border-image-width: 9px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-lock {
    padding: 8px 10px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-actions {
    gap: 11px;
    padding-top: 9px;
  }

  body.roa-story-dungeon-detail-page .button,
  body.roa-story-dungeon-detail-page button {
    min-height: 40px !important;
    font-size: 0.66rem !important;
  }
}

@media (max-width: 980px) {
  body.roa-story-dungeon-detail-page {
    overflow: auto;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-shell {
    height: auto;
    min-height: 100dvh;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-command {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-visual {
    border-right: 0;
    border-bottom: 1px solid rgba(216, 184, 107, 0.14);
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-cover {
    width: min(100%, 760px);
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-brief {
    align-content: start;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-shell {
    padding-right: 8px;
    padding-left: 8px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-context {
    display: none;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-visual {
    padding: 7px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-cover {
    aspect-ratio: 16 / 11;
    border-width: 8px;
    border-image-width: 8px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-status-badge {
    top: 7px;
    right: 7px;
    padding: 4px 7px;
  }



  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-brief {
    padding: 13px 11px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-heading h1 {
    font-size: clamp(1.6rem, 8vw, 2.35rem);
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-intelligence,
  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-action-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-lock {
    grid-template-columns: minmax(0, 1fr);
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-lock-icon {
    display: none;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable {
    grid-template-columns: minmax(0, 1fr);
    padding: 17px 14px;
  }

  body.roa-story-dungeon-detail-page .roa-story-dungeon-detail-unavailable-icon {
    display: none;
  }

  body.roa-story-dungeon-detail-page .button,
  body.roa-story-dungeon-detail-page button {
    width: 100%;
  }
}