.maker-page{
  padding: 22px 0 40px;
}

.maker-hero,
.maker-section{
  margin-bottom: 16px;
}

.maker-hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}

.page-kicker{
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.maker-title{
  margin: 0 0 8px;
  font-size: 30px;
}

.maker-lead{
  margin:0;
  color: var(--muted);
}

.maker-hero-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.maker-layout{
  display:grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap:20px;
  align-items:start;
}

.maker-main,
.maker-side{
  min-width:0;
}

.maker-side{
  display:grid;
  gap:16px;
  position:sticky;
  top:16px;
  align-self:start;
}

.form-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.form-label{
  color: var(--muted);
  font-size:14px;
}

.text-input,
.text-area{
  width:100%;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding:12px 14px;
  outline:none;
}

.text-input:focus,
.text-area:focus{
  border-color: rgba(200,164,90,0.55);
}

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.state-list,
.selected-groups,
.jinx-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.selected-summary{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 12px;
}

.selected-summary-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(200,164,90,0.28);
  background:rgba(0,0,0,0.22);
  color:var(--muted);
  font-size:13px;
  line-height:1;
}

.selected-summary-pill strong{
  color:var(--text);
  font-size:14px;
}

.selected-summary-pill.is-total{
  border-color:rgba(200,164,90,0.52);
  background:rgba(200,164,90,0.12);
  color:var(--gold);
}

.state-item,
.jinx-item,
.selected-card,
.result-card{
  border:1px solid var(--line);
  border-radius:16px;
  background: rgba(255,255,255,0.02);
  padding:14px;
}

.state-toolbar,
.selected-card-toolbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.maker-tabs{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}

.maker-tab{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--muted);
  cursor:pointer;
}

.maker-tab.is-active{
  color: var(--text);
  border-color: rgba(200,164,90,0.55);
  background: rgba(200,164,90,0.12);
}

.team-filter{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  margin:12px 0;
  color: var(--muted);
}

.library-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:520px;
  max-height:70vh;
  overflow:auto;
  padding-right:4px;
}

.library-item{
  display:flex;
  align-items:center;
  gap:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background: rgba(0,0,0,0.18);
  padding:12px;
  cursor:pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.library-item:hover{
  border-color: rgba(200,164,90,0.35);
}

.library-item.is-active{
  border-color: rgba(200,164,90,0.55);
  background: rgba(200,164,90,0.08);
}

.library-item.is-selected{
  border:2px solid #4f8cff;
  box-shadow:0 0 0 3px rgba(79, 140, 255, 0.15);
}

.library-item.is-selected .library-name{
  color:#4f8cff;
  font-weight:700;
}

.library-icon{
  width:48px;
  height:48px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
  flex:0 0 48px;
}

.library-meta{
  flex:1;
  min-width:0;
}

.library-name{
  font-size:16px;
  font-weight:700;
  margin-bottom:4px;
}

.library-team{
  color: var(--gold);
  font-size:13px;
  margin-bottom:6px;
}

.library-ability{
  color: var(--muted);
  font-size:14px;
  line-height:1.45;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}

.library-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
}

.library-add-btn{
  min-width:64px;
  white-space:nowrap;
}

.library-add-btn.is-added{
  opacity:.8;
}

.manual-actions{
  margin-top:12px;
}

.hidden{
  display:none !important;
}

.selected-groups{
  gap:16px;
}

.selected-groups-side{
  max-height:46vh;
  overflow:auto;
  padding-right:4px;
}

.selected-group-title{
  margin:0 0 10px;
  color: var(--gold);
  font-size:18px;
}

.selected-role-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}

.selected-role-row:last-child{
  border-bottom:none;
}

.selected-role-main{
  min-width:0;
}

.selected-role-name{
  font-weight:700;
}

.selected-role-sub{
  color: var(--muted);
  font-size:13px;
  margin-top:4px;
}

.selected-role-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.detail-panel{
  min-height:320px;
}

.detail-panel.empty{
  color: var(--muted);
}

.detail-grid{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.reminder-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.reminder-row{
  display:flex;
  gap:8px;
}

.result-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.json-preview{
  margin:0;
  border-radius:14px;
  padding:16px;
  background: rgba(0,0,0,.28);
  border:1px solid var(--line);
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-word;
  max-height:720px;
}

.is-disabled{
  opacity:.5;
  pointer-events:none;
}

button:disabled{
  opacity:.5;
  cursor:not-allowed;
}

@media (max-width: 1100px){
  .maker-layout{
    grid-template-columns:1fr;
  }

  .maker-side{
    position:static;
  }

  .selected-groups-side{
    max-height:none;
  }

  .library-list{
    min-height:0;
    max-height:none;
  }
}

@media (max-width: 720px){
  .maker-hero{
    flex-direction:column;
    align-items:flex-start;
  }

  .section-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .selected-role-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .library-item{
    align-items:flex-start;
  }

  .library-actions{
    align-self:flex-start;
  }

  .reminder-row{
    flex-direction:column;
  }
}

.detail-save-msg,
#generateMsg{
  min-height: 22px;
  margin-bottom: 10px;
}

.detail-save-msg.is-success,
#generateMsg.is-success{
  color: #7bd88f;
}

.detail-save-msg.is-error,
#generateMsg.is-error{
  color: #ff8a8a;
}

.maker-tabs-with-action{
  align-items:center;
  flex-wrap:wrap;
}

.maker-create-role-link{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

#customRoleMsg{
  min-height:22px;
  margin-bottom:12px;
}

#customRoleMsg.is-success{
  color:#7bd88f;
}

#customRoleMsg.is-error{
  color:#ff8a8a;
}
select {
  color: var(--text);
}

select option,
.text-input option {
  color: #000;
  background: #fff;
}

.maker-create-role-link{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    linear-gradient(135deg, #ff4fd8 0%, #7b61ff 35%, #33c3ff 68%, #7dff7a 100%);
  background-size: 200% 200%;
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .02em;
  box-shadow:
    0 10px 24px rgba(123, 97, 255, 0.28),
    0 4px 14px rgba(51, 195, 255, 0.22),
    inset 0 1px 0 rgba(255,255,255,0.28);
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    filter .18s ease,
    background-position .35s ease;
  overflow: hidden;
}

.maker-create-role-link::before{
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
  pointer-events: none;
}

.maker-create-role-link::after{
  content: "";
  position: absolute;
  top: -40%;
  left: -20%;
  width: 42%;
  height: 180%;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.55) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: rotate(20deg);
  transition: transform .45s ease;
  pointer-events: none;
}

.maker-create-role-link:hover{
  transform: translateY(-1px) scale(1.02);
  background-position: 100% 50%;
  filter: saturate(1.15) brightness(1.05);
  box-shadow:
    0 14px 30px rgba(123, 97, 255, 0.34),
    0 6px 18px rgba(255, 79, 216, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.34);
}

.maker-create-role-link:hover::after{
  transform: translateX(220%) rotate(20deg);
}

.maker-create-role-link:active{
  transform: translateY(0) scale(0.99);
}

.maker-create-role-link:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.15),
    0 0 0 6px rgba(123, 97, 255, 0.38),
    0 10px 24px rgba(123, 97, 255, 0.28);
}
