/* スペック診断（/spec/）。白ベースで、右上のボタンでダーク（黒＋落ち着いた黄土色 #d9b62a。明るい黄色は「設定を下げれば遊べる」のオレンジと紛らわしいので使わない）に切り替える */
:root {
    /* 白ベース（初期）。ダークは html[data-theme="dark"] */
    --bg: #f4f5f7; --card: #fff; --soft: #f7f8fa; --field: #fff; --hover: #eef0f3; --nav: rgba(255,255,255,.97);
    --line: #e3e6ea; --line2: #d3d8de; --ink: #1d2329; --text2: #39424b; --sub: #5d6670; --mute: #848c95;
    --accent: #8a6d00; --accent-fill: #f2d22e; --accent-bg: rgba(242,210,46,.18); --on-accent: #1d2329;
    --ng: #d32f2f; --low: #c26a00; --ok: #23864d; --good: #0b8aa3; --on-good: #fff;
    --xbtn: #000; --xbtn-ink: #fff; --shadow: 0 8px 24px rgba(20,30,40,.15);
    color-scheme: light;
}
html[data-theme="dark"] {
    --bg: #0b0d0f; --card: #13171b; --soft: #171b20; --field: #1a1e23; --hover: #262c33; --nav: rgba(11,13,15,.97);
    --line: #22282e; --line2: #2e353d; --ink: #e6e9ec; --text2: #c4cad1; --sub: #8b949e; --mute: #6b737b;
    --accent: #d9b62a; --accent-fill: #d9b62a; --accent-bg: rgba(217,182,42,.1); --on-accent: #0b0d0f;
    --ng: #ef5350; --low: #f5a623; --ok: #57c785; --good: #3ec6e0; --on-good: #0b0d0f;
    --xbtn: #000; --xbtn-ink: #fff; --shadow: 0 8px 24px rgba(0,0,0,.5);
    color-scheme: dark;
}
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif; font-weight: 500; line-height: 1.7; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.sp-wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }

/* ナビ */
.sp-nav { position: sticky; top: 0; z-index: 50; background: var(--nav); border-bottom: 1px solid var(--line); }
.sp-nav .sp-wrap { display: flex; align-items: center; gap: 10px; height: 48px; }
.sp-brand img { display: block; height: 20px; width: auto; }
.sp-sub { font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 13px; letter-spacing: .12em; color: var(--sub); white-space: nowrap; }
.sp-updated { margin-left: auto; font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 11px; letter-spacing: .1em; color: var(--mute); white-space: nowrap; }

.sp-main { padding-top: 14px; padding-bottom: 8px; }
.sp-crumb { font-size: 11px; color: var(--mute); margin-bottom: 10px; }
.sp-crumb a:hover { color: var(--accent); }
.sp-title { font-size: 26px; line-height: 1.35; margin: 0 0 8px; letter-spacing: .02em; }
.sp-br { display: none; }
.sp-lead { font-size: 14px; color: var(--text2); margin: 0 0 6px; }
.sp-pr { font-size: 11px; color: var(--sub); margin: 0 0 6px; }

.sp-card { background: var(--card); border: 1px solid var(--line); padding: 18px; margin: 16px 0; }
.sp-h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; }
.sp-h2 span { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .16em; color: var(--accent); }
.sp-note { font-size: 12px; color: var(--sub); margin: 8px 0 0; }
.sp-warn { font-size: 12px; color: var(--low); border-left: 3px solid var(--low); padding: 4px 10px; margin: 0 0 10px; background: rgba(245,166,35,.07); }
.sp-src { font-size: 11px; color: var(--mute); margin: 8px 0 0; }
.sp-src a, .sp-link { color: var(--accent); }
.sp-src a:hover, .sp-link:hover { text-decoration: underline; }
.sp-list { margin: 0; padding-left: 1.2em; font-size: 13px; color: var(--text2); }
.sp-list li { margin: 4px 0; }

/* 表 */
.sp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp-table th, .sp-table td { border: 1px solid var(--line2); padding: 8px 10px; text-align: left; vertical-align: top; }
.sp-table thead th { background: var(--field); font-size: 12px; color: var(--sub); white-space: nowrap; }
.sp-table tbody th { background: var(--soft); white-space: nowrap; font-size: 12px; color: var(--sub); width: 1%; }

