/* ===== トップページ スナップセクション共通 ===== */

/* セクションヘッダ */
.snap-section-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.snap-section-title {
  margin: 0; font-size: 20px; font-weight: 800; color: var(--text);
  padding-left: 14px; position: relative;
}
.snap-section-title::before {
  content: ""; position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 75%; min-height: 14px; max-height: 20px;
  background: var(--accent); border-radius: 99px;
}
/* season-suffix: JS で折り返し検出時のみ非表示にする */
.snap-section-updated { font-size: 13px; color: var(--muted); font-weight: 650; margin-left: 2px; white-space: nowrap; }

/* セクションリンク行 */
.snap-links-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; margin-bottom: 16px; }
.snap-section-link {
  font-size: 14px; color: var(--accent); font-weight: 750;
  text-decoration: none; white-space: nowrap;
  display: inline-block; margin-top: 12px;
}
.snap-section-link:hover { text-decoration: underline; }

/* 副見出し */
.subsect-title {
  font-size: 12px; font-weight: 800; color: var(--muted);
  margin: 0 0 12px; letter-spacing: 0.6px; text-transform: uppercase;
}
.subsect-note { font-size: 11px; font-weight: 650; color: var(--muted); margin-left: 4px; }
.snap-loading { padding: 24px 0; color: var(--muted); font-size: 14px; font-weight: 650; }
.snap-error   { padding: 8px 0;  color: var(--danger);      font-size: 14px; font-weight: 650; }

/* セクション区切り */
.env-section, .featured-section, .card-ranking-section {
  border-top: 1px solid var(--line);
  padding-top: 32px;
  margin: 0 0 52px;
}
.tier-snapshot {
  padding-top: 32px;
  margin: 0 0 52px;
}

/* ===== Tier Snapshot ===== */
.tier-rows { display: flex; flex-direction: column; gap: 16px; }
.tier-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tier-num { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; line-height: 1; min-width: 1.2em; flex-shrink: 0; }
.tier-count-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; border: 1px solid; letter-spacing: 0.04em; flex-shrink: 0; line-height: 20px; }
.tier-divider { flex: 1; height: 1px; }
.tier-col-1 .tier-num { color: var(--tier-1); }
.tier-col-1 .tier-count-chip { color: var(--tier-1); border-color: rgba(var(--tier-1-rgb),0.3); background: rgba(var(--tier-1-rgb),0.08); }
.tier-col-1 .tier-divider { background: linear-gradient(90deg, rgba(var(--tier-1-rgb),0.4), transparent); }
.tier-col-2 .tier-num { color: var(--tier-2); }
.tier-col-2 .tier-count-chip { color: var(--tier-2); border-color: rgba(var(--tier-2-rgb),0.3); background: rgba(var(--tier-2-rgb),0.08); }
.tier-col-2 .tier-divider { background: linear-gradient(90deg, rgba(var(--tier-2-rgb),0.4), transparent); }
.tier-snap-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.tier-more-badge {
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font-size: 13px; font-weight: 800; color: var(--muted);
  height: 60px; white-space: nowrap; flex-shrink: 0;
}

