:root {
  color-scheme: dark;
  --bg: #110e19;
  --panel: #1a1624;
  --line: #332b42;
  --text: #f8f5ff;
  --muted: #b8adc7;
  --accent: #c9aaff;
  --soft: #e9dbff;
  font-family:
    "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.65;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.shell {
  width: min(1100px, calc(100% - 64px));
  margin-inline: auto;
}
.top {
  border-bottom: 1px solid #2b2437;
}
.bar {
  height: 67px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.mark {
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
}
.subtle,
.rules-head a {
  color: var(--muted);
  font-size: 0.9rem;
}
.subtle:hover,
.rules-head a:hover,
.text-btn:hover {
  color: var(--soft);
}
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 36px;
  border-radius: 24px;
  border: 1px solid #30243d;
  background: radial-gradient(ellipse at 76% 44%, #412859 0%, #261933 32%, #140e20 68%);
  min-height: 366px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
.hero-art {
  position: absolute;
  z-index: -2;
  right: clamp(22px, 8vw, 104px);
  top: 50%;
  width: clamp(154px, 27vw, 248px);
  height: auto;
  transform: translateY(-50%) rotate(-11deg);
  filter: drop-shadow(0 0 24px #a264f69c) drop-shadow(0 0 48px #613ba995);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      #140e20 21%,
      #140e20 34%,
      #140e20a8 50%,
      transparent 68%
    ),
    linear-gradient(0deg, #140e205d, transparent 27%);
}
.hero-copy {
  padding: 42px 54px;
  max-width: 660px;
  min-width: 0;
}
.eyebrow {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  line-height: 1.19;
  letter-spacing: -0.07em;
  font-size: clamp(2.16rem, 5vw, 3.55rem);
  font-weight: 850;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
h2 {
  line-height: 1.3;
  letter-spacing: -0.055em;
}
h3 {
  letter-spacing: -0.045em;
}
.intro {
  color: var(--muted);
  margin: 16px 0 23px;
  font-size: 1rem;
  word-break: keep-all;
}
.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
  gap: 7px;
  width: 100%;
  max-width: 470px;
  padding: 5px;
  border: 1px solid #504064;
  background: #120d1ee8;
  border-radius: 13px;
}
.search:focus-within {
  border-color: var(--accent);
}
.search input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 8px 11px;
}
.search input:focus-visible {
  outline: none;
}
.search input::placeholder {
  color: #a79bb8;
}
.search button {
  min-width: 0;
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}
button[type="submit"],
.secondary {
  border: 0;
  border-radius: 8px;
  background: #c5a3fa;
  color: #1a1029;
  padding: 10px 15px;
  font-weight: 800;
  white-space: nowrap;
}
button[type="submit"]:hover {
  background: #e1ccff;
}
.quick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
}
.recent {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 470px;
  min-width: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}
.recent > span {
  flex: none;
}
.recent-list {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 4px;
}
.recent-list button {
  flex: none;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #231932;
  color: var(--soft);
  padding: 4px 9px;
  white-space: nowrap;
}
.recent-list button:hover {
  background: #39254f;
}
.recent-list button:focus-visible {
  outline-offset: 1px;
}
.text-btn {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  background: none;
  border: 0;
  padding: 8px 0;
  font-size: 0.9rem;
}
.results,
.manual {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
}
.results {
  margin-top: 23px;
  padding: 25px 28px;
}
.result-head,
.rules-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.result-head h2 {
  font-size: clamp(1.35rem, 3.2vw, 2.05rem);
  word-break: keep-all;
}
.primary-score {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #654d81;
  border-radius: 12px;
  background: #241a31;
}
.score-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 14px;
}
.score-head h2 {
  color: var(--soft);
  font-size: 1.08rem;
}
#score-scope, .score-detail {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.score-value {
  color: var(--soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.score-value strong {
  color: var(--text);
  font-size: clamp(1.85rem, 6vw, 2.5rem);
  line-height: 1.2;
}
.score-value span {
  font-size: 0.9rem;
}
#score-slots, .score-rules {
  margin-top: 5px;
}
.score-rules summary {
  width: fit-content;
  min-height: 32px;
  padding-block: 4px;
  font-size: 0.85rem;
}
.purchase-plan {
  padding-top: 9px;
  border-top: 1px solid #483653;
}
.purchase-plan h3 {
  font-size: 0.95rem;
}
#purchase-options {
  list-style: none;
  padding: 0;
  margin: 0;
}
.purchase-option {
  padding-top: 8px;
}
.purchase-option + .purchase-option {
  margin-top: 7px;
  border-top: 1px solid #483653;
}
.purchase-option strong {
  color: var(--text);
  font-size: 0.94rem;
}
.purchase-score {
  display: inline-block;
  margin-inline-start: 6px;
  color: #a7f2c6;
  font-size: 0.9rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.target-purchase {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid #483653;
}
.target-purchase h3 {
  font-size: 0.95rem;
}
.target-field, .target-options li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 10px;
  font-size: 0.9rem;
}
.target-field {
  margin: 6px 0;
}
.target-field select, #peak-minimum {
  min-height: 40px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #6c5380;
  border-radius: 6px;
  background: #21182e;
  color: var(--text);
}
.target-options {
  list-style: none;
  margin: 5px 0;
  padding: 0;
}
.target-options li {
  padding-block: 5px;
  border-bottom: 1px solid #483653;
}
.target-quantity {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.target-quantity-tag {
  padding: 1px 6px;
  border: 1px solid #6c5380;
  border-radius: 4px;
  color: var(--soft);
  font-size: 0.75rem;
  white-space: nowrap;
}
.target-cost {
  margin-inline-start: auto;
  color: #ffd479;
  text-align: end;
  font-variant-numeric: tabular-nums;
}
#scope {
  overflow-wrap: anywhere;
}
.count {
  white-space: nowrap;
  color: var(--soft);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.count span {
  color: var(--muted);
  font-size: 1.12rem;
  font-weight: 500;
}
.calculation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
}
.calculation-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 40px;
  margin-top: 6px;
  color: var(--soft);
  font-size: 0.9rem;
  cursor: pointer;
}
.calculation-option input {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: inherit;
}
.slots {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
}
.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  min-height: 76px;
  border: 1px solid #433650;
  background: #21182e;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
  line-height: 1.3;
}
.slot .gem-icon,
.manual-preview .gem-icon {
  width: 33px;
  height: 33px;
  object-fit: contain;
  border-radius: 6px;
}
.slot.high {
  background: linear-gradient(155deg, #45305e, #241832);
  border-color: #7957a0;
  color: #f0e3ff;
}
.slot.empty {
  border-style: dashed;
  border-color: #40364e;
  background: #17131f;
  color: #a69ab6;
}
.empty-icon,
.star-icon {
  display: inline-grid;
  place-items: center;
  font-size: 1.5rem;
  font-style: normal;
  line-height: 1;
}
.empty-icon {
  color: #796b8c;
}
.star-icon {
  color: var(--soft);
}
.plan {
  color: var(--soft);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
  word-break: keep-all;
}
.summary,
.manual p,
.rules-note {
  color: var(--muted);
  font-size: 0.92rem;
  word-break: keep-all;
}
.leftover-gems {
  margin: 14px 0 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #241a31;
  color: var(--text);
  word-break: keep-all;
}
.leftover-gems h3 {
  color: var(--soft);
  font-size: 1rem;
}
#leftover-list, #combined-rosters {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
#leftover-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
#leftover-list li {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 0.92rem;
}
#leftover-list .gem-icon {
  width: 23px;
  height: 23px;
  object-fit: contain;
}
#combined-rosters li + li {
  border-top: 1px solid var(--line);
}
#leftover-count {
  color: var(--muted);
  font-size: 0.85rem;
}
.gold-value {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid #eabf67;
  background: #30251f;
  border-radius: 6px;
}
.gold-value h3, .gold-source a {
  color: #ffe0a2;
}
.gold-value h3 {
  font-size: 0.95rem;
}
.gold-total {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #ffd479;
  font-size: clamp(1.1rem, 5vw, 1.65rem);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.gold-total img {
  flex: none;
  object-fit: contain;
}
.gold-source {
  font-size: 0.8rem;
  color: var(--muted);
}
.combine {
  margin-top: 13px;
}
.combine summary {
  width: fit-content;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #654d81;
  border-radius: 8px;
  background: #21182e;
}
.combine summary span {
  margin-inline-start: 5px;
  color: var(--text);
  font-size: 0.85rem;
}
.combine p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.combine .search {
  max-width: 34rem;
}
#combine-status.problem {
  color: #ffced0;
}
#combined-rosters li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  overflow-wrap: anywhere;
}
#combined-rosters button {
  min-height: 44px;
  flex: none;
}
.combine-impact {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid #75d9aa;
  border-radius: 6px;
  background: #1d2926;
}
.combine-impact h3 {
  font-size: 1rem;
}
.impact-row {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #476052;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.impact-row > b {
  color: #d6f4e3;
}
#impact-roster-list {
  margin: 5px 0;
  padding-inline-start: 18px;
}
#impact-roster-list li + li {
  margin-top: 5px;
}
#impact-basis {
  margin-top: 8px;
}
#impact-summary {
  color: #a7f2c6;
  font-weight: 750;
}
#impact-changes {
  margin: 6px 0;
  padding-inline-start: 18px;
  font-size: 0.9rem;
}
.slot.contributed {
  border-color: #75d9aa;
}
.slot.lowered {
  border-color: #efa77f;
}
#impact-changes .lowered {
  color: #ffd0b6;
}
.message {
  margin-top: 18px;
  padding: 10px 15px;
  border-left: 3px solid var(--accent);
  background: #21172c;
  border-radius: 4px;
  color: var(--soft);
}
.message.problem {
  border-color: #feb2b6;
  color: #ffced0;
}
.message:not([hidden]) + .results {
  margin-top: 12px;
}
.roster-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}
.roster-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #32293f;
  padding: 4px 0 7px;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.roster-character {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  font-weight: 700;
}
.roster-character small {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.roster-gems,
#totals {
  color: var(--muted);
  font-size: 0.88rem;
}
.roster-gems {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 11px;
}
.roster-gems span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  word-break: keep-all;
}
.roster-gems .converted-gem {
  color: var(--soft);
  font-weight: 700;
}
.roster-gems .gem-icon {
  flex: none;
  width: 22px;
  height: 22px;
  object-fit: contain;
}
#breakdown {
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}
summary {
  cursor: pointer;
  font-weight: 750;
  color: var(--soft);
}
.manual {
  padding: 12px 27px;
  margin-top: 14px;
}
.manual[open] {
  padding-bottom: 20px;
}
.manual p {
  margin: 8px 0 12px;
}
.manual-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 7rem) minmax(0, 6rem) minmax(0, 6rem) 38px;
  gap: 7px;
  margin: 7px 0;
}
.manual-preview {
  display: grid;
  place-items: center;
}
.manual-row select,
.manual-row input {
  color: var(--text);
  background: #130f1b;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  min-width: 0;
}
.manual-row input {
  width: 100%;
}
.manual-row button {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 7px;
  min-width: 38px;
}
.manual-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.secondary {
  color: var(--soft);
  background: #352649;
}
.secondary:hover {
  background: #4b3467;
}
.manual-status {
  display: inline-block;
  margin-right: 12px !important;
}
.rules {
  margin-top: 30px;
}
.rules h2 {
  font-size: 1.22rem;
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.rule-grid article {
  background: #17131f;
  border: 1px solid #302739;
  border-radius: 11px;
  padding: 13px 15px;
}
.rule-grid h3 {
  font-size: 0.97rem;
  color: var(--soft);
}
.rule-grid p {
  color: var(--muted);
  font-size: 0.88rem;
}
.footer {
  margin-top: 26px;
  border-top: 1px solid #2b2437;
  color: #a99bb8;
  padding-block: 17px;
  font-size: 0.85rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 16px;
}
.visitor-count {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.visitor-count b {
  color: var(--soft);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 820px) {
  .slots {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .hero-copy {
    padding-inline: 34px;
  }
  .hero::before {
    background: linear-gradient(
      90deg,
      #140e20 19%,
      #140e20ed 35%,
      #140e209e 55%,
      transparent 80%
    );
  }
}
@media (max-width: 540px) {
  .shell {
    width: calc(100% - 28px);
  }
  .bar {
    height: 53px;
  }
  .hero {
    margin-top: 17px;
    min-height: 350px;
    border-radius: 17px;
    align-items: end;
  }
  .hero-art {
    top: 20px;
    right: 5%;
    width: min(46%, 190px);
    transform: rotate(-11deg);
  }
  .hero::before {
    background:
      linear-gradient(
        0deg,
        #140e20 18%,
        #140e20ee 35%,
        #140e20ac 78%,
        #140e2045
      ),
      linear-gradient(90deg, #140e20cd 10%, transparent 90%);
  }
  .hero-copy {
    padding: 27px 17px;
  }
  .intro {
    margin: 14px 0 18px;
  }
  .search button {
    padding-inline: 9px;
    font-size: 0.89rem;
  }
  .search input {
    padding-inline: 7px;
  }
  .results {
    margin-top: 13px;
    padding: 16px 13px;
  }
  .slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 13px 0;
  }
  .slot {
    min-height: 62px;
  }
  .slot .gem-icon {
    width: 26px;
    height: 26px;
  }
  .manual {
    padding-inline: 13px;
  }
  .rule-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rule-grid article {
    padding: 10px;
  }
  .rules {
    margin-top: 21px;
  }
}
@media (max-width: 365px) {
  .search {
    grid-template-columns: minmax(0, 1fr);
  }
}
