.scPage{
  padding: 28px 0 54px;
}

.scHeader{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin: 14px 0 16px;
}

.scHeader__title{
  margin:0;
  font-size:28px;
  letter-spacing:.2px;
}

.scHeader__subtitle{
  margin:6px 0 0;
  color: var(--muted);
}

.scChips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.scChips .chip{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding:10px 12px;
  border-radius:999px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.scChips .chip:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(96,165,250,0.35);
}

.scChips .chip:active{
  transform: translateY(1px);
}

.scChips .chip.is-active{
  border-color: rgba(96,165,250,0.35);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.12);
}

.scGrid{
  display:grid;
  grid-template-columns: 1.1fr 1.25fr .95fr;
  gap:16px;
}

@media (max-width: 980px){
  .scGrid{ grid-template-columns: 1fr; }
}

.scPickerCard,
.scStatsCard,
.scSideCard{
  padding: 14px;
}

.card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.card__title{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
}

.muted{
  color: var(--muted);
  font-size:12px;
}

.label{
  display:block;
  font-size:12px;
  color: var(--muted);
  margin-bottom:6px;
}

.input, .select{
  width:100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius:14px;
  padding:11px 12px;
  outline:none;
  transition: border-color .12s ease, background .12s ease;
}

.input:hover, .select:hover{
  border-color: rgba(96,165,250,0.25);
  background: rgba(255,255,255,0.08);
}

.input:focus-visible, .select:focus-visible{
  outline: 2px solid rgba(96,165,250,0.55);
  outline-offset: 2px;
}

.input--sm{
  padding:8px 10px;
  border-radius:14px;
}

.levelRow{
  display:flex;
  gap:10px;
  align-items:center;
}

.levelRow .label{
  margin:0;
}

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

.preview{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  margin-top:12px;
}

.preview__img{
  width:72px;
  height:72px;
  object-fit:contain;
  border-radius:16px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
}

.preview__title{
  font-weight:900;
  letter-spacing:.2px;
}

.preview__subtitle{
  color: var(--muted);
  font-size:12px;
  margin-top:4px;
}

.preview__error{
  color: var(--danger);
  font-size:12px;
  margin-top:6px;
  min-height:16px;
}

.dropdown{
  margin-top:8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(15, 22, 40, 0.86);
  box-shadow: var(--shadow-soft);
  max-height:320px;
  overflow:auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ddItem{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  width:100%;
  background: transparent;
  border:0;
  color: var(--text);
  cursor:pointer;
  text-align:left;
  transition: background .12s ease;
}

.ddItem:hover{
  background: rgba(96,165,250,0.10);
}

.ddItem__img{
  width:34px;
  height:34px;
  border-radius:12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  object-fit:contain;
}

.ddItem__name{
  font-weight:800;
}

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

.scRow{
  display:grid;
  grid-template-columns: 1fr 140px 90px;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

.scRow__left{
  display:flex;
  align-items:center;
  gap:10px;
}

.scRow__icon{
  width:18px;
  height:18px;
  opacity:.95;
}

.scRow__label{
  font-weight:900;
  letter-spacing:.2px;
}

.scRow__value{
  text-align:right;
  font-variant-numeric: tabular-nums;
  font-size:16px;
  font-weight:900;
}

.scRow[data-color="red"]{
  box-shadow: inset 0 0 0 1px rgba(218, 23, 52, 0.87);
}

.scRow[data-color="white"]{
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

.scRow[data-color="green"]{
  box-shadow:
    inset 0 0 0 1px rgba(6, 255, 97, 0.596),
    0 0 12px rgba(34,197,94,0.08);
}

.bonusGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

.bonusItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding:10px;
  background: rgba(255,255,255,0.04);
}

.hr{
  border:0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin:14px 0;
}

.relicSlots{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
}

.relicSlot{
  height:58px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  cursor:pointer;
  --relic-img: none;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
  will-change: transform;
}
.relicSlot::before{
  content:"";
  position:absolute;
  inset: 10px;
  background-image: var(--relic-img);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events:none;
  transform: translateZ(0);
}

.relicSlot:hover{
  transform: translateY(-1px);
  border-color: rgba(96,165,250,0.28);
  background-color: rgba(255,255,255,0.06);
}

.relicSlot:active{
  transform: translateY(0px);
}

.relicTotals{
  margin-top:12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  padding:10px;
  background: rgba(255,255,255,0.03);
}

.relicTotals.is-off{
  opacity:.55;
}

.relicTotal{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.10);
}

.relicTotal:last-child{
  border-bottom:0;
}

.relicTotal__left{
  display:flex;
  align-items:center;
  gap:8px;
}

.relicTotal__icon{
  width:16px;
  height:16px;
  opacity:.95;
}

.relicTotal__key{
  color: var(--muted);
  font-size:12px;
}

.relicTotal__val{
  font-weight:900;
}

/* =========================
   Modal
========================= */
.modal[hidden]{ display:none !important; }

.modal{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  z-index:50;
}

.modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.55);
}

.modal__panel{
  position:relative;
  width:min(860px, calc(100vw - 24px));
  max-height: min(80vh, 720px);
  overflow:auto;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: rgba(17, 24, 39, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding:14px;
}

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

.modal__title{
  font-weight: 900;
  letter-spacing:.2px;
}

.relicGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-top:12px;
}

@media (max-width: 740px){
  .relicGrid{ grid-template-columns: 1fr; }
}