/* 入力 */
.sp-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sp-row:last-of-type { border-bottom: 0; }
.sp-label { font-size: 13px; color: var(--sub); }
.sp-seg { display: flex; gap: 6px; }
.sp-seg-wrap { flex-wrap: wrap; }
.sp-seg button { background: var(--field); border: 1px solid var(--line2); padding: 7px 14px; cursor: pointer; font-size: 13px; line-height: 1.3; min-height: 38px; }
.sp-seg button small { display: block; font-size: 10px; color: var(--mute); }
.sp-seg button:hover { border-color: var(--sub); }
.sp-seg button.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.sp-seg button.is-on small { color: var(--accent); }
.sp-select { width: 100%; box-sizing: border-box; background: var(--field); border: 1px solid var(--line2); color: var(--ink); padding: 9px 12px; font-size: 16px; border-radius: 0; }
.sp-select:focus { border-color: var(--accent); outline: none; }
.sp-combo { position: relative; }
.sp-combo input { width: 100%; box-sizing: border-box; background: var(--field); border: 1px solid var(--line2); color: var(--ink); padding: 9px 12px; font-size: 16px; outline: none; border-radius: 0; }
.sp-combo input:focus { border-color: var(--accent); }
.sp-opts { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 2px 0 0; padding: 0; list-style: none; max-height: 320px; overflow-y: auto; background: var(--field); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.sp-opt { padding: 8px 12px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.sp-opt small { color: var(--mute); font-size: 11px; white-space: nowrap; }
.sp-opt:hover, .sp-opt.is-active { background: var(--hover); }
.sp-opt.is-sel { color: var(--accent); }
.sp-opt-grp { padding: 6px 12px 4px; font-size: 10px; letter-spacing: .08em; color: var(--accent); background: var(--soft); position: sticky; top: 0; }
.sp-opt-none { padding: 10px 12px; font-size: 12px; color: var(--sub); }
.sp-howto { margin-top: 12px; font-size: 13px; color: var(--text2); }
.sp-howto summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.sp-howto ol { padding-left: 1.4em; margin: 8px 0 0; }
.sp-howto li { margin: 4px 0; }
.sp-msg { font-size: 13px; color: var(--sub); margin: 12px 0 0; text-align: center; }

/* 結果 */
.sp-verdict { border-top: 4px solid var(--sub); }
.sp-verdict.is-ng { border-top-color: var(--ng); }
.sp-verdict.is-low { border-top-color: var(--low); }
.sp-verdict.is-ok { border-top-color: var(--ok); }
.sp-verdict.is-good { border-top-color: var(--good); }
.sp-v-game { margin: 0; font-size: 13px; color: var(--sub); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.sp-v-game span { font-size: 11px; border: 1px solid var(--line2); padding: 0 8px; }
.sp-v-label { font-size: 30px; font-weight: 800; margin: 4px 0 2px; letter-spacing: .03em; }
.is-ng .sp-v-label { color: var(--ng); }
.is-low .sp-v-label { color: var(--low); }
.is-ok .sp-v-label { color: var(--ok); }
.is-good .sp-v-label { color: var(--good); }
.sp-v-text { margin: 0; font-size: 14px; }
.sp-v-neck { margin: 6px 0 0; font-size: 12px; color: var(--sub); }
.sp-parts { list-style: none; padding: 0; margin: 14px 0 4px; border-top: 1px solid var(--line); }
.sp-part { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sp-part-k { font-size: 12px; color: var(--sub); display: flex; align-items: flex-start; gap: 6px; }
.sp-part-k::before { content: ''; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--sub); }
.sp-part.is-ng .sp-part-k::before { background: var(--ng); }
.sp-part.is-low .sp-part-k::before { background: var(--low); }
.sp-part.is-ok .sp-part-k::before { background: var(--ok); }
.sp-part.is-good .sp-part-k::before { background: var(--good); }
.sp-part-v b { display: block; font-size: 14px; }
.sp-part-v > span { display: block; font-size: 12px; color: var(--text2); }
.sp-part.is-ng .sp-part-v > span { color: var(--ng); }
.sp-part.is-low .sp-part-v > span { color: var(--low); }
.sp-bar { position: relative; height: 6px; background: var(--line); margin-top: 6px; max-width: 420px; }
.sp-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--sub); }
.is-ng .sp-bar i { background: var(--ng); }
.is-low .sp-bar i { background: var(--low); }
.is-ok .sp-bar i { background: var(--ok); }
.is-good .sp-bar i { background: var(--good); }
.sp-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--mute); }
.sp-bar b.is-t { background: var(--ink); }
.sp-legend { font-size: 10px; color: var(--mute); margin: 6px 0 0; display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.sp-legend i { display: inline-block; width: 14px; height: 6px; background: var(--sub); margin-right: 4px; }
.sp-legend b { display: inline-block; width: 2px; height: 10px; background: var(--mute); margin-right: 4px; }
.sp-legend b.is-t { background: var(--ink); }
.sp-notes { margin-top: 12px; font-size: 12px; color: var(--sub); }

/* 改善案・案内 */
.sp-fix { margin-top: 16px; border: 1px solid var(--line2); padding: 14px; background: var(--soft); }
.sp-fix h3 { margin: 0 0 6px; font-size: 14px; }
.sp-fix ul { margin: 0; padding-left: 1.2em; font-size: 13px; }
.sp-fix-soft { background: none; }
.sp-cta { margin-top: 12px; border-top: 1px dashed var(--line2); padding-top: 10px; }
.sp-cta-h { margin: 0 0 6px; font-size: 13px; color: var(--accent); }
.sp-spec { font-size: 13px; margin: 0 0 8px; }
.sp-spec b { color: var(--ink); }
.sp-cta-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 6px 0; font-size: 13px; }
.sp-shops { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-shop { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); padding: 6px 12px; font-size: 12px; background: var(--soft); }
.sp-shop:hover { border-color: var(--accent); color: var(--accent); }
.sp-prlabel { font-size: 9px; font-weight: 700; border: 1px solid currentColor; padding: 0 4px; line-height: 1.5; color: var(--sub); }

