/* カード一覧（/cards/）。生成は site/cards/build.py。基調は承認済みデザイン基準：黒インクの不透明面＋金の細線、
   明朝は見出しとカード名だけ、項目・数字はゴシック（数字は等幅） */
.card-list { --gutter: clamp(16px, 4.5vw, 56px); }
.card-list [data-el="ember"] { --el: #e0703a; }
.card-list [data-el="tide"] { --el: #5fb3c9; }
.card-list [data-el="forest"] { --el: #b9b06a; }
.card-list [data-el="mist"] { --el: #b7a3e0; }
.card-list [data-el="light"] { --el: #ede6c7; }
.card-list [data-el="dark"] { --el: #a294b3; }

.cl-main { max-width: 1320px; margin: 0 auto; padding: 116px var(--gutter) 72px; }
.cl-hero h1 { margin: 0; font: 600 clamp(1.9rem, 4.4vw, 2.8rem) "Noto Serif JP", serif; letter-spacing: .16em; }
.cl-lead { margin: .5rem 0 0; color: var(--muted); font-size: .92rem; }

.cl-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 絞り込み */
.cl-filters { display: grid; gap: 14px; margin: 28px 0 24px; padding: 18px; border: 1px solid var(--line); background: var(--deep); }
.cl-search input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 0;
  background: var(--ink); color: var(--paper); font: 500 1rem "Noto Sans JP", sans-serif; -webkit-appearance: none; appearance: none;
}
.cl-search input:focus { outline: none; border-color: var(--gold); }
.cl-search input::placeholder { color: #6f7d80; }
.cl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-chip {
  --el: var(--gold);
  min-width: 52px; height: 38px; padding: 0 14px; border: 1px solid rgba(255,255,255,.16); background: var(--ink);
  color: #cdd3d0; font: 600 .9rem "Noto Sans JP", sans-serif; letter-spacing: .08em; cursor: pointer;
}
.cl-chip::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--el); vertical-align: 1px; }
.cl-chip[aria-pressed="true"] { border-color: var(--el); color: #fff; background: color-mix(in srgb, var(--el) 16%, var(--ink)); }
.cl-selects { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
/* スマホで畳む絞り込み（PCでは見出しを隠して常に開く） */
.cl-more > summary { display: none; }
.cl-lead .nw { white-space: nowrap; }
.cd-ability p { word-break: normal; overflow-wrap: anywhere; }
.cl-select { display: grid; gap: 4px; min-width: 0; }
.cl-select span { color: var(--muted); font-size: .74rem; letter-spacing: .1em; }
.cl-select select {
  width: 100%; height: 42px; padding: 0 30px 0 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 0;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23d9b873'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--paper); font: 500 .92rem "Noto Sans JP", sans-serif; -webkit-appearance: none; appearance: none;
}
.cl-select select:focus { outline: none; border-color: var(--gold); }
.cl-select select.is-set { border-color: var(--gold); }
.cl-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cl-count { margin: 0; color: var(--muted); font-size: .86rem; }
.cl-count b { margin-right: 2px; color: var(--paper); font: 600 1.25rem "Noto Sans JP", sans-serif; font-variant-numeric: tabular-nums; }
.cl-reset { height: 36px; padding: 0 12px; border: 1px solid transparent; background: none; color: var(--gold); font: 500 .84rem "Noto Sans JP", sans-serif; cursor: pointer; }
.cl-reset:hover { border-color: var(--line); }

/* 一覧 */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; margin: 0; padding: 0; list-style: none; }
.cl-item[hidden] { display: none; }
.cl-card { display: grid; gap: 8px; text-decoration: none; color: inherit; }
.cl-item { position: relative; min-width: 0; }
/* 名前が長いカード（大天使アークエンジェル等）で列が押し広げられ、カードの大きさがそろわなかった（2026-10-15 ユーザー指摘）。
   サイト共通の word-break: auto-phrase はカタカナの長い語を折らないため、カード名だけ普通の折り返しに戻し、列の幅を超えさせない */
.cl-card { min-width: 0; }
.cl-name { word-break: normal; overflow-wrap: anywhere; }
.cl-card img { width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 6px; background: var(--surface); }
.cl-card:focus-visible { outline: none; }
.cl-card:focus-visible .cl-tilt { outline: 1px solid var(--gold); outline-offset: 3px; }

/* カードの傾き（ポケポケの公式サイトのカード一覧に倣う）と光（アプリの CardFoil と同じ。2026-10-15 ユーザー指示「アプリの光り方を正に」）。
   光は詳細のカードだけ（アプリの図鑑も一覧のカードは光らず、詳細の TactileCard だけが光る。2026-10-15「レアカードが光りすぎてる」）。
   レア（★）・極レア（☘）だけ：22°傾いた細い一閃（幅30%・高さ160%）が端から端へ走り、金の縁が光る。虹色や白い反射は足さない。
   触っていないカードは 3.2秒＋ずらし の後、4.5秒ごとに1.7秒かけて一閃が走る。マウスを乗せている間は指した位置に一閃がついてくる。
   位置はアプリの x = 幅 ×（進み × 1.9 − 0.45）を中心とする式を、帯の左端（−15%）に直したもの。cards.js が --sweep・--ty を入れる */
.cl-tilt {
  position: relative; display: block; border-radius: 6px; isolation: isolate;
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--s, 1));
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), box-shadow .55s ease;
}
.cl-tilt.is-active { --s: 1.06; z-index: 2; transition: transform .08s linear, box-shadow .25s ease; box-shadow: 0 20px 40px rgba(0, 0, 0, .65); }

/* 一覧のカードのホバーは共通部品 /card-hover.css（2026-10-16）。大きくしている間は下の名前を隠す */
.cl-item:has(.ch-hover) .cl-name { visibility: hidden; }
.cd-tilt.is-active { --s: 1; }
.cl-foil { display: none; position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; mix-blend-mode: screen; }
.cd-tilt[data-foil] .cl-foil { display: block; }
/* 金の縁（アプリ：2pt の線を2pt 内側、角度162°の角錐グラデーション） */
.cl-foil::after {
  content: ""; position: absolute; inset: 2px; border-radius: inherit; padding: 2px;
  background: conic-gradient(from 162deg at 45% 40%, rgba(201, 166, 102, .3), rgba(255, 255, 255, .95), var(--rim, #c9a666), rgba(201, 166, 102, .3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.cl-sweep {
  position: absolute; top: -30%; left: -60%; width: 30%; height: 160%;
  background: linear-gradient(90deg, transparent, rgba(201, 166, 102, .14), rgba(255, 255, 255, .34), rgba(201, 166, 102, .2), transparent);
  transform: translateY(var(--ty, 0px)) rotate(22deg);
  animation: cl-sweep 4.5s linear var(--delay, 3.2s) infinite;
}
.cd-tilt[data-foil="☘"] .cl-foil { --rim: rgba(50, 173, 230, .8); }
.cd-tilt[data-foil="☘"] .cl-sweep {
  background: linear-gradient(90deg, transparent, rgba(50, 173, 230, .18), rgba(255, 255, 255, .4), rgba(201, 166, 102, .24), transparent);
}
/* 1.7秒（4.5秒の37.8%）で −60%→130% を走り、残りは画面の外で待つ */
@keyframes cl-sweep { 0% { left: -60%; } 37.8% { left: 130%; } 37.81%, 100% { left: 130%; } }
.cl-tilt.is-active .cl-sweep { animation: none; left: calc((var(--sweep, .5) * 1.9 - .45) * 100% - 15%); }
.cl-footer { display: block; margin-top: 56px; padding: 24px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; text-align: center; }
.cl-cta { display: inline-block; margin-top: 8px; padding: .8rem 1.6rem; background: var(--gold); color: #10140f; font-weight: 700; text-decoration: none; letter-spacing: .08em; }
.cd-ability p + p { margin-top: .5em; }
.cl-rights { max-width: 40em; margin: 20px auto 0; font-size: .76rem; line-height: 1.8; }
.cl-rights a { color: inherit; }

/* 詳細ページ（/cards/<id>/）。ポケモンカード公式のカード検索の詳細と同じく、上に名前、左にカード、右に情報（2026-10-15 ユーザー指示） */
.cd-main { max-width: 1080px; margin: 0 auto; padding: 108px var(--gutter) 64px; }
.cd-back { display: flex; align-items: center; justify-content: space-between; margin: 0 0 18px; font-size: .86rem; }
.cd-back a { color: var(--gold); text-decoration: none; }
.cd-back a::before { content: "‹"; margin-right: .5em; }
.cd-pos { color: var(--muted); font-variant-numeric: tabular-nums; }
.cd-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.cd-epithet { margin: 0; color: var(--gold); font-size: .82rem; letter-spacing: .1em; }
.cd-head h1 { margin: .1rem 0 0; font: 600 clamp(1.5rem, 3.4vw, 2.2rem) "Noto Serif JP", serif; letter-spacing: .08em; line-height: 1.4; }
.cd-reading { margin: 0; color: var(--muted); font-size: .8rem; }
.cd-body { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 40px; margin-top: 28px; align-items: start; }
.cd-tilt { border-radius: 10px; }
.cd-img { width: 100%; height: auto; border-radius: 10px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cd-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; border-top: 1px solid var(--line); }
.cd-facts dt, .cd-facts dd { margin: 0; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .92rem; }
.cd-facts dt { padding-right: 24px; color: var(--muted); white-space: nowrap; }
.cd-facts dd { font-variant-numeric: tabular-nums; }
/* PCでは見出しと値の2列の表。マスの入れ物（スマホ用）は無いものとして並べる */
.cd-fact { display: contents; }
.cd-el::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--el); vertical-align: 1px; }
.cd-ability { margin-top: 24px; }
.cd-ability h2 { margin: 0 0 6px; color: var(--muted); font: 500 .8rem "Noto Sans JP", sans-serif; letter-spacing: .12em; }
.cd-ability p { margin: 0; font-size: .98rem; line-height: 1.9; }
.cd-lore { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.cd-lore p { margin: 0; font: 500 .92rem "Noto Serif JP", serif; line-height: 1.95; color: #d6d9d3; }
.cd-lore .cd-source { margin-top: 4px; color: var(--muted); font: 400 .78rem "Noto Sans JP", sans-serif; text-align: right; }
.cd-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); margin-top: 40px; border: 1px solid var(--line); background: var(--deep); }
.cd-nav a { min-width: 0; word-break: normal; overflow-wrap: anywhere; display: grid; align-content: center; min-height: 64px; padding: 10px 16px; color: var(--paper); text-decoration: none; font-size: .9rem; line-height: 1.5; }
.cd-nav a:hover { color: var(--gold-pale); }
.cd-nav small { color: var(--muted); font-size: .72rem; letter-spacing: .1em; }
.cd-nav .cd-list { padding-inline: 28px; border-inline: 1px solid var(--line); color: var(--gold); text-align: center; }
.cd-nav .cd-next { text-align: right; }
.cl-card img { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

@media (max-width: 960px) {
  .cl-selects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cl-main { padding-top: 100px; }
  .cl-hero h1 { font-size: 1.7rem; }
  .cl-lead { font-size: .84rem; }
  .cl-filters { gap: 10px; margin: 20px 0; padding: 12px; }
  .cl-search input { height: 42px; }
  .cl-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
  .cl-chip { min-width: 0; height: 36px; padding: 0 6px; }
  .cl-chip::before { margin-right: 5px; }
  .cl-selects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 6px; }
  .cl-select span { font-size: .68rem; }
  .cl-select select { height: 38px; padding: 0 22px 0 8px; font-size: .84rem; background-position: right 8px center; }
  .cl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .cl-name { font-size: .72rem; }
  .cl-more > summary {
    display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 12px;
    border: 1px solid rgba(255,255,255,.16); background: var(--ink); color: var(--paper); font-size: .86rem; cursor: pointer; list-style: none;
  }
  .cl-more > summary::-webkit-details-marker { display: none; }
  .cl-more > summary::after { content: "＋"; color: var(--gold); }
  .cl-more[open] > summary::after { content: "－"; }
  .cl-more-n { margin-left: auto; margin-right: 10px; padding: 0 8px; border: 1px solid var(--gold); color: var(--gold-pale); font-size: .76rem; line-height: 1.6; font-variant-numeric: tabular-nums; }
  .cl-more[open] .cl-selects { margin-top: 10px; }
  .cd-main { padding-top: 92px; }
  /* 属性・数値は、見出しの下に値を置くマスを2列に並べる（長い見出しで値が画面の中ほどから始まらないように） */
  .cd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; border-top: 0; }
  .cd-facts dt, .cd-facts dd { padding: 0; border: 0; }
  .cd-facts .cd-fact { display: grid; gap: 2px; min-width: 0; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .cd-facts .cd-fact dd { word-break: normal; overflow-wrap: anywhere; }
  .cd-facts .cd-fact dt { font-size: .74rem; }
  .cd-facts .cd-fact dd { font-size: .98rem; }
  .cd-nav { margin-top: 28px; }
  .card-detail .cl-footer { margin-top: 32px; }
  .cd-body { grid-template-columns: 1fr; gap: 24px; margin-top: 20px; }
  .cd-figure { width: 100%; max-width: 340px; margin: 0 auto; }
  .cd-nav a { min-height: 56px; padding: 8px 12px; font-size: .8rem; }
  .cd-nav .cd-list { padding-inline: 14px; }
}
@media (max-width: 380px) {
  .cl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .cl-tilt { transition: none; }
  .cl-sweep { display: none; }
}
