/* ------------------------------------------------------------
   Reliquary — Results (Relic Preview)
   ------------------------------------------------------------ */

:root {
  --results-img-col: 130px;
  --row-radius: 0.56rem;
  --row-pad-y: 0.38rem;
  --row-pad-top: 0.38rem;
  --row-pad-x: 0.52rem;
  --row-gap: 0.4rem;
  --icon-size: 24px;
  --row-min-height-compact: 90px;
  --row-min-height-raw: 140px;
}

#results {
  font-size: 0.7rem;
}

#results {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0.75rem;
  padding: 0.9rem !important;
}

#results,
#results * {
  box-sizing: border-box;
}

/* ------------------------------------------------------------
   Header (Valid/Invalid + gradient)
   ------------------------------------------------------------ */

#results .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.10);
  margin-bottom: 0.75rem;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

#results .panel-header.is-valid {
  background: linear-gradient(
    90deg,
    rgba(18, 74, 44, 0.55) 0%,
    rgba(0, 0, 0, 0.22) 62%,
    rgba(0, 0, 0, 0.55) 100%
  );
  border-color: rgba(18, 74, 44, 0.35);
  box-shadow: inset 0 0 0 1px rgba(18, 74, 44, 0.18);
}

#results .panel-header.is-invalid {
  background: linear-gradient(
    90deg,
    rgba(92, 22, 22, 0.58) 0%,
    rgba(0, 0, 0, 0.22) 62%,
    rgba(0, 0, 0, 0.55) 100%
  );
  border-color: rgba(92, 22, 22, 0.38);
  box-shadow: inset 0 0 0 1px rgba(92, 22, 22, 0.18);
}

#results .panel-header h3 { margin: 0; }

.panel-header__right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
  white-space: nowrap;
}

.auto-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 0;
  height: 33.72px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(200, 165, 255, 0.45);
  background:
    radial-gradient(120% 140% at 10% 15%, rgba(230, 200, 255, 0.25), rgba(0, 0, 0, 0) 62%),
    linear-gradient(135deg,
      rgba(120, 80, 200, 0.90) 0%,
      rgba(170, 110, 255, 0.78) 55%,
      rgba(30, 18, 48, 0.82) 100%
    );
  color: #f4f7ff;
  padding: 0 12px;
  font-weight: 800;
  font-size: 14.82px;
  letter-spacing: 0.01em;
  line-height: 22.23px;
  transform: none;
  transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
}

.auto-sort-btn:hover:not(:disabled) {
  background: rgba(80, 110, 150, 0.38);
  border-color: rgba(255, 255, 255, 0.24);
}

.auto-sort-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.auto-sort-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.validity-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.12);
}

.validity-badge.is-valid { background: rgba(18, 74, 44, 0.90); }
.validity-badge.is-invalid { background: rgba(92, 22, 22, 0.90); }

/* ------------------------------------------------------------
   Preview layout
   ------------------------------------------------------------ */

.relic-preview {
  display: grid;
  grid-template-columns: clamp(200px, 22vw, 300px) minmax(420px, 1fr);
  grid-template-areas: "relic-img relic-effects";
  gap: 0.55rem;
  align-items: stretch;
  /* row height follows effects; image stretches without contributing size */
  grid-auto-rows: auto;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  /* avoid scaling so the layout height matches the visible content */
  width: 100%;
}

/* Raw + curse only: give the image column a sane size so it can't collapse to 2px */
#results.raw-has-curse .relic-preview {
  grid-template-columns: clamp(240px, 26vw, 340px) minmax(460px, 1fr) !important;
}

/* Raw inherits the same column sizing; raw-has-curse keeps its wider override above */

/* Raw mode baseline: keep the effects column wide enough that text can wrap without vertical stacking */
#results.is-raw .relic-effects {
  min-width: 420px;
}

/* Raw + curse: enforce list items grid so rows don't collapse */
#results.raw-has-curse .relic-preview .chosen-effects > li {
  display: grid;
  grid-template-columns: var(--icon-size) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  min-width: 0;
}

/* Raw + curse: keep the row layout from collapsing into a narrow column */
#results.raw-has-curse .relic-preview .effect-row {
  display: grid;
  grid-template-columns: var(--icon-size) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

/* Raw mode: match the standard clamp/min sizing so the image scales with effects */
#results.is-raw .relic-preview {
  grid-template-columns: clamp(200px, 22vw, 300px) minmax(420px, 1fr);
}

.relic-frame {
  grid-area: relic-img;
  grid-row: 1;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1; /* square; height follows row, width follows height */
  contain: none; /* allow frame to fill the column */
  min-height: 0;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  justify-self: start;
  grid-column: 1;
  position: relative;
  z-index: 2;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.relic-color-control {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.3rem;
  z-index: 5;
}

.relic-color-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  line-height: 1;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(145deg, rgba(38, 46, 68, 0.95), rgba(22, 24, 32, 0.95));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 140ms ease, box-shadow 140ms ease;
}