.relicItem{
  display:flex;
  gap:12px;
  align-items:center;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  padding:10px;
  background: rgba(255,255,255,0.04);
  cursor:pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.relicItem:hover{
  transform: translateY(-1px);
  border-color: rgba(96,165,250,0.25);
  background: rgba(255,255,255,0.06);
}

.relicItem__img{
  width:44px;
  height:44px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  object-fit:contain;
}

.relicItem__name{
  font-weight:900;
}

.relicItem__bonus{
  color: var(--muted);
  font-size:12px;
  margin-top:4px;
}
/* =========================================
   Miscrit Preview
========================================= */

.preview--imageOnly{
  justify-content:center;
  padding: 18px;
}

.preview__img--xl{
  width: 200px;
  height: 200px;
  object-fit: contain;
}
/* =========================================
   Bonus with icons
========================================= */

.bonusGrid--icons .bonusItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.bonusItem__left{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
}

.bonusItem__left img{
  width:16px;
  height:16px;
  opacity:.95;
}

/* =========================================
   Miscrit image
========================================= */

.preview{
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  place-items: center;
}

.preview--imageOnly{
  padding: 0;
}

.preview__img--xl{
  width: 220px;
  height: 220px;
  object-fit: contain;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;

  filter:
    drop-shadow(0 18px 40px rgba(0,0,0,0.55))
    drop-shadow(0 0 26px rgba(96,165,250,0.18))
    drop-shadow(0 0 10px rgba(34,197,94,0.12));
  transform: translateY(-2px);
}

@media (max-width: 980px){
  .preview__img--xl{
    width: 240px;
    height: 240px;
  }
}
.preview--imageOnly{
  position: relative;
}

.preview--imageOnly::before{
  content:"";
  position:absolute;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(96,165,250,0.18), transparent 62%);
  filter: blur(8px);
  pointer-events:none;
}
/* =========================================
   Preset buttons dynamic states
========================================= */

.presetBtn{
  transition: all .15s ease;
}

.presetBtn.is-green{
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.45);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

.presetBtn.is-red{
  background: rgba(251,113,133,0.18);
  border-color: rgba(251,113,133,0.45);
  box-shadow: 0 0 0 3px rgba(251,113,133,0.15);
}
/* =========================================
   Custom Colors
========================================= */

body:not(.scCustomOn) .scRow .select{
  display: none;
}

body:not(.scCustomOn) .scRow{
  grid-template-columns: 1fr 90px;
}


body.scCustomOn .scRow{
  grid-template-columns: 1fr 140px 90px;
}

#toggleCustomBtn.is-active{
  border-color: rgba(96,165,250,0.35);
  background: rgba(96,165,250,0.10);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.12);
}

/* =========================
   Export modal
========================= */
.modal__panel--export{
  width: min(920px, calc(100vw - 24px));
}

.exportWrap{
  display:flex;
  flex-direction: column;
  gap: 12px;
}

.exportPreview{
  display:grid;
  place-items:center;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}

#exportCanvas{
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  image-rendering: auto;
}

.exportActions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
}

.exportHint{
  font-size: 12px;
  opacity: .9;
}

.modal__panel--export{
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: hidden;
}

.exportPreview{
  display: grid;
  place-items: center;
  width: 100%;
  max-height: 72vh;
  overflow: auto;
  padding: 12px;
}

#exportCanvas{
  display: block;
  width: 100%;
  height: auto;
  max-width: min(720px, 92vw);
  max-height: 70vh;
  object-fit: contain;
  image-rendering: auto;
}
.presetBtn.is-active{
  border-color: rgba(96,165,250,0.45);
  background: rgba(96,165,250,0.18);
}

#toggleCustomBtn.is-active{
  border-color: rgba(96,165,250,0.45);
  background: rgba(96,165,250,0.18);
}
/* =========================================
   Toggle buttons:
========================================= */

.scToggle{
  position: relative;
}

#applyBonusBtn_dup.is-active{
  border-color: rgba(96,165,250,0.55);
  background: rgba(96,165,250,0.18);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.14);
}

#applyRelicsBtn.is-active{
  border-color: rgba(96,165,250,0.55);
  background: rgba(96,165,250,0.18);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.14);
}

#applyBonusBtn:not(.is-active),
#applyBonusBtn_dup:not(.is-active),
#applyRelicsBtn:not(.is-active){
  opacity: .85;
}
.actionsRow--end{
  justify-content:flex-end;
}

.btnSwapLike{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
}

.btnSwapLike__icon{
  width:18px;
  height:18px;
  opacity:.95;
}

.presetGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:12px;
}

@media (max-width: 820px){
  .presetGrid{ grid-template-columns: 1fr; }
}

.presetCard{
  display:grid;
  grid-template-columns: 84px 1fr;
  gap:12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  padding:12px;
}

.presetCard__avatar{
  width:84px;
  height:84px;
  border-radius: 18px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  object-fit:contain;
}

.presetCard__titleRow{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}

.presetCard__name{
  font-weight:900;
  letter-spacing:.2px;
  max-width: 70%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.presetCard__meta{
  color: var(--muted);
  font-size:12px;
  font-variant-numeric: tabular-nums;
  white-space:nowrap;
}

.presetStats{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:8px;
  margin-top:10px;
}

.presetStat{
  display:flex;
  align-items:center;
  gap:8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding:8px;
  background: rgba(255,255,255,0.03);
}

.presetStat__ico{
  width:16px;
  height:16px;
  opacity:.95;
}

.presetStat__k{
  color: var(--muted);
  font-size:11px;
  font-weight:800;
}

.presetStat__v{
  margin-left:auto;
  font-weight:900;
  font-variant-numeric: tabular-nums;
}

.presetRelics{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:8px;
  margin-top:10px;
}

.presetRelic{
  width:100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  object-fit: contain;
  padding:8px;
}

.presetActions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:10px;
}
