/* ================================================================
   名探偵コナンカードゲーム ファンサイト — スタイル
   白基調。PC での見やすさを最優先し、狭い画面では段組みを畳む。
   ================================================================ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-mute: #eef2f7;
  --line: #dfe5ee;
  --line-strong: #c5cfdc;
  --text: #1c2430;
  --text-sub: #56627a;
  --text-mute: #8492a6;
  --accent: #1f5fd0;
  --accent-dark: #174aa5;
  --accent-soft: #e8f0fe;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warn: #a15c00;
  --warn-soft: #fff4e0;
  --c-blue: #2f7de1;
  --c-green: #2e9e5b;
  --c-white: #ffffff;
  --c-red: #dc3d3d;
  --c-yellow: #f2c230;
  --c-black: #2b2f38;
  --radius: 8px;
  --header-h: 60px;
  --shadow: 0 1px 2px rgba(20, 35, 60, 0.06), 0 4px 14px rgba(20, 35, 60, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.is-modal-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- ヘッダー */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: 1680px; margin: 0 auto; padding: 0 24px; height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.site-logo { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.site-logo:hover { text-decoration: none; }
.site-logo__mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
.site-logo__text { display: flex; flex-direction: column; line-height: 1.25; }
.site-logo__name { font-weight: 700; font-size: 15px; }
.site-logo__sub { font-size: 11px; color: var(--text-mute); }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav__item { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; color: var(--text-sub); font-size: 14px; font-weight: 600; white-space: nowrap; }
.main-nav__item:hover { background: var(--bg-mute); text-decoration: none; color: var(--text); }
.main-nav__item.is-active { background: var(--accent-soft); color: var(--accent-dark); }
.main-nav__item.is-disabled { color: var(--text-mute); font-weight: 500; cursor: default; }
.main-nav__item.is-disabled:hover { background: transparent; color: var(--text-mute); }
.main-nav__soon { font-size: 10px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; line-height: 1.5; }

/* ---- ログインメニュー（ヘッダー右上） */
.user-menu { position: relative; flex-shrink: 0; }
.user-menu__login { padding: 7px 14px; }
.user-menu__button { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 600; }
.user-menu__button:hover { background: var(--bg-soft); }
.user-menu__button .fa-circle-user { font-size: 18px; color: var(--accent); }
.user-menu__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; z-index: 60; }
.user-menu__panel a, .user-menu__panel button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: none; background: none; border-radius: 6px; color: var(--text); font-size: 14px; text-align: left; width: 100%; }
.user-menu__panel a:hover, .user-menu__panel button:hover { background: var(--bg-mute); text-decoration: none; }
.user-menu__panel i { width: 16px; text-align: center; color: var(--text-sub); }
.site-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; margin: 0; background: #1c2430; color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.site-toast.is-warn { background: #8a4b00; }
.site-toast.is-error { background: var(--danger); }

