/* 全站の総合ランキング（/ranking/）。設計稿「全站排行榜设计方案」1a（PC）／ 1b（手機）の実値。
   読み物の頁なので遊技頁の縮め方（--scale）は使わない。最大幅 ＋ 格子で並べ、900px 未満は 1 列（layout.css の境目と同じ）。
   色は tokens.css の名前で持つ（設計稿の #F6E7C6 ＝ --soft、#EADFC8 ＝ --dash、#C05A2E ＝ --accent …）*/

.hub { max-width: 1100px; margin: 0 auto; padding: 16px 16px 48px; }

/* ---------- 見出しの行 ---------- */
.hub-title-row { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.hub-h1 {
  margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 4px 15px 4px 11px;
  background: var(--surface); border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill); box-shadow: 0 2px 0 var(--stroke);
  font-size: 18px; font-weight: 900; white-space: nowrap;
}
.hub-h1 i { display: inline-block; width: 4px; height: 18px; border-radius: var(--radius-pill); background: var(--brand-red); }
.hub-chip { padding: 2px 12px; background: var(--soft); border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; }
.hub-pico-sm { display: none; margin-left: auto; }
.hub-periods { margin-left: auto; display: flex; gap: 6px; }
.hub-periods button {
  padding: 4px 16px; border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.hub-periods button[aria-selected="true"] { background: var(--ink); color: var(--surface); }

/* ---------- 札（板の見出しの丸ピル。カードの縁に掛ける）---------- */
.hub-tag {
  position: absolute; top: -14px; left: 18px; z-index: 1; padding: 3px 16px;
  background: var(--tone, var(--soft)); color: var(--tone-ink, var(--ink));
  border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 900; line-height: 1.6; white-space: nowrap;
}
.hub-tag.is-total { --tone: var(--brand-red); --tone-ink: var(--surface); letter-spacing: 2px; }
.hub-tag.is-grade { --tone: var(--mino-t); }
.hub-tag.is-first { --tone: var(--gold); }
.hub-narrow { display: none; }

/* ---------- 上段：総合 ＋ 右の柱 ---------- */
/* 総合と右の柱は同じ高さに（stretch）。総合の行の数は ranking.js の fitTotal が柱に合わせて増やし、残りは白い面が伸びて受ける */
.hub-top { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 22px; align-items: stretch; margin-top: 64px; }
.hub-total {
  position: relative; display: flex; flex-direction: column; padding: 30px 18px 18px;
  background: var(--soft); border: var(--stroke-w) solid var(--stroke); border-radius: 24px; box-shadow: 0 6px 0 var(--stroke);
}
/* ピコは板の右上に載る（設計稿 1a）。吹き出しは板から上へはみ出す */
.hub-pico { position: absolute; top: -70px; right: 10px; z-index: 3; display: flex; align-items: flex-end; gap: 8px; pointer-events: none; }
.hub-pico svg { display: block; animation: hub-bob 2.6s ease-in-out infinite; }
.hub-bubble {
  margin: 0 0 6px; padding: 6px 12px; white-space: nowrap;
  background: var(--surface); border: var(--stroke-w) solid var(--stroke); border-radius: 14px 14px 2px 14px;
  box-shadow: 0 3px 0 rgb(74 56 38 / .3); font-size: 12px; font-weight: 800; line-height: 1.6;
}
.hub-bubble:empty { display: none; }
@keyframes hub-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .hub-pico svg { animation: none; } }

.hub-total-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; padding: 0 6px; }
.hub-total-title { font-size: 20px; font-weight: 900; }
.hub-total-rule { flex-basis: 100%; font-size: 12px; font-weight: 700; line-height: 1.6; color: var(--muted); }
.hub-count { flex: none; font-size: 11px; font-weight: 800; color: var(--muted); white-space: nowrap; }

.hub-list { flex: 1; padding: 8px 10px; background: var(--surface); border: var(--stroke-w) solid var(--stroke); border-radius: 18px; }
.hub-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 150px 90px; align-items: center; gap: 12px;
  min-height: 48px; padding: 0 8px; border-radius: 10px; border-bottom: 1px dashed var(--dash);
}
.hub-row:last-child { border-bottom: 0; }
.hub-row.is-you { background: rgb(217 91 67 / .1); }
.hub-row.is-pinned { margin-top: 6px; border-top: 1px dashed #C8B89A; }
.hub-pill {
  display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px;
  background: var(--medal, var(--surface)); border: var(--stroke-w) solid var(--stroke); border-radius: 13px;
  font-size: 13px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}
.hub-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 800; color: var(--sub); }
.hub-you {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; vertical-align: 2px;
  background: var(--accent); color: var(--surface); font-size: 9.5px; font-style: normal; font-weight: 700; letter-spacing: .5px;
}
.hub-gap { margin-left: 8px; font-size: 11px; font-weight: 800; color: var(--accent); }
.hub-dots { display: flex; gap: 4px; }
.hub-dots i { width: 18px; height: 18px; border-radius: 5px; border: var(--stroke-w) solid var(--stroke); background: var(--dot); }
.hub-dots i.is-off { background: var(--surface); border-style: dashed; border-color: #C8B89A; }
.hub-pt { text-align: right; font-family: 'Share Tech Mono', ui-monospace, monospace; font-weight: 400; font-size: 20px; color: var(--ink); }
.hub-row.is-you .hub-pt { color: var(--accent); }
.hub-pt small { margin-left: 3px; font-family: 'Zen Maru Gothic', sans-serif; font-size: 10px; font-weight: 800; color: var(--muted); }
.hub-empty { margin: 0; padding: 18px 0; text-align: center; font-size: 12px; font-weight: 700; line-height: 1.9; color: var(--muted); }
.hub-retry { margin-top: 6px; padding: 4px 14px; border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill); background: var(--soft); font: inherit; font-weight: 900; cursor: pointer; }
.hub-total-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 0 6px; }
.hub-legend { font-size: 11.5px; font-weight: 800; color: var(--muted); }
.hub-more {
  flex: none; padding: 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 800; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}