/* 全ゲームの表 */
.sp-alltable td { text-align: center; padding: 6px; }
.sp-alltable th button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-align: left; font-size: 13px; text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.sp-alltable tr.is-cur th { box-shadow: inset 3px 0 0 var(--accent); }
.sp-alltable tr.is-cur th button { color: var(--accent); }
.sp-pill { display: inline-block; font-size: 11px; padding: 2px 8px; white-space: nowrap; border: 1px solid; }
.sp-pill.is-ng { color: var(--ng); }
.sp-pill.is-low { color: var(--low); }
.sp-pill.is-ok { color: var(--ok); }
.sp-pill.is-good { color: var(--on-good); background: var(--good); border-color: var(--good); }
.sp-pill.is-na { color: var(--mute); background: none; border-color: var(--line2); }
.sp-short { display: none; }

/* シェア */
.sp-share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 140px; border: 1px solid var(--line2); background: var(--soft); padding: 9px 16px; font-size: 13px; cursor: pointer; }
.sp-btn:hover { border-color: var(--accent); color: var(--accent); }
.sp-btn-x { background: var(--xbtn); color: var(--xbtn-ink); border-color: var(--xbtn); }
.sp-copied { font-size: 12px; color: var(--ok); margin: 8px 0 0; }
.sp-copybox { width: 100%; margin-top: 8px; box-sizing: border-box; background: var(--field); border: 1px solid var(--line2); color: var(--ink); padding: 8px; font-size: 13px; }

