/* ブロスタのサイト：見た目の決まり。
   - 色は役割の名前（--surface・--ink など）で使い、明るい／暗いの切り替えは1か所で行う
   - 奥行き：重ねた影と上の縁の光で、カードが浮いて見えるようにする。動きは控えめにし、動きを減らす設定では止める
   - グラフの色（勝率の高低）は skill dataviz の検証を通した段（明るい背景・暗い背景で別の段）
   - 携帯の幅を先に作る。操作できるものは44px以上。入力は16px以上（拡大の防止）。拡大の禁止はしない */

:root {
  color-scheme: light;
  --page: #f3f5fb;
  --page-glow-1: rgba(61, 139, 255, 0.16);
  --page-glow-2: rgba(255, 201, 60, 0.18);
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --card-edge: rgba(20, 33, 61, 0.08);
  --card-light: rgba(255, 255, 255, 0.9);
  --shadow: 0 1px 2px rgba(20, 33, 61, 0.06), 0 8px 24px rgba(20, 33, 61, 0.08);
  --shadow-lift: 0 2px 4px rgba(20, 33, 61, 0.08), 0 18px 40px rgba(20, 33, 61, 0.16);
  --ink: #101828;
  --ink-2: #475467;
  --muted: #8a93a6;
  --line: #e4e8f0;
  --axis: #c6ccd8;
  --link: #1d4ed8;
  --accent: #ffc93c;
  --accent-ink: #1a1300;
  --header: #0b1022;
  --header-ink: #e7ecf7;
  --warn-bg: #fff5d6;
  --warn-line: #f0c75e;
  /* ティア（順序のある段・金の1色）*/
  --tier-S: #e09b00; --tier-A: #f2b632; --tier-B: #f6cf76; --tier-C: #cfd5e1; --tier-D: #a7afbf;
  --tier-ink: #1a1300;
  /* 勝率の高低（50%＝灰色、上＝青、下＝赤）明るい背景用 */
  --hc-0: #eef0f4;
  --hc-p1: #86b6ef; --hc-p2: #5598e7; --hc-p3: #2a78d6; --hc-p4: #184f95;
  --hc-m1: #ec8686; --hc-m2: #e05a5a; --hc-m3: #c93636; --hc-m4: #982020;
  --series: #2a78d6;
  --radius: 18px;
  --radius-sm: 12px;
  --tap: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0b1022;
    --page-glow-1: rgba(61, 139, 255, 0.22);
    --page-glow-2: rgba(214, 74, 255, 0.14);
    --surface: #141b2e;
    --surface-2: #1a2238;
    --card-edge: rgba(255, 255, 255, 0.08);
    --card-light: rgba(255, 255, 255, 0.07);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.45), 0 22px 48px rgba(0, 0, 0, 0.5);
    --ink: #eef2fb;
    --ink-2: #b2bdd3;
    --muted: #7c879e;
    --line: #26304a;
    --axis: #3a4562;
    --link: #8ab4ff;
    --header: #070b18;
    --warn-bg: #3a3014;
    --warn-line: #8a6d1f;
    --tier-C: #c3c9d6; --tier-D: #8e97aa;
    --hc-0: #2b3348;
    --hc-p1: #b7d3f6; --hc-p2: #86b6ef; --hc-p3: #3987e5; --hc-p4: #1c5cab;
    --hc-m1: #f5b3b3; --hc-m2: #ee8a8a; --hc-m3: #e34948; --hc-m4: #b52b2b;
    --series: #3987e5;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 10% -10%, var(--page-glow-1), transparent 60%),
    radial-gradient(800px 480px at 95% 0%, var(--page-glow-2), transparent 60%),
    var(--page);
  background-attachment: fixed;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--link); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 30; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ico { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }

/* ---- 見出しの帯 ---- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--header) 88%, transparent); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; padding-top: 6px; padding-bottom: 6px; }
.brand { color: #fff; font-weight: 800; letter-spacing: 0.02em; text-decoration: none; min-height: var(--tap); display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #ffd85c, #ff9f1c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 4px 10px rgba(255, 170, 30, 0.35); transform: rotate(-8deg); }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.site-nav a { color: var(--header-ink); text-decoration: none; min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 12px; font-weight: 600; font-size: 15px; }
.site-nav a:hover { background: rgba(255, 255, 255, 0.08); }
.site-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15); }
@media (max-width: 599px) {
  .site-nav { margin-left: 0; width: 100%; gap: 4px; }
  .site-nav a { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 1px; padding: 4px 2px; font-size: 11px; line-height: 1.2; white-space: nowrap; min-height: 48px; }
  .site-nav a .ico { width: 20px; height: 20px; }
}
.notice-mock { background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); font-size: 14px; padding: 8px 0; color: var(--ink); }

main { padding-top: 18px; padding-bottom: 40px; }

/* ---- ヒーロー（ページの頭） ---- */
.hero { padding: 6px 0 10px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2); }
h1 { font-size: clamp(23px, 4.6vw, 34px); line-height: 1.3; margin: 4px 0 6px; letter-spacing: 0.01em; text-wrap: balance; word-break: auto-phrase; }
h2 { font-size: 19px; margin: 0; }
.lead { margin: 0 0 12px; color: var(--ink-2); }
.sub, .fresh { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 4px; }
.kpis-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .kpis-4 { grid-template-columns: repeat(4, 1fr); } }
.kpi { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); background: linear-gradient(180deg, var(--card-light), transparent 60%), var(--surface); border: 1px solid var(--card-edge); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.kpi .k { font-size: 13px; color: var(--ink-2); }
.kpi .v { font-size: 26px; font-weight: 800; line-height: 1.2; }
.kpi .v-sm { font-size: 17px; }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi-top-row { display: flex; align-items: center; gap: 10px; }
@media (max-width: 599px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi-top { grid-column: 1 / -1; } }

/* ---- 絞り込み（1列・上にまとめる） ---- */
.filters { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 16px; }
.seg { display: inline-flex; align-self: flex-start; background: var(--surface); border: 1px solid var(--card-edge); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.seg a { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; }
.seg a[aria-current="page"] { background: var(--ink); color: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 10px; border: 1px solid var(--card-edge); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 600; box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.chip[aria-current="page"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.chip-badge { width: 20px; height: 30px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25)); }
.chip-ico { width: 18px; height: 18px; fill: #e0a400; }

/* ---- カード ---- */
.card { position: relative; margin: 0 0 16px; padding: 16px; border-radius: var(--radius); background: linear-gradient(180deg, var(--card-light), transparent 42%), var(--surface); border: 1px solid var(--card-edge); box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 12px; }
.card-sub { margin: 0; font-size: 13px; color: var(--ink-2); }
.empty { padding: 16px; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--card-edge); }

/* ---- ティア表 ---- */
.tier-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.tier-row:first-of-type { border-top: 0; padding-top: 0; }
.tier-label { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 6px; }
.tier-count { font-size: 12px; color: var(--muted); }
.tier { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; color: var(--tier-ink); font-weight: 900; font-size: 16px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.tier-row .tier { min-width: 42px; height: 42px; font-size: 22px; border-radius: 12px; }
.tier-S { background: var(--tier-S); } .tier-A { background: var(--tier-A); } .tier-B { background: var(--tier-B); } .tier-C { background: var(--tier-C); } .tier-D { background: var(--tier-D); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 14px; text-decoration: none; color: var(--ink); background: linear-gradient(180deg, var(--card-light), transparent 70%), var(--surface-2); border: 1px solid var(--card-edge); box-shadow: var(--shadow); transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0)); transition: transform 0.18s ease, box-shadow 0.18s ease; will-change: transform; }
.tile:hover { --lift: -3px; box-shadow: var(--shadow-lift); }
.tile-name { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.25; overflow-wrap: anywhere; }
.tile-wr { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 599px) {
  .tier-row { grid-template-columns: 1fr; gap: 6px; }
  .tier-label { flex-direction: row; gap: 8px; padding-top: 0; }
  .tier-row .tier { min-width: 34px; height: 34px; font-size: 18px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px; }
  .tile { padding: 6px 2px 5px; border-radius: 12px; gap: 2px; }
  .tile .av { width: 40px; height: 40px; }
  .tile-name { font-size: 10px; }
  .tile-wr { display: none; }
}