.hub-side { display: flex; flex-direction: column; gap: 26px; }
.hub-card {
  position: relative; padding: 26px 16px 14px;
  background: var(--surface); border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-card); box-shadow: var(--shadow-solid);
}
.hub-grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hub-grade {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px 8px; min-width: 0;
  border: var(--stroke-w) solid var(--stroke); border-radius: 14px; background: var(--surface);
}
.hub-grade.is-none, .hub-grade.is-goal { border-style: dashed; border-color: #C8B89A; }
.hub-medal {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-pill);
  border: var(--stroke-w) solid var(--stroke); background: var(--medal); font-size: 12px; font-weight: 900;
}
/* まだの段は目標として薄く。段の無い板（対戦）は丸を描かない —— 空の丸は頭像の空き枠に見えた */
.hub-grade.is-goal .hub-medal { opacity: .45; border-style: dashed; }
.hub-grade.is-none .hub-medal { display: none; }
.hub-grade b { font-size: 11px; font-weight: 800; color: var(--sub); white-space: nowrap; }
.hub-grade small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 9.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.hub-small { margin: 10px 0 0; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.hub-first-note { margin: 0 0 10px; font-size: 12px; font-weight: 700; line-height: 1.7; color: var(--sub); }
.hub-first { display: flex; flex-direction: column; gap: 8px; }
.hub-first-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px;
  background: var(--surface); color: var(--ink); border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill);
  box-shadow: 0 3px 0 var(--stroke); font-size: 13px; font-weight: 900; text-decoration: none;
}
.hub-first-link.is-main { background: var(--cta); color: var(--surface); }
.hub-first-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.hub-first-link.is-main .hub-first-count { color: var(--surface); }

/* ---------- 下段：板ごと ---------- */
.hub-boards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 22px; margin-top: 48px; }
.hub-board {
  position: relative; display: flex; flex-direction: column; padding: 24px 14px 12px;
  background: var(--surface); border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-card); box-shadow: var(--shadow-solid);
}
.hub-board-link { display: none; }
.hub-board-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 6px; font-size: 10.5px; font-weight: 800; color: var(--muted); }
.hub-board-rows { flex: 1; }
.hub-board-row {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px;
  border-radius: 8px; border-bottom: 1px dashed var(--dash);
}
.hub-board-row.is-you { background: rgb(217 91 67 / .1); }
.hub-board-row.is-pinned { margin-top: 6px; border-top: 1px dashed var(--dash); }
.hub-board-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--sub); }
.hub-board-row > b { font-size: 14px; font-weight: 800; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hub-board-row.is-you > b { color: var(--accent); }
.hub-pill.is-small { min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; font-size: 12px; }
.hub-board-empty { margin: 0; padding: 12px 0; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.9; color: var(--muted); }
.hub-board-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 0 4px; }
.hub-board-foot .hub-gap { margin: 0; font-size: 11.5px; }
.hub-play {
  flex: none; padding: 5px 14px; background: var(--soft); color: var(--ink);
  border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill); box-shadow: 0 2px 0 var(--stroke);
  font-size: 11.5px; font-weight: 900; text-decoration: none;
}
.hub-board-brief { display: none; }
.hub-note { margin: 28px 0 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }

/* 手機の自分の札（設計稿 1b）。PC では出さない */
.hub-me { display: none; }

