/* Melo no Boutique palette: cream, brown ink, and a small pastel set. */
/* 最終更新: 2026-08-21 */
:root {
  --bg: #fdf9f2;
  --ink: #3d2b22;
  --pink: #f6cdd8;
  --pink-deep: #d98ba3;
  --mint: #cce8db;
  --mint-deep: #6faf93;
  --peach: #fbe3c9;
  --lemon: #f9ecb4;
  --line: #f0e4d6;
  --card: #ffffff;
  --muted: #8f8178;
  --danger: #b9657d;
  --blue-deep: #7aa2c8;
  --shadow: 0 5px 16px rgba(61, 43, 34, 0.055);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Yu Gothic', sans-serif;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.025em;
}

button,
input,
select {
  font: inherit;
}

button,
select,
summary,
input[type='checkbox'] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(217, 139, 163, 0.32);
  outline-offset: 2px;
}

.app-header {
  padding: 2.2rem 1.5rem 1.2rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--mint-deep);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-header h1 {
  margin: 0;
  color: var(--pink-deep);
  font-family: 'Mochiy Pop One', 'Zen Maru Gothic', sans-serif;
  font-size: clamp(1.8rem, 7vw, 2.45rem);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.tagline {
  margin: 0.45rem 0 0;
  color: var(--mint-deep);
  font-size: 0.86rem;
}

.app-main {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 1rem 1.2rem 4rem;
}

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
}

