/* ------------------------------------------------------------
   Reliquary overrides (loaded last)
   Purpose: safety rails only.
   ------------------------------------------------------------ */


#results,
#results.is-raw {
  height: auto !important;
  min-height: 0 !important;
}

/* Force curse-required label to match selected curse styling */
#results .curse-line .curse-required {
  color: #b58cff !important;
  font-style: italic;
  font-weight: 800;
  margin-right: 0.6rem;
  font-size: 0.75em;
}

#results .curse-line .curse-sub {
  margin-right: 0.6rem;
}

/* Keep curse text centered with its button in all modes */
#results .curse-line .curse-sub {
  margin-top: 0;
  align-self: center;
  line-height: 1.1;
}

#results.is-raw .effect-main--row .curse-sub {
  align-self: center !important;
}

/* ------------------------------------------------------------
   Relic Preview (use base layout styles; no overrides here)
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   Start Over button spacing + tan gradient (LEFT → RIGHT)
   (Overrides layout.css which uses !important)
   ------------------------------------------------------------ */

/* Keep the utility-bar row vertically centered */
.utility-bar button#startOver {
  margin: 0 0.4rem 0 auto !important;
  align-self: center;
}

/* Tuck the left utility group in slightly so Start Over aligns with the effect row instead of the preview width */
.utility-bar__col--left {
  padding-right: 0.9rem;
}

/* Offset right column to line up Instructions with the Details panel content */
.utility-bar__col--right {
  padding-left: 0.85rem;
}

/* Purple gradients for Instructions / Disclaimer */
button#instructionsBtn,
button#disclaimerBtn {
  background: linear-gradient(135deg, #5b3c9f 0%, #8f6bd8 55%, #2b1a4f 100%) !important;
  color: #f5f0ff !important;
  border: 1px solid rgba(180, 150, 255, 0.55) !important;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

button#instructionsBtn:hover,
button#disclaimerBtn:hover {
  filter: brightness(1.06);
  border-color: rgba(200, 175, 255, 0.8) !important;
}

button#instructionsBtn:active,
button#disclaimerBtn:active {
  filter: brightness(0.98);
}

button#startOver {
  margin-top: 0.85rem !important;
  margin-bottom: 0.35rem !important;

  background: linear-gradient(
    90deg,
    #d6c29a 0%,
    #b9a47a 45%,
    #1a1a1a 100%
  ) !important;
  color: #111 !important;
  border: 1px solid rgba(0, 0, 0, 0.55) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 16px rgba(0, 0, 0, 0.45) !important;
}

button#startOver:hover {
  background: linear-gradient(
    90deg,
    #cdb88f 0%,
    #a79267 45%,
    #111 100%
  ) !important;
}

button#startOver:active {
  background: linear-gradient(
    90deg,
    #bca577 0%,
    #8f7b55 45%,
    #000 100%
  ) !important;
  transform: translateY(1px);
}

button#startOver:focus-visible {
  outline: 2px solid rgba(214, 194, 154, 0.9) !important;
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Illegal toggle (highest priority): active = white bg + red icon/border
   ------------------------------------------------------------ */

button#showIllegalBtn.is-active,
button#showIllegalBtn[aria-pressed="true"] {
  background-color: #ffffff !important;
  background-image: none !important;
  border: 2px solid #b10000 !important;
  color: #b10000 !important;
  box-shadow: 0 0 0 1px rgba(177, 0, 0, 0.35) !important;
}

button#showIllegalBtn.is-active .utility-toggle__svg,
button#showIllegalBtn[aria-pressed="true"] .utility-toggle__svg {
  stroke: #b10000 !important;
  stroke-width: 2.4px !important;
}
/* ------------------------------------------------------------
   Raw-mode layout: keep effect row simple; curse row stacks below via effect-line grid
   ------------------------------------------------------------ */

/* Keep the effect title/controls on one row; curse-line now lives outside effect-main */
#results.is-raw .effect-main--row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "text controls";
  column-gap: 0.75rem;
  row-gap: 0.35rem;
  align-items: center;
}

#results.is-raw .effect-main--row .effect-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#results.is-raw .effect-main--row .effect-btn,
#results.is-raw .effect-main--row .control-cluster.effect-controls {
  grid-area: controls;
  justify-self: end;
  align-self: center;
}
  /* Let main tokens sit on line 1; allow a controlled wrap for curse tokens */
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  white-space: normal;
  gap: 0.35rem 0.65rem;
  align-items: center;
}

#results.is-raw .effect-main--row .meta code {
  padding: 0.16rem 0.40rem;
}

/* Force a clean break before curse tokens without extra gap */
#results.is-raw .effect-main--row .meta .meta-break {
  flex-basis: 100%;
  height: 0;
  padding: 0;
  margin: 0;
  line-height: 0;
}

#results.is-raw .effect-main--row .meta .meta-curse {
  color: #b58cff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
/* ------------------------------------------------------------
   Curse dialog sizing (compact centered modal)
   ------------------------------------------------------------ */

.curse-dialog {
  /* compact rectangle, centered */
  width: min(520px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  height: auto;
  max-height: calc(100vh - 2rem);

  margin: auto;
  padding: 0;

  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 10, 14, 0.92);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65);

  overflow: hidden; /* keeps header/footer pinned and corners clean */
}

.curse-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

/* Make the dialog content scroll INSIDE the bounding box */
.curse-dialog__form {
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-height: calc(100vh - 2rem);
  margin: 0;
}

.curse-dialog__header,
.curse-dialog__footer {
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.22);
}

.curse-dialog__title {
  font-size: 1.0rem;
  line-height: 1.2;
  margin: 0;
}

.curse-dialog__body {
  padding: 0.85rem 0.9rem 0.95rem;
  overflow: auto;
}

.curse-dialog__footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.curse-dialog__footer button {
  width: auto;
  min-width: 160px;
}
/* ------------------------------------------------------------
   Curse dialog controls (Category + Effect dropdowns)
   ------------------------------------------------------------ */

.curse-dialog__controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.curse-field {
  display: grid;
  gap: 0.35rem;
}

.curse-field__label {
  font-size: 0.85rem;
  opacity: 0.85;
}

.curse-dialog__controls select {
  width: 100%;
}


/* ------------------------------------------------------------
   Curse dialog — boxed modal with header + close
   ------------------------------------------------------------ */

.curse-dialog {
  width: min(520px, calc(100vw - 2rem));
  margin: auto;
  border-radius: 1rem;
  background: rgba(10, 12, 16, 0.96);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 40px 90px rgba(0,0,0,0.75);
}

.curse-dialog::backdrop {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.curse-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.curse-dialog__close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  cursor: pointer;
}
.curse-dialog__close:hover {
  color: #fff;
}

.curse-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
