/* 色はここでまとめて定義する。ゲームから切り替えてもまぶしくないよう、暗い配色を標準にしている */
:root {
  --bg: #101211;
  --panel: #171a18;
  --panel-2: #1e221f;
  --line: #2a2f2b;
  --text: #e8e5da;
  --muted: #9b988c;
  --accent: #c8b273;

  --kappa: #c39bf5;
  --task: #6ec6e6;
  --hideout: #7fd39a;
  --sell: #a6a397;
  --warn: #f0b45a;

  --tier-high: #f2c94c;
  --tier-mid: #d7d2c0;
  --tier-low: #8b887d;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}
a { color: var(--accent); }
button, select, input { font: inherit; color: inherit; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* ---- ヘッダー ---- */
.top { border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.logo { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; white-space: nowrap; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo b { font-weight: inherit; }
.logo span { color: var(--accent); }
.mark { flex: none; width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: var(--bg); font-style: normal; font-weight: 800; display: grid; place-items: center; font-size: .95rem; }

.top-right { display: flex; align-items: center; gap: 8px; }
.lang { border: 1px solid var(--line); background: none; border-radius: 8px; padding: 5px 10px; cursor: pointer; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.lang:hover { color: var(--text); border-color: var(--muted); }
.modes { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.mode { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; }
.mode[aria-selected="true"] { background: var(--accent); color: var(--bg); }
.mode:disabled { opacity: .4; cursor: not-allowed; }

/* ---- 検索バー（スクロールしても上に残す） ---- */
.searchbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 12px 0; font-size: 1.05rem; }
.search input::-webkit-search-cancel-button { filter: invert(.7); }
.search kbd { flex: none; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; color: var(--muted); font-size: .8rem; }

.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: .88rem; color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
.chip.kappa[aria-pressed="true"] { background: var(--kappa); border-color: var(--kappa); }
.chip.task[aria-pressed="true"] { background: var(--task); border-color: var(--task); }
.chip.hideout[aria-pressed="true"] { background: var(--hideout); border-color: var(--hideout); }
.sort { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.sort select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }

/* ---- お知らせ・件数 ---- */
.notice { margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--warn); color: var(--warn); border-radius: 10px; font-size: .9rem; }
.meta { color: var(--muted); font-size: .88rem; margin: 14px 0 10px; }
.more { color: var(--muted); font-size: .88rem; text-align: center; }

/* ---- 結果 ---- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; }
.icon { width: 52px; height: 52px; border-radius: 8px; background: var(--panel-2); object-fit: contain; }
.name { min-width: 0; }
.name h2 { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.name h2 small { color: var(--muted); font-weight: 500; margin-left: 6px; font-size: .82rem; }
.sub { color: var(--muted); font-size: .8rem; margin-top: 1px; overflow-wrap: anywhere; }

.verdict { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .82rem; font-weight: 700; padding: 2px 9px; border-radius: 6px; border: 1px solid currentColor; }
.verdict.kappa { color: var(--kappa); }
.verdict.task { color: var(--task); }
.verdict.hideout { color: var(--hideout); }
.verdict.sell { color: var(--sell); }
.needs { color: var(--muted); font-size: .8rem; margin-left: 6px; }

.value { text-align: right; white-space: nowrap; }
.value .per { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.value .per small { font-size: .72rem; font-weight: 500; color: var(--muted); margin-left: 2px; }
.value .where { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tier-high { color: var(--tier-high); }
.tier-mid { color: var(--tier-mid); }
.tier-low { color: var(--tier-low); }

details.more-info { border-top: 1px solid var(--line); }
details.more-info summary { cursor: pointer; padding: 6px 12px; color: var(--muted); font-size: .82rem; list-style: none; }
details.more-info summary::-webkit-details-marker { display: none; }
details.more-info summary::before { content: "＋ "; }
details.more-info[open] summary::before { content: "－ "; }
.info { padding: 0 12px 12px; display: grid; gap: 10px; font-size: .86rem; }
.info h3 { margin: 0 0 4px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.info ul { margin: 0; padding-left: 18px; }
.info li { margin: 1px 0; }
.info .k { color: var(--kappa); }
.info .fir { color: var(--warn); font-size: .78rem; }
.prices { display: flex; flex-wrap: wrap; gap: 4px 18px; font-variant-numeric: tabular-nums; }
.prices span { color: var(--muted); margin-right: 4px; }

.footer { color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); margin-top: 32px; padding-top: 12px; padding-bottom: 24px; }
.footer p { margin: 2px 0; }

/* ---- スマホ ---- */
@media (max-width: 560px) {
  .top-inner { height: 52px; }
  .logo { font-size: 1rem; }
  .mode { padding: 4px 9px; font-size: .84rem; }
  .top-right { gap: 6px; }
  .lang { padding: 4px 7px; font-size: .78rem; }
}
/* 幅が狭いスマホでは、ロゴを「T」の印だけにして、モード切替と言語ボタンが収まるようにする */
@media (max-width: 440px) {
  .logo b { display: none; }
  .search kbd { display: none; }
  .row { grid-template-columns: 44px 1fr; }
  .icon { width: 44px; height: 44px; }
  .value { grid-column: 2; text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; }
  .needs { display: block; margin: 4px 0 0; }
}