/* Tier カードスタイル */
.tier-item {
  --tier-bg-width: 50%;
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr; gap: 2px;
  padding: 7px 10px 5px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(11,24,38,0.65);
  height: 60px; width: 299px; max-width: 100%;
  box-shadow: 0 10px 22px rgba(0,0,0,0.28);
  color: var(--text); flex-shrink: 0;
  box-sizing: border-box;
}
.tier-item.linkable {
  cursor: pointer; text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  will-change: transform;
}
.tier-item.linkable:hover {
  transform: translateY(-2px) scale(1.012);
  box-shadow: 0 16px 30px rgba(0,0,0,0.28);
  background: rgba(255,255,255,0.04);
}
.tier-item[data-class-id="ELF"]       { border-color: rgba(34,197,94,0.38); }
.tier-item[data-class-id="ROYAL"]     { border-color: rgba(245,158,11,0.38); }
.tier-item[data-class-id="WITCH"]     { border-color: rgba(168,85,247,0.38); }
.tier-item[data-class-id="DRAGON"]    { border-color: rgba(239,68,68,0.38); }
.tier-item[data-class-id="NIGHTMARE"] { border-color: rgba(236,72,153,0.38); }
.tier-item[data-class-id="BISHOP"]    { border-color: rgba(234,179,8,0.38); }
.tier-item[data-class-id="NEMESIS"]   { border-color: rgba(6,182,212,0.38); }
.tier-item.linkable[data-class-id="ELF"]:hover       { border-color: rgba(34,197,94,0.64); }
.tier-item.linkable[data-class-id="ROYAL"]:hover     { border-color: rgba(245,158,11,0.64); }
.tier-item.linkable[data-class-id="WITCH"]:hover     { border-color: rgba(168,85,247,0.64); }
.tier-item.linkable[data-class-id="DRAGON"]:hover    { border-color: rgba(239,68,68,0.64); }
.tier-item.linkable[data-class-id="NIGHTMARE"]:hover { border-color: rgba(236,72,153,0.64); }
.tier-item.linkable[data-class-id="BISHOP"]:hover    { border-color: rgba(234,179,8,0.64); }
.tier-item.linkable[data-class-id="NEMESIS"]:hover   { border-color: rgba(6,182,212,0.64); }
.tier-link-icon {
  position: absolute; top: 7px; right: 8px; z-index: 3;
  font-size: 14px; font-weight: 900; color: rgba(234,247,255,0.92);
  opacity: 0; transform: translateY(2px);
  transition: opacity 0.16s ease, transform 0.16s ease; pointer-events: none;
}
.tier-item.linkable:hover .tier-link-icon { opacity: 1; transform: translateY(0); }
.tier-item .content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  background: transparent;
}
.tier-row1 {
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  align-items: center; column-gap: 12px;
  padding-top: 2px;
  width: calc(100% - var(--tier-bg-width) + 40px);
}
.tier-row1 .title {
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 0; flex: 1 1 auto; overflow: hidden;
}
.tier-row1 .class-chip { font-size: 22px; line-height: 1.15; }
.tier-row1 .tier-score {
  font-size: 22px; font-weight: 900; color: var(--text);
  white-space: nowrap; font-variant-numeric: tabular-nums;
  position: relative; z-index: 2;
}
.tier-row2 { color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap; width: 100%; }
.tier-symbol-bg {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: var(--tier-bg-width); z-index: 1; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.10) 3%, rgba(0,0,0,0.30) 6%, rgba(0,0,0,0.65) 9%, rgba(0,0,0,0.90) 12%, #000 16%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.10) 3%, rgba(0,0,0,0.30) 6%, rgba(0,0,0,0.65) 9%, rgba(0,0,0,0.90) 12%, #000 16%, #000 100%);
}
.tier-symbol-bg img {
  position: absolute; right: 0; top: 0;
  height: 100%; width: auto; max-width: none;
  object-position: right center; display: block; opacity: 0.95;
}
.tier-symbol-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,24,38,0.90) 0%, rgba(11,24,38,0.55) 55%, rgba(11,24,38,0.0) 100%);
  opacity: 0.55;
}
.class-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: 0.2px; }
.class-chip img { width: 24px; height: 24px; object-fit: contain; border-radius: 50%; }
.class-chip .chip-text {
  max-width: 140px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; display: inline-block;
}
.tier-item[data-name-long="1"] .tier-row1 .class-chip .chip-text { font-size: 18px; letter-spacing: 0; }
@media (max-width: 500px) {
  .tier-row1 .tier-score { font-size: 18px; }
}

/* ===== 環境分布セクション ===== */
.env-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 36px;
  align-items: start;
}
@media (max-width: 860px) {
  .env-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .env-grid { grid-template-columns: 1fr; }
}