.sp-games { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.sp-games a { display: block; border: 1px solid var(--line2); padding: 8px 12px; font-size: 13px; }
.sp-games a:hover { border-color: var(--accent); color: var(--accent); }
.sp-games a[aria-current] { border-color: var(--accent); color: var(--accent); }
.sp-updates ul { list-style: none; padding: 0; margin: 0; font-size: 12px; color: var(--text2); }
.sp-updates time { color: var(--mute); margin-right: 12px; font-family: 'Rajdhani', sans-serif; font-weight: 600; }

.sp-footer { border-top: 1px solid var(--line); margin-top: 24px; padding: 18px 0 28px; font-size: 12px; color: var(--sub); }
.sp-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
.sp-footer-links a:hover { color: var(--accent); }
.sp-copy { font-size: 11px; line-height: 1.7; color: var(--mute); margin: 0; }

ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

@media (max-width: 640px) {
    .sp-title { font-size: 21px; }
    .sp-br { display: inline; }
    .sp-card { padding: 14px; margin: 12px 0; }
    .sp-row { grid-template-columns: 1fr; gap: 6px; }
    .sp-seg button { padding: 7px 10px; }
    .sp-updated { display: none; }
    .sp-v-label { font-size: 26px; }
    .sp-part { grid-template-columns: 70px 1fr; }
    .sp-alltable th, .sp-alltable td { padding: 6px 4px; }
    .sp-pill { font-size: 11px; padding: 2px 5px; }
    .sp-long { display: none; }
    .sp-short { display: inline; }
    .sp-btn { min-width: 0; flex: 1; }
}

/* テーマの切り替え・ロゴ */
.sp-brand .sp-logo-dark { display: none; }
html[data-theme="dark"] .sp-brand .sp-logo-dark { display: block; }
html[data-theme="dark"] .sp-brand .sp-logo-light { display: none; }
/* スイッチ: 白はつまみが左（太陽）、ダークは右（月）でレールが黄色 */
.sp-theme { flex: none; position: relative; width: 46px; height: 26px; border: 1px solid var(--line2); border-radius: 13px; background: var(--soft); cursor: pointer; padding: 0; transition: background .2s, border-color .2s; }
.sp-theme:hover { border-color: var(--accent); }
.sp-theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; color: var(--accent); transition: transform .2s; }
.sp-knob svg { width: 13px; height: 13px; }
.sp-theme .sp-ico-moon { display: none; }
html[data-theme="dark"] .sp-theme { background: var(--accent-fill); border-color: var(--accent-fill); }
html[data-theme="dark"] .sp-knob { transform: translateX(20px); background: #0b0d0f; }
html[data-theme="dark"] .sp-theme .sp-ico-sun { display: none; }
html[data-theme="dark"] .sp-theme .sp-ico-moon { display: block; }
@media (max-width: 640px) { .sp-theme { margin-left: auto; } }

/* ゲームのアイコン */
.sp-gi { width: 24px; height: 24px; border-radius: 6px; flex: none; object-fit: cover; vertical-align: middle; background: var(--soft); box-shadow: 0 0 0 1px var(--line); }
.sp-gi-l { width: 56px; height: 56px; border-radius: 12px; }
.sp-title-row { display: flex; align-items: center; gap: 14px; }
.sp-title-row .sp-title { margin: 0; }
.sp-title-row + .sp-lead { margin-top: 10px; }
.sp-gamepick { position: relative; }
.sp-gamebtn { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--field); border: 1px solid var(--line2); padding: 7px 12px; font-size: 16px; cursor: pointer; text-align: left; }
.sp-gamebtn::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--sub); border-bottom: 2px solid var(--sub); transform: rotate(45deg) translate(-2px, -2px); }
.sp-gamebtn:focus { outline: none; border-color: var(--accent); }
.sp-gamelist { position: absolute; left: 0; right: 0; top: 100%; z-index: 21; margin: 2px 0 0; padding: 4px 0; list-style: none; background: var(--field); border: 1px solid var(--line2); box-shadow: var(--shadow); max-height: 380px; overflow-y: auto; }
.sp-gamelist li { display: flex; align-items: center; gap: 10px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.sp-gamelist li:hover, .sp-gamelist li.is-active { background: var(--hover); }
.sp-gamelist li[aria-selected="true"] { color: var(--accent); }
.sp-v-game { align-items: center; }
.sp-v-game .sp-gi { width: 28px; height: 28px; }
.sp-alltable th button { display: inline-flex; align-items: center; gap: 8px; }
.sp-games a { display: flex; align-items: center; gap: 10px; }
