.form-card--master-selection {
  width: min(100%, 860px);
}

.master-profile-selection {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.master-profile-selection__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.master-profile-option {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid rgba(238, 235, 224, 0.16);
  border-radius: 6px;
  background: rgba(4, 10, 11, 0.76);
  color: #eee9df;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.master-profile-option:hover {
  border-color: rgba(217, 155, 104, 0.54);
  transform: translateY(-1px);
}

.master-profile-option:has(input:checked) {
  border-color: #da9258;
  background: rgba(217, 155, 104, 0.11);
  box-shadow: 0 0 0 2px rgba(217, 155, 104, 0.13);
}

.master-profile-option:has(input:focus-visible) {
  outline: 3px solid rgba(217, 155, 104, 0.48);
  outline-offset: 3px;
}

.master-profile-option > input {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #da9258;
}

.master-profile-option > img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 24%;
}

.master-profile-option__copy {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 12px;
}

.master-profile-option__copy strong,
.master-profile-option__copy small,
.master-profile-option__copy > span {
  min-width: 0;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.master-profile-option__copy strong {
  color: #fff8ed;
  font-size: 0.9rem;
  line-height: 1.2;
}

.master-profile-option__copy small {
  color: #da9258;
  font-size: 0.7rem;
  line-height: 1.35;
}

.master-profile-option__copy > span {
  color: rgba(238, 235, 224, 0.68);
  font-size: 0.68rem;
  line-height: 1.45;
}

.master-profile-option > .fa-circle-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: none;
  color: #f3b274;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.master-profile-option:has(input:checked) > .fa-circle-check {
  display: block;
}

@media (max-width: 700px) {
  .master-profile-selection__grid {
    grid-template-columns: 1fr;
  }

  .master-profile-option {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: 112px;
  }

  .master-profile-option > img {
    height: 112px;
  }

  .master-profile-option__copy {
    align-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .master-profile-option {
    transition: none;
  }
}

/* Campaign creation NPC selection; same palette and optional flow. */
.campaign-npc-selection { border:0; padding:0; min-width:0; }
.campaign-npc-selection p { color:var(--color-text-secondary); font-size:.9rem; }
.campaign-npc-selection h3 { font-size:1rem; margin:20px 0 10px; }
.campaign-npc-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:14px 0; }
.campaign-npc-option { display:flex; gap:10px; align-items:flex-start; min-width:0; padding:14px; border:1px solid rgba(120,132,220,.28); border-radius:var(--radius-md); background:rgba(8,10,20,.6); cursor:pointer; }
.campaign-npc-option:has(input:checked) { border-color:var(--color-accent); }
.campaign-npc-option:focus-within { outline:3px solid var(--color-accent); outline-offset:3px; }
.campaign-npc-option input { flex:0 0 auto; width:18px; height:18px; margin-top:4px; }
.campaign-npc-option img, .campaign-npc-placeholder { width:64px; min-width:64px; height:96px; object-fit:contain; border-radius:6px; background:rgba(8,10,20,.8); }
.campaign-npc-placeholder { display:flex; align-items:center; justify-content:center; flex-direction:column; text-align:center; font-size:28px; color:var(--color-text-secondary); }
.campaign-npc-placeholder small { font-size:10px; line-height:1.25; padding:0 4px; overflow-wrap:anywhere; }
.campaign-npc-option-readonly { cursor:default; }
.campaign-npc-option .campaign-npc-kind { color:var(--color-text-secondary); font-weight:600; }
.campaign-npc-option > span:last-child { min-width:0; }
.campaign-npc-option strong, .campaign-npc-option > span:last-child small { display:block; overflow-wrap:anywhere; }
.campaign-npc-option > span:last-child small { font-size:.78rem; color:var(--color-text-secondary); margin-top:8px; }
@media(max-width:720px) { .campaign-npc-grid { grid-template-columns:1fr; } }