/* 円グラフ */
.pie-wrap { width: 100%; max-width: 240px; margin: 0 auto; }
.pie-wrap svg { display: block; overflow: visible; }
.pie-tooltip {
  position: fixed; z-index: 200;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px;
  font-size: 13px; font-weight: 650; color: var(--text);
  pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity 0.12s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.pie-tooltip.visible { opacity: 1; }
.pie-slice { transition: transform 0.18s ease; cursor: pointer; }

/* archetype-mini-cell（app.css と同様だがトップ用に値を調整） */
.archetype-mini-cell {
  --arch-thumb-w: 100px;
  position: relative; display: flex; align-items: stretch;
  min-height: 36px; overflow: hidden; padding: 0;
  border: 0; background: transparent; min-width: 0; height: 100%;
}
.archetype-mini-cell .info {
  /* width 制約なし: thumb と重なることでフェード効果が生きる */
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 36px;
  padding-left: 4px; padding-right: 10px;
}
.archetype-mini-cell .name {
  font-size: 15px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 160px;
  text-shadow: -1px 0 rgba(13,15,20,0.92), 1px 0 rgba(13,15,20,0.92),
               0 -1px rgba(13,15,20,0.92), 0 1px rgba(13,15,20,0.92);
}
.archetype-mini-cell .thumb {
  position: absolute; inset: 0 0 0 auto;
  width: var(--arch-thumb-w);
  display: block; overflow: hidden; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.30) 8%, rgba(0,0,0,0.70) 16%, #000 24%, #000 100%);
  mask-image: linear-gradient(to right, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.30) 8%, rgba(0,0,0,0.70) 16%, #000 24%, #000 100%);
}
.archetype-mini-cell .thumb img {
  position: absolute; right: 0; top: 0;
  width: auto; height: 100%; display: block;
}

/* 行ホバー */
.matchup-row, .mulligan-row, .rising-row {
  transition: background 0.15s ease;
}
.matchup-row:hover, .mulligan-row:hover, .rising-row:hover {
  background: rgba(38,32,18,0.98);
}

/* ===== 急上昇ランキング ===== */
.rising-rows { display: flex; flex-direction: column; gap: 4px; }
.rising-row {
  display: flex; align-items: center; gap: 10px;
  height: 44px; overflow: hidden;
  padding: 0 4px;
  transition: background 0.15s ease, padding-left 0.15s;
}
.rising-row:hover { padding-left: 8px; } /* デフォルト 4px → +4px */
.rising-mini-cell { flex: 1; min-width: 0; height: 44px; }
/* 急上昇行: 縦長画像対応 */
.rising-mini-cell .archetype-mini-cell .thumb img {
  position: absolute; right: 0; top: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: right center;
}
.rising-name-block { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rising-tier-badge { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; line-height: 1; }
.rising-rank-badge {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1;
}
.rising-rank-badge img { width: 28px; height: 28px; object-fit: contain; }
.rising-rank-badge.rN { color: var(--muted); font-size: 13px; font-weight: 900; }
.rising-stats { flex-shrink: 0; text-align: center; min-width: 64px; }
.rising-diff  { font-size: 18px; font-weight: 900; color: var(--success); white-space: nowrap; line-height: 1; }
.rising-appear { font-size: 11px; color: var(--muted); white-space: nowrap; margin-top: 2px; }

/* ===== T1特集セクション ===== */
.featured-arch-meta { font-size: 13px; color: var(--muted); font-weight: 650; }
.featured-arch-meta span { color: var(--accent); font-weight: 750; }
.featured-title-icon { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; margin-right: 4px; }
.featured-note { margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 650; }
/* ローテーション */
.featured-content { transition: opacity 0.35s ease; }
.featured-content.fading { opacity: 0; }
.featured-dots { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.featured-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line); border: none; padding: 0; cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.featured-dot.active { background: var(--accent); transform: scale(1.25); }
.featured-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start;
}
@media (max-width: 640px) {
  .featured-grid { grid-template-columns: 1fr; gap: 28px; }
  .matchup-games { display: none; }
  .matchup-class-label { width: 64px; font-size: 13px; }
  .matchup-wr { width: 40px; font-size: 13px; }
  .mulligan-bar-wrap { display: none; }
}