/* ---- キャラの顔 ---- */
.av { border-radius: 50%; flex: 0 0 auto; object-fit: cover; background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.35), transparent 60%), var(--surface-2); box-shadow: 0 0 0 2px var(--surface), 0 3px 8px rgba(0, 0, 0, 0.25); }
.av-letter { width: var(--size, 44px); height: var(--size, 44px); display: inline-flex; align-items: center; justify-content: center; background: var(--av, #cfd8e3); color: #14213d; font-weight: 900; font-size: calc(var(--size, 44px) * 0.42); }

/* ---- キャラのページの頭 ---- */
.crumbs { font-size: 14px; color: var(--ink-2); }
.crumbs a { display: inline-flex; min-height: var(--tap); align-items: center; }
.hero-brawler { display: flex; align-items: center; gap: 18px; }
.portrait { position: relative; display: grid; place-items: center; width: 132px; height: 132px; border-radius: 30px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rarity) 55%, transparent), transparent 70%), linear-gradient(160deg, color-mix(in srgb, var(--rarity) 40%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--rarity) 50%, transparent); box-shadow: 0 0 0 1px var(--card-edge), 0 16px 40px color-mix(in srgb, var(--rarity) 30%, transparent), var(--shadow); transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.2s ease; flex: 0 0 auto; }
.portrait .av { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); background: transparent; }
@media (max-width: 420px) { .portrait { width: 104px; height: 104px; border-radius: 24px; } .portrait .av { width: 84px; height: 84px; } }

/* ---- 表 ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px 8px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; font-weight: 800; padding: 4px 0 8px; }
.rank-table th, .rank-table td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rank-table thead th { font-size: 12px; color: var(--ink-2); font-weight: 700; text-align: left; white-space: nowrap; }
.rank-table thead th:nth-child(n+4) { text-align: right; }
.rank-table th[scope="row"] { text-align: left; font-weight: 700; }
.rank-table .col-ci { min-width: 120px; width: 28%; }
.rank-table thead th.col-ci { text-align: left; }
.who { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; min-height: 40px; }
.who:hover span { text-decoration: underline; }
.band-table { min-width: 560px; }
@media (max-width: 599px) {
  .rank-table { font-size: 14px; }
  .rank-table .col-ci { display: none; }
  .me-table .col-ci { display: table-cell; min-width: 96px; }
  .me-table .th-unit { display: none; } /* 「平均との差（ポイント）」の（ポイント）。見出しが列を広げて右が切れていた */
  .me-table .diff { min-width: 96px; grid-template-columns: 1fr 3em; gap: 4px; } /* 差の横棒は最小140pxだったので携帯の幅では詰める */
  .me-table .col-avg { display: none; }
}

/* ---- 勝率の95%の範囲（点と横棒） ---- */
.ci { display: block; min-width: 110px; padding: 0 6px; } /* 端の点（半径5px）が枠の外へ出ないように */
.ci-track { position: relative; display: block; height: 18px; }
.ci-track::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--line); border-radius: 2px; }
.ci-mid { position: absolute; left: 50%; top: 2px; bottom: 2px; width: 1px; background: var(--axis); }
.ci-range { position: absolute; top: 6px; height: 6px; border-radius: 3px; background: var(--hc-0); }
.ci-dot { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px var(--surface); }
.ci-up .ci-range { background: color-mix(in srgb, var(--hc-p3) 45%, transparent); } .ci-up .ci-dot { background: var(--hc-p3); }
.ci-down .ci-range { background: color-mix(in srgb, var(--hc-m3) 45%, transparent); } .ci-down .ci-dot { background: var(--hc-m3); }
.ci-even .ci-range { background: color-mix(in srgb, var(--muted) 35%, transparent); }