.relic-color-chip:hover { border-color: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.relic-color-chip:active { transform: translateY(0); }

.relic-color-control.is-open .relic-color-chip {
  border-color: rgba(200, 210, 255, 0.6);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.relic-color-chip[data-swatch] {
  background: var(--chip-swatch, linear-gradient(135deg, #c94b4b, #3b82f6, #f2c94c, #2fa44a));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 0 2px rgba(255, 255, 255, 0.08);
}

.relic-color-menu {
  position: absolute;
  right: calc(100% + 0.4rem);
  top: 50%;
  transform: translateY(-50%);
  padding: 0.08rem 0.22rem;
  display: none;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.24rem;
  border-radius: 999px;
  background: linear-gradient(160deg, rgba(12, 14, 22, 0.96), rgba(22, 28, 38, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.35) inset;
}

.relic-color-control.is-open .relic-color-menu { display: flex; }
.relic-color-control.is-open .relic-color-menu .relic-color-option { opacity: 1; }
.relic-color-menu .relic-color-option { opacity: 0.94; }

.relic-color-option {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 1;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(235, 238, 255, 0.95);
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.relic-color-option .color-dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset;
  display: block;
}

.relic-color-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.relic-color-option.is-active {
  background: linear-gradient(135deg, rgba(78, 108, 176, 0.55), rgba(24, 28, 38, 0.85));
  border-color: rgba(200, 210, 255, 0.5);
}

.relic-color-option[data-color-option="Random"] .color-dot {
  background: linear-gradient(135deg, #c94b4b, #3b82f6, #f2c94c, #2fa44a);
}

.relic-color-option[data-color-option="Red"] .color-dot { background: linear-gradient(135deg, #642121, #b84242); }
.relic-color-option[data-color-option="Blue"] .color-dot { background: linear-gradient(135deg, #1e4275, #3f7ad0); }
.relic-color-option[data-color-option="Yellow"] .color-dot { background: linear-gradient(135deg, #645019, #b28d2c); }
.relic-color-option[data-color-option="Green"] .color-dot { background: linear-gradient(135deg, #10482a, #2f8a52); }

/* Raw + curse: frame fills its bounded column and can contribute size */
#results.raw-has-curse .relic-preview .relic-frame {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  align-self: start;
  justify-self: start;
  contain: none;
}

/* Raw + curse: keep effects from collapsing */
#results.raw-has-curse .relic-preview .relic-effects {
  min-width: 380px;
}

/* Raw + curse: keep frame within the bounded column */
#results.raw-has-curse .relic-frame {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  align-self: start;
  justify-self: start;
}

.relic-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* ------------------------------------------------------------
   Effects list
   ------------------------------------------------------------ */

.relic-effects {
  grid-area: relic-effects;
  grid-row: 1;
  height: auto;
  min-height: auto;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  grid-column: 2;
  position: relative;
  z-index: 0;
  overflow: hidden;
}

/* Raw mode: keep natural width; rely on wrapping to avoid bleed */
#results.is-raw .relic-effects {
  overflow: hidden;
}

/* Keep preview columns isolated so raw data rows never bleed over the image column */
.relic-preview > * {
  min-width: 0;
}

.relic-frame {
  position: relative;
  z-index: 2;
}

#results.is-raw .relic-effects,
#results.is-raw .relic-effects .chosen-effects,
#results.is-raw .relic-effects .chosen-effects li,
#results.is-raw .relic-effects .chosen-effects li .effect-line,
#results.is-raw .relic-effects .chosen-effects li .effect-main {
  min-width: 0;
  max-width: 100%;
}

#results.is-raw .relic-effects .chosen-effects li {
  overflow: hidden;
}

#results.is-raw .effect-main,
#results.is-raw .effect-main.effect-main--row {
  width: 100%;
  min-width: 0;
}

/* (reverted raw text wrapping experiment) */

#results.is-raw .effect-main.effect-main--row .effect-text,
#results.is-raw .effect-main.effect-main--row .title,
#results.is-raw .effect-main.effect-main--row .title .title-text {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#results.is-raw .chosen-effects li .effect-main.effect-main--row,
#results.is-raw .chosen-effects li .effect-main.effect-main--row .effect-text,
#results.is-raw .chosen-effects li .effect-main.effect-main--row .title,
#results.is-raw .chosen-effects li .effect-main.effect-main--row .title .title-text {
  min-width: 0;
  max-width: 100%;
}

#results.is-raw .chosen-effects li .effect-main.effect-main--row .title .title-text {
  overflow-wrap: anywhere;
}

.chosen-effects {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-rows: repeat(3, minmax(var(--row-min-height-compact), auto));
  grid-auto-rows: minmax(var(--row-min-height-compact), auto);
  gap: var(--row-gap);
  width: 100%;
}

.slot-counts {
  display: none;
}

.slot-counts .subtext {
  margin: 0;
}

.chosen-effects li {
  display: grid;
  grid-template-columns: var(--icon-size) minmax(0, 1fr);
  gap: 0.75rem;
  padding: var(--row-pad-top) var(--row-pad-x) var(--row-pad-y) var(--row-pad-x);
  border-radius: var(--row-radius);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.10));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  align-items: start;
  min-height: var(--row-min-height-compact);
  height: auto;
  align-self: stretch;
}

/* Raw mode: allow taller rows/panel to fit curse content */
#results.is-raw .relic-effects {
  min-height: calc(var(--row-min-height-raw) * 3 + var(--row-gap) * 2);
}

#results.is-raw .chosen-effects {
  grid-template-rows: repeat(3, minmax(var(--row-min-height-raw), auto));
  grid-auto-rows: minmax(var(--row-min-height-raw), auto);
}

#results.is-raw .chosen-effects li {
  min-height: var(--row-min-height-raw);
}