/* マッチアップ行 */
.matchup-rows { display: flex; flex-direction: column; gap: 8px; }
.matchup-row { display: flex; align-items: center; gap: 10px; height: 28px; }
/* クラスセルのみ transform スライド */
.matchup-class-cell { display: flex; align-items: center; gap: 10px; flex-shrink: 0; transition: transform 0.15s; }
.matchup-row:hover .matchup-class-cell { transform: translateX(4px); }
.matchup-class-icon { width: 22px; height: 22px; flex-shrink: 0; object-fit: contain; }
.matchup-class-label {
  font-size: 14px; font-weight: 700; color: var(--text);
  width: 80px; flex-shrink: 0; white-space: nowrap;
}
.matchup-bar-wrap {
  flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden;
}
.matchup-bar { height: 100%; border-radius: 99px; transition: width 0.3s ease; }
.matchup-bar.win  { background: rgba(34,197,94,0.7); }
.matchup-bar.even { background: rgba(148,163,184,0.6); }
.matchup-bar.lose { background: rgba(239,68,68,0.65); }
.matchup-wr {
  font-size: 14px; font-weight: 750; width: 44px; text-align: center; flex-shrink: 0;
}
.matchup-wr.win  { color: var(--success); }
.matchup-wr.even { color: var(--muted); }
.matchup-wr.lose { color: var(--danger); }
.matchup-games { font-size: 11px; color: var(--muted); font-weight: 650; width: 32px; text-align: right; }

/* マリガン行 */
.mulligan-rows { display: flex; flex-direction: column; gap: 6px; }
.mulligan-row {
  display: flex; align-items: center; gap: 10px;
  height: 44px; overflow: hidden; padding: 0 4px;
}
.mulligan-mini-cell { flex: 1; min-width: 0; height: 44px; }
/* ランクバッジと名前テキストのみ transform スライド（サムネは固定） */
.mulligan-row .rising-rank-badge { transition: transform 0.15s; }
.mulligan-row:hover .rising-rank-badge { transform: translateX(4px); }
.mulligan-mini-cell .archetype-mini-cell .info { transition: transform 0.15s; }
.mulligan-row:hover .mulligan-mini-cell .archetype-mini-cell .info { transform: translateX(4px); }
/* 縦長カード画像対応 */
.mulligan-mini-cell .archetype-mini-cell .name { max-width: 220px; }
.mulligan-mini-cell .archetype-mini-cell .thumb {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.35) 20%, rgba(0,0,0,0.75) 40%, #000 55%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.35) 20%, rgba(0,0,0,0.75) 40%, #000 55%, #000 100%);
}
.mulligan-mini-cell .archetype-mini-cell .thumb img {
  position: absolute; right: 0; top: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: right center;
}
.mulligan-bar-wrap {
  width: 72px; height: 8px; background: var(--line);
  border-radius: 99px; overflow: hidden; flex-shrink: 0;
}
.mulligan-bar { height: 100%; border-radius: 99px; transition: width 0.3s ease; }
.mulligan-bar.win  { background: rgba(34,197,94,0.7); }
.mulligan-bar.even { background: rgba(var(--accent-rgb),0.65); }
.mulligan-bar.lose { background: rgba(239,68,68,0.65); }
.mulligan-rate {
  font-size: 14px; font-weight: 750; width: 44px; text-align: center; flex-shrink: 0;
}
.mulligan-rate.win  { color: var(--success); }
.mulligan-rate.even { color: var(--accent); }
.mulligan-rate.lose { color: var(--danger); }

/* ===== よく使われるカードランキング ===== */
.card-ranking-list { display: flex; flex-wrap: wrap; gap: 10px; }
.card-ranking-item {
  flex: 1 1 110px; min-width: 90px;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 8px; text-decoration: none; color: var(--text); gap: 7px;
}
.card-ranking-item:hover { background: rgba(38,32,18,0.98); text-decoration: none; }
.card-rank-badge {
  align-self: flex-start; font-size: 11px; font-weight: 900; color: var(--muted);
  background: var(--line); border-radius: 6px; padding: 1px 6px; line-height: 1.6;
}
.card-rank-badge.gold   { background: rgba(var(--tier-1-rgb),0.25); color: var(--tier-1); }
.card-rank-badge.silver { background: rgba(148,163,184,0.2); color: #94a3b8; }
.card-rank-badge.bronze { background: rgba(160,120,90,0.2);  color: #a0785a; }
.card-thumb {
  width: 100%; aspect-ratio: 1; object-fit: contain;
}
.card-thumb-placeholder {
  width: 72px; height: 72px; border-radius: 8px; background: var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--muted);
}
.card-rank-name {
  font-size: 12px; font-weight: 750; color: var(--text);
  text-align: center; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; width: 100%;
}
.card-rank-count { font-size: 12px; font-weight: 750; color: var(--muted); white-space: nowrap; }