/* ---- 帯ごとの勝率の表（色つき） ---- */
.heat { min-width: 480px; font-variant-numeric: tabular-nums; }
.heat th, .heat td { padding: 6px; border-bottom: 2px solid var(--surface); }
.heat thead th { font-size: 12px; color: var(--ink-2); font-weight: 700; text-align: center; }
.heat th[scope="row"] { text-align: left; white-space: nowrap; font-size: 14px; }
.heat th[scope="row"] a { color: var(--ink); text-decoration: none; }
.hc { text-align: center; font-size: 13px; font-weight: 700; border-radius: 8px; border-left: 2px solid var(--surface); border-right: 2px solid var(--surface); color: var(--ink); }
.hc-p0 { background: var(--hc-0); }
.hc-p1 { background: var(--hc-p1); color: #0b1a33; } .hc-p2 { background: var(--hc-p2); color: #fff; } .hc-p3 { background: var(--hc-p3); color: #fff; } .hc-p4 { background: var(--hc-p4); color: #fff; }
.hc-m1 { background: var(--hc-m1); color: #2a0606; } .hc-m2 { background: var(--hc-m2); color: #fff; } .hc-m3 { background: var(--hc-m3); color: #fff; } .hc-m4 { background: var(--hc-m4); color: #fff; }
.hc-none { color: var(--muted); font-weight: 400; }
.legend-heat { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); margin: 4px 0 0; }
.legend-heat .lg { width: 28px; height: 12px; border-radius: 4px; display: inline-block; }
.legend-heat .lg-text { margin-left: 6px; }

/* ---- メタの地図（散布図） ---- */
.scatter-fig { margin: 0; }
.scatter { width: 100%; max-width: 600px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.scatter .grid, .trend .grid { stroke: var(--line); stroke-width: 1; }
.scatter .axis { stroke: var(--axis); stroke-width: 1; }
.scatter .mid, .trend .mid { stroke: var(--axis); stroke-width: 1; }
.scatter .tick, .trend .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.scatter .axis-title { fill: var(--ink-2); font-size: 12px; font-weight: 700; }
.scatter .quad { font-size: 12px; font-weight: 800; fill: var(--ink-2); opacity: 0.8; }
.scatter .quad-bg.q-hot { fill: color-mix(in srgb, var(--hc-p3) 9%, transparent); }
.scatter .quad-bg.q-gem { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.scatter .pt { cursor: pointer; }
.scatter .pt-ring { fill: var(--surface); stroke: var(--card-edge); stroke-width: 1; }
.scatter .pt-fallback { fill: var(--muted); }
.scatter .pt-letter { fill: #fff; font-size: 12px; font-weight: 800; }
.scatter .pt:hover .pt-ring, .scatter .pt:focus .pt-ring, .scatter .pt.is-hover .pt-ring { stroke: var(--accent); stroke-width: 3; }
.scatter-fig figcaption { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* ---- 勝率の動き ---- */
.trend { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }
.trend .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .end { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.trend .end-label { fill: var(--ink); font-size: 12px; font-weight: 700; }

/* ---- 同じ役割 ---- */
.peer-list { list-style: none; margin: 0; padding: 0; }
.peer-list li { display: grid; grid-template-columns: minmax(8em, 1fr) minmax(100px, 2fr) 4.5em; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.peer-list li.me { font-weight: 800; background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 10px; padding: 4px 8px; }

/* ---- そのほか ---- */
.few { margin-top: 10px; }
.few summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.few-list { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 4px 0 0; font-size: 14px; }
.howto ul { padding-left: 1.2em; margin: 8px 0; }
.howto li { margin: 4px 0; }

/* ---- 触ったときの説明 ---- */
.tip { position: fixed; z-index: 50; max-width: min(320px, calc(100vw - 24px)); padding: 8px 10px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: 13px; line-height: 1.45; box-shadow: var(--shadow-lift); pointer-events: none; }

.site-footer { border-top: 1px solid var(--line); padding: 18px 0 36px; font-size: 13px; color: var(--ink-2); }
.site-footer p { margin: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  .tile, .chip, .portrait { transition: none; transform: none !important; }
}

/* ---- 差の横棒（マイページ：自分の勝率と、同じ帯の平均の差） ---- */
.diff { display: grid; grid-template-columns: 1fr 3.6em; align-items: center; gap: 6px; min-width: 140px; }
.diff-track { position: relative; height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.diff-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--axis); }
.diff-fill { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; }
.diff-up .diff-fill { background: var(--hc-p3); }
.diff-down .diff-fill { background: var(--hc-m3); }
.diff-val { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- マイページ ---- */
.me-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.me-form input { font-size: 16px; min-height: var(--tap); padding: 0 14px; border-radius: 12px; border: 1px solid var(--card-edge); background: var(--surface); color: var(--ink); flex: 1 1 220px; letter-spacing: 0.04em; text-transform: uppercase; }
.me-form button { font-size: 16px; min-height: var(--tap); padding: 0 20px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15), var(--shadow); }
.me-recent { margin: 10px 0 0; font-size: 14px; }
.me-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.me-name { font-size: clamp(22px, 4vw, 30px); font-weight: 900; margin: 0; }
.me-tag { color: var(--ink-2); font-size: 14px; letter-spacing: 0.05em; }
.badge-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); font-weight: 700; }
.battle-list { list-style: none; padding: 0; margin: 0; }
.battle-list li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.battle-list .res { font-weight: 900; font-size: 13px; padding: 2px 8px; border-radius: 8px; text-align: center; }
.res-win { background: color-mix(in srgb, var(--hc-p3) 22%, transparent); }
.res-lose { background: color-mix(in srgb, var(--hc-m3) 22%, transparent); }
.res-draw { background: var(--surface-2); }
.battle-meta { font-size: 13px; color: var(--ink-2); }
.battle-main { font-weight: 700; font-size: 14px; }
.mvp { display: inline-block; font-size: 11px; font-weight: 900; padding: 0 6px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); margin-left: 6px; }

/* ---- 判定中（95%の範囲がまだ広い） ---- */
.tile.tentative { opacity: 0.55; }
.tile.tentative .tile-wr { font-size: 11px; }
.tent { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; white-space: nowrap; vertical-align: middle; }
.rank-table td:has(> .tent) { white-space: nowrap; }

/* ---- マップ ---- */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.map-card { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink); background: var(--surface-2); border: 1px solid var(--card-edge); box-shadow: var(--shadow); transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0)); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.map-card:hover { --lift: -3px; box-shadow: var(--shadow-lift); }
.map-img { display: block; width: 100%; object-fit: cover; background: linear-gradient(135deg, color-mix(in srgb, var(--hc-p3) 35%, var(--surface)), color-mix(in srgb, var(--accent) 30%, var(--surface))); }
.map-img-card { aspect-ratio: 4 / 3; object-fit: contain; background-color: color-mix(in srgb, var(--ink) 6%, var(--surface)); }
.map-img-hero { width: 132px; height: 132px; border-radius: 22px; object-fit: contain; background-color: color-mix(in srgb, var(--ink) 6%, var(--surface)); box-shadow: var(--shadow); flex: 0 0 auto; }
.map-img-none { min-height: 60px; }
.map-card-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.map-mode { font-size: 11px; font-weight: 800; color: var(--ink-2); letter-spacing: 0.03em; }
.map-name { font-size: 14px; font-weight: 800; line-height: 1.3; }
.map-sub { font-size: 12px; color: var(--muted); }
.map-top { display: flex; gap: 4px; margin-top: 4px; min-height: 30px; align-items: center; }
.map-top .av { box-shadow: 0 0 0 2px var(--surface); }
.hero-map { display: flex; align-items: center; gap: 16px; }
@media (max-width: 420px) { .map-grid { grid-template-columns: repeat(2, 1fr); } .map-img-hero { width: 96px; height: 96px; } }
.map-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; font-size: 14px; }
.map-list a { font-weight: 700; }