/* ------------------------------------------------------------
   Row gradients driven by indicators
   ------------------------------------------------------------ */

.chosen-effects li:has(.move-indicator.move-up),
.chosen-effects li:has(.move-indicator.move-down) {
  background: linear-gradient(
    90deg,
    rgba(92, 22, 22, 0.58) 0%,
    rgba(0, 0, 0, 0.22) 62%,
    rgba(0, 0, 0, 0.55) 100%
  );
  border-color: rgba(92, 22, 22, 0.38);
  box-shadow: inset 0 0 0 1px rgba(92, 22, 22, 0.18);
}

/* ------------------------------------------------------------
   Invalid — Curse Required but Missing (no curse selected yet)
   Match standard Invalid gradient exactly
   ------------------------------------------------------------ */

.chosen-effects li:has(.curse-btn):not(:has(.curse-sub)) {
  background: linear-gradient(
    90deg,
    rgba(92, 22, 22, 0.58) 0%,
    rgba(0, 0, 0, 0.22) 62%,
    rgba(0, 0, 0, 0.55) 100%
  );
  border-color: rgba(92, 22, 22, 0.38);
  box-shadow: inset 0 0 0 1px rgba(92, 22, 22, 0.18);
}


/* ✅ Correct selector (your previous one was malformed) */
.chosen-effects li:has(.move-indicator.move-ok):not(:has(.move-indicator.move-up)):not(:has(.move-indicator.move-down)):not(:has(.validity-badge--row.is-invalid)) {
  background: linear-gradient(
    90deg,
    rgba(18, 74, 44, 0.50) 0%,
    rgba(0, 0, 0, 0.22) 62%,
    rgba(0, 0, 0, 0.55) 100%
  );
  border-color: rgba(18, 74, 44, 0.35);
  box-shadow: inset 0 0 0 1px rgba(18, 74, 44, 0.18);
}

.chosen-effects li .effect-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
  overflow: hidden;
  align-self: center;
}

.chosen-effects li .effect-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chosen-effects li .effect-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.55rem;
  row-gap: 0.35rem;
  min-width: 0;
  align-items: start;
}

.effect-main.effect-main--row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-auto-rows: auto;
  align-items: start;
  gap: 0.35rem 0.6rem;
  width: 100%;
  min-width: 0;
}

#results:not(.is-raw) .effect-main.effect-main--row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "text controls";
  align-items: center;
  align-content: start;
  column-gap: 0.55rem;
  row-gap: 0.35rem;
  width: 100%;
}

#results:not(.is-raw) .effect-main.effect-main--row .effect-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

#results:not(.is-raw) .effect-main.effect-main--row .title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

#results:not(.is-raw) .effect-line .curse-line {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

#results:not(.is-raw) .effect-main.effect-main--row .effect-btn,
#results:not(.is-raw) .effect-main.effect-main--row .control-cluster.effect-controls,
#results:not(.is-raw) .effect-main.effect-main--row .curse-btn,
#results:not(.is-raw) .effect-main.effect-main--row .control-cluster.curse-controls,
#results:not(.is-raw) .effect-main.effect-main--row .row-indicators {
  align-self: center;
}

#results:not(.is-raw) .effect-main.effect-main--row .control-cluster.effect-controls,
#results:not(.is-raw) .effect-main.effect-main--row .effect-btn {
  grid-area: controls;
  justify-self: end;
  align-self: start;
  margin-top: -1px;
}

.effect-main.effect-main--row .effect-text {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

#results.is-raw .chosen-effects li .effect-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.55rem;
  row-gap: 0.35rem;
  width: 100%;
  min-width: 0;
  align-items: start;
}

