/* AGENT_TARGET: royal-quest-log-styles — story quest modal and HUD quest state */

.royal-quest-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  place-items: center;
  padding: 18px;
}

.royal-quest-modal[hidden] {
  display: none;
}

.royal-quest-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 48, 0.58);
  backdrop-filter: blur(4px);
}

.royal-quest-shell {
  position: relative;
  width: min(1120px, calc(100vw - 28px));
  max-height: min(88vh, 820px);
  overflow: auto;
  border: 3px solid #caa85f;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(250, 253, 249, 0.95)),
    linear-gradient(135deg, #fff2bd, #d5fff0 48%, #efd9ff);
  box-shadow: 0 18px 60px rgba(12, 18, 45, 0.36);
  color: #24324c;
}

.royal-quest-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(36, 50, 76, 0.16);
  border-radius: 12px;
  background: #fff;
  color: #713c87;
  font: 900 26px/1 Arial, sans-serif;
  cursor: pointer;
}

.royal-quest-header {
  padding: 22px 70px 14px 24px;
  border-bottom: 1px solid rgba(36, 50, 76, 0.14);
}

.royal-quest-header span,
.royal-quest-giver {
  display: block;
  color: #126f61;
  font:
    900 12px/1.2 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.royal-quest-header h2 {
  margin: 4px 0;
  color: #24324c;
  font:
    900 24px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

.royal-quest-header p {
  margin: 0;
  max-width: 680px;
  color: #506074;
  font: 700 14px/1.35 "Trebuchet MS", Arial, sans-serif;
}

.royal-quest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.royal-quest-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 2px solid rgba(36, 50, 76, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.royal-quest-card.ready {
  border-color: #159d89;
  box-shadow: 0 0 0 3px rgba(21, 157, 137, 0.16);
}

.royal-quest-card.celebrated {
  background: linear-gradient(180deg, rgba(232, 255, 249, 0.86), rgba(255, 248, 216, 0.86));
}

.royal-quest-top {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.royal-quest-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff7d8;
  font-size: 24px;
}

.royal-quest-card h3 {
  margin: 3px 0 0;
  color: #24324c;
  font:
    900 18px/1.12 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.royal-quest-ask,
.royal-quest-bridge {
  margin: 0;
  color: #506074;
  font: 800 13px/1.35 "Trebuchet MS", Arial, sans-serif;
}

.royal-quest-bridge {
  color: #7d3764;
}

.royal-quest-steps {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.royal-quest-steps li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(36, 50, 76, 0.06);
  color: #506074;
  font: 800 13px/1.2 "Trebuchet MS", Arial, sans-serif;
}

.royal-quest-steps li.done {
  background: rgba(21, 157, 137, 0.12);
  color: #126f61;
}

.royal-quest-steps span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  color: #126f61;
  font-weight: 900;
}

.royal-quest-actions {
  display: flex;
  justify-content: flex-end;
}

.royal-quest-action {
  min-width: 148px;
  min-height: 48px;
  padding: 9px 14px;
  border: 2px solid #d9941e;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff2bd, #ffd979);
  color: #24324c;
  font:
    900 13px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
}

.royal-quest-action:disabled {
  border-color: rgba(36, 50, 76, 0.14);
  background: #e8fff9;
  color: #126f61;
  cursor: default;
}

.royal-quest-close:focus-visible,
.royal-quest-action:focus-visible {
  outline: 3px solid rgba(21, 157, 137, 0.8);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .royal-quest-modal {
    align-items: start;
    padding: 8px;
  }

  .royal-quest-shell {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .royal-quest-header {
    padding: 18px 62px 12px 14px;
  }

  .royal-quest-header h2 {
    font-size: 19px;
  }

  .royal-quest-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .royal-quest-card {
    padding: 12px;
  }

  .royal-quest-actions {
    display: grid;
  }

  .royal-quest-action {
    width: 100%;
  }
}