/* ---- 2体の比較 ---- */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; margin: 10px 0; }
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 18px; text-decoration: none; color: var(--ink); background: linear-gradient(180deg, var(--card-light), transparent 60%), var(--surface); border: 1px solid var(--card-edge); box-shadow: var(--shadow); transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.18s ease; }
.vs-name { font-weight: 900; font-size: 17px; text-align: center; }
.vs-meta { font-size: 12px; color: var(--ink-2); text-align: center; }
.vs-mark { align-self: center; font-weight: 900; font-size: 22px; color: var(--accent); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.vs-mark.small { font-size: 16px; }
.verdict-line strong { color: var(--ink); }
.num-strong { display: block; font-weight: 800; font-variant-numeric: tabular-nums; }
.cmp-table td { min-width: 120px; }
.cmp-table th[scope="row"] { white-space: nowrap; }
.verdict { font-size: 13px; font-weight: 700; white-space: nowrap; }
.v-short { display: none; }
/* 携帯の幅：1行目＝帯の名前と判定、2行目＝2体の数字（4列の表は右が切れるため） */
@media (max-width: 599px) {
  .cmp-table, .cmp-table thead, .cmp-table tbody { display: block; }
  .cmp-table caption { display: block; }
  .cmp-table tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .cmp-table th, .cmp-table td { min-width: 0; padding: 2px 0; border-bottom: 0; }
  .cmp-table thead th:first-child, .cmp-table thead th:last-child { display: none; }
  .cmp-table tbody th[scope="row"] { grid-column: 1; grid-row: 1; }
  .cmp-table tbody td.verdict { grid-column: 2; grid-row: 1; text-align: right; }
  .cmp-table tbody td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .cmp-table tbody td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .cmp-table .ci { min-width: 0; }
  .v-long { display: none; }
  .v-short { display: inline; }
}
.v-left, .v-right { color: var(--ink); }
.v-none, .v-even { color: var(--muted); }
.cmp-maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cmp-maps h3 { font-size: 15px; margin: 0 0 6px; }
.cmp-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cmp-form select { font-size: 16px; min-height: var(--tap); padding: 0 10px; border-radius: 12px; border: 1px solid var(--card-edge); background: var(--surface); color: var(--ink); max-width: 100%; }
.cmp-form button { font-size: 16px; min-height: var(--tap); padding: 0 20px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; cursor: pointer; }
.h2h { margin: 0 0 6px; }

/* ---- 携帯の幅の表（右が切れないように・2026-10-12） ---- */
.sub-games, .band-short, .heat-badge { display: none; }
@media (max-width: 599px) {
  /* ランキング・マップの表：「試合」は勝率の下へ、「判定中」はティアの下へ */
  .rank-table:not(.cmp-table):not(.band-table) :is(th, td) { padding-left: 5px; padding-right: 5px; }
  .rank-table .col-games { display: none; }
  .rank-table .sub-games { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
  .rank-table td:has(> .tent) { white-space: normal; }
  .rank-table .tent { display: block; width: max-content; margin: 3px 0 0; padding: 0 4px; font-size: 10px; }
  /* キャラのページの帯の表：1行目＝帯とティア、2行目＝順位・勝率・使用率・試合 */
  .band-table { min-width: 0; }
  .band-table, .band-table tbody, .band-table caption { display: block; }
  .band-table thead { display: none; }
  .band-table tr { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 8px; row-gap: 4px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .band-table th, .band-table td { padding: 0; border-bottom: 0; }
  .band-table th[scope="row"] { grid-column: 1 / 4; grid-row: 1; }
  .band-table td.col-tier { grid-column: 4; grid-row: 1; text-align: right; }
  .band-table td.col-tier .tent { margin-left: auto; }
  .band-table td[data-label] { text-align: left; }
  .band-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 400; color: var(--ink-2); }
  /* 帯ごとの強さの表：見出しは短い名前、名前の列は横に動かしても残す */
  .heat { min-width: 0; }
  .heat th, .heat td { padding: 5px 2px; }
  .heat thead th { padding-left: 1px; padding-right: 1px; font-size: 9px; line-height: 1.25; letter-spacing: -0.03em; vertical-align: bottom; }
  .heat thead .band-short { white-space: nowrap; }
  .band-long { display: none; }
  .band-short { display: inline; }
  .heat-badge { display: block; margin: 0 auto 2px; }
  .heat th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); font-size: 12px; white-space: normal; padding-right: 6px; }
  .heat th[scope="row"] a { display: block; max-width: 6em; }
  .hc { font-size: 12px; min-width: 40px; }
}

