:root{color-scheme:light;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Hiragino Sans","Yu Gothic",Meiryo,sans-serif;--bg:#f6f8fb;--card:#fff;--panel:#f7f8fa;--line:#d8dee8;--line-strong:#cdd5df;--text:#2b2f36;--muted:#677385;--accent:#5b6f95;--accent-strong:#3f557d;--accent-soft:#dfe7f5;--rarity-l:#8d63df;--rarity-e:#d46046;--rarity-r:#d1a52f;--rarity-u:#4d9d63;--rarity-c:#8995a4;--rarity-n:#626e7f;color:var(--text);background:var(--bg);line-height:1.6}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);font-size:14px}
button,input,select{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #78a5ed;outline-offset:2px}
.app{max-width:920px;margin:0 auto;padding:22px 18px 34px}
.header{margin-bottom:20px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.heading{min-width:0}
h1{font-size:clamp(20px,4vw,26px);line-height:1.4;margin:0;font-weight:750;letter-spacing:.01em}
.subtitle{font-size:12px;color:var(--muted);margin:5px 0 0}
.language-toggle{display:inline-flex;align-items:center;gap:2px;flex-shrink:0;border:1px solid var(--line);background:#edf1f6;border-radius:999px;padding:3px;box-shadow:0 1px 2px rgba(20,35,60,.04)}
.lang-option{border:0;background:transparent;color:#687386;min-width:43px;padding:6px 11px;border-radius:999px;font-size:12px;font-weight:700;line-height:1.4;white-space:nowrap;transition:background-color .15s,color .15s,box-shadow .15s}
.lang-option:hover:not(.active){color:var(--accent-strong);background:#e3eaf4}
.lang-option.active{background:var(--card);color:var(--accent-strong);box-shadow:0 1px 4px rgba(30,45,75,.12)}
.filters{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:7px;box-shadow:0 1px 2px rgba(20,35,60,.03)}
.field-label{font-size:13px;font-weight:750;color:#263244}
#search{border:1px solid var(--line-strong);border-radius:9px;width:100%;background:var(--card);min-height:43px;padding:8px 12px;color:#182232;outline:none}
#search:focus{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.help{font-size:11px;color:var(--muted);margin:0 0 8px}
.group{margin-top:8px}
.rarity-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.rarity-hint{font-size:11px;color:var(--muted);white-space:nowrap}
.choice-row{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.choice{border:1.5px solid var(--line-strong);background:var(--card);padding:5px 15px;border-radius:999px;min-width:46px;font-weight:700;color:#465164;transition:background-color .15s,border-color .15s,color .15s}
.choice.active{background:var(--accent-strong);border-color:var(--accent-strong);color:#fff}
.choice:hover:not(.active){background:#eef2f8}
.choice[data-rarity="L"]{--rarity:var(--rarity-l)}
.choice[data-rarity="E"]{--rarity:var(--rarity-e)}
.choice[data-rarity="R"]{--rarity:var(--rarity-r)}
.choice[data-rarity="U"]{--rarity:var(--rarity-u)}
.choice[data-rarity="C"]{--rarity:var(--rarity-c)}
.choice[data-rarity="N"]{--rarity:var(--rarity-n)}
.choice[data-rarity]:not([data-rarity=""]){border-color:var(--rarity);color:var(--rarity)}
.choice[data-rarity]:not([data-rarity=""]).active{background:var(--rarity);border-color:var(--rarity);color:#fff}
.sort-group{display:grid;gap:8px}
.sort-wrap{position:relative;width:min(100%,360px)}
#sort{appearance:none;-webkit-appearance:none;min-height:43px;width:100%;border:1px solid var(--line-strong);border-radius:9px;background:var(--card);color:var(--text);padding:8px 38px 8px 13px;cursor:pointer}
.sort-arrow{position:absolute;right:15px;top:50%;transform:translateY(-57%);pointer-events:none;color:var(--muted);font-size:24px;line-height:1}
.result-bar{display:flex;align-items:center;justify-content:space-between;padding:16px 2px 11px;gap:10px}
.result-bar p{font-weight:750;margin:0;font-size:14px}
.reset{border:0;background:transparent;color:var(--accent);text-decoration:underline;text-underline-offset:2px;padding:5px}
.results{display:grid;gap:11px}
.sphere{border:1px solid #e1e6ee;border-radius:12px;padding:15px 17px;background:var(--card);overflow-wrap:anywhere;box-shadow:0 1px 2px rgba(20,35,60,.03)}
.sphere-head{display:flex;align-items:center;gap:13px;margin-bottom:12px;min-height:66px}
.sphere-image{width:64px;height:64px;object-fit:contain;flex-shrink:0;border:1px solid #e5eaf0;background:#f4f6f9;border-radius:9px;padding:3px}
.sphere-image[hidden]{display:none}
.img-fallback{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:64px;height:64px;background:#eef2f7;color:#8492a3;border-radius:9px;font-size:10px}
.img-fallback[hidden]{display:none}
.sphere-ident{min-width:0;flex:1}
.name-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rarity{font-size:12px;font-weight:800;border-radius:999px;padding:3px 9px;min-width:32px;text-align:center;flex-shrink:0;color:#fff;line-height:1.4}
.rarity-l{background:var(--rarity-l)}.rarity-e{background:var(--rarity-e)}.rarity-r{background:var(--rarity-r)}.rarity-u{background:var(--rarity-u)}.rarity-c{background:var(--rarity-c)}.rarity-n{background:var(--rarity-n)}
.sphere-name{font-size:16px;font-weight:760;line-height:1.45;margin:0;overflow-wrap:anywhere}
.sphere-meta{display:flex;align-items:baseline;gap:4px 8px;justify-content:space-between;min-width:0;margin-top:4px}
.sphere-secondary-name{font-size:11px;color:var(--muted);margin:0;min-width:0;flex:1;overflow-wrap:anywhere}
.sphere-id{font-size:10px;color:#718097;white-space:nowrap;flex-shrink:0;margin-left:auto;font-variant-numeric:tabular-nums}
.section-label{font-size:12px;font-weight:750;margin:0 0 7px;color:#51647d}
.stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin-bottom:12px}
.stat{min-width:0;background:#f2f5f9;border-radius:6px;padding:7px 2px;text-align:center}
.stat-label{font-size:11px;color:#617086;font-weight:650;white-space:nowrap}
.stat-value{font-size:15px;color:#263244;line-height:1.5;font-weight:760;font-variant-numeric:tabular-nums;white-space:nowrap}
.effect-lines{display:grid;gap:3px}
.effect-line{margin:0;font-size:13px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.empty,.notice{border:1px solid #e2e7ee;border-radius:12px;text-align:center;padding:24px 12px;color:var(--muted);background:var(--card)}
.notice{color:#923c35;background:#fff8f7}
.footer{color:#748093;font-size:11px;line-height:1.8;margin:24px 3px 0}
.footer p{margin:0}.footer p+p{margin-top:8px}.footer a{color:var(--accent);text-decoration:underline}
[hidden]{display:none!important}
@media(max-width:480px){.app{padding:14px 10px 22px}.filters{padding:14px 12px}.sphere{padding:12px 10px}.sphere-head{gap:10px;min-height:54px}.sphere-image,.img-fallback{width:54px;height:54px}.sphere-name{font-size:14px}.choice{padding:6px 12px}.stats{gap:2px}.stat{padding:6px 1px}.stat-label{font-size:10px;letter-spacing:-.035em}.stat-value{font-size:13px}.effect-line{font-size:13px}.header{gap:7px}h1{font-size:18px}.lang-option{padding:6px 9px;min-width:37px}}
@media(max-width:360px){.app{padding-left:7px;padding-right:7px}.sphere{padding-left:8px;padding-right:8px}.stat-label{font-size:9px}.stat-value{font-size:12px}}

@media(max-width:540px){.choice-row{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.choice{width:100%;min-width:0;min-height:36px;padding:6px 0;font-size:12px;white-space:nowrap}}
@media(max-width:360px){.choice-row{gap:3px}.choice{font-size:11px}.sphere-meta{gap:4px}.sphere-id{font-size:9px}.sphere-secondary-name{font-size:10px}}


/* Shared lightweight navigation across the three BFH encyclopedias (v1). */
.bfh-dex-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:min(100%,520px);margin:-4px 0 18px}
.bfh-dex-item{min-width:0;min-height:41px;display:flex;align-items:center;justify-content:center;gap:7px;padding:7px 8px;border:1px solid #d8e1ed;border-radius:9px;background:#fff;color:#526987;text-decoration:none;font-size:13px;font-weight:700;line-height:1.2;white-space:nowrap;transition:background-color .13s,border-color .13s}
.bfh-dex-item svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
a.bfh-dex-item:hover{background:#eef3fa;border-color:#b7cbe2;color:#38597f}
a.bfh-dex-item:focus-visible{outline:3px solid #92b2e0;outline-offset:2px}
.bfh-dex-item.is-current{background:#526f9a;color:#fff;border-color:#526f9a;cursor:default}
.bfh-dex-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;column-gap:11px;row-gap:3px;font-size:11px;line-height:1.65;margin:0 0 10px;color:#7c8ba2}
.bfh-dex-footer a{color:#5c789d;text-decoration:underline;text-underline-offset:2px}
@media(max-width:420px){.bfh-dex-nav{gap:5px;margin-top:-3px;margin-bottom:14px}.bfh-dex-item{min-height:39px;padding:7px 3px;gap:5px;font-size:12px}.bfh-dex-item svg{width:14px;height:14px;flex-basis:14px}}
@media(max-width:320px){.bfh-dex-item{font-size:11px;gap:4px}.bfh-dex-item svg{width:13px;height:13px;flex-basis:13px}}