/* ---------------------------------------------------------------- 共通部品 */
.site-main { flex: 1; }
.page { max-width: 1680px; margin: 0 auto; padding: 24px; }
.page--narrow { max-width: 860px; }
.page--detail { max-width: 1240px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: var(--radius); border: 1px solid transparent; padding: 8px 16px; font-weight: 600; font-size: 14px; background: none; line-height: 1.4; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--outline { border-color: var(--line-strong); background: #fff; color: var(--text); }
.btn--outline:hover { background: var(--bg-soft); }
.btn--text { padding: 4px 8px; color: var(--accent); font-weight: 500; font-size: 13px; }
.btn--text:hover { background: var(--accent-soft); }
.btn--icon { padding: 6px 10px; color: var(--text-sub); }
.badge { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 1.7; border: 1px solid var(--line-strong); color: var(--text-sub); background: #fff; white-space: nowrap; }
.badge--type { background: var(--bg-mute); border-color: transparent; }
.badge--banned { background: var(--danger); border-color: var(--danger); color: #fff; }
.badge--restricted { background: var(--warn-soft); border-color: #e5b566; color: var(--warn); }
.badge--notice { background: var(--bg-mute); border-color: var(--line-strong); }
.card-num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-sub); }
.color-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; border: 1px solid rgba(0, 0, 0, 0.12); }
.color-dot + .color-dot { margin-left: 3px; }
.color-dot--blue { background: var(--c-blue); }
.color-dot--green { background: var(--c-green); }
.color-dot--white { background: var(--c-white); color: var(--text); border-color: var(--line-strong); }
.color-dot--red { background: var(--c-red); }
.color-dot--yellow { background: var(--c-yellow); color: #4a3800; }
.color-dot--black { background: var(--c-black); }
.color-dot--none { background: var(--bg-mute); color: var(--text-sub); }
.kw { font-weight: 700; color: #123a7c; }
.kw--ref { color: #7a3a00; font-weight: 600; }
.message-box { text-align: center; padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--bg-soft); }
.message-box h1, .message-box h2 { font-size: 18px; margin-bottom: 8px; }
.message-box p { color: var(--text-sub); margin-bottom: 16px; }

/* カード画像（公式画像を参照。比率 716:1000） */
.card-image { display: block; aspect-ratio: 716 / 1000; background: var(--bg-mute) center / cover no-repeat; border-radius: 4.2% / 3%; overflow: hidden; box-shadow: 0 1px 3px rgba(20, 35, 60, 0.18); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-image.is-missing { display: grid; place-items: center; border: 1px dashed var(--line-strong); box-shadow: none; }
.card-image.is-missing::after { content: "画像なし"; font-size: 11px; color: var(--text-mute); }

/* ---------------------------------------------------------------- トップ */
.page--home { max-width: 1320px; }
.hero { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 36px 40px; }
.hero__title { font-size: 28px; line-height: 1.35; }
.hero__lead { color: var(--text-sub); margin-top: 6px; }
.hero__search { display: flex; gap: 10px; margin-top: 22px; max-width: 860px; }
.hero__search input { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; font-size: 16px; }
.hero__search .btn { padding: 12px 26px; font-size: 16px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 14px 44px; margin-top: 26px; }
.hero__stats dt { font-size: 12px; color: var(--text-sub); }
.hero__stats dd { font-size: 26px; font-weight: 700; line-height: 1.3; }
.hero__stats dd small { font-size: 13px; font-weight: 500; margin-left: 3px; color: var(--text-sub); }
.hero__stats dd.is-text { font-size: 18px; padding-top: 6px; }
.home-section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-title { font-size: 19px; margin-bottom: 14px; padding-left: 12px; border-left: 4px solid var(--accent); line-height: 1.4; }
.section-title__sub { font-size: 14px; font-weight: 500; color: var(--text-sub); margin-left: 8px; }
.section-head__more { font-size: 14px; white-space: nowrap; }
.quick-filters { display: flex; flex-direction: column; gap: 12px; }
.quick-filters__group { display: flex; flex-wrap: wrap; gap: 10px; }
.color-button { display: inline-grid; place-items: center; width: 74px; height: 46px; border-radius: var(--radius); font-weight: 700; font-size: 16px; color: #fff; border: 1px solid rgba(0, 0, 0, 0.12); }
.color-button:hover { text-decoration: none; filter: brightness(1.07); }
.color-button--blue { background: var(--c-blue); }
.color-button--green { background: var(--c-green); }
.color-button--white { background: #fff; color: var(--text); border-color: var(--line-strong); }
.color-button--red { background: var(--c-red); }
.color-button--yellow { background: var(--c-yellow); color: #4a3800; }
.color-button--black { background: var(--c-black); }
.chip-link { display: inline-flex; align-items: center; padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); font-weight: 600; font-size: 14px; background: #fff; }
.chip-link--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-link--primary:hover { background: var(--accent-dark); color: #fff; }
.chip-link:not(.chip-link--primary):hover { background: var(--accent-soft); border-color: var(--accent); text-decoration: none; }
.package-group + .package-group { margin-top: 18px; }
.package-group__title { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.package-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.package-list > li, .roadmap-list > li { min-width: 0; }
.package-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: #fff; }
.package-item:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.package-item__code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-sub); flex-shrink: 0; min-width: 52px; }
.package-item__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.package-item__count { font-size: 12px; color: var(--text-mute); flex-shrink: 0; }
.roadmap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 8px; }
.roadmap-list li { padding: 12px 16px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-sub); font-size: 14px; }
.roadmap-list i { color: var(--text-mute); margin-right: 8px; width: 18px; text-align: center; }

/* ---------------------------------------------------------------- カードグリッド */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px 14px; }
.card-grid--home { grid-template-columns: repeat(6, 1fr); }
.card-tile { display: flex; flex-direction: column; gap: 6px; color: var(--text); border-radius: 8px; padding: 6px; margin: -6px; }
.card-tile:hover { background: var(--bg-soft); text-decoration: none; }
.card-tile:hover .card-image { box-shadow: 0 4px 14px rgba(20, 35, 60, 0.28); }
.card-tile__name { font-size: 13px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tile__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: auto; }
.tile-versions { font-size: 11px; color: var(--text-mute); white-space: nowrap; }

/* ---------------------------------------------------------------- カードリスト（2カラム） */
.page--cards { display: grid; grid-template-columns: 312px minmax(0, 1fr); gap: 28px; align-items: start; }
.filter-panel { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.filter-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filter-panel__head h2 { font-size: 15px; }
.filter-panel__close, .filter-panel__foot, .results__filter-button { display: none; }
.filter-form { overflow-y: auto; padding: 4px 16px 16px; overscroll-behavior: contain; }
.filter-group { padding: 12px 0; border-bottom: 1px solid var(--line); }
.filter-group:last-child { border-bottom: none; padding-bottom: 0; }
.filter-group__label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.filter-group--fold > summary { cursor: pointer; margin-bottom: 0; list-style: none; display: flex; align-items: center; gap: 6px; }
.filter-group--fold > summary::-webkit-details-marker { display: none; }
.filter-group--fold > summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px; color: var(--text-mute); margin-left: auto; transition: transform 0.15s; }
.filter-group--fold[open] > summary::after { transform: rotate(180deg); }
.filter-group--fold[open] > summary { margin-bottom: 10px; }
.filter-count:not(:empty) { background: var(--accent); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 7px; line-height: 1.6; }
.filter-sub { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.filter-form input[type="search"] { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 14px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); margin-top: 8px; cursor: pointer; }
.filter-sub .check-inline, .results__controls .check-inline { margin-top: 0; }
.chip-set { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-set--scroll { max-height: 216px; overflow-y: auto; padding-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: 13px; line-height: 1.5; color: var(--text); }
.chip:hover { border-color: var(--accent); }
.chip small { font-size: 11px; color: var(--text-mute); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip.is-on small { color: rgba(255, 255, 255, 0.8); }
.chip--color { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; font-weight: 700; color: #fff; border-color: rgba(0, 0, 0, 0.12); opacity: 0.55; }
.chip--color:hover { opacity: 0.85; }
.chip--color.is-on { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.chip--blue, .chip--blue.is-on { background: var(--c-blue); }
.chip--green, .chip--green.is-on { background: var(--c-green); }
.chip--white, .chip--white.is-on { background: #fff; color: var(--text); border-color: var(--line-strong); }
.chip--red, .chip--red.is-on { background: var(--c-red); }
.chip--yellow, .chip--yellow.is-on { background: var(--c-yellow); color: #4a3800; }
.chip--black, .chip--black.is-on { background: var(--c-black); }
.range-row { display: flex; align-items: center; gap: 8px; }
.range-row select { flex: 1; min-width: 0; padding: 7px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 14px; }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.check-list__title { font-size: 11px; color: var(--text-mute); margin: 8px 0 2px; }
.check-list__title:first-child { margin-top: 0; }
.check-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 6px; cursor: pointer; line-height: 1.45; }
.check-item:hover { background: var(--bg-soft); }
.check-item input { margin-top: 3px; flex-shrink: 0; }
.check-item span { flex: 1; min-width: 0; }
.check-item b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; font-weight: 500; color: var(--text-sub); }
.check-item small { color: var(--text-mute); font-size: 11px; flex-shrink: 0; }

.results { min-width: 0; }
.results__toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.results__count { font-size: 14px; color: var(--text-sub); }
.results__count b { font-size: 24px; color: var(--text); margin-right: 3px; }
.results__count span { margin-left: 12px; font-size: 13px; color: var(--text-mute); }
.results__controls { display: flex; align-items: center; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.select-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); }
.select-inline select { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 14px; color: var(--text); }
.view-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.view-toggle button { border: none; background: #fff; padding: 6px 12px; font-size: 13px; color: var(--text-sub); display: inline-flex; align-items: center; gap: 6px; }
.view-toggle button + button { border-left: 1px solid var(--line-strong); }
.view-toggle button.is-on { background: var(--accent); color: #fff; font-weight: 600; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0 0; }
.active-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid #b9cef5; background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; font-size: 12px; font-weight: 600; }
.active-chip:hover { background: #d6e4fd; }
.active-chip i { font-size: 10px; opacity: 0.7; }
.results__body { padding-top: 18px; min-height: 320px; transition: opacity 0.12s; }
.results__body.is-loading { opacity: 0.45; pointer-events: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.card-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.card-table th { position: sticky; top: 0; background: var(--bg-soft); text-align: left; font-size: 12px; color: var(--text-sub); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.card-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.card-table tbody tr { cursor: pointer; }
.card-table tbody tr:hover { background: var(--bg-soft); }
.card-table tbody tr:last-child td { border-bottom: none; }
.card-table .col-image { width: 58px; padding-right: 0; }
.card-table .col-image .card-image { width: 46px; box-shadow: none; }
.card-table .col-name { min-width: 150px; }
.card-table .col-name a { display: block; font-weight: 700; font-size: 14px; color: var(--text); }
.card-table .col-name a:hover { color: var(--accent); }
.card-table .col-name .badge, .card-table .col-name .tile-versions { margin-left: 6px; }
.card-table .col-type, .card-table .col-rarity { white-space: nowrap; }
.card-table .col-color { white-space: nowrap; }
.card-table .col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-table .col-cat { min-width: 110px; max-width: 170px; color: var(--text-sub); }
.card-table .col-text { min-width: 300px; }
.card-table .col-text p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.6; }

.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; padding: 28px 0 8px; }
.pagination button { min-width: 38px; padding: 7px 12px; border: 1px solid var(--line-strong); background: #fff; border-radius: 6px; font-size: 14px; }
.pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pagination button.is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination__gap { color: var(--text-mute); padding: 0 2px; }

/* ---------------------------------------------------------------- カード詳細（モーダル・単独ページ共用） */
.card-detail { display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: 32px; align-items: start; }
.card-detail__media { position: sticky; top: 0; }
.page--detail .card-detail__media { top: calc(var(--header-h) + 16px); }
.card-image--large { box-shadow: 0 6px 22px rgba(20, 35, 60, 0.24); }
.card-detail__info { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.card-detail__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-detail__meta .card-num { font-size: 14px; }
.card-detail__name { font-size: 26px; line-height: 1.35; margin-top: 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stats:empty { display: none; }
.stat { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; min-width: 84px; }
.stat dt { font-size: 11px; color: var(--text-sub); }
.stat dd { font-size: 15px; line-height: 1.4; }
.stat dd b { font-size: 21px; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tags__label { font-size: 12px; color: var(--text-sub); margin-right: 4px; }
.tag { padding: 2px 11px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; color: var(--text); background: #fff; }
.tag:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.text-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: #fff; }
.text-box h3 { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.text-box p { font-size: 15px; line-height: 1.8; }
.text-box--main { border-left: 4px solid var(--accent); }
.text-box--hirameki { border-left: 4px solid #e0a800; background: #fffdf3; }
.text-box--cutin { border-left: 4px solid #d6455a; background: #fff7f8; }
.text-box--henso { border-left: 4px solid #7a55c7; background: #faf7ff; }
.text-box--empty { color: var(--text-mute); background: var(--bg-soft); font-size: 14px; }
.notice { font-size: 13px; padding: 9px 13px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); color: var(--text-sub); }
.notice i { margin-right: 4px; }
.notice--banned { background: var(--danger-soft); border-color: #f1b5b5; color: #8f1d1d; }
.notice--restricted { background: var(--warn-soft); border-color: #ecc98b; color: #7a4500; }
.qa { border: 1px solid var(--line); border-radius: var(--radius); }
.qa > summary { cursor: pointer; padding: 10px 16px; font-weight: 700; font-size: 14px; }
.qa__body { padding: 2px 16px 14px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); }
.qa__section { font-size: 13px; color: var(--accent-dark); background: var(--accent-soft); padding: 3px 10px; border-radius: 4px; margin-top: 12px; }
.qa__item { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.qa__body > :first-child { margin-top: 12px; }
.qa__item:last-child { border-bottom: none; padding-bottom: 0; }
.qa__q, .qa__a { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; font-size: 14px; line-height: 1.7; }
.qa__q { font-weight: 600; }
/* 丸印は .qa__mark だけに当てる（本文中の【】などの span を巻き込まない） */
.qa__mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 2px; }
.qa__q .qa__mark { background: var(--accent); color: #fff; }
.qa__a .qa__mark { background: var(--bg-mute); color: var(--text-sub); }
.qa__text { min-width: 0; overflow-wrap: anywhere; }
.qa__note { font-size: 13px; color: var(--text-sub); }
.facts { display: grid; grid-template-columns: 1fr; gap: 0; font-size: 13px; border-top: 1px solid var(--line); }
.facts .stat { display: grid; grid-template-columns: 84px 1fr; gap: 12px; background: none; border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 7px 0; }
.facts .stat dt { font-size: 12px; padding-top: 1px; }
.facts .stat dd { font-size: 13px; }
.versions h3 { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.versions__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 10px; }
.version { display: flex; flex-direction: column; gap: 4px; color: var(--text-sub); padding: 4px; border-radius: 6px; border: 2px solid transparent; }
.version:hover { background: var(--bg-soft); text-decoration: none; }
.version.is-current { border-color: var(--accent); background: var(--accent-soft); }
.version__label { font-size: 11px; line-height: 1.35; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.version__label small { display: block; font-family: inherit; color: var(--text-mute); }
.card-detail__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.copyright { font-size: 11px; color: var(--text-mute); white-space: pre-line; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-sub); margin-bottom: 18px; }
.breadcrumb i { font-size: 9px; color: var(--text-mute); }
.card-detail-page__fallback { color: var(--text-sub); }

/* ---------------------------------------------------------------- モーダル */
/* 行の高さを画面内に固定する（auto のままだと中身の高さまで伸びて、画面外にはみ出しスクロールできなくなる） */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center; padding: 28px 72px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(18, 26, 40, 0.55); }
.modal__dialog { position: relative; width: min(1180px, 100%); max-height: 100%; min-height: 0; display: flex; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(10, 20, 40, 0.35); }
.modal__content { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 32px; overscroll-behavior: contain; transition: opacity 0.12s; border-radius: inherit; }
.modal__content.is-loading { opacity: 0.5; }
.modal__loading { color: var(--text-sub); padding: 60px 0; text-align: center; }
.modal__close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--text-sub); font-size: 16px; }
.modal__close:hover { background: var(--bg-mute); color: var(--text); }
.modal__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: none; background: #fff; color: var(--text); font-size: 16px; box-shadow: var(--shadow); }
.modal__nav:hover:not(:disabled) { background: var(--accent); color: #fff; }
.modal__nav:disabled { opacity: 0.35; cursor: default; }
.modal__nav--prev { left: -60px; }
.modal__nav--next { right: -60px; }

/* ---- カード詳細：相場を調べる ---- */
.price-links { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.price-links h3 { font-size: 13px; margin-bottom: 8px; }
.price-links__list { display: flex; flex-wrap: wrap; gap: 8px; }
.price-links__list a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600; color: var(--text); }
.price-links__list a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.price-links__list i { font-size: 10px; color: var(--text-mute); }
.price-links p { font-size: 12px; color: var(--text-mute); margin-top: 8px; }

/* ---------------------------------------------------------------- 文章ページ・フッター */
.prose h1 { font-size: 24px; margin-bottom: 16px; }
.prose h2 { font-size: 17px; margin: 28px 0 10px; padding-left: 12px; border-left: 4px solid var(--accent); }
.prose p { margin-bottom: 10px; }
.prose ul { list-style: disc; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.site-footer__inner { max-width: 1680px; margin: 0 auto; padding: 22px 24px; font-size: 12px; color: var(--text-sub); display: flex; flex-direction: column; gap: 4px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; }
.site-footer__links a { white-space: nowrap; }

/* ================================================================
   レスポンシブ（PC を基準に、狭い画面で畳む）
   ================================================================ */
@media (max-width: 1280px) {
  .page--cards { grid-template-columns: 280px minmax(0, 1fr); gap: 22px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .site-logo__sub { display: none; }
  .main-nav__soon { display: none; }
}
@media (max-width: 1024px) {
  .card-grid--home { grid-template-columns: repeat(4, 1fr); }
  .card-detail { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 24px; }
  .modal { padding: 20px 16px; }
  .modal__nav--prev { left: 6px; }
  .modal__nav--next { right: 6px; }
  .modal__nav { top: auto; bottom: 10px; transform: none; }
}
@media (max-width: 900px) {
  .page { padding: 16px; }
  .site-header__inner { padding: 0 14px; gap: 12px; }
  .main-nav__item { padding: 8px 10px; }
  .main-nav__item.is-disabled { display: none; }
  .page--cards { display: block; }
  .results__filter-button { display: inline-flex; }
  .filter-panel { position: fixed; inset: 0; z-index: 55; max-height: none; border: none; border-radius: 0; transform: translateX(-100%); transition: transform 0.2s; visibility: hidden; }
  body.is-filter-open { overflow: hidden; }
  body.is-filter-open .filter-panel { transform: none; visibility: visible; }
  .filter-panel__close { display: inline-flex; }
  .filter-panel__foot { display: block; padding: 12px 16px; border-top: 1px solid var(--line); }
  .filter-panel__foot .btn { width: 100%; padding: 12px; font-size: 15px; }
  .filter-form { flex: 1; }
  .results__controls { margin-left: 0; width: 100%; gap: 12px; }
  .results__count span { display: block; margin-left: 0; }
  .hero { padding: 24px 20px; }
  .hero__title { font-size: 22px; }
  .roadmap-list, .package-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .site-logo__name { font-size: 13px; }
  .user-menu__login span, .user-menu__name, .user-menu__button .fa-caret-down { display: none; }
  .user-menu__login, .user-menu__button { padding: 8px 10px; }
  .site-logo__sub { display: none; }
  .hero__search { flex-direction: column; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
  .card-grid--home { grid-template-columns: repeat(3, 1fr); }
  .card-tile__name { font-size: 12px; }
  .card-detail { grid-template-columns: 1fr; gap: 18px; }
  .card-detail__media { position: static; max-width: 260px; margin: 0 auto; width: 100%; }
  .card-detail__name { font-size: 21px; }
  .modal { padding: 0; }
  .modal__dialog { height: 100%; border-radius: 0; }
  .modal__content { padding: 52px 16px 70px; }
  .card-table .col-cat, .card-table .col-rarity { display: none; }
  .card-table .col-text { min-width: 220px; }
}

/* ---- ヘッダー：幅が足りない画面では、メニューを 2 段目に回す（項目が隠れないようにする） */
@media (max-width: 1180px) {
  :root { --header-h: 100px; }
  .site-header__inner { flex-wrap: wrap; height: var(--header-h); padding-top: 8px; gap: 0 12px; align-content: flex-start; }
  .site-logo { flex: 1 1 auto; min-width: 0; height: 40px; }
  .site-logo__text { min-width: 0; }
  .site-logo__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-menu { margin-left: auto; height: 40px; display: flex; align-items: center; }
  .main-nav { order: 3; flex: 0 0 100%; margin-left: 0; height: 52px; }
}
@media (max-width: 640px) {
  .main-nav { justify-content: space-between; gap: 0; }
  .main-nav__item { flex: 1 0 auto; flex-direction: column; gap: 2px; padding: 5px 4px; border-radius: 8px; font-size: 16px; }
  .main-nav__item span { display: block; font-size: 10px; font-weight: 600; line-height: 1.2; }
}