.section-heading,
.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2,
.results-heading h2 {
  margin: 0;
  font-family: 'Mochiy Pop One', 'Zen Maru Gothic', sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.section-heading p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.button {
  min-height: 2.35rem;
  padding: 0.4rem 0.9rem;
  white-space: nowrap;
  color: var(--ink);
  background: var(--mint);
  border: 1.5px solid var(--mint-deep);
  border-radius: 12px;
  font-size: 0.84rem;
  transition: filter 0.12s ease, transform 0.12s ease;
}

.button:hover {
  filter: brightness(1.025);
}

.button:active {
  transform: translateY(1px);
}

.button-ghost {
  color: var(--muted);
  background: var(--bg);
  border-color: var(--line);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.filter-field > span,
.rank-title {
  color: var(--mint-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-field select,
.filter-field input {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.48rem 0.75rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
}

.filter-field select:focus,
.filter-field input:focus {
  border-color: var(--pink-deep);
}

.search-field {
  grid-column: 1 / -1;
}

.toggle-field {
  align-self: end;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.65rem;
  padding: 0.48rem 0.75rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 0.86rem;
}

.toggle-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-mark {
  position: relative;
  flex: none;
  width: 2.15rem;
  height: 1.2rem;
  background: var(--line);
  border: 1px solid #dfcebb;
  border-radius: 999px;
  transition: background 0.12s ease;
}

.toggle-mark::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.82rem;
  height: 0.82rem;
  background: var(--card);
  border-radius: 50%;
  content: '';
  transition: transform 0.12s ease;
}

.toggle-field input:checked + .toggle-mark {
  background: var(--mint);
  border-color: var(--mint-deep);
}

.toggle-field input:checked + .toggle-mark::after {
  transform: translateX(0.92rem);
}

.toggle-field input:focus-visible + .toggle-mark {
  outline: 3px solid rgba(217, 139, 163, 0.32);
  outline-offset: 2px;
}

.rank-filter {
  min-width: 0;
  margin: 1rem 0 0;
  padding: 0.85rem 0 0;
  border: 0;
  border-top: 1.5px dashed var(--line);
}

.rank-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rank-actions {
  display: flex;
  gap: 0.35rem;
}

.rank-actions button {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px dotted currentColor;
  font-size: 0.72rem;
}

.rank-options {
  display: grid;
  grid-template-columns: repeat(15, minmax(2.1rem, 1fr));
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.rank-options label {
  min-width: 0;
}

.rank-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rank-options span {
  display: grid;
  min-height: 2.1rem;
  place-items: center;
  color: var(--muted);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.rank-options input:checked + span {
  color: var(--ink);
  background: var(--pink);
  border-color: var(--pink-deep);
}

.rank-options input:focus-visible + span {
  outline: 3px solid rgba(217, 139, 163, 0.32);
  outline-offset: 2px;
}

.results {
  margin-top: 1.45rem;
}

.results-heading {
  padding: 0 0.15rem 0.55rem;
}

.result-count,
.shown-count {
  margin: 0.08rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.shown-count {
  text-align: right;
}

.enchant-list {
  display: grid;
  gap: 0.75rem;
}

.enchant-card {
  overflow: clip;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.enchant-card[open] {
  border-color: #e6d2bc;
}

.enchant-card summary {
  display: block;
  padding: 1rem 1.1rem 0.85rem;
  list-style: none;
}

.enchant-card summary::-webkit-details-marker {
  display: none;
}

.enchant-card summary::marker {
  content: '';
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.name-block {
  min-width: 0;
}

.enchant-name {
  display: block;
  font-family: 'Mochiy Pop One', 'Zen Maru Gothic', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
}

.enchant-name-en {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.badges {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.12rem 0.52rem;
  color: var(--ink);
  background: var(--peach);
  border: 1px solid #e9cdaa;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.25;
}

.badge-unimplemented {
  background: var(--lemon);
  border-color: #e2cf77;
}

.enchant-meta {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.enchant-meta strong {
  color: var(--ink);
  font-weight: 500;
}

.notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.note {
  padding: 0.12rem 0.48rem;
  color: #557c6b;
  background: #eff8f4;
  border: 1px solid var(--mint);
  border-radius: 8px;
  font-size: 0.68rem;
  line-height: 1.45;
}

.note-exclude {
  color: #8d6570;
  background: #fff6f8;
  border-color: var(--pink);
}

.effects {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.7rem;
}

.effect {
  display: grid;
  grid-template-columns: 1.45rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 0.83rem;
  line-height: 1.55;
}

.effect-marker {
  font-weight: 700;
  text-align: center;
}

.effect-increase .effect-marker {
  color: var(--mint-deep);
}

.effect-decrease .effect-marker {
  color: var(--danger);
}

.effect-neutral .effect-marker {
  color: var(--muted);
}

.effect-unknown {
  color: var(--muted);
}

.unknown-label {
  padding: 0.02rem 0.38rem;
  color: #796628;
  background: var(--lemon);
  border: 1px solid #e2cf77;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 700;
}

.toggle-hint {
  display: block;
  margin-top: 0.7rem;
  color: var(--pink-deep);
  font-size: 0.7rem;
  text-align: right;
}

.toggle-hint::before {
  content: '＋ ';
}

.enchant-card[open] .toggle-hint::before {
  content: '− ';
}

.open-label {
  display: inline;
}

.close-label {
  display: none;
}

.enchant-card[open] .open-label {
  display: none;
}

.enchant-card[open] .close-label {
  display: inline;
}

.source-details {
  padding: 0.85rem 1.1rem 1.05rem;
  background: #fffcf7;
  border-top: 1.5px dashed var(--line);
}

.source-details h3 {
  margin: 0 0 0.35rem;
  color: var(--mint-deep);
  font-size: 0.78rem;
}

.source-details pre {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.empty-message {
  margin: 0;
  padding: 2.4rem 1rem;
  color: var(--muted);
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: 18px;
  text-align: center;
}

.more-wrap {
  text-align: center;
}

.button-more {
  min-width: 13rem;
  margin-top: 1.2rem;
  background: var(--peach);
  border-color: #e6c39a;
}

.app-footer {
  padding: 0 1.2rem 2rem;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

.app-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .app-header {
    padding-top: 1.7rem;
  }

  .app-main {
    padding-inline: 0.8rem;
  }

  .card {
    padding: 1rem;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .rank-options {
    grid-template-columns: repeat(8, minmax(2rem, 1fr));
  }

  .card-title-row {
    display: block;
  }

  .badges {
    justify-content: flex-start;
    margin-top: 0.45rem;
  }

  .enchant-card summary {
    padding-inline: 0.9rem;
  }

  .source-details {
    padding-inline: 0.9rem;
  }
}

@media (max-width: 390px) {
  .section-heading {
    align-items: flex-start;
  }

  .rank-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .rank-options {
    grid-template-columns: repeat(5, minmax(2rem, 1fr));
  }

  .effect {
    grid-template-columns: 1.2rem minmax(0, 1fr) auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* 攻撃系ページ用 */
.header-link {
  display: inline-block;
  margin-top: 0.7rem;
  color: var(--pink-deep);
  font-size: 0.76rem;
  font-weight: 700;
  text-underline-offset: 0.2rem;
}

.criterion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.badge-criterion {
  background: var(--mint);
  border-color: var(--mint-deep);
}

.badge-condition {
  color: var(--muted);
  background: var(--bg);
  border-color: var(--line);
}

.badge-penalty {
  color: var(--danger);
  background: var(--pink);
  border-color: var(--pink-deep);
}

/* 才能ページ用 */
/* 1200px ＋ ▲▼の列（1.4rem）×3枠ぶん。中の寸法は据え置き */
.talent-main {
  width: min(1270px, 100%);
}

.talent-header-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.talent-button-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

/* 既定は「基準にしたいステータス」の未選択ボタンと同じ色。選ばれているものだけ緑 */
.talent-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--bg);
  border-color: var(--line);
}

/* 工事中 は同じ行に置く。block にすると治癒だけ2行になり、ボタン列の高さが揃わない */
.talent-button small {
  display: inline;
  flex: none;
  color: var(--muted);
  font-size: 0.67rem;
}

.talent-button-active {
  background: var(--mint);
  border-color: var(--mint-deep);
}

.talent-button:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.45;
}

.talent-overview,
.talent-totals-section,
.talent-grid-section {
  margin-top: 1.45rem;
}

.talent-priority-list {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.talent-condition-toggle {
  flex: none;
}

/* 基準のボタンと「別部位から〜」を1行に並べる。仕切り線は行ごと引く */
.talent-priority-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1.5px dashed var(--line);
}

.talent-priority-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-width: 0;
}

.talent-priority-button {
  background: var(--bg);
  border-color: var(--line);
}

.talent-priority-active {
  background: var(--mint);
  border-color: var(--mint-deep);
}

.talent-total-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.talent-total-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
}

/* 合算軸のときだけ、数字の下に内訳を1行 */
.talent-total-breakdown {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: right;
}

.talent-total-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.talent-total-card strong {
  color: var(--pink-deep);
  font-family: 'Mochiy Pop One', 'Zen Maru Gothic', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
}

.talent-slot-grid {
  --talent-prefix-bg: #fdeef1;
  --talent-prefix-line: #f3d3da;
  --talent-suffix-bg: #eaf1f8;
  --talent-suffix-line: #cfdeec;
  /* 選んでいる1件。淡く塗って、左端だけ濃い線を入れる。文字はこげ茶のまま */
  --talent-prefix-picked: #f9d5e0;
  --talent-suffix-picked: #d6e5f3;
  --talent-prefix-picked-edge: #d98ba3;
  --talent-suffix-picked-edge: #7aa2c8;
  /* 候補1行の高さ。窓は5行ぶんで、10件持っていても表の形は変わらない */
  --talent-row-h: 3.25rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 0.75rem;
}

.talent-slot {
  padding: 0.9rem 0.95rem;
  display: grid;
  grid-template-rows: 2.65rem 2.1rem repeat(2, auto);
  align-content: start;
  gap: 0.55rem;
  min-width: 0;
}

.talent-slot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.talent-slot-heading h3 {
  margin: 0;
  font-family: 'Mochiy Pop One', 'Zen Maru Gothic', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: nowrap;
}

.talent-equipment-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  min-width: 0;
  max-width: 65%;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.talent-equipment-control select {
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  border: 0;
  appearance: none;
  font: inherit;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talent-equipment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talent-equipment-arrow {
  flex: none;
  color: var(--muted);
  font-size: 0.72rem;
}

.talent-subtotal {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.55rem;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.talent-candidate-section {
  display: grid;
  grid-template-rows: 2rem auto;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  min-width: 0;
  /* 選んだ行の塗りが角丸からはみ出さないように切る */
  overflow: hidden;
  border: 1px solid;
  border-radius: 12px;
}

.talent-candidate-prefix {
  background: var(--talent-prefix-bg);
  border-color: var(--talent-prefix-line);
}

.talent-candidate-suffix {
  background: var(--talent-suffix-bg);
  border-color: var(--talent-suffix-line);
}

.talent-candidate-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  padding: 0 0.5rem 0 0.55rem;
}

.talent-candidate-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
}

/* 接頭／接尾を「なし」にするスイッチ。サイトの toggle-field を小さくしたもの */
.talent-section-toggle {
  align-self: auto;
  flex: none;
  gap: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.talent-section-toggle .toggle-mark {
  width: 1.7rem;
  height: 0.95rem;
}

.talent-section-toggle .toggle-mark::after {
  width: 0.62rem;
  height: 0.62rem;
}

.talent-section-toggle input:checked + .toggle-mark::after {
  transform: translateX(0.8rem);
}

/* 入っているときは、その枠の色（接頭＝赤寄り／接尾＝青寄り）で光らせる */
.talent-candidate-prefix .talent-section-toggle input:checked + .toggle-mark {
  background: var(--talent-prefix-picked);
  border-color: var(--talent-prefix-picked-edge);
}

.talent-candidate-suffix .talent-section-toggle input:checked + .toggle-mark {
  background: var(--talent-suffix-picked);
  border-color: var(--talent-suffix-picked-edge);
}

.talent-candidate-prefix .talent-candidate-head {
  border-bottom: 1px solid var(--talent-prefix-line);
}

.talent-candidate-suffix .talent-candidate-head {
  border-bottom: 1px solid var(--talent-suffix-line);
}

.talent-candidate-nav {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-right: 1px solid;
}

.talent-candidate-prefix .talent-candidate-nav {
  border-color: var(--talent-prefix-line);
}

.talent-candidate-suffix .talent-candidate-nav {
  border-color: var(--talent-suffix-line);
}

.talent-nav-button {
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  color: var(--pink-deep);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 0.52rem;
  line-height: 1;
}

.talent-candidate-suffix .talent-nav-button {
  color: var(--blue-deep);
}

.talent-nav-button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.75);
}

.talent-nav-button:disabled {
  color: #cfc4ba;
  cursor: default;
}

.talent-candidate-list {
  grid-row: 2;
  grid-column: 2;
  height: calc(var(--talent-row-h) * 5);
  min-width: 0;
  overflow: hidden;
}

.talent-candidate-track {
  display: grid;
  grid-auto-rows: var(--talent-row-h);
  min-width: 0;
  transition: transform 0.14s ease;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .talent-candidate-track {
    transition: none;
  }
}

.talent-candidate {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) 1.15rem 3.7rem;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.45rem;
  overflow: hidden;
  color: inherit;
  background: transparent;
  border: 0 none;
  border-top: 1px dotted;
  border-radius: 0;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  appearance: none;
}

button.talent-candidate {
  cursor: pointer;
}

button.talent-candidate:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: -2px;
}

button.talent-candidate:not(.talent-candidate-picked):hover {
  background: rgba(255, 255, 255, 0.6);
}

/* 選んでいる1件。接頭は赤寄り、接尾は青寄りに淡く塗り、左端に濃い線を1本入れる。
   べた塗りだと重かったので、色は淡く・目印は線で出す */
.talent-candidate-picked {
  border-top-color: transparent;
}

.talent-candidate-prefix .talent-candidate-picked {
  background: var(--talent-prefix-picked);
  box-shadow: inset 3px 0 0 var(--talent-prefix-picked-edge);
}

.talent-candidate-suffix .talent-candidate-picked {
  background: var(--talent-suffix-picked);
  box-shadow: inset 3px 0 0 var(--talent-suffix-picked-edge);
}

/* 淡い塗りなので文字はこげ茶のまま。順位と内訳だけ、地に負けないよう濃くする */
.talent-candidate-picked,
.talent-candidate-picked .talent-place,
.talent-candidate-picked .talent-enchant-name,
.talent-candidate-picked .talent-candidate-value,
.talent-candidate-picked .talent-candidate-breakdown {
  color: var(--ink);
}

.talent-candidate-picked .talent-candidate-element-fire {
  color: #a8465f;
}

.talent-candidate-picked .talent-candidate-element-water {
  color: #33608f;
}

.talent-candidate-picked .talent-mark {
  color: var(--ink);
  border-color: rgba(61, 43, 34, 0.35);
}

/* ここから下は「なし」にした枠と ES が1件も無い枠。
   赤／青の指定より後に置いて、こちらが勝つようにしている */
.talent-candidate-section-off {
  background: var(--bg);
  border-color: var(--line);
}

.talent-candidate-section-off .talent-candidate-head,
.talent-candidate-section-off .talent-candidate-nav {
  border-color: var(--line);
}

.talent-candidate-section-off h4,
.talent-candidate-section-off .talent-enchant-name,
.talent-candidate-section-off .talent-candidate-value,
.talent-candidate-section-off .talent-candidate-breakdown,
.talent-candidate-section-off .talent-candidate-element-fire,
.talent-candidate-section-off .talent-candidate-element-water {
  color: var(--muted);
}

.talent-candidate-section-off .talent-candidate {
  border-top-color: var(--line);
}

.talent-candidate-section-off .talent-candidate-picked {
  background: #eee7df;
  box-shadow: inset 3px 0 0 #c9bcae;
}

.talent-candidate-section-off .talent-nav-button {
  color: #b7aa9e;
}

.talent-candidate-section-off .talent-nav-button:disabled {
  color: #d8cec4;
}

.talent-candidate-section-off .talent-mark {
  color: var(--muted);
  border-color: var(--line);
}

.talent-candidate-prefix .talent-candidate {
  border-color: var(--talent-prefix-line);
}

.talent-candidate-suffix .talent-candidate {
  border-color: var(--talent-suffix-line);
}

.talent-place {
  color: var(--muted);
  font-size: 0.64rem;
  white-space: nowrap;
}

.talent-enchant-name {
  display: -webkit-box;
  height: 2.7em;
  min-width: 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.talent-candidate-marks {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  white-space: nowrap;
}

.talent-slot [hidden] {
  display: none;
}

.talent-mark {
  display: inline-grid;
  width: 1.15rem;
  height: 1.15rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.talent-mark-cross {
  background: var(--peach);
}

.talent-candidate-value {
  color: var(--pink-deep);
  font-size: 0.74rem;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.talent-candidate-total {
  display: block;
}

/* 合算軸のときだけ内訳を2行目に出す。数値の列はそのぶん広げる */
.talent-candidate-breakdown {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 400;
}

.talent-candidate-section-combined .talent-candidate {
  grid-template-columns: 2.1rem minmax(0, 1fr) 1.15rem 5.4rem;
}

/* 錬金は合計の1行を出さず、火と水の2行だけにする。
   1行に並べると 火100〜110 ／ 水100〜110 で列がはみ出すので縦に割る */
.talent-candidate-section-alchemy .talent-candidate {
  grid-template-columns: 2.1rem minmax(0, 1fr) 1.15rem 4.6rem;
}

/* 2行が数値そのものになるので、内訳より一段大きく出す */
.talent-candidate-section-alchemy .talent-candidate-breakdown {
  font-size: 0.7rem;
  font-weight: 700;
}

.talent-candidate-element {
  display: block;
  line-height: 1.2;
}

.talent-candidate-element-fire {
  color: var(--pink-deep);
}

.talent-candidate-element-water {
  color: var(--blue-deep);
}

.talent-candidate-empty .talent-enchant-name {
  color: var(--muted);
  font-weight: 400;
}

/* 3列だと名前が読めなくなる幅で1列に落とす */
@media (max-width: 860px) {
  .talent-slot-grid {
    grid-template-columns: 1fr;
  }

  .talent-slot {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .talent-button-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .talent-priority-row {
    align-items: stretch;
    flex-direction: column;
  }

  .talent-condition-toggle {
    align-self: stretch;
  }

  .talent-total-list,
  .talent-slot-grid {
    grid-template-columns: 1fr;
  }

  .talent-slot {
    min-height: 0;
  }
}

@media (max-width: 390px) {
  .talent-button-list {
    grid-template-columns: 1fr;
  }
}

/* ===== 公開用（Melo no Boutique / esfit）===== */

/* ブティックの入口へ戻る帯。ampoule・spoito と同じ形にそろえる */
.home-bar {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.8rem 1.2rem 0;
  font-size: 0.85rem;
}

.home-bar a {
  color: var(--pink-deep);
  text-decoration: none;
}

.home-bar a:hover {
  text-decoration: underline;
}