/* ---- 上位何%（分布のページ・マイページ・共有の画像） ---- */
.pct-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0 0 10px; }
.pct-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pct-form input, .pct-form select { font-size: 16px; min-height: var(--tap); padding: 0 12px; border-radius: 12px; border: 1px solid var(--card-edge); background: var(--surface); color: var(--ink); min-width: 10em; }
.pct-form button, .share-btn, .share-actions button, .share-actions a { font-size: 16px; min-height: var(--tap); padding: 0 20px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.pct-results { display: grid; gap: 10px; margin: 6px 0 10px; }
.pct-result { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--card-edge); }
.pct-result p { margin: 0; }
.pct-q { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pct-a { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 4px 0 !important; }
.pct-d { font-size: 13px; color: var(--ink-2); }
.pct-badge { width: auto; height: 30px; vertical-align: middle; margin-right: 6px; }
.pct-q .pct-badge { height: 42px; }
.pct-table { font-variant-numeric: tabular-nums; }
.pct-table th, .pct-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.pct-table thead th { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.pct-table th[scope="row"] { white-space: nowrap; font-weight: 700; }
.pct-table td { font-size: 14px; }
.pbar { display: inline-block; width: 90px; height: 10px; border-radius: 5px; background: var(--hc-0); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.pbar-fill { display: block; height: 100%; border-radius: 5px; background: var(--series); }
.pct-num { font-weight: 700; }
.sub-range { display: block; font-size: 11px; color: var(--muted); }
.sub-h { font-size: 15px; margin: 16px 0 6px; }
.share-card .kpis { margin-bottom: 12px; }
.share-out { margin-top: 12px; }
.share-img { display: block; width: 100%; max-width: 600px; height: auto; border-radius: 14px; box-shadow: var(--shadow); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.share-btn:disabled { opacity: 0.6; cursor: progress; }
@media (max-width: 599px) {
  .pbar { width: 48px; margin-right: 6px; }
  .pct-table th, .pct-table td { padding-left: 4px; padding-right: 4px; }
  .pct-a { font-size: 30px; }
  /* 早見表：1行目＝トロフィー、2行目＝2つの母集団の値（3列だと右が切れるため） */
  .pct-2col, .pct-2col tbody { display: block; }
  .pct-2col thead { display: none; }
  .pct-2col tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .pct-2col th, .pct-2col td { border-bottom: 0; padding: 0; }
  .pct-2col th[scope="row"] { grid-column: 1 / -1; }
  .pct-2col td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 400; color: var(--ink-2); }
}

/* ---- 強化コスト（計算機・マイページの育てる候補） ---- */
.up-form label { min-width: 0; }
.up-form select { min-width: 5.5em; }
.up-result { margin: 8px 0 10px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--card-edge); }
.up-q { margin: 0 0 8px; font-weight: 700; }
.up-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.up-totals > div { display: flex; flex-direction: column; }
.up-totals .k { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.up-totals .v { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; }
.up-totals .d { font-size: 12px; color: var(--ink-2); }
.up-table td.num, .up-table th[scope="row"] { white-space: nowrap; } /* 数字の列だけ折り返さない（解放の列・見出しは折り返してよい） */
.up-table thead th { white-space: normal; }
.up-table thead th:first-child { white-space: nowrap; }
.up-cum .sub-range { display: block; }
.warn { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--ink); font-size: 14px; }
.grow-table .who > span { display: flex; flex-direction: column; }
.grow-table td { white-space: nowrap; }
.grow-table .tier { min-width: 24px; height: 24px; font-size: 13px; margin-right: 6px; vertical-align: middle; }
.grow-table .num-strong { display: inline; }
.grow-table td.num .num-strong { display: block; }
@media (max-width: 599px) {
  .up-totals .v { font-size: 26px; }
  .up-table th, .up-table td { padding-left: 4px; padding-right: 4px; font-size: 13px; }
}

/* ---- 日ごとの勝率（⑤） ---- */
.daily .band { fill: color-mix(in srgb, var(--series) 16%, transparent); stroke: none; }
.daily .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.daily .dot.partial { fill: var(--surface); stroke: var(--series); stroke-width: 2; }
.daily .mark { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
.daily .mark-label { fill: var(--ink-2); font-size: 11px; font-weight: 700; }
.ba { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 8px 0; }
.ba > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--card-edge); }
.ba .k { display: block; font-size: 12px; color: var(--ink-2); font-weight: 700; }
.ba .v { display: block; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ba .d { display: block; font-size: 12px; color: var(--muted); }
.ba-arrow { font-weight: 900; color: var(--ink-2); }
.chg-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; font-size: 14px; }
/* 強化・弱体化は文字の色ではなく、横の札の色で表す（文字は文字の色のまま） */
.chg-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 6px; margin-right: 6px; vertical-align: 1px; }
.chg-badge.up { background: var(--hc-p3); color: #fff; }
.chg-badge.down { background: var(--hc-m3); color: #fff; }
.chg-badge.neutral { background: var(--hc-0); color: var(--ink); }
.chg-item { padding: 12px 0; border-top: 1px solid var(--line); }
.chg-item:first-child { border-top: 0; }
.chg-head { display: flex; align-items: center; gap: 10px; }
.chg-head .who { min-height: 0; }