/* ---------- 900px 未満：1 列（設計稿 1b）---------- */
@media (max-width: 900px) {
  .hub { padding: 12px 16px 32px; }
  .hub-h1 { font-size: 16px; padding: 3px 13px 3px 10px; }
  .hub-h1 i { height: 16px; }
  .hub-chip { display: none; }
  .hub-pico-sm { display: block; }
  .hub-periods { flex-basis: 100%; margin-left: 0; gap: 5px; }
  .hub-periods button { flex: 1; padding: 5px 0; font-size: 12px; }

  .hub-me:not([hidden]) {
    position: relative; display: block; margin-top: 22px; padding: 24px 14px 14px;
    background: var(--soft); border: var(--stroke-w) solid var(--stroke); border-radius: 20px; box-shadow: 0 5px 0 var(--stroke);
  }
  .hub-me .hub-tag { font-size: 12px; padding: 3px 14px; left: 16px; }
  .hub-me-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
  .hub-me-label { display: block; font-size: 11px; font-weight: 800; color: var(--muted); }
  .hub-me-rank { display: block; font-family: 'Share Tech Mono', ui-monospace, monospace; font-weight: 400; font-size: 44px; line-height: 1; }
  .hub-me-rank small, .hub-me-pt small { margin-left: 3px; font-family: 'Zen Maru Gothic', sans-serif; font-size: 14px; font-weight: 900; }
  .hub-me-side { text-align: right; }
  .hub-me-pt { display: block; font-family: 'Share Tech Mono', ui-monospace, monospace; font-weight: 400; font-size: 24px; line-height: 1; color: var(--accent); }
  .hub-me-pt small { font-size: 10px; font-weight: 800; color: var(--muted); }
  .hub-me-gap { display: block; margin-top: 4px; font-size: 11px; font-weight: 800; color: var(--accent); }
  .hub-grade-minis { display: flex; gap: 6px; margin-top: 12px; }
  .hub-grade-mini {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
    background: var(--surface); border: var(--stroke-w) solid var(--stroke); border-radius: 10px;
  }
  .hub-grade-mini.is-none, .hub-grade-mini.is-goal { border-style: dashed; border-color: #C8B89A; }
  .hub-grade-mini b { font-size: 10px; font-weight: 900; }
  .hub-grade-mini.is-none b, .hub-grade-mini.is-goal b { color: var(--faint); }
  .hub-grade-mini small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 8px; font-weight: 800; color: var(--muted); white-space: nowrap; }
  .hub-cta:not([hidden]) {
    display: flex; align-items: center; justify-content: center; margin-top: 12px; padding: 9px 12px;
    background: var(--cta); color: var(--surface); border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill);
    box-shadow: 0 3px 0 var(--stroke); font-size: 13px; font-weight: 900; text-align: center; text-decoration: none; text-wrap: balance;
  }

  /* 総合は「上位 5 人」の白い札に畳む。ピコ・決まりの説明・色の凡例は自分の札と見出しの行が受け持つ */
  .hub-top { display: block; margin-top: 22px; }
  .hub-total { padding: 20px 10px 8px; background: var(--surface); border-radius: 16px; box-shadow: 0 3px 0 var(--stroke); }
  .hub-total .hub-tag { --tone: var(--gold); --tone-ink: var(--ink); top: -13px; left: 14px; padding: 2px 12px; font-size: 11.5px; letter-spacing: 0; }
  .hub-wide, .hub-pico, .hub-total-head, .hub-total-foot { display: none; }
  .hub-narrow { display: inline; }
  .hub-list { padding: 0; border: 0; }
  .hub-row { grid-template-columns: 22px minmax(0, 1fr) auto 52px; gap: 10px; min-height: 42px; padding: 0 6px; }
  .hub-row .hub-pill { min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; font-size: 12px; }
  .hub-name { font-size: 13.5px; }
  .hub-row .hub-gap { display: none; }
  .hub-dots { gap: 3px; }
  .hub-dots i { width: 12px; height: 12px; border-radius: 3px; border-width: 1.5px; }
  .hub-pt { font-size: 17px; }
  .hub-pt small { display: none; }
  .hub-side { display: none; }

  /* 板ごとは畳んで、1 位と自分だけ。札全体が「あそぶ」へのリンク */
  /* ⚠ 1fr ではなく minmax(0, 1fr)。1fr の下限は中身の幅なので、1 位の名前が長い（10 字）と
     折り返さない「1 位 名前 記録」の幅まで列が広がり、頁ごと横に流れる（2026-09-19 審査で発見）*/
  .hub-boards { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 22px; }
  .hub-board { flex-direction: row; align-items: center; gap: 10px; padding: 10px 30px 10px 12px; border-radius: 14px; box-shadow: 0 3px 0 var(--stroke); }
  .hub-board .hub-tag { position: static; flex: none; padding: 2px 10px; font-size: 11px; }
  .hub-board-meta, .hub-board-rows, .hub-board-foot { display: none; }
  .hub-board-brief { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; margin: 0; }
  .hub-board-brief b { display: flex; gap: .7em; min-width: 0; white-space: nowrap; font-size: 12.5px; font-weight: 800; color: var(--sub); }
  .hub-brief-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .hub-brief-value { flex: none; font-variant-numeric: tabular-nums; }
  .hub-board-brief small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 800; color: var(--accent); }
  .hub-board-link { display: block; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
  .hub-board::after {
    content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -4px;
    border-right: 1.7px solid var(--muted); border-bottom: 1.7px solid var(--muted); rotate: -45deg;
  }
  .hub-note { margin-top: 20px; }
}