/* Raw mode: let the main content own the space; indicators stay absolute via existing rules */
#results.is-raw .effect-line .effect-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* Raw: use the base grid layout; wrapping handled by min-width:0 rules below */
#results.is-raw .effect-main.effect-main--row {
  display: grid !important;
}

/* Raw mode: force a simple flex row so the text column can use full width */
#results.is-raw .effect-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

#results.is-raw .effect-line {
  width: 100%;
  min-width: 0;
}

#results:not(.is-raw) .chosen-effects li .effect-main:not(.effect-main--row) {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

#results:not(.is-raw) .chosen-effects li .effect-main:not(.effect-main--row):has(.curse-line) {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  align-items: start;
}

#results:not(.is-raw) .chosen-effects li .effect-main .title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 850;
  line-height: 1.15;
  margin: 0;
  min-width: 0;
}

.chosen-effects li .title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
  font-size: 0.75em;
}

.chosen-effects li .curse-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0;
  position: relative;
}

/* Keep curse text level with the button; remove the negative lift from the shared style */
#results .curse-line .curse-sub {
  margin-top: 0;
  align-self: center;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75em;
}

.curse-line .curse-required,
.curse-line .curse-btn,
.curse-line .curse-sub {
  align-self: center;
}

.curse-line .curse-btn {
  font-size: 0.75em;
  margin-top: 0;
}

.curse-line .curse-btn {
  align-items: center;
  line-height: 1.25;
}

.chosen-effects li .curse-required {
  color: #b58cff !important;
  font-style: italic;
  font-weight: 700;
  margin-right: 0.6rem;
  display: inline-flex;
  align-items: center;
}

#results:not(.is-raw) .chosen-effects li,
#results:not(.is-raw) .chosen-effects li .effect-line { align-items: center; }

/* ------------------------------------------------------------
   Indicators
   ------------------------------------------------------------ */

.move-indicator {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: none;
  border: none;
  padding: 0;
  align-self: center;
  height: var(--icon-size);
}

.move-indicator .carrot {
  width: 0.92rem;
  height: 0.92rem;
  border-right: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
  display: inline-block;
  opacity: 0.95;
  transform-origin: 50% 50%;
}

/* Arrows are ALL red */
.move-indicator.move-up,
.move-indicator.move-down { color: rgba(235, 90, 90, 1); }

.move-indicator.move-up .carrot { transform: translateY(1px) rotate(-135deg); }
.move-indicator.move-down .carrot { transform: translateY(1px) rotate(45deg); }

/* Green check */
.move-indicator.move-ok { color: rgba(70, 210, 130, 1); }

.move-indicator .check-box {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-block;
  position: relative;
  border: 0;
  background: transparent;
}

.move-indicator .check-box::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-52%, -56%) rotate(45deg);
  width: 0.55rem;
  height: 1.05rem;
  border-right: 5px solid currentColor;
  border-bottom: 5px solid currentColor;
  opacity: 0.95;
}

@media (max-width: 720px) {
  :root { --results-img-col: 150px; }
}

@media (max-width: 520px) {
  .relic-preview {
    grid-template-columns: 1fr;
    align-items: start;
  }
}


/* ------------------------------------------------------------
   Row-level validity badge (used for per-row invalid markers)
   ------------------------------------------------------------ */

.validity-badge.validity-badge--row {
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  opacity: 0.95;
}

/* Row indicators container (badge + arrows/check) */
.row-indicators {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  align-self: center;
}

/* ------------------------------------------------------------
   RIGHT RAIL: Row indicators (badge/arrows/check) pinned to the far right
   ------------------------------------------------------------ */
#results .chosen-effects li {
  position: relative;
}

#results .chosen-effects li .effect-line {
  /* reserve space so text/buttons never collide with the right rail */
  padding-right: 3.5rem;
}

#results .chosen-effects li .row-indicators {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* ------------------------------------------------------------
   Curse Button — Purple gradient when a curse is selected
   Keep "Select a Curse" red; switch only after selection.
   Uses the same left-to-right multi-stop gradient language as other states,
   with a slightly darker purple.
   ------------------------------------------------------------ */

#results .effect-line:has(.curse-sub) .curse-btn {
  background: linear-gradient(
    90deg,
    rgba(112, 70, 168, 0.92) 0%,
    rgba(0, 0, 0, 0.18) 62%,
    rgba(0, 0, 0, 0.45) 100%
  ) !important;
  border-color: rgba(140, 110, 210, 0.55) !important;
  box-shadow: inset 0 0 0 1px rgba(140, 110, 210, 0.22) !important;
}

#results .effect-line:has(.curse-sub) .curse-btn:hover {
  background: linear-gradient(
    90deg,
    rgba(132, 86, 190, 0.95) 0%,
    rgba(0, 0, 0, 0.16) 62%,
    rgba(0, 0, 0, 0.42) 100%
  ) !important;
}
